毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> WEB开发 >> 正文

支付宝接口接好后,如何判断交易成功与否

更新时间:2013-1-18:  来源:毕业论文

支付宝接口接好后,如何判断交易成功与否
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 = "' 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)

itemURL =  INTERFACE_URL & "?cmd=" & s1
itemURL =  itemURL & "&subject=" & Server.HTMLEncode(s2)
itemURL =  itemURL & "&body=" & Server.HTMLEncode(s3)
itemURL =  itemURL & "&order_no=" & s4
itemURL =  itemURL & "&price=" & s5
itemURL =  itemURL & "&url=" & s6
itemURL =  itemURL & "&type=" & s7
itemURL =  itemURL & "&number=" & s8
itemURL =  itemURL & "&transport=" & s9
itemURL =  itemURL & "&ordinary_fee=" & s10
itemURL =  itemURL & "&express_fee=" & s11
itemURL =  itemURL & "&readonly=" & s12
itemURL =  itemURL & "&buyer_msg=" & Server.HTMLEncode(s13)
itemURL =  itemURL & "&buyer=" & Server.HTMLEncode(s14)
itemURL =  itemURL & "&buyer_name=" & Server.HTMLEncode(s15)
itemURL =  itemURL & "&buyer_address=" & Server.HTMLEncode(s16)
itemURL =  itemURL & "&buyer_zipcode=" & s17
itemURL =  itemURL & "&buyer_tel=" & s18
itemURL =  itemURL & "&buyer_mobile=" & s19
itemURL =  itemURL & "&partner=" & s20
itemURL =  itemURL & "&ac=" & acCode
判断交易成功则弹出
“交易成功”
不成功则弹出
“交易失败”%>

支付流程应该是这样的:
你提供支付数据(比如购买的商品,支付金额等,就是你上面的那些数据),同时提供一个你自己的页面地址用于接收支付结果,把数据提交到支付宝的处理页面。支付宝处理完成后就会返回到你提供的那个支付结果接收页面,在这个页面你对支付宝返回的结果进行处理然后显示给客户知道就可以了。
安全问题一般是不用担心的,问题不大,除非支付宝账户被盗用。 至于安全方面嘛,因为整个支付过程全是在支付宝平台运行的,所以支付安全应该没问题。

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。