小编给大家分享一下如何修改VB .网支付宝接口,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
曾经为没有VB .网支付宝接口程序郁闷过很长一段时间,终于忍不住修改了一下,其主要的3个文件修改为VB .网很容易,不再给出,只给出接口代码:
PrivateSubImageButton1_Click(由ByValsenderAsSystem提供。对象,
由价值系统网络。ui。imageclickeventargs)handlesimagebutton 1 .点击
'按时构造订单号
DimcurrentTimeAsSystem .日期时间=新系统。日期时间
当前时间=系统。日期时间,现在
Dimout_trade_noAsString
out _ trade _ no=currentTime .ToString('g ')
out _ trade _ noout _ trade _ no=out _ trade _ no .替换('-','')
out _ trade _ noout _ trade _ no=out _ trade _ no .替换(' : ','')
out _ trade _ noout _ trade _ no=out _ trade _ no .替换(',')
'业务参数赋值
dimgatewaystring=' https://www。支付宝。com/cooperative/gateway。做什么?'支付接口
DimserviceAsString=' trade _ create _ by _ buyer ' '服务参数
Dimsign_typeAs
String = "MD5"
Dim subject, body As String
body = ""
sql = "select cp_name from chanpin where cp_id="& cint(label2.text)
getdata.myconn.Open()
reader = getdata.getdatareader(sql)
While reader.Read
subject = reader.Item(0)'商品名称
bodybody = body & " " & reader.Item(0)'商品描述 ,不能有太多字符
End While
reader.Close()
Dim quantity As String
quantity = "1" '商品数量
Dim payment_type As String
payment_type = "1"
'支付类型'1=商品购买,2=服务购买,3=网络拍卖,4=捐赠,5=邮费补偿,6=奖金
Dim price As String
sql = "select cp_money from chanpin where cp_id="& cint(label1.text)
reader = getdata.getdatareader(sql)
If reader.Read Then
price = reader.Item(0)'商品价格
End If
reader.Close()
Dim show_url, seller_email, key, partner As String
show_url = "http://****"'商品描述地址
seller_email = *** '您的支付宝认证Email,必须通过支付宝认证才可以
key = ***'安全校验码,在支付宝网站“商家工具”那里可以获得
partner = ***'partner合作伙伴ID
Dim return_url As String ="Alipay_Return.aspx" '服务器通知返回接口
Dim notify_url As String ="Alipay_Notify.aspx" '服务器通知接口
Dim _input_charset As String = "utf-8" '服务器编码
Dim logistics_type As String = "POST"
Dim logistics_fee As String = "0" '平邮费包含在价格中
Dim logistics_fee_1 As String = "0"'快递费 包含在价格中
Dim logistics_payment As String = "BUYER_PAY"
Dim logistics_type_1 As String = "EXPRESS"
Dim logistics_payment_1 As String = "BUYER_PAY"
Dim ap As AliPay = New AliPay
Dim aliay_url As String = ap.CreatUrl(gateway, service, partner, sign_type,
out_trade_no, subject, body, payment_type, price, show_url, seller_email, key,
return_url, _input_charset, notify_url, logistics_type, logistics_fee,
logistics_payment, logistics_type_1, logistics_fee_1, logistics_payment_1, quantity)
Response.Redirect(aliay_url)
End Sub
以上是“如何修改VB.NET支付宝接口”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!
内容来源网络,如有侵权,联系删除,本文地址:https://www.230890.com/zhan/105118.html