<!--#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=3
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/x-click-but01.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">paypal支付网关</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 & "号订单在线支付" 




 merchant_id = str_payid		'''商户编号
 merchant_key = str_paypwd 		'''商户密钥
 orderid = str_goods		'''订单编号
 amount = shopsum 		'''订单金额
 curr = "1"		'''货币类型,1为人民币
 isSupportDES = "2"		'''是否安全校验,2为必校验,推荐

 merchant_url = str_payurl 		'''支付结果返回地址
 pname = ""		'''支付人姓名
 commodity_info = ""		'''商品信息
 merchant_param = ""		'''商户私有参数
	
pemail=""		'''传递email到快钱网关页面
pid=""		'''代理/合作伙伴商户编号

'''生成加密串,注意顺序
ScrtStr="merchant_id=" & merchant_id & "&orderid=" & orderid & "&amount=" & amount & "&merchant_url=" & merchant_url & "&merchant_key=" & merchant_key
mac=ucase(md5(ScrtStr)) =        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/x-click-but01.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>
 <div align="center" style="font-size=12px;font-weight: bold;color=red;">
		<form action="https://www.paypal.com/cgi-bin/webscr" method="POST" target=new>
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<%=str_payid%>">
<input type="hidden" name="item_name" value="<%=webname%>(No. orders:<%=str_goods%>)">
<input type="hidden" name="item_number" value="<%=str_goods%>">
<input type="hidden" name="amount" value="<%=str_sum%>">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" SRC="http://images.paypal.com/images/x-click-but04.gif"
 style='border: 0px;height:31px'  name="submit" alt="PayPal">
</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.paypal.com'  target="_blank"><img src='images/x-click-but01.gif' border=0></a>
</td></tr>

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