<!--#include file="../inc/pay_md5.asp"-->
<!--#include file="../inc/base64.asp"-->
<!--#include file="../conn/conn.asp"-->
<!--#include file="paysub.asp"-->

<%
    
	payflag=cint(request("playflag"))
	''''''''''''''''''''''''''''''''''''网银账号处理
	set rs=server.CreateObject("adodb.recordset")
	query="select * from Job_pay_online where chk=1 and payflag="&payflag
	rs.open query,conn,1,1
	if not rs.eof then
	ipayno=rs("shbh")
    ipaykey=rs("pay_key")
	end if
	rs.close  

	
	
    ''''''''''''''''''''''''''''''''''''''根据选择用户选择设定支付金额
	sql="select money from JOB_C_cmembertype where id="&request("usertype")
	rs.open sql,conn,1,1
	money=rs("money")
	rs.close 
	
	v_mid=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipayno))),chr(13)&chr(10),"<br>")
    key=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(ipaykey))),chr(13)&chr(10),"<br>")
	
	if payflag=2 then
			curdate=now()
			OrderNo=year(curdate)&month(curdate)&day(curdate)&"-"&v_mid&"-"&hour(curdate)&minute(curdate)&second(curdate)
	else
	'交易日期，格式：YYYYMMDD
			yy=year(date)
			mm=right("00"&month(date),2)
			dd=right("00"&day(date),2)
			
			'生成订单号所有所需元素,格式为：小时，分钟，秒
			xiaoshi=right("00"&hour(time),2)
			fenzhong=right("00"&minute(time),2)
			miao=right("00"&second(time),2)
			OrderNo=yy & mm & dd & xiaoshi & fenzhong & miao
	end if
	select case payflag
	case 1 
		pay_type="支付宝支付"
	case 2
      	pay_type="网银支付"
   	case 3
      	pay_type="Ipay在线支付"
   	case 4
      	pay_type="NPS在线支付"
   	case 5
      	pay_type="PayPal国际支付"
   	case else
      response.write "系统错误"
	end select
	
	pay_mid=v_mid
	pay_amount=money
	pay_pmode=""
	pay_oid=OrderNo
	
	pay_cmember
	pay_address
	pay_email
	pay_tel
	
	
	
	sql="select * from JOB_pay_back"
	rs.open sql,conn,1,3
	rs.addnew	
	rs("pay_mid")=pay_mid '账号
	rs("pay_amount")=pay_amount
	rs("pay_type")=pay_type
	rs("pay_pmode")=pay_pmode
	rs("pay_oid")=OrderNo
	rs("pay_content")="购买会员"
	rs("pay_cmember")="11"
	rs("pay_address")="11"
	rs("pay_email")="11"
	rs("pay_tel")="11"
	
	rs("pay_date")=now()
	rs("pay_userip")=request.servervariables("remote_addr")
	rs("pay_isucceed")=0
	rs("pay_pstring")=""
    rs.update
	rs.close
	set rs=nothing
	
	
   select case payflag
   case 1
      call pay_AliPay()
   case 2
      call pay_chinabank()
   case 3
      call pay_ipay()
   case 4
      call pay_nps()
   case 5
      call pay_paypal()
   case else
      response.write "系统错误"
   end select
	


	'**********以下几项与网上支付货款无关，建议不用**************
	v_rcvname="wq"
	v_rcvaddr="北京"
	v_rcvtel="01088579011"
	v_rcvpost="100001"
	v_ordername="wq"
	v_orderemail = "test@test.com"
%>


