📄 payonline.asp
字号:
<!--#include file="../Conn.asp"-->
<!--#include file="../Inc/Cl_Const.asp"-->
<!--#include file="../Inc/Cl_Function_Public.asp"-->
<!--#include file="../Inc/Cl_Md5.asp"-->
<%
Const ChannelID=0
if Not Cl.ChkUserLogin Then
'Call Cl.OutErr(0,"对不起,在线支付只对会员开放,请先注册成为会员!")
Response.Redirect InstallDir & "User/Login.asp"
End if
Cl.Product_Setting(3) = Cl.GetClng(Cl.Product_Setting(3))
if Cl.Product_Setting(3)=0 then Call Cl.OutErr(0,"对不起,在线支付已经暂时关闭,请用其它支付途径!")
'Cl.LoadTemplates("")
dim Action,OrderID,OrderNum,MoneyReceipt
'Rem 定义所需变量
Dim P_PayNum,P_PayAmount,P_PayDate
Dim P_MoneyType,P_Remark1,P_Remark2,P_Md5Text
Dim Money,PayID,Rate,HCharge,Post_Url
Action =Lcase(Trim(request("action")))
OrderID =Cl.GetClng(request("OrderID"))
OrderNum =0 : MoneyReceipt=0
if OrderID>0 then action = "step2"
Response.write Template.ReplaceAllFlag(Template.Head())
select case action
case "step2"
call Step_2()
case else
call Step_1()
end select
Response.write Template.ReplaceAllFlag(Template.Bottom())
CloseAllObj
Sub Step_1()
%>
<form action="PayOnline.asp" method="get" name="payonline" id="payonline">
<table class="border" cellspacing="1" cellpadding="2" width="760" align="center" border="0">
<tr class="title">
<td align="center"><b>在 线 支 付 操 作</b>(第一步)</td>
</tr>
<tr class="tdbg">
<td bgcolor="#FFFFFF" align="center">请输入你要支付的金额:
<input name="Money" type="text" id="Money" value="100" size="10" maxlength="6" />
元</td>
</tr>
<tr class="tdbg">
<td align="center" bgcolor="#E6E6E6">
<input name="Action" type="hidden" id="Action" value="Step2" />
<input type="submit" name="Submit" value=" 下一步 " /></td>
</tr>
</table>
</form>
<%
End Sub
Sub Step_2()
if OrderID>0 then
Set rs= Cl.Execute("select OrderNum,MoneyReceipt,MoneyTotal from Cl_Order where OrderID="&OrderID&" and UserID="&Cl.UserID&" and Status<2")
if Rs.eof and Rs.bof then
Call Cl.OutMsg(0,"找不到此定单!","javascript:history.go(-1)")
Else
OrderNum =rs(0)
MoneyReceipt=rs(1)
Money =rs(2)
End if
rs.Close : Set Rs=Nothing
Else
Money = Trim(request("Money"))
OrderID = 0
if Money="" then Call Cl.OutMsg(0,"请输入划款金额!","javascript:history.go(-1)")
end if
if Cl.GetClng(Cl.Product_Setting(6))=1 then
Rate = Cl.Product_Setting(7) & "%"
HCharge = Money * Cl.GetClng(Cl.Product_Setting(7)) / 100
P_PayAmount = Money + HCharge
else
Rate = "-"
HCharge = 0
P_PayAmount = Money
end if
P_PayAmount = CCur(Cl.FormatNum(P_PayAmount - MoneyReceipt,2))
P_PayNum = Cl.Product_Setting(1) & Year(Now()) & 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)
'Cl.Format_Time(now(),8)
PayID = Cl.Execute("select max(PaymentID) from Cl_Payment")(0)
if Isnull(PayID) or Not IsNumeric(PayID) then PayID=0
PayID = PayID+1
P_Remark1 = "订单金额:"&Money&",手绩费:"&Rate&",已支付:"&MoneyReceipt&",实际支付:"&P_PayAmount&"。"
set Rs=server.createobject("adodb.recordset")
SQL="select * from Cl_Payment"
OpenConn : Rs.open SQL,conn,1,3
Rs.AddNew
Rs("PaymentID") = PayID
Rs("UserID") = Cl.UserID
Rs("UserName") = Cl.MemberName
Rs("OrderID") = OrderID
Rs("PaymentNum")= P_PayNum
Rs("eBankID") = Cl.Product_Setting(3)
Rs("PayMoney") = Money
Rs("TrueMoney") = P_PayAmount
Rs("PayTime") = now()
Rs("Status") = 0
Rs("eBankInfo") = ""
Rs("Remark") = P_Remark1
Rs.Update
Rs.close : set Rs=nothing
P_MoneyType = "0"
%>
<table cellspacing="1" cellpadding="2" width="760" align="center" border="0" class="border">
<tr>
<td align="center" class="title"><b>在 线 支 付 操 作</b>(第二步)</td>
</tr>
<tr>
<td class="tdbg">
<table width="400" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td colspan="2" align="center" bgcolor="#E6E6E6"><b>确 认 款 项</b></td>
</tr>
<tr>
<td width="100" align="right" bgcolor="#FFFFFF">支付序号:</td>
<td width="289" bgcolor="#FFFFFF"><%=P_PayNum%></td>
</tr>
<tr>
<td width="100" align="right" bgcolor="#FFFFFF">支付金额:</td>
<td bgcolor="#FFFFFF">¥<font color="blue"><%=Cl.FormatNum(Money,2)%></font> 元</td>
</tr>
<tr>
<td width="100" align="right" bgcolor="#FFFFFF">手 续 费:</td>
<td bgcolor="#FFFFFF">¥<font color="green"><%=Cl.FormatNum(HCharge,2)%></font> 元(<%=Rate%>)</td>
</tr>
<tr>
<td width="100" align="right" bgcolor="#FFFFFF">已 支 付:</td>
<td bgcolor="#FFFFFF">¥<%=Cl.FormatNum(MoneyReceipt,2)%> 元</td>
</tr>
<tr>
<td width="100" align="right" bgcolor="#FFFFFF">实际划款:</td>
<td bgcolor="#FFFFFF">¥<font color="red"><b><%=P_PayAmount%></b></font> 元</td>
</tr>
<tr bgcolor="#E6E6E6">
<td colspan="2"> 点击“确认支付”按钮后,将进入在线支付界面,在此页面选择您的银行卡。</td>
</tr>
<%
Select Case Cl.GetClng(Cl.Product_Setting(3))
Case 1
Rem 财付通
TenpayForm
Case 2
Rem 支付宝
AlipayForm
Case 3
Rem 网银在线
ChinaBankForm
Case 4
Rem 云网
CnCardForm
Case Else
Response.write "在线支付已经禁用!"
End Select
%>
</table></td>
</tr>
</table>
<%
End Sub
Public Function GetAlipayMD5(s1,s2,s3,s4,s5,s6,s7,s8)
Dim strTemp
strTemp = "body=" & s2
strTemp = strTemp & "¬ify_url=" & s7
strTemp = strTemp & "&out_trade_no=" & s3
strTemp = strTemp & "&partner=" & Cl.Product_Setting(4)
strTemp = strTemp & "&payment_type=1"
strTemp = strTemp & "&price=" & s4
strTemp = strTemp & "&quantity=" & s5
strTemp = strTemp & "&return_url=" & s8
strTemp = strTemp & "&seller_email=" & s6
strTemp = strTemp & "&service=create_direct_pay_by_user"'create_digital_goods_trade_p"
strTemp = strTemp & "&subject=" & s1 & Cl.Product_Setting(5)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -