<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<%
if online_pay  <> "" then
online_pay = cint(online_pay)
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from shop_pay where id=" & online_pay,conn,1,1
if rs.eof and rs.bof then
rs.Close
set rs=Nothing
else
pay_id=trim(rs("id"))
pay2=trim(rs("pay2"))
pay3=trim(rs("pay3"))
pay4=trim(rs("pay4"))
pay5=trim(rs("pay5"))
pay6=trim(rs("pay6"))
pay7=trim(rs("pay7"))
pay8=trim(rs("pay8"))
rs.Close
set rs=Nothing
select case pay_id
                      case 1
                        call pay_1()
                      case 2
                        call pay_2()
                      case 3
                        call pay_3()
                      case 4
                        call pay_4()
                      case 5
                        call pay_5()
                      case 6
                        call pay_6()
                      case 7
                        call pay_7()
                      case 8
                        call pay_8()
					  case 9
                        call pay_9()
					  case 10
                        call pay_10()
					  case 11
                        call pay_11()
                  end select
	end if
end if


'------------------------------------默认支付----------------------------------

sub pay_1()

	spid		= pay2
	sp_key		= pay3
	cmdno		= "1"
	bill_date	= year(now)&right("0"&month(now),2)&right("0"&day(now),2) 
	bank_type	= "0"
	desc		= "购买订单号："&dd
	purchaser_id = ""
	bargainor_id = spid
	sp_billno	 = right("0"&month(now),2)&right("0"&day(now),2)&right("0"&Hour(now),2)&right("0"&Minute(now),2)&right("0"&second(now),2) 
	transaction_id = spid & bill_date & sp_billno
	total_fee	 =  zj*100
	fee_type	 = "1"
	return_url	 = pay4
	attach		 = "my_magic_string"


	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(trim(md5(sign_text)))
   
response.write ("<form method=post name=post action=""http://portal.tenpay.com/cfbiportal/cgi-bin/cfbiin.cgi"" target=new>")
response.write (" <td height=""30"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=hidden name=cmdno value="&cmdno&">")
response.write ("<input type=hidden name=date value="&bill_date&">")
response.write ("<input type=hidden name=bank_type value="&bank_type&">")
response.write ("<input type=hidden name=desc value="&desc&">")
response.write ("<input type=hidden name=purchaser_id value="&purchaser_id&">")
response.write ("<input type=hidden name=bargainor_id value="&bargainor_id&">")
response.write ("<input type=hidden name=transaction_id size=100 value="&transaction_id&">")
response.write ("<input type=hidden name=sp_billno value="&sp_billno&">")
response.write ("<input type=hidden name=total_fee value="&total_fee&">")
response.write ("<input type=hidden name=fee_type value="&fee_type&">")
response.write ("<input type=hidden name=return_url value="&return_url&">")
response.write ("<input type=hidden name=attach value="&attach&">")
response.write ("<input type=hidden name=sign size=100 value="&md5_sign&">")
response.write ("<input type=submit  value=""立即用财付通付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")
end sub

'---------------------------------------支付宝--------------------------------
sub pay_2()
if pay6=0 then
response.write ("<form method=post name=post action=""alipay02.asp"" target=new>")
response.write (" <td height=""30"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=hidden name=pay2 value="&pay2&">")
response.write ("<input type=hidden name=pay3 value="&pay3&">")
response.write ("<input type=hidden name=pay4 value="&pay4&">")
response.write ("<input type=hidden name=pay5 value="&pay5&">")
response.write ("<input type=hidden name=pay6 value="&pay6&">")
response.write ("<input type=hidden name=pay7 value="&pay7&">")
response.write ("<input type=hidden name=pay8 value="&pay8&">")
response.write ("<input type=hidden name=dd value="&dd&">")
response.write ("<input type=hidden name=zj value="&zj&">")
response.write ("<input type=submit  value=""立即用支付宝付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")
else
response.write ("<form method=post name=post action=""alipay01.asp"" target=new>")
response.write (" <td height=""30"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=hidden name=pay2 value="&pay2&">")
response.write ("<input type=hidden name=pay3 value="&pay3&">")
response.write ("<input type=hidden name=pay4 value="&pay4&">")
response.write ("<input type=hidden name=pay5 value="&pay5&">")
response.write ("<input type=hidden name=pay6 value="&pay6&">")
response.write ("<input type=hidden name=pay7 value="&pay7&">")
response.write ("<input type=hidden name=pay8 value="&pay8&">")
response.write ("<input type=hidden name=dd value="&dd&">")
response.write ("<input type=hidden name=zj value="&zj&">")
response.write ("<input type=submit  value=""立即用支付宝付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")
end if
end sub


'-----------------------------------网银--------------------------------
sub pay_3()
key = pay3'      MD5私钥
v_mid = pay2 '商户号,这里为测试商户号1001，替换为自己的商户号即可
v_moneytype = pay4'      支付币种0为人民币
style=pay5'      指网关模式0(普通)，1(银行列表中带外卡)
v_url= pay6'      商户自定义返回接收支付结果的页面	 
v_oid=dd'      订单号，构成格式 年月日-商户号-小时分钟秒
v_amount=zj'      订单金额
remark1=""
remark2=""
text = v_amount&v_moneytype&v_oid&v_mid&v_url&key
v_md5info=Ucase(trim(md5(text)))	
response.write ("<form method=post name=post action=""https://pay.chinabank.com.cn/select_bank"" target=new>")
response.write (" <td height=""30"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=hidden name=v_md5info size=100  value="&v_md5info&">")
response.write ("<input type=hidden name=v_mid value="&v_mid&">")
response.write ("<input type=hidden name=v_oid value="&v_oid&">")
response.write ("<input type=hidden name=v_amount value="&v_amount&">")
response.write ("<input type=hidden name=v_moneytype  value="&v_moneytype&">")
response.write ("<input type=hidden name=v_url value="&v_url&">")
response.write ("<input type=hidden name=style value="&style&">")
response.write ("<input type=hidden name=remark1 value="&remark1&">")
response.write ("<input type=hidden name=remark2 value="&remark2&">")
response.write ("<input type=submit  value=""使用“网银”付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")
end sub



'-----------------------------------------------------------nps--------------------------------------------

sub pay_4()

	m_id		=	pay2
	modate		=	date()
	m_orderid	=	dd
	m_oamount	=	zj
	m_ocurrency	=	pay4
	m_url		=	pay6
	m_language	=	pay5
	s_name		=	request("userzhenshiname")
	s_addr		=	request("shouhuodizhi")
	s_postcode	=	request("youbian")
	s_tel		=	request("usertel")			
	s_eml		=	request("useremail")
	r_name		=	request("userzhenshiname")
	r_addr		=	request("shouhuodizhi")
	r_postcode	=	request("youbian")	
	r_tel		=	request("usertel")	
	r_eml		=	request("useremail")
	m_ocomment	=	request("liuyan")	
	m_status	=	pay7
	key		    =	key
	'创建NPS安全组件
	Set NPSMAC = Server.CreateObject("NPSDigest.NPSSecurity")
	'组织订单信息
	m_info = m_id&"|"&m_orderid&"|"&m_oamount&"|"&m_ocurrency&"|"&m_url&"|"&m_language
	s_info = s_name&"|"&s_addr&"|"&s_postcode&"|"&s_tel&"|"&s_eml&"|"&r_name
	r_info = r_addr&"|"&r_postcode&"|"&r_tel&"|"&r_eml&"|"&m_ocomment&"|"&m_status&"|"&modate
	NPSMAC.OrderInfo =  m_info&"|"&s_info&"|"&r_info
	'设置密钥
	NPSMAC.NPSKey = pay3
	'加密
	OrderInfo = NPSMAC.GetEncrypt
	NPSMAC.OrderInfo = OrderInfo
	digest = NPSMAC.GetDigest
    response.write ("<form name=""FORM"" method=""post"" action=""https://payment.nps.cn/ReceiveMerchantAction.do""  target=new>")
	response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
	response.write ("<input type=""hidden"" name=""OrderMessage"" value="&OrderInfo&">")
	response.write ("<input type=""hidden"" name=""digest"" value="&digest&">")
	response.write ("<input type=""hidden"" name=""M_ID"" value="&m_id&">")
	response.write ("<input type=""hidden"" name=""s"" value=""submit"">")
response.write ("<input type=submit  value=""使用“nps”付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")
end sub

'-----------------------------------------------------------西部支付--------------------------------------------

sub pay_5()
MerchantID= pay2							'商户在西部支付上的ID
MerchantPostBackURL = pay3	'商户接收西部支付的支付通知的网址	
MerchantOrderNumber = dd		'订单号，不能重复。建议用　“日期”＋“订单号”
MerchantOrderAmount = zj			'订单金额，例：0.01 代表 0.01
response.write ("<form method=post name=post action=""http://www.WestPay.com.cn/Pay/WestPayReceiveOrderFromMerchant.asp"" target=new>")
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=""hidden"" name=""MerchantID"" value="&MerchantID&">")
response.write ("<input type=""hidden"" name=""PostBackURL"" value="&MerchantPostBackURL&">")
response.write ("<input type=""hidden"" name=""OrderNumber"" value="&MerchantOrderNumber&">")
response.write ("<input type=""hidden"" name=""OrderAmount"" value="&MerchantOrderAmount&">")
response.write ("<input type=submit  value=""使用“西部支付”付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")
end sub

'-----------------------------------------------------------1st-pay--------------------------------------------

sub pay_6()
username=pay2
leixing=pay7
ver=pay4
xinxi=request("liuyan")
payid=pay3
urlback=pay6
fangshi=pay5
email=webemail
handphone="13800000000"
cash=zj
shopname=request("shopname")
response.write ("<form method=post name=post action=""http://www.1st-pay.net/work/work.asp"" target=new>")
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=""hidden"" name=""username"" value="&username&">")
response.write ("<input type=""hidden"" name=""leixing"" value="&leixing&">")
response.write ("<input type=""hidden"" name=""ver"" value="&ver&">")
response.write ("<input type=""hidden"" name=""xinxi"" value="&xinxi&">")
response.write ("<input type=""hidden"" name=""payid"" value="&payid&">")
response.write ("<input type=""hidden"" name=""urlback"" value="&urlback&">")
response.write ("<input type=""hidden"" name=""fangshi"" value="&fangshi&">")
response.write ("<input type=""hidden"" name=""email"" value="&email&">")
response.write ("<input type=""hidden"" name=""handphone"" value=""&handphone&"">")
response.write ("<input type=""hidden"" name=""cash"" value="&cash&">")
response.write ("<input type=""hidden"" name=""shopname"" value="&shopname&">")
response.write ("<input type=submit  value=""使用“1st-pay”付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")
end sub


'-----------------------------------------------------------首信易--------------------------------------------

sub pay_7()
ddbh=ymd&"-"&pay3&"-"&dd

response.write ("<form method=""post"" action=""http://pay.beijing.com.cn/prs/user_payment.checkit"" name=""E_FORM"" target=new>")
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=submit name=v_action value=""使用“首信易网上安全支付平台”付款""  class=""go-wenbenkuang"">")
response.write ("<input type=""hidden"" name=""v_mid"" value="&pay2&">")
response.write ("<input type=""hidden"" name=""v_oid"" value="&ddbh&">")
response.write ("<input type=""hidden"" name=""v_rcvname"" value="&trim(request("userzhenshiname"))&">")
response.write ("<input type=""hidden"" name=""v_rcvaddr"" value="&trim(request("shouhuodizhi"))&">")
response.write ("<input type=""hidden"" name=""v_rcvtel"" value="&trim(request("usertel"))&">")
response.write ("<input type=""hidden"" name=""v_rcvpost"" value="&trim(request("youbian"))&">")
response.write ("<input type=""hidden"" name=""v_amount"" value="&zj&">")
response.write ("<input type=""hidden"" name=""v_ymd""  value="&ymd&">")
response.write ("<input type=""hidden"" name=""v_orderstatus""  value=""0"">")
response.write ("<input type=""hidden"" name=""v_ordername""  value="&trim(request("userzhenshiname"))&">")
response.write ("<input type=""hidden"" name=""v_moneytype""  value=""0"">")
response.write ("<input type=""hidden"" name=""v_url"" value="&pay4&">")
response.write (" </td> ")
response.write ("</form>")
end sub

'-----------------------------------------------------------易付通--------------------------------------------

sub pay_8()
tid= pay2       '商户交易唯一号号，即商户号，请改为你自己的商户号
key=pay3    '交易密钥，必须跟易付通商户后台设置的相同，否则会验证失败
actioncode=pay5    '交易码,用于标识交易,目前支持sell,custom 等于custom表示用户可以修改支付金额
actionParameter=""    '当 actioncode="sell"和"custom"时 ,此参数为空
ver=pay7          '版本号,当前系统请使用2.0
sitename=""           '网站名称，多个网站商户使用，在支付网关页面显示，设置为空时读取在我们系统设置的网站名称
siteurl=""            '网站域名，多个网站域名商户使用，在支付网关页面显示，设置为空时读取在我们系统设置的网站域名
disableemail=""       '是否隐藏支付网关页面显示的填写email栏
url=pay6
bid=dd'定单号
	prc=zj'      订单金额
	pdt=request("shopname")'      交易摘要或产品名称
	username=request("userzhenshiname") '      购买用户
	remark1=request("liuyan")'      备注
	card=pay4'      默认支付方式
    scard=""
    lang="gb2312"
    md=md5(key&":"&prc&","&bid&","&tid&","&card&","&scard&","&actioncode&","&actionparameter&","&ver)
                                                            'md为加密数据，加密顺序必须严格按此顺序

response.write ("<form method=post action=""http://pay.xpay.cn/pay.aspx"" name=""XpayFORM"" >")
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=HIDDEN name=""tid"" 	value="&tid&"> ")
response.write ("<input type=HIDDEN name=""bid""   value="&bid&">  ")	
response.write ("<input type=HIDDEN name=""prc""    value="&prc&"> 	")
response.write ("<input type=HIDDEN name=""card"" value="&card&">  	")
response.write ("<input type=HIDDEN name=""scard"" value="&scard&" > ")
response.write ("<input type=HIDDEN name=""actioncode"" value="&actioncode&">  ")
response.write ("<input type=HIDDEN name=""actionparameter""  value="&actionparameter&"> ")
response.write ("<input type=HIDDEN name=""ver""  value="&ver&">   ")
response.write ("<input type=HIDDEN name=""md""  value="&md&">  ")
response.write ("<input type=HIDDEN name=""url""  value="&url&">  ")
response.write ("<input type=HIDDEN name=""pdt""  value="&pdt&">")
response.write ("<input type=HIDDEN name=""username""  value="&username&"> ")   
response.write ("<input type=HIDDEN name=""type""  value="&pdttype&">")
response.write ("<input type=HIDDEN name=""lang""  value="&lang&">    ")
response.write ("<input type=HIDDEN name=""remark1""  value="&remark1&">")
response.write ("<input type=HIDDEN name=""disableemail""  value="&disableemail&">   ")
response.write ("<input type=HIDDEN name=""sitename""  value="&sitename&">   ")
response.write ("<input type=HIDDEN name=""siteurl""  value="&siteurl&">   ")
response.write ("<input type=submit  value=""使用“易付通”付款""  class=""go-wenbenkuang"">")
response.write (" </td> ")
response.write ("</form>")

end sub

'------------------------------------ipay----------------------------------
sub pay_9()
v_mid		= pay2						'商户编号，改成IPAY负责分配给商户的编号
'注意：这里是测试 ， 实际根据您的情况来生成自己的订单
v_oid		= dd		'订单号，由数字0至9组成,一天内不重复。由商户负责产生的数字编号，长度Max(14)
v_email		= pay4					'消费者Email地址，必须填写 
v_mobile	= pay5						'为了方便为您提供服务，请填写消费者手机，必须填写
v_amount	= zj					'订单金额，单位，小数点后保留两位，如10或12.34，如果为整数，则不需要小数点
v_key		= pay3			'支付密码，在IPAY商户后台设置，长度(32-64)
v_url		= pay6		'返回网址(可以不提交，直接在商户管理后台设置)
dim md5string 
md5_string	= MD5(v_mid & v_oid & v_amount & v_email & v_mobile & v_key)   '加密生成数字验证字符串
response.write ("<form method=""post"" name=""post"" action=""http://www.ipay.cn/4.0/bank.shtml""  target=new>")
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=""hidden"" name=""v_name"" value="&request("userzhenshiname")&">")
response.write ("<input type=""hidden"" name=""v_email""  value="&v_email&">")
response.write ("<input type=""hidden"" name=""v_mobile""   value="&v_mobile&">")
response.write ("<input type=""hidden"" name=""v_tel""   value="&v_tel&">")
response.write ("<input type=""hidden"" name=""v_address"" value="&request("shouhuodizhi")&">")
response.write ("<input type=""hidden"" name=""v_zip"" value="&request("youbian")&">")
response.write ("<input type=""hidden"" name=""v_comment"" value="&request("liuyan")&">")
response.write ("<input type=""hidden"" name=""v_amount""  value="&v_amount&"> ")
response.write ("<input type=""hidden"" name=""v_mid"" value="&v_mid&"> ")
response.write ("<input type=""hidden"" name=""v_oid"" value="&v_oid&">")  
response.write ("<input type=""hidden""  name=""v_md5""  value="&md5_string&"> ")
response.write ("<input type=""hidden""  name=""v_url""  value="&v_url&"> ")
response.write ("<input type=""submit"" name=""submit""  value=""使用“IPAY在线支付”付款""  class=""go-wenbenkuang"">")
sponse.write ("</td>")
response.write ("</form>")
end sub

'------------------------------------IPS----------------------------------
sub pay_10()
datestr=ymd
billstr=pay2&(hour(now())+54)&(minute(now())+21)&(second(now())+19)

response.write ("<form method=""post"" name=""post"" action=""https://www.ips.net.cn/ipay/test_ipayment.asp""  target=new>")
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write ("<input type=""hidden"" name=""mer_code"" value="&pay2&">")
response.write ("<input type=""hidden"" name=""billno""  value="&billstr&">")
response.write ("<input type=""hidden"" name=""currency""   value="&pay3&">")
response.write ("<input type=""hidden"" name=""lang""   value="&pay4&">")
response.write ("<input type=""hidden"" name=""amount"" value="&zj&">")
response.write ("<input type=""hidden"" name=""date"" value="&datestr&">")
response.write ("<input type=""hidden"" name=""merchanturl"" value="&weburl&">")
response.write ("<input type=""hidden"" name=""attach""  value="&dingdan&"> ")
response.write ("<input type=""submit"" name=""submit""  value=""使用“IPS”付款""  class=""go-wenbenkuang"">")
response.write ("</td>")
response.write ("</form>")

end sub
'------------------------------------不使用----------------------------------


sub pay_11()
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
%>
<form method="post" action="/play/paypal.asp">
<input type="hidden" name="amount" value="<%=zj%>">
<input type="hidden" name="item_name" value="<%=request("shopname")%>">
<input type="hidden" name="address1" value="<%=request("shouhuodizhi")%>">
<input type="hidden" name="djj_snsn" value="11">
<input type="hidden" name="email" value="<%=request("useremail")%>">
<input type="hidden" name="shipping_amount" value="0">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="paypal_invoice" value="<%=dd%>">
<input type="hidden" name="on0" value="定单编号">
<input type="hidden" name="os0" value="<%=dd%>">
<input type="submit" name="submit" value=" Pay Now! ">
</form>
<%
response.write ("</td>")
end sub

sub pay_12()
response.write (" <td height=""11"" bgcolor=""#FFFFFF"" style='PADDING-LEFT: 50px'> ")
response.write (" 目前网站在线支付关闭 ")
response.write ("</td>")
end sub

%>