- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
query_result.asp
资源名称:shop2.rar [点击查看]
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
DOS
- <!-- #include file="conn.asp" -->
- <!-- #include file="asp_md5.asp" -->
- <meta name="TENCENT_ONELINE_PAYMENT" content="China TENCENT">
- <html>
- <% exec="select * from webinfo"
- set rs=server.createobject("adodb.recordset")
- rs.open exec,conn,1,3
- tenpayid=rs("tenpayid")
- tenpaypin=rs("tenpaypin")
- tenpayurl=rs("tenpayurl")
- payall=session("payall")
- dingdan=session("dingdan")
- des=rs("webname")
- %>
- <%
- '取返回参数(财付通将会用Post方式请求该页面)
- cmdno = Request("cmdno")
- pay_result = Request("pay_result")
- pay_info = Request("pay_info")
- bill_date = Request("date")
- bargainor_id = Request("bargainor_id")
- transaction_id = Request("transaction_id")
- sp_billno = Request("sp_billno")
- total_fee = Request("total_fee")
- fee_type = Request("fee_type")
- attach = Request("attach")
- md5_sign = Request("sign")
- '本地参数
- spid = tenpayid ' 这里替换为您的实际商户号
- sp_key = tenpaypin ' sp_key是32位商户密钥, 请替换为您的实际密钥
- '返回值定义
- Private Const retOK = 0 ' 成功
- Private Const invalidSpid = 1 ' 商户号错误
- Private Const invalidSign = 2 ' 签名错误
- Private Const tenpayErr = 3 ' 财付通返回支付失败
- '验签函数
- Function verifyMd5Sign
- origText = "cmdno=" & cmdno & "&pay_result=" & pay_result &_
- "&date=" & bill_date & "&transaction_id=" & transaction_id &_
- "&sp_billno=" & sp_billno & "&total_fee=" & total_fee &_
- "&fee_type=" & fee_type & "&attach=" & attach &_
- "&key=" & sp_key
- localSignText = UCase(ASP_MD5(origText)) ' 转换为大写
- verifyMd5Sign = (localSignText = md5_sign)
- End Function
- '返回值
- Dim retValue
- retValue = retOK
- '判断商户号
- If bargainor_id <> spid Then
- retValue = invalidSpid
- Else
- ' 验签
- If verifyMd5Sign <> True Then
- retValue = invalidSign
- Else
- ' 检查财付通返回值
- If pay_result <> 0 Then
- retValue = tenpayErr
- End If
- End If
- End If
- ' 业务处理,修改数据库,向客户发送通知...
- Select Case retValue
- Case retOK pay_msg = "此单已成功支付!"
- Case invalidSpid pay_msg = "错误的商户号!"
- Case invalidSign pay_msg = "验证MD5签名失败!"
- Case Else pay_msg = "此单未支付!"
- End Select
- response.write pay_msg
- %>
- </html>