- 爱易网页
-
ASP教程
- 支付宝接口接好后,怎么判断交易成功与否?
日期:2014-05-16 浏览次数:21023 次
支付宝接口接好后,如何判断交易成功与否???
demo.asp如下
<!--#include file="zfb.asp"-->
<a href="<%=itemURL%>" target="_blank">立即支付</a>
zfb.asp如下
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- 支付宝接口文档,本文件由湖南E族网络服务中心提供。程序原版 。如有不明之处可联系我们www.22cnshop.com,腾诩QQ:349897132-->
<%
myaa = int(999999 * rnd)
t1 = "https://www.alipay.com/payto:" '支付接口
t2 = "" '商户支付宝账户(改成你自己的)
t3 = "" '安全校验码(改成你自己的)
' t4 = "http://img.alipay.com/pimg/button_alipaybutton_o.gif" '支付宝按钮图片
' t5 = "用支付宝支付,放心" '按钮悬停说明
s1 = "0001" 'cmd 命令码
s2 = Request.form("subject") 'subject 商品名称
s3 = Request.form("body") 'body 商品描述
s4 = year(date())&month(date())&day(date())&hour(time())&minute(time())&second(time())&myaa 'order_no 商户订单号
s5 = Request.form("price") 'price 商品单价 0.01~50000.00
s6 = Request.form("url") 'url 商品展示网址
s7 = "1" 'type 支付类型 1:商品购买2:服务购买3:网络拍卖4:捐赠
s8 = Request.form("number") 'number 购买数量
s9 = Request.form("transport") 'transport 发货方式 1:平邮2:快递3:虚拟物品
s10 = Request.form("ordinary_fee") 'ordinary_fee 平邮运费
s11 = Request.form("express_fee") 'express_fee 快递运费
s12 = "true" 'readonly 交易信息是否只读
s13 = Request.form("buyer_msg") 'buyer_msg 买家给卖家的留言
s14 = session("Email") 'buyer 买家Email
s15 = session("name") 'buyer_name 买家姓名
s16 = Request.form("buyer_address") 'buyer_address 买家地址
s17 = session("youbian") 'buyer_zipcode 买家邮编
s18 = session("tel") 'buyer_tel 买家电话号码
s19 = session("shouji") 'buyer_mobile 买家手机号码
s20 = "" 'partner 合作伙伴ID 保留字段
'初始化各必要变量
INTERFACE_URL = t1+t2 '支付接口
sellerEmail = t2 '商户支付宝账户(改成你自己的)
keyCode = t3 '安全校验码(改成你自己的)
' imgsrc = t4 '支付宝按钮图片
' imgtitle = t5 '按钮悬停说明
str2CreateAc = "cmd" & s1 & "subject" & s2
str2CreateAc = str2CreateAc & "body" & s3
str2CreateAc = str2CreateAc & "order_no" & s4
str2CreateAc = str2CreateAc & "price" & s5
str2CreateAc = str2CreateAc & "url" & s6
str2CreateAc = str2CreateAc & "type" & s7
str2CreateAc = str2CreateAc & "number" & s8
str2CreateAc = str2CreateAc & "transport" & s9
str2CreateAc = str2CreateAc & "ordinary_fee" & s10
str2CreateAc = str2CreateAc & "express_fee" & s11
str2CreateAc = str2CreateAc & "readonly" & s12
str2CreateAc = str2CreateAc & "buyer_msg" & s13
str2CreateAc = str2CreateAc & "seller" & sellerEmail
str2CreateAc = str2CreateAc & "buyer" & s14
str2CreateAc = str2CreateAc & "buyer_name" & s15
str2CreateAc = str2CreateAc & "buyer_address" & s16
str2CreateAc = str2CreateAc & "buyer_zipcode" & s17
str2CreateAc = str2CreateAc & "buyer_tel" & s18
str2CreateAc = str2CreateAc & "buyer_mobile" & s19
str2CreateAc = str2CreateAc & "partner" & s20
str2CreateAc = str2CreateAc & keyCode
acCode = MD5(str2CreateAc)