www.gusucode.com > 中网景企业网站管理系统 2008源码程序 > english/pay.asp

    
<br />
您未付款,请选择点击以下支付方式进行付款:
<% 

Dim strFullURL'获取当前文件url路径
'strFullURL ="http://"& Request.ServerVariables("LOCAL_ADDR") &":" & Request.ServerVariables("SERVER_PORT")& Request.ServerVariables("PATH_INFO")
strFullURL ="http://"& Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("PATH_INFO")
strFullURL=Mid(strFullURL,1,InstrRev(strFullURL,"/"))

rs.open "select * from cnk_payway where payname='alipay' and isopen=1",conn,1,1
if rs.recordcount>0 then
Response.Write("<div class=""paywaybox"">")

'2.0
dim service,agent,partner,sign_type,subject,body,out_trade_no,price,discount,show_url,quantity,payment_type,logistics_type,logistics_fee,logistics_payment,logistics_type_1,logistics_fee_1,logistics_payment_1,seller_email,notify_url
dim t1,t4,t5,key
dim AlipayObj,itemUrl
	t1				=	"https://www.alipay.com/cooperate/gateway.do?"	'支付接口
	t4				=	"../images/p_alipay.gif"		'支付宝按钮图片
	t5				=	"推荐使用支付宝付款"						'按钮悬停说明
	
	service         =   "trade_create_by_buyer"
	agent           =   "" '合作厂商id
	partner			=	rs("payid")		'partner合作伙伴ID(必须填)
	sign_type       =   "MD5"
	subject			=	orderid&"号订单在线支付"		'商品名称
	body			=	"以下金额("&alltotalprice&"元)已包含配送费用"			'body			商品描述
	out_trade_no    =   orderid           '客户网站订单号
	'out_trade_no    =   Trim(Replace(out_trade_no,":","")) '客户网站订单号
	price		    =	alltotalprice				'price商品单价			0.01~50000.00
    discount        =   "0"               '商品折扣
    show_url        =   "http://"&SiteURL        '商品展示地址(可以直接写网站首页网址)
    quantity        =   "1"               '商品数量
    payment_type    =   "1"                '支付类型,(1代表商品购买)
    logistics_type  =   "EXPRESS"          '物流种类(快递)
    logistics_fee   =   "0"                '物流费用
    logistics_payment  =   "SELLER_PAY"    '物流费用承担(卖家付)
	logistics_type_1  =   "EMS"
    logistics_fee_1   =   "1"
    logistics_payment_1  =   "BUYER_PAY"   '物流费用承担(买家付)
    seller_email    =    buyer_email   '(必须填)
    key             =   rs("paykey")   '(必须填)
    notify_url=  strFullURL & "pay_receive_alipay.asp"   '服务器通知url(不使用,请不要注释或者删除此参数,不用传递给支付宝系统,Alipay_Notify.asp文件所在路经) 
   

	Set AlipayObj	= New creatAlipayItemURL
	itemUrl=AlipayObj.creatAlipayItemURL(t1,t4,t5,service,agent,partner,sign_type,subject,body,out_trade_no,price,discount,show_url,quantity,payment_type,logistics_type,logistics_fee,logistics_payment,logistics_type_1,logistics_fee_1,logistics_payment_1,seller_email,notify_url,key)

Response.Write(itemURL)
Response.Write("</div>")
end if
rs.close
%>
<% rs.open "select * from cnk_payway where payname='chinabank' and isopen=1",conn,1,1 
if rs.recordcount>0 then%>
<%
	dim v_mid,v_url,v_key,v_oid,v_amount,v_moneytype,v_text,v_md5info
	dim v_rcvname,v_rcvaddr,v_rcvtel,v_rcvpost,v_rcvemail,v_rcvmobile,v_ordername
	dim v_orderaddr,v_ordertel,v_orderpost,v_orderemail,v_ordermobile,remark1,remark2
	
	v_mid = rs("payid") 	' 商户号,这里为测试商户号20000400,替换为自己的商户号即可
	v_url = strFullURL & "pay_receive_chinabank.asp"	' 商户自定义返回接收支付结果的页面 Receive.asp 为接收页面

							' MD5密钥要跟订单提交页相同,如Send.asp里的 key = "test" ,修改""号内 test 为您的密钥
	v_key =  rs("paykey")	' 如果您还没有设置MD5密钥请登陆我们为您提供商户后台,地址:https://merchant3.chinabank.com.cn/
							' 登陆后在上面的导航栏里可能找到“资料管理”,在资料管理的二级导航栏里有“MD5密钥设置” 
							' 建议您设置一个16位以上的密钥或更高,密钥最多64位,但设置16位已经足够了
	v_oid = orderid
	v_amount = alltotalprice		' 订单金额
	v_moneytype = "CNY"					' 币种
	v_text = v_amount&v_moneytype&v_oid&v_mid&v_url&v_key	' 拼凑加密串
	v_md5info=Ucase(trim(md5(v_text)))					' 网银支付平台对MD5值只认大写字符串,所以小写的MD5值得转换为大写

'**********以下几项为可选信息,如果发送网银在线会保存此信息,使用和不使用都不影响支付!**************

	v_rcvname = buyer_name			' 收货人
	v_rcvaddr = buyer_address			' 收货地址
	v_rcvtel = buyer_tel			' 收货人电话
	v_rcvpost = buyer_postcode			' 收货人邮编
	v_rcvemail = buyer_email		' 收货人邮件
	v_rcvmobile = ""		' 收货人手机号

	v_ordername = buyer_name		' 订货人姓名
	v_orderaddr = buyer_address		' 订货人地址
	v_ordertel = buyer_tel		' 订货人电话
	v_orderpost = buyer_postcode		' 订货人邮编
  	v_orderemail = buyer_email		' 订货人邮件
	v_ordermobile = ""	' 订货人手机号

	remark1 = buyer_msg			' 备注字段1
	remark2 = ""			' 备注字段2

%>
<div class="paywaybox">
  <form action="https://pay3.chinabank.com.cn/PayGate" method="post" name="E_FORM" target="_blank">
    <!--以下几项为网上支付重要信息,信息必须正确无误,信息会影响支付进行!-->
    <input type="hidden" name="v_md5info"    value="<%=v_md5info%>" size="100">
    <input type="hidden" name="v_mid"        value="<%=v_mid%>">
    <input type="hidden" name="v_oid"        value="<%=v_oid%>">
    <input type="hidden" name="v_amount"     value="<%=v_amount%>">
    <input type="hidden" name="v_moneytype"  value="<%=v_moneytype%>">
    <input type="hidden" name="v_url"        value="<%=v_url%>">
    <!--以下几项项为网上支付完成后,随支付反馈信息一同传给信息接收页,在传输过程中内容不会改变,如:Receive.asp -->
    <input type="hidden"  name="remark1" value="<%=remark1%>">
    <input type="hidden"  name="remark2" value="<%=remark2%>">
    <!--以下几项与网上支付货款无关,只是用来记录客户信息,可以不用,使用和不使用都不影响支付 -->
    <input type="hidden"  name="v_rcvname"      value="<%=v_rcvname%>">
    <input type="hidden"  name="v_rcvaddr"      value="<%=v_rcvaddr%>">
    <input type="hidden"  name="v_rcvtel"       value="<%=v_rcvtel%>">
    <input type="hidden"  name="v_rcvpost"      value="<%=v_rcvpost%>">
    <input type="hidden"  name="v_rcvemail"     value="<%=v_rcvemail%>">
    <input type="hidden"  name="v_rcvmobile"    value="<%=v_rcvmobile%>">
    <input type="hidden"  name="v_ordername"    value="<%=v_ordername%>">
    <input type="hidden"  name="v_orderaddr"    value="<%=v_orderaddr%>">
    <input type="hidden"  name="v_ordertel"     value="<%=v_ordertel%>">
    <input type="hidden"  name="v_orderpost"    value="<%=v_orderpost%>">
    <input type="hidden"  name="v_orderemail"   value="<%=v_orderemail%>">
    <input type="hidden"  name="v_ordermobile"  value="<%=v_ordermobile%>">
    <input name="image3" type="image" src="../images/p_chinabank.gif" alt="" />
  </form>
</div>
<% end if
		  rs.close %>
<% rs.open "select * from cnk_payway where payname='99bill' and isopen=1",conn,1,1 
		if rs.recordcount>0 then
		
		Dim kq_merchant_id,kq_key,kq_amount,kq_orderid,kq_curr,kq_commodity_info,kq_pname
		Dim kq_merchant_url,kq_merchant_param,kq_pid_99billaccount,kq_sendtxt,kq_mac
		kq_merchant_id = rs("payid")   '商户编号
		kq_key = rs("paykey")			'私钥值。即商户登录99BILL快钱系统后设定的 商户密钥
		kq_orderid = orderid '订单编号[商户网站]
		kq_amount =  alltotalprice  	'支付金额
		kq_curr = "1"    								'货币类型。1为RMB
		kq_commodity_info = "商品信息"
		kq_pname = buyer_name  	'"收货人姓名"

		kq_merchant_url = strFullURL & "pay_receive_99bill.asp"     '商家接受支付结果的URL
		'kq_merchant_url =  rs("backurl")    '商家接受支付结果的URL

		kq_merchant_param = ""'商家需要回传的额外参数,如果是多个参数,可以用|分隔
 
		'kq_pid_99billaccount="879905060102977462"   ''快钱合作伙伴商户编号


 		'注意正确的参数串拼凑顺序
		kq_sendtxt="merchant_id=" & kq_merchant_id & "&orderid=" & kq_orderid & "&amount=" & kq_amount & "&merchant_url=" & kq_merchant_url & "&merchant_key=" & kq_key

			'md5加密
			kq_mac=ucase(md5(kq_sendtxt))%>
<div class="paywaybox">
  <form name="frm" method="post" action="https://www.99bill.com/webapp/receiveMerchantInfoAction.do" target="_blank">
    <input type="hidden" name="merchant_id" value="<%=kq_merchant_id%>">
    <input type="hidden" name="orderid" value="<%=kq_orderid%>">
    <input type="hidden" name="amount" value="<%=kq_amount%>">
    <input type="hidden" name="commodity_info"  value="<%=server.urlencode(kq_commodity_info)%>">
    <input type="hidden" name="merchant_url"  value="<%=kq_merchant_url%>">
    <input type="hidden" name="merchant_param"  value="<%=kq_merchant_param%>">
    <input type="hidden" name="pname"  value="<%=server.urlencode(kq_pname)%>">
    <input type="hidden" name="currency" value="<%=kq_curr%>">
    <input type="hidden" name="isSupportDES" value="2">
    <input type="hidden" name="mac" value="<%=kq_mac%>">
    <input type="hidden" name="pid" value="<%=kq_pid_99billaccount%>">
    <input name="image" type="image" src="../images/p_99bill.gif"  alt="使用快钱支付" />
  </form>
</div>
<% end if
	rs.close %>
<% rs.open "select * from cnk_payway where payname='tenpay' and isopen=1",conn,1,1 
	if rs.recordcount>0 then
	
	' 获取服务器日期,格式YYYYMMDD
	Function CFTGetServerDate 
		Dim strTmp, iYear,iMonth,iDate 
		iYear = Year(Date) 
		iMonth = Month(Date) 
		iDate = Day(Date) 

		strTmp = CStr(iYear)
		If iMonth < 10 Then 
			strTmp = strTmp & "0" & Cstr(iMonth)
		Else 
			strTmp = strTmp & Cstr(iMonth)
		End If 
		If iDate < 10 Then 
			strTmp = strTmp & "0" & Cstr(iDate) 
		Else 
			strTmp = strTmp & Cstr(iDate) 
		End If 
		CFTGetServerDate = strTmp 
	End Function

	Dim request_text
	Dim md5_sign
	Dim spid,sp_key,cmdno,bill_date,bank_type,desc,purchaser_id,bargainor_id,sp_billno
	Dim transaction_id,total_fee,fee_type,return_url,attach,sign_text

	spid	= rs("payid")		' 这里替换为您的实际商户号
	sp_key	= rs("paykey")	' sp_key是32位商户密钥, 请替换为您的实际密钥

	' 下面是请求参数
	cmdno		= "1"				' 财付通支付为"1" (当前只支持 cmdno=1)	
	bill_date	= CFTGetServerDate	' 交易日期 (yyyymmdd)	
	bank_type	= "0"				' 银行类型:	0		财付通
									'			1001	招商银行   
									'			1002	中国工商银行  
									'			1003	中国建设银行  
									'			1004	上海浦东发展银行   
									'			1005	中国农业银行  
									'			1006	中国民生银行  
									'			1008	深圳发展银行   
									'			1009	兴业银行   

	desc		= orderid&"号订单在线支付"		' 商品名称
	purchaser_id = ""				' 用户财付通帐号,如果没有可以置空
	bargainor_id = spid				' 商户号
	sp_billno	 = orderid		' 商户生成的订单号(最多32位)	

	' 重要:
	' 交易单号(28位): 商户号(10位) + 日期(8位) + 流水号(10位), 必须按此格式生成, 且不能重复
	' 如果sp_billno超过10位, 则截取其中的流水号部分加到transaction_id后部(不足10位左补0)
	' 如果sp_billno不足10位, 则左补0, 加到transaction_id后部
	transaction_id = spid & bill_date & left(sp_billno,10)

	total_fee	 = 	alltotalprice*100			' 总金额, 分为单位
	fee_type	 = "1"				' 货币类型: 1 – RMB(人民币) 2 - USD(美元) 3 - HKD(港币)
	return_url	 = strFullURL & "pay_receive_tenpay.asp" ' 财付通回调页面地址, (最长255个字符)
	attach		 = ""	' 商户私有数据, 请求回调页面时原样返回

	' 生成MD5签名    
	sign_text = "cmdno=" & cmdno & "&date=" & bill_date & "&bargainor_id=" & bargainor_id &_
        "&transaction_id=" & transaction_id & "&sp_billno=" & sp_billno &_
        "&total_fee=" & total_fee & "&fee_type=" & fee_type & "&return_url=" & return_url &_
        "&attach=" & attach & "&key=" & sp_key

	md5_sign = UCase(MD5(sign_text))        ' 转换为大写  
	%>
<div class="paywaybox">
  <form action="https://www.tenpay.com/cgi-bin/v1.0/pay_gate.cgi" target="_blank">
    <input type="hidden" name="cmdno"				value="<%=cmdno%>">
    <input type="hidden" name="date"			    value="<%=bill_date%>">
    <input type="hidden" name="bank_type"			value="<%=bank_type%>">
    <input type="hidden" name="desc"				value="<%=desc%>">
    <input type="hidden" name="purchaser_id"		value="<%=purchaser_id%>">
    <input type="hidden" name="bargainor_id"		value="<%=bargainor_id%>">
    <input type="hidden" name="transaction_id"	value="<%=transaction_id%>">
    <input type="hidden" name="sp_billno"			value="<%=sp_billno%>">
    <input type="hidden" name="total_fee"			value="<%=total_fee%>">
    <input type="hidden" name="fee_type"			value="<%=fee_type%>">
    <input type="hidden" name="return_url"		value="<%=return_url%>">
    <input type="hidden" name="attach"			value="<%=attach%>">
    <input type="hidden" name="sign"				value="<%=md5_sign%>">
    <input name="image" type="image" src="../images/p_tenpay.gif"  alt="使用财付通支付" />
  </form>
</div>
<% end if
		  rs.close %>
<% rs.open "select * from cnk_payway where payname='shengxun' and isopen=1",conn,1,1 
		if rs.recordcount>0 then%>
<%dim payid,paykey,backurl,servicename,amount,ymd,sjj,custom1name,custom1,custom2name,custom2,payvia,paymode,post_md5info
payid=rs("payid")
paykey=rs("paykey")
backurl=strFullURL & "pay_receive_shengxun.asp"
servicename=orderid& "号订单在线支付"
amount=alltotalprice*100
ymd=zhuan_day(now)
'xiaoshi=right("00"&hour(time),2)
'fenzhong=right("00"&minute(time),2)
'miao=right("00"&second(time),2)
Randomize
sjj=cstr(Int((8999 * Rnd) + 1000))
custom1name="定货人"
custom1=buyer_name
custom2name=""
custom2=""
payvia="2,3,4,1"
paymode=""
post_md5info=Ucase(trim(md5(payid&amount&ymd&backurl&orderid&custom1&custom2&payvia&paykey&paymode)))
%>
<div class="paywaybox">
  <form name="form2" method="get" action="http://pay.168reg.cn/pay.do" target="_blank" />
  <input type="hidden" name="reg_userid" value="<%=payid%>" />
  <input type="hidden" name="servicename" value="<%=servicename%>" />
  <input type="hidden" name="amount" value="<%=amount%>" />
  <input type="hidden" name="ymd" value="<%=ymd%>" />
  <input type="hidden" name="receive_url" value="<%=backurl%>" />
  <input type="hidden" name="billno" value="<%=orderid%>" />
  <input type="hidden" name="custom1name" value="<%=custom1name%>" />
  <input type="hidden" name="custom1" value="<%=custom1%>" />
  <input type="hidden" name="custom2name" value="<%=custom2name%>" />
  <input type="hidden" name="custom2" value="<%=custom2%>" />
  <input type="hidden" name="paymode" value="<%=paymode%>" />
  <input type="hidden" name="payvia" value="<%=payvia%>" />
  <input type="hidden" name="post_md5info" value="<%=post_md5info%>" />
  <input name="image" type="image" src="../images/pay_msg.gif"  alt="" />
  </form>
</div>
<% end if
		  rs.close %>
<div class="paywaybox">
  <script language="JavaScript" type="text/javascript">
		function showbank()
		{
		var b;
		b=document.getElementById('bankaccount');
		if (b.style.display=='none')
		{b.style.display="";}
		else
		{b.style.display='none';}
		}
		</script>
  <a href="javascript:showbank();"> <img src="../images/pay_other.gif" alt="" border="0" /><br />
  点击显示银行帐号
</a> </div>
<div class="clearboth"></div>
<div id="bankaccount" style="display:none;"> 可选择以下银行帐号直接汇款/转帐,为了为防止您的汇款与其他客户的汇款混淆,请存入一个零头,如:500.08元以相互区分<br />
  为确认款到帐,请您将银行底单等汇款凭证传真或截图给我们。
  <% rs.open "select payid,content from cnk_payway where payname='bank' order by paixu",conn,1,1
		do while not rs.eof %>
  <div class="paybankbox">
    <div class="banklogo"><img src="../images/bank_<%= rs("payid") %>.gif" /></div>
    <div class="bankinfo"> <%= CnkUBBContent(rs("content")) %> </div>
  </div>
  <% rs.movenext 
		  loop
		  rs.close %>
  <div class="clearboth"></div>
</div>