How to modify VB.NET Alipay Interface
Editor to share with you how to modify the VB.NET Alipay interface, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
I was depressed that there was no VB.NET Alipay interface program for a long time, but finally I couldn't help but modify it. It is easy to change its three main files to VB.NET, not to give any more, but only the interface code:
Private Sub ImageButton1_Click (ByVal sender As System.Object
ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
'construct the order number on time
Dim currentTime As System.DateTime = New System.DateTime
CurrentTime = System.DateTime.Now
Dim out_trade_no As String
Out_trade_no = currentTime.ToString ("g")
Out_trade_noout_trade_no = out_trade_no.Replace ("-", "")
Out_trade_noout_trade_no = out_trade_no.Replace (":", ")
Out_trade_noout_trade_no = out_trade_no.Replace ("", ")
'Business parameter assignment
Dim gateway As String = "https://www.alipay.com/cooperate/gateway.do?" 'payment interface
Dim service As String = "trade_create_by_buyer" 'service parameter
Dim sign_type As 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) 'trade name
Bodybody = body & "& reader.Item (0) 'product description, cannot have too many characters
End While
Reader.Close ()
Dim quantity As String
Quantity = "1" 'quantity of goods
Dim payment_type As String
Payment_type = "1"
'payment type'1 = merchandise purchase, 2 = service purchase, 3 = online auction, 4 = donation, 5 = postage compensation, 6 = bonus
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) 'commodity price
End If
Reader.Close ()
Dim show_url, seller_email, key, partner As String
Show_url = "http://****"' product description address
Seller_email = * 'your Alipay certification Email must be certified by Alipay
Key = * 'security check code, which can be obtained from Alipay's website "Merchant tools"
Partner = * * 'partner partner ID
Dim return_url As String = "Alipay_Return.aspx" 'Server Notification return Interface
Dim notify_url As String = "Alipay_Notify.aspx" 'server notification interface
Dim _ input_charset As String = "utf-8" 'server code
Dim logistics_type As String = "POST"
Dim logistics_fee As String = "0" 'surface postage is included in the price
Dim logistics_fee_1 As String = "0" 'express fee is included in the price
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
The above is all the contents of this article "how to modify VB.NET Alipay Interface". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!