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

📄 yeepaycommon.asp

📁 网点用户名:admin 密码:admin
💻 ASP
字号:
<%
	Dim mctSDK
	Dim nodeAuthorizationURL
	Dim messageType
	Dim addressFlag
	nodeAuthorizationURL = "https://www.yeepay.com/app-merchant-proxy/node"	'扣款请求URL 无需更改
	messageType="Buy"			'消息类型
	addressFlag="0"				'需要填写送货信息 0:不需要  1:需要

	
Function getReqHmacString(orderId,amount,cur,productId,productCat,productDesc,merchantCallbackURL,sMctProperties,frpId)
	Dim sbOld
	'进行加密串处理,一定按照下列顺序进行
	sbOld=""
	sbOld = sbOld + messageType
	sbOld = sbOld + merchantId
	sbOld = sbOld + orderId
	sbOld = sbOld + CStr(amount)		
	sbOld = sbOld + cur					
	sbOld = sbOld + productId
	sbOld = sbOld + productCat
	sbOld = sbOld + productDesc
	sbOld = sbOld + merchantCallbackURL
	sbOld = sbOld + addressFlag
	sbOld = sbOld + sMctProperties
	sbOld = sbOld + frpId
	
	getReqHmacString = HMAC(sbOld,keyValue) 
	
End Function

Function getCallbackHmacString(sCmd,sErrorCode,sTrxId,orderId,amount,productId,userId,MP,bType)
	Dim sbOld
	'取得加密前的字符串
	sbOld = ""
	sbOld = sbOld + CStr(merchantId)
	sbOld = sbOld + sCmd
	sbOld = sbOld + sErrorCode
	sbOld = sbOld + sTrxId
	sbOld = sbOld + amount
	sbOld = sbOld + cur
	sbOld = sbOld + productId
	sbOld = sbOld + orderId
	sbOld = sbOld + userId
	sbOld = sbOld + MP
	sbOld = sbOld + bType

	getCallbackHmacString = HMAC(sbOld,keyValue)
	
End Function

Function CheckHmac(sCmd,sErrorCode,sTrxId,orderId,amount,productId,userId,MP,bType,hmac)
	if(hmac=getCallbackHmacString(sCmd,sErrorCode,sTrxId,orderId,amount,productId,userId,MP,bType)) Then
		CheckHmac = True
	ELSE
		CheckHmac = Flase
	END IF
End Function

'取得返回串中的所有参数
Sub getCallBackValue(ByRef sCmd,ByRef sErrorCode,ByRef sTrxId,ByRef amount,ByRef cur,ByRef productId,ByRef orderId,ByRef userId,ByRef MP,ByRef bType,ByRef svrHmac)
	sCmd = Request.QueryString("r0_Cmd")
	sErrorCode = Request.QueryString("r1_Code")
	sTrxId = Request.QueryString("r2_TrxId")
	amount = Request.QueryString("r3_Amt")
	cur = Request.QueryString("r4_Cur")
	productId = Request.QueryString("r5_Pid")
	orderId = Request.QueryString("r6_Order")
	userId = Request.QueryString("r7_Uid")
	MP = Request.QueryString("r8_MP")
	bType = Request.QueryString("r9_BType") 	
	svrHmac = Request.QueryString("hmac")
End Sub

%>

⌨️ 快捷键说明

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