<!--#include file="../../inc/payconn.asp"-->
<!--#include file="asp_md5.asp"-->
<%
	'mysp_billno = (request.QueryString("num"))
	mysp_billno = Session("L_Num")
	'total_fee= (request.QueryString("price"))
	total_fee= Session("L_PayPrice")
	sp_id = (request.QueryString("GetStr_wg"))
	PayID = (Request.QueryString("PayID"))

	If PayID = "" or mysp_billno ="" or total_fee="" or sp_id=""  Then
		Response.Write("缺少参数！")
		Response.End()
	End If

Call ConnectionDatabase()
Set Res = GrateRs("Select * From [L_pay] Where ptype='kbpay'",1)

'商户在互赢支付网关上的商户号
user_id=Res("sId")
'商户流水号
sp_billno = mysp_billno
'后台通知地址，商户系统后台接收互赢支付订单结果的地址
sp_returnurl="http://"&Request.ServerVariables("HTTP_HOST")&"/Pay/kbpay_bank/receive.asp"
'商户备注信息
remarks="banana"
'商户自定义
sp_extdata="test"
'商户密钥，请登陆商户后台查询
sp_key=Res("sKey")
Res.close
'组合字符串
sign_text = "user_id=" & user_id & "&sp_id=" & sp_id & "&total_fee=" & total_fee  &"&sp_billno=" & sp_billno & "&sp_key=" & sp_key & "&sp_returnurl=" & sp_returnurl & "&sp_extdata=" & sp_extdata
'生成MD5签名
sign = UCase(ASP_MD5(sign_text))        ' 转换为大写

linkurl="http://gate.kbpay.cn/"

TOSPPost = linkurl&"bank/index.asp?user_id="&user_id&"&sp_id="&sp_id&"&total_fee="&total_fee&"&sp_billno="&sp_billno&"&sp_returnurl="&sp_returnurl&"&sp_extdata="&sp_extdata&"&sign="&sign

'response.Write(TOSPPost)
'response.End()
response.Redirect(TOSPPost)
%>

