<!--#include file="MD5.asp"-->
<!--#include file="../../conn.asp"-->
<!--#include file="../../config.asp"-->

<body bgcolor=#FCFCFC leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<% dim  goods,sum,opayid
goods=saferequest("paygood",1)
sum=saferequest("paysum",1)
opayid=2
Function GetLocationURL() 
Dim Url 
Dim ServerPort,ServerName,ScriptName,QueryString 
ServerName = Request.ServerVariables("SERVER_NAME") 
ServerPort = Request.ServerVariables("SERVER_PORT") 
ScriptName = Request.ServerVariables("SCRIPT_NAME") 
QueryString = Request.ServerVariables("QUERY_STRING") 
Url="http://"&ServerName 
If ServerPort <> "80" Then Url = Url & ":" & ServerPort 
Url=Url&ScriptName 
Url=replace(Url,"index.asp","")
GetLocationURL=Url 
End Function 


action=FormatSQL(SafeRequest("action",0))

set rs=server.CreateObject("adodb.recordset")
rs.open "select opayid,opayname,opaypassword,opayrturl,opayparter from sdx_opay where opayid="&opayid,conn,1,1
payid=rs("opayname")
paypwd=rs("opaypassword")
payurl=GetLocationURL()&rs("opayrturl")
payparter=rs("opayparter")
rs.close
set rs=nothing

select case action
Case "1"
%> 

<TABLE cellSpacing=1 cellPadding=0 width="100%" border=0 align="center" >
       
     <TBODY>
    <TR bgcolor=#ECECEC>
          <TD  height="20" colspan="2"></TD>
        </TR>
   <TR >
          <TD  height="30" colspan="2">&nbsp&nbsp&nbsp</TD>
        </TR>
    

   </TBODY>
  </TABLE>
  <TABLE cellSpacing=1 cellPadding=0 width="600" border=0 align="center" >
       
     <TBODY>
    <TR bgcolor=#FFffff>
          <TD  height="50"><IMG src="images/chinabankpayment.gif" border=0></TD>
        </TR>

   
   </TBODY>
  </TABLE>

   <TABLE cellSpacing=1 cellPadding=0 width="600" border=0 align="center" >
       
     <TBODY>
    <TR bgcolor=#FFffff>
          <TD bgcolor=#FF5900 height="28" colspan="2" align="center">网银支付网关</TD>
        </TR>

   
   </TBODY>
  </TABLE>
<TABLE cellSpacing=1 cellPadding=0 width="600" border=0 align="center" >
       
     <TBODY>
     <TR bgcolor=#FFD350>
          <TD  height="30" colspan="2">&nbsp&nbsp&nbsp您现在[<%=webname%>]在线支付给<%=payid %>网址:(<%=weburl%>)</TD>
        </TR>

   
   </TBODY>
  </TABLE>
<TABLE cellSpacing=1 cellPadding=0 width="600" border=0 align="center" bgcolor=#f1f1f1>
       
     <TBODY>
      <form name="alipayment" method="post" action="index.asp?action=2">
         
       
          <TR bgcolor=#ffffff>
          
          <TD height="30">&nbsp 商品订单：</TD>
          <TD height="30"><%=goods%>
          <input type="hidden" name="shopname"  size="30" value="<%=goods%>">

    </TD>
      </TR>
      
          
        <TR bgcolor=#ffffff>
          
         
          <TD  height="30">&nbsp 付款金额：</TD>
         <TD height="30"> <%=FormatNumber(sum)%>元
          <input type="hidden" name="shopsum"  size="30" value="<%=sum%>">

        </TD>
         </TR>           
         
        <TR bgcolor=#ffffff>
          
          <TD  height="30"> &nbsp 客户留言：</TD>
          <TD height="30"><textarea name="shopbody" cols="60" rows="4">暂无</textarea><br>（如联系方法，商品要求、数量等。50汉字内）</TD></TR>

         <TR bgcolor=#F5F5B8>
         
          <TD height="30" colspan="2">&nbsp &nbsp <input type="Submit" name="aliorder"  size="30" value="确   认"  onClick="return CheckForm();"></TD></TR>
   </FORM>
   </TBODY>

</TABLE>
<TABLE cellSpacing=1 cellPadding=0 width="100%" border=0 align="center" >
       
     <TBODY>

   <TR >
          <TD  height="60" colspan="2">&nbsp&nbsp&nbsp</TD>
        </TR>
     <TR bgcolor=#ECECEC>
          <TD  height="5" colspan="2"></TD>
        </TR>

      <TR >
          <TD  height="40" colspan="2" align="center"><IMG src="images/logo.gif" border=0>	</TD>
        </TR>
   </TBODY>
  </TABLE>
<%
Case "2"
dim shopsum,shopname,shopbody
shopname      =     sqlCheckstr(request.form("shopname")) 
shopsum       =     sqlCheckstr(request.form("shopsum"))
shopbody      =     sqlCheckstr(request.form("shopbody"))

str_name               =  shopname
str_payid              =  payid
str_paypwd             =  paypwd
str_payurl             =  payurl
str_sum	               =  shopsum
str_goods	       =  shopname
str_comment            =  shopbody
pro_body               =  "以下金额（"& str_sum & "元）已包含配送费用"
str_shopname           =  str_goods & "号订单在线支付" 



 v_mid                 =          str_payid    '商户号,这里为测试商户号1001，替换为自己的商户号即可	 
 key                   =          str_paypwd   'MD5私钥
 v_oid                 =          str_goods    '订单号，构成格式 年月日-商户号-小时分钟秒
 v_amount              =	  round(str_sum,2)      '订单金额
 v_moneytype	       =          "0"          '支付币种0为人民币
 v_url                 =	  str_payurl   '商户自定义返回接收支付结果的页面
 remark1               =          strUserName  '备注字段1
 remark2               =           LngUserID         '备注字段1
 style	               =          "0"          '指网关模式0(普通)，1(银行列表中带外卡)
 text                  =          v_amount&v_moneytype&v_oid&v_mid&v_url&key
 v_md5info             =          Ucase(trim(md5(text)))
	 
%>

 <TABLE cellSpacing=1 cellPadding=0 width="100%" border=0 align="center" >
       
     <TBODY>
    <TR bgcolor="#336699">
          <TD  height="28" width="300"  align="center"><img src='images/plogo.gif' border=0></TD>
         <TD  height="28"  align="center"></TD>
        </TR>

   
   </TBODY>
  </TABLE>
 <TABLE cellSpacing=1 cellPadding=0 width="600" border=0 align="center" >
       
     <TBODY>
    <TR bgcolor=#FFffff>
          <TD  height="50" colspan="2" align="center"></TD>
        </TR>

   
   </TBODY>
  </TABLE>


<TABLE cellSpacing=1 cellPadding=0 width="600" border=0 align="center" >
       
     <TBODY>
     <TR bgcolor=#FFD350>
          <TD  height="30" colspan="2">&nbsp&nbsp&nbsp您现在[<%=webname%>]在线支付给<%=payid %>网址:(<%=weburl%>)</TD>
        </TR>

   
   </TBODY>
  </TABLE>
<table width="600" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#f1f1f1" >

<tr bgcolor=#FFFFFF><td  height=300 align=center>
 <form method="post" action="https://pay3.chinabank.com.cn/PayGate" name="E_FORM" target=new>

    

	<input type="hidden" name="v_md5info" size="100"  value="<%=v_md5info%>">
	<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%>">
	<input type="hidden" name="style" value="<%=style%>">
	<input type="hidden" name="remark1" value="<%=remark1%>">
	<input type="hidden" name="remark2" value="<%=remark2%>">

       <input type=submit name=v_action value="网银在线支付平台">
</form>
</td>
</tr>
    

</table>
  <TABLE cellSpacing=1 cellPadding=0 width="600" border=0 align="center" >
       
     <TBODY>
    <TR bgcolor=#FFffff>
          <TD bgcolor=#FF5900 height="28" colspan="2" align="center"><FONT color=#ffffff>本站使用网银在线支付平台，在线实时支付</font></TD>
        </TR>

   
   </TBODY>
  </TABLE>
 <TABLE cellSpacing=1 cellPadding=0 width="100%" border=0 align="center" >
       
     <TBODY>
    <tr bgcolor="#f1f1f1" height=100 ><td colspan=2 align=center>
<a href='http://www.chinabank.com.cn'  target="_blank"><img src='images/logo.gif' border=0></a>
</td></tr>

   
   </TBODY>
  </TABLE>
</body>
<% 
end select  %>	