⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alipaysbackok.asp

📁 一个不错的个人商务网站的源码
💻 ASP
字号:
<!--#include file="comm/my_request.asp"-->
<!--#include file="db_conn.asp"-->
<!--#include file="comm/base64.asp"-->
<!--#include file="comm/mmd5.asp"-->
<%
sql="select * from pay_online where id=2"
set rs=conn.execute (sql)
ipayno2=rs("shbh")
ipaykey2=rs("pay_key")
rs.close
set rs=nothing
constPayEmail=base64Decode(ipayno2)
constPaySecurityCode=base64Decode(ipaykey2)

msg_id   = my_request("msg_id",0)                '通知ID
order_no = my_request("order_no",0)                '交易订单号

gross       = my_request("gross",0)        '交易总金额
buyer_email = my_request("buyer_email",0)        '买家的支付宝账户
buyer_name  = my_request("buyer_name",0)'买家姓名
buyer_address = my_request("buyer_address",0)        '买家地址
buyer_zipcode = my_request("buyer_zipcode",0)        '买家邮编
buyer_tel    = my_request("buyer_tel",0)        '买家电话号码
buyer_mobile = my_request("buyer_mobile",0)'买家手机号码
action     = my_request("action",0)        '通知动作
Req_Date   = my_request("date",0)        '发送通知时的支付宝系统当前时间,格式为:yyyyMMddHHmmss
ac         = my_request("ac",0)

if action <> "test" then

'###############################
'
'   检查信息是否由支付宝发出
'
'###############################
        
Set Retrieval  = Server.CreateObject("Microsoft.XMLHTTP") 
        
        strURL = "http://notify.alipay.com/trade/notify_query.do?msg_id=" & msg_id
        strURL = strURL & "&email=" & constPayEmail & "&order_no=" & order_no
        
        Retrieval.open "GET", strURL, False, "", "" 
        Retrieval.send()
        
        ReturnState = Retrieval.ResponseText
Set Retrieval = Nothing

conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('0','"&strURL&" 来源状态:"&ReturnState&"')"

If Cstr(ReturnState) <> "true" and Cstr(ReturnState) <> "false" Then
        conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('0','"&strURL&" 来源错误完成')"
End If 
end if


Select Case action
        Case "test"
                response.write "Y"
                conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('0','测试接口')"
        
        Case "sendOff"        '用户已付款

                Str = "msg_id" & msg_id & "order_no" & order_no & "gross" & gross  & "buyer_email" & buyer_email & "buyer_name" & buyer_name & "buyer_address" & buyer_address & "buyer_zipcode" & buyer_zipcode & "buyer_tel" & buyer_tel & "buyer_mobile" & buyer_mobile & "action" & action  & "date" & Req_Date & constPaySecurityCode

                if MD5(Str) = ac then
                        'conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('"&order_no&"','"&Str&"-"&ac&" 通过')"
                        
                        conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('"&order_no&"','"&ac&" 通过')"
                        response.write "Y"
                else
                        conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('"&order_no&"','"&Str&"-"&ac&" AC不通过')"
                        response.write "N"
                end if
                
        Case "checkOut"        '交易完成
                        conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('"&order_no&"','"&Str&"-"&ac&" 交易完成')"
                response.write "Y"

        Case Else
                conn.Execute"INSERT INTO [pay_back] (order_no,pay_value) VALUES ('0','其他情况')"                
                response.write "N"
                
End Select

conn.close
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -