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

<body bgcolor=#FCFCFC leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<% dim  goods,sum,opayid,payname
payname=saferequest("payname",0)
sum=saferequest("paysum",1)
opayid=1
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="http://"&Request.ServerVariables("HTTP_HOST")&"/"&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/alipayment.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"><IMG src="images/alif.gif" border=0></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">
          <input type="text" name="shopname"  size="30" value="">

    </TD>
      </TR>
      
          
        <TR bgcolor=#ffffff>
          
         
          <TD  height="30">&nbsp 付款金额：</TD>
         <TD height="30">
          <input type="text" name="shopsum"  size="30" id="shopsum"   onkeyup="value=value.replace(/[^\d]/g,'')  "onbeforepaste="clipboarddata.setdata('text',clipboarddata.getdata('text').replace(/[^\d]/g,''))"value="1">

        </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/alipaylogo.gif" border=0>	</TD>
        </TR>
   </TBODY>
  </TABLE>
<%
Case "2"

dim service,partner,sign_type,subject,body,out_trade_no,price,show_url,quantity,seller_email,notify_url,return_url,key
dim t1,t4,t5
dim AlipayObj,itemUrl
        shopname      =     request.form("shopname") 
         shopsum       =     request.form("shopsum")
         shopbody      =     request.form("shopbody")

	t1				=	"https://www.alipay.com/cooperate/gateway.do?"	'支付接口
	t4				=	"images/alipay_bwrx.gif"		'支付宝按钮图片
	t5				=	"支付宝付款"						'按钮悬停说明
	
	service         =   "create_digital_goods_trade_p"
        agent           =   "2088002002956503" '合作厂商id
	partner		=    payparter		'partner合作伙伴ID(必须填)
	sign_type       =   "MD5"
	subject			=	 shopname 		'subject		商品名称
	body			=	shopbody 			'body			商品描述
	out_trade_no    =   Replace(Now(),"-","")
	out_trade_no    =   Trim(Replace(out_trade_no,":",""))
	price		    =	shopsum				'price	商品单价			0.01～50000.00
        show_url        =   "http://www.alipay.com"   '商品展示地址
        quantity        =   "1"   '商品数量
        seller_email    =   payid  '卖家账户
        key             =    paypwd '支付宝安全校验码
	notify_url      =    payurl
	return_url      =    payurl


	Set AlipayObj	= New creatAlipayItemURL
	itemUrl=AlipayObj.creatAlipayItemURL(t1,t4,t5,service,partner,sign_type,subject,body,out_trade_no,price,show_url,quantity,seller_email,notify_url,return_url,key)

%>



<table border="0" cellspacing="1" cellpadding="0" align="center" valign=absmiddle width=450>
<tr><td align=center width=50% height=120>
<%=itemUrl%>
</td>

</tr>
<tr><td colspan=2 align=center>本站使用支付宝支付平台，在线实时支付<br><br>
<a href='http://www.alipay.com'  target="_blank"><img src='https://img.alipay.com/pimg/logo.gif' border=0></a>
</td></tr>
</table>
</body>
<% 
end select  %>	

