转一个支付宝接口的ASP代码 支付宝接口(应用实例)2008-08-22 16:33支付宝接口的ASP代码

来源:互联网 发布:js中国地图插件 编辑:程序博客网 时间:2024/06/08 02:14
转一个支付宝接口的ASP代码 支付宝接口(应用实例)2008-08-22 16:33支付宝接口的ASP代码<% Dim clsAlipayDim strNotify, strTradeURL, strShoppingBagIDDim intPriceDim dtmNowSet clsAlipay = New Cls_AlipayintPrice = 0.01dtmNow = Now()'交易号Randomize 'RNDstrShoppingBagID = Year(dtmNow) & Right("0" & Month(dtmNow), 2) & Right("0" & Day(dtmNow), 2) & Right("0" & Hour(dtmNow), 2) & Right("0" & Minute(dtmNow), 2) & Right("0" & Second(dtmNow), 2) & Right("000000" & Rnd * 1000000, 6)Set clsAlipay = New Cls_Alipay '支付宝交易类' 生成支付宝交易地址clsAlipay.key = "" '安全校验码clsAlipay.Input.partner = "" '合作伙伴IDclsAlipay.Input.service = "create_direct_pay_by_user" '接口名称.即时到帐交易clsAlipay.Input.payment_type = "1" '支付类型clsAlipay.Input.show_url = "" '商品展示网址'clsAlipay.Input.notify_url = strSiteDomain & "/personal/alipay_notify.asp" '通知URLclsAlipay.Input.notify_url = "http://project.sotong.cn/personal/alipay_notify.asp"clsAlipay.Input.return_url = "" '返回URLclsAlipay.Input.input_charset = "utf-8" 'gbk/utf-8clsAlipay.Input.subject = "用户充值"clsAlipay.Input.body = ""clsAlipay.Input.discount = "0"clsAlipay.Input.out_trade_no = strShoppingBagIDclsAlipay.Input.total_fee = intPriceclsAlipay.Input.seller_email = ""strTradeURL = clsAlipay.TradeURLIf clsAlipay.ErrCodes > 0 Then Response.write clsAlipay.Description '如果出错显示错误提示Response.Write "go alipay.com"Response.Write "
"' 支付宝通知验证clsAlipay.key = ""clsAlipay.Notify.partner = ""clsAlipay.Notify.RequestPay()'clsAlipay.Notify_Verify 通知验证'clsAlipay.Sign_Verify sign对比验证If clsAlipay.Notify_Verify and clsAlipay.Sign_Verify Then strNotify = "success" ' Update Database '实物交易根据 clsAlipay.Notify.trade_status 来更新自己的数据 'Response.Write clsAlipay.Notify.trade_statusElse strNotify = "fail"End If' Return NotifyResponse.Write strNotify' ShutDownSet clsAlipay = NothingSet ls = Nothing%>