⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classpayonline.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 2 页
字号:
			PayAmount = EL_Common.ELRequest("v_amount", 1)
			RequestMD5 = EL_Common.ELRequest("v_md5str", 1)
			Moneytype1 = EL_Common.ELRequest("v_moneytype", 1)
			Remark1 = EL_Common.ELRequest("Remark1", 1)
			Remark2 = EL_Common.ELRequest("Remark2", 1)
			PayMode = EL_Common.ELRequest("v_pmode", 1)
			
			MD5String = UCase(MD5(BookNumber & PayStatus & PayAmount & Moneytype1 & PayOnlineMD5Key, 32))
			
			If RequestMD5 <> MD5String Then
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayResultMD5Error", "MD5校验错误"))
			   Call ApplicationTerminate()
			End If		
			
			If PayStatus = "20" Then
			   RemarkString = "支付银行:"& PayMode & VBCRLF
			   RemarkString = RemarkString &"支付结果:"& PayResultString & VBCRLF
			   RemarkString = RemarkString &"币种:"& Moneytype1 & VBCRLF
			   RemarkString = RemarkString &"其他:"& Remark1 & VBCRLF & Remark2
			   Call InsertPayment(ChannelID, BookTableName, BookNumber, PayOnlineProvider, PayAmount, RemarkString)
			   Response.Write "请稍候……"
			   Response.Write "<meta http-equiv=""refresh"" content=""3;url=User_PaySuccess.asp"">"
			Else
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayOnlineFail", "支付失败,未完成支付操作"))
			End If
			
		 Case 3:'中国在线支付网 成功:00
		    Dim PayDate
			
		    BookNumber = EL_Common.ELRequest("v_oid", 1)
			PayDate = EL_Common.ELRequest("v_date", 1)
			PayAmount = EL_Common.ELRequest("v_amount", 1)
			PayStatus = EL_Common.ELRequest("v_status", 1)
			RequestMD5 = EL_Common.ELRequest("v_md5", 1) 
			
			MD5String = MD5(PayDate & PayOnlineUserName & BookNumber & PayAmount & PayStatus & PayOnlineMD5Key, 32) 
			
			If RequestMD5 <> MD5String Then
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayResultMD5Error", "MD5校验错误"))
			   Call ApplicationTerminate()
			End If
			
			If PayStatus = "00" Then
			   RemarkString = "接收订单日期:"& PayDate
			   Call InsertPayment(ChannelID, BookTableName, BookNumber, PayOnlineProvider, PayAmount, RemarkString)
			   Response.Write "请稍候……"
			   Response.Write "<meta http-equiv=""refresh"" content=""3;url=User_PaySuccess.asp"">"
			Else
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayOnlineFail", "支付失败,未完成支付操作"))
			End If
			
		 Case 4:'易付通 成功:true
		    Dim sid, actionCode, actionParameter, tid, card
			
		    BookNumber = EL_Common.ELRequest("bid", 1)
			PayAmount = EL_Common.ELRequest("prc", 1)
			PayStatus = EL_Common.ELRequest("success", 1)
			RequestMD5 = EL_Common.ELRequest("md", 1) 
			sid = EL_Common.ELRequest("sid", 1) 
			actionCode = EL_Common.ELRequest("actionCode", 1) 
			actionParameter = EL_Common.ELRequest("actionParameter", 1) 
			tid = EL_Common.ELRequest("tid", 1) 
			card = EL_Common.ELRequest("card", 1) 
			
			MD5String = MD5(PayOnlineMD5Key &":"& BookNumber &","& sid &","& PayAmount &","& actionCode &","& actionParameter &","& tid &","& card &","& PayStatus, 32) 
			
			If RequestMD5 <> MD5String Then
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayResultMD5Error", "MD5校验错误"))
			   Call ApplicationTerminate()
			End If
			
			If PayStatus = "true" Then
			   RemarkString = "交易流水号:"& sid & VBCRLF
			   RemarkString = RemarkString &"支付银行代码:"& EL_Common.ELRequest("bankcode", 1) & VBCRLF
			   RemarkString = RemarkString &"其他:"& EL_Common.ELRequest("remark1", 1)
			   Call InsertPayment(ChannelID, BookTableName, BookNumber, PayOnlineProvider, PayAmount, RemarkString)
			   Response.Write "请稍候……"
			   Response.Write "<meta http-equiv=""refresh"" content=""3;url=User_PaySuccess.asp"">"
			Else
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayOnlineFail", "支付失败,未完成支付操作"))
			End If
			
		 Case 5:'支付宝支付	
		    Dim VarItems, MyString, Length, minmax, minmaxSlot, mark, temp
			Dim alipayNotifyURL, Retrieval, ResponseTxt
			
			alipayNotifyURL = "https://www.alipay.com/cooperate/gateway.do?"
			alipayNotifyURL	= alipayNotifyURL & "service=notify_verify&partner=" & partner & "&notify_id=" & Request.QueryString("notify_id")
			Set Retrieval = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
			Retrieval.setOption 2, 13056 
			Retrieval.open "GET", alipayNotifyURL, False, "", "" 
			Retrieval.send()
			ResponseTxt = Retrieval.ResponseText
			Set Retrieval = Nothing
			
			For Each VarItems In Request.QueryString 
			   MyString = VarItems &"="& Request.QueryString(VarItems) &"^"& MyString
			Next 
			
			If MyString <> "" Then 
			   MyString = Left(MyString, Len(MyString) - 1)
			End If	
			
			MyString = Split(MyString, "^")
			Length = Ubound(MyString)
			For i = Length TO 0 Step -1
			   minmax = MyString( 0 )
			   minmaxSlot = 0
			   For j = 1 To i
			      mark = (MyString(j) > minmax)
			      If mark Then 
                     minmax = MyString(j)
                     minmaxSlot = j
			      End If
			   Next
			
			   If minmaxSlot <> i Then 
			      temp = MyString(minmaxSlot)
			      MyString(minmaxSlot) = MyString(i)
			      MyString(i) = temp
			   End If
			Next	
			
			Dim arr
			MD5String = ""
			For j = 0 To Length Step 1
			   arr = Split(MyString( j ), "=")
			   If  arr(0)<>"sign" And arr(0)<>"sign_type"  then
			      If j = Length Then
			         MD5String = MD5String & MyString(j)
			      Else 
			         MD5String = MD5String & MyString(j) &"&"
			      End If 
			   End If 
			Next
			MD5String = MD5String & PayOnlineMD5Key
			MD5String = MD5(MD5String, 32)
			
			If MD5String = Request.QueryString("sign") And ResponseTxt = "true"  Then
			   RemarkString = "支付完成!"
			   Call InsertPayment(ChannelID, BookTableName, EL_Common.ELRequest("order_no", 2), PayOnlineProvider, EL_Common.ELRequest("price", 2), RemarkString)
			   Response.Write "请稍候……"
			   Response.Write "<meta http-equiv=""refresh"" content=""3;url=User_PaySuccess.asp"">"
			Else
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayOnlineFail", "支付失败,未完成支付操作"))
			End If
			
			 
		 'Case 6:'快钱支付
		 'Case 7:'快钱神州行
		 'Case 8:'西部支付
		 Case 9:'上海环迅IPS 成功:Y
			Dim date1, Currency_type, ipsbillno
			
		    BookNumber = EL_Common.ELRequest("Billno", 1)			
			PayAmount = EL_Common.ELRequest("amount", 1)
			PayStatus = EL_Common.ELRequest("succ", 1)
			RequestMD5 = EL_Common.ELRequest("signature", 1) 
			PayResultString = EL_Common.ELRequest("msg", 1)
			date1 = EL_Common.ELRequest("date", 1)
			Currency_type = EL_Common.ELRequest("Currency_type", 1)
			ipsbillno = EL_Common.ELRequest("ipsbillno", 1)
			
			MD5String = MD5(BookNumber & PayAmount & date1 & PayStatus & ipsbillno & Currency_type & PayOnlineMD5Key, 32)
			
			If RequestMD5 <> MD5String Then
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayResultMD5Error", "MD5校验错误"))
			   Call ApplicationTerminate()
			End If
			
			If PayStatus = "Y" Then
			   RemarkString = "币种:"& Currency_type & VBCRLF
			   RemarkString = RemarkString &"订单日期:"& date1 & VBCRLF
			   RemarkString = RemarkString &"银行返回时间:"& EL_Common.ELRequest("IpsBankTime", 1)
			   Call InsertPayment(ChannelID, BookTableName, BookNumber, PayOnlineProvider, PayAmount, RemarkString)
			   Response.Write "请稍候……"
			   Response.Write "<meta http-equiv=""refresh"" content=""3;url=User_PaySuccess.asp"">"
			Else
			   EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayOnlineFail", "支付失败,未完成支付操作"))
			End If
			
		 Case Else:
		    EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.PayOnlineProviderError", "系统未设置在线支付接口,暂时不接受在线支付,如有问题请与管理员联系"))
		    Call ApplicationTerminate()
	  End Select	  
   End Sub
   
   Private Sub InsertPayment(ByVal ChannelID, ByVal BookTableName, ByVal BookNumber, ByVal PayOnlineProvider, ByVal PayMoney, ByVal Remark)
      Dim PaymentCmd
      Call EL_Common.InitCommand(PaymentCmd, "EL_SP_PayOnline")
	  With PaymentCmd
	     .Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
		 .Parameters.Append .CreateParameter("@BookTableName", 200, 1, 50, BookTableName)
		 .Parameters.Append .CreateParameter("@UserID", 3, 1, 4, EL_User.UserID)
		 .Parameters.Append .CreateParameter("@BookNumber", 200, 1, 30, BookNumber)
		 .Parameters.Append .CreateParameter("@PayOnlineProvider", 3, 1, 4, PayOnlineProvider)		 
		 .Parameters.Append .CreateParameter("@PayMoney", 6, 1, 8, PayMoney)
		 .Parameters.Append .CreateParameter("@Remark", 200, 1, 500, Remark)
		 .Parameters.Append .CreateParameter("@IPAddress", 200, 1, 15, RemoteIp)
		 .Execute()
	  End With
	  Select Case PaymentCmd(0)
	     Case 40: 
		     EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.InsertPaymentError", "添加付款记录失败,订单号有错误") &" <p><b>"& BookNumber &"</b></p>")
			 Call ApplicationTerminate()
		 Case 41: 
		     EL_Common.ShowErrorMsg(EL_Common.Lang("User.Error16", "会员ID错误"))
			 Call ApplicationTerminate()
	  End Select
	  Set PaymentCmd = Nothing
   End Sub
End Class

%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -