public static WCRedEnvelopesReceiverInfo GetReceiverInfoFromDictionary(Dictionary <string, object> dict, string receiveId) { if (dict == null) { return(null); } WCRedEnvelopesReceiverInfo info = new WCRedEnvelopesReceiverInfo { m_nsReceiverName = PayUtils.getSafeValue(dict, "receiveName"), m_nsReceiverHeadImg = PayUtils.getSafeValue(dict, "receiveHeadImg"), m_lReceiveAmount = PayUtils.getSafeLong(dict, "receiveAmount"), m_uiReceiveTime = PayUtils.getSafeLong(dict, "receiveTime"), m_nsWishing = PayUtils.getSafeValue(dict, "answer"), m_nsReceiverGameTips = PayUtils.getSafeValue(dict, "gameTips"), m_nsReceiveId = PayUtils.getSafeValue(dict, "receiveId"), m_nsReceiverUserName = PayUtils.getSafeValue(dict, "userName") }; if (!string.IsNullOrEmpty(receiveId)) { info.m_bIsMySelf = receiveId.Equals(info.m_nsReceiveId); return(info); } info.m_bIsMySelf = false; return(info); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { string merOrderNum = this.Request.Form["merOrderNum"].ToString().Trim(); string tranDate = this.Request.Form["tranDate"].ToString().Trim(); string txnString = merchantId + "|" + merOrderNum + "|" + tranDate; string signValue = PayUtils.md5(txnString + datakey); Deerchao.Utility.HttpClient myClient = new Deerchao.Utility.HttpClient(); myClient.Url = this.queryUrl; myClient.PostingData.Add("merchantId", merchantId); myClient.PostingData.Add("merOrderNum", merOrderNum); myClient.PostingData.Add("tranDate", tranDate); myClient.PostingData.Add("signValue", signValue); string pageContents = myClient.GetString(); if (pageContents != "none") { StringBuilder sb = new StringBuilder(""); var decoded = PayUtils.UrlToData(pageContents).Item2; foreach (KeyValuePair <string, string> obj in decoded) { sb.Append(obj.Key + ":" + obj.Value + "<br>"); } this.Response.Write(sb.ToString()); } else { this.Response.Write("订单信息不存在"); } } }
public static WCRedEnvelopesOperationInfo GetOperationsInfoFromDictionary(Dictionary <string, object> dict) { if (dict != null) { return(new WCRedEnvelopesOperationInfo { m_bOpEnable = PayUtils.getSafeInt(dict, "enable") > 0, m_nsOpName = PayUtils.getSafeValue(dict, "name"), m_nsOpType = PayUtils.getSafeValue(dict, "type"), m_nsOpContent = PayUtils.getSafeValue(dict, "content"), m_nsOssKey = PayUtils.getSafeLong(dict, "ossKey") }); } return(null); }
//public static string GetAppMsgContent(ChatMsg msg, AppMsgInfo msgInfo) //{ // if ((msg == null) || (msgInfo.payinfoitem == null)) // { // return string.Format("[{0}]", strings.WCRedEnvelopes_WelcomePage_Title); // } // string str = string.Format("[{0}]", strings.WCRedEnvelopes_WelcomePage_Title); // if (msg.IsSender()) // { // return (str + msgInfo.payinfoitem.m_senderTitle); // } // return (str + msgInfo.payinfoitem.m_receiverTitle); //} public static WCRedEnvelopesAtomicInfo GetAtomicInfoFromDictionary(Dictionary <string, object> dict) { if (dict != null) { return(new WCRedEnvelopesAtomicInfo { m_bEnable = PayUtils.getSafeInt(dict, "enable") > 0, m_nsAtomicUrl = PayUtils.getSafeValue(dict, "fissionUrl"), m_nsAtomicTitle = PayUtils.getSafeValue(dict, "fissionContent"), m_nsSessionKey = PayUtils.getSafeLong(dict, "sessionKey") }); } return(null); }
public static void onResponse(Dictionary <string, object> tenPayResponsRetString, HongBaoReq tenPayRequest) { _instance = null; WCRedEnvelopesDetailInfo info = new WCRedEnvelopesDetailInfo { m_enWCRedEnvelopesType = (ENWCRedEnvelopesType)PayUtils.getSafeInt(tenPayResponsRetString, "hbType"), m_enWCRedEnvelopesStatus = (ENWCRedEnvelopesStatus)PayUtils.getSafeInt(tenPayResponsRetString, "hbStatus"), m_enWCRedEnvelopesUserReceiveStatus = (ENWCRedEnvelopesUserReceiveStatus)PayUtils.getSafeInt(tenPayResponsRetString, "receiveStatus"), m_nsStatusMessage = PayUtils.getSafeValue(tenPayResponsRetString, "statusMess"), m_nsGameMessage = PayUtils.getSafeValue(tenPayResponsRetString, "gameMess"), m_bIsSender = PayUtils.getSafeInt(tenPayResponsRetString, "isSender") > 0, m_nsWishing = PayUtils.getSafeValue(tenPayResponsRetString, "wishing"), m_nsSendNickName = PayUtils.getSafeValue(tenPayResponsRetString, "sendNick"), m_nsSendHeadImg = PayUtils.getSafeValue(tenPayResponsRetString, "sendHeadImg"), m_nsSendId = PayUtils.getSafeValue(tenPayResponsRetString, "sendId"), m_nsAdMessage = PayUtils.getSafeValue(tenPayResponsRetString, "adMessage"), m_nsAdUrl = PayUtils.getSafeValue(tenPayResponsRetString, "adUrl"), m_lAmount = PayUtils.getSafeLong(tenPayResponsRetString, "amount"), m_lRecNum = PayUtils.getSafeLong(tenPayResponsRetString, "recNum"), m_lRecAmount = PayUtils.getSafeLong(tenPayResponsRetString, "recAmount"), m_lTotalNum = PayUtils.getSafeLong(tenPayResponsRetString, "totalNum"), m_lTotalAmount = PayUtils.getSafeLong(tenPayResponsRetString, "totalAmount"), m_nsReceiveId = PayUtils.getSafeValue(tenPayResponsRetString, "receiveId"), m_bHasWriteThanks = PayUtils.getSafeInt(tenPayResponsRetString, "hasWriteAnswer") > 0, m_bAllowJumpToBalance = PayUtils.getSafeInt(tenPayResponsRetString, "jumpChange") > 0, m_nsJumpBalanceDesc = PayUtils.getSafeValue(tenPayResponsRetString, "changeWording"), m_nsHeadTitle = PayUtils.getSafeValue(tenPayResponsRetString, "headTitle"), m_bHasMoreReceiver = PayUtils.getSafeInt(tenPayResponsRetString, "isContinue") > 0, m_bCanShareHB = PayUtils.getSafeInt(tenPayResponsRetString, "canShare") > 0, m_nsWaterMarkUrl = PayUtils.getSafeValue(tenPayResponsRetString, "watermark"), m_nsExternMessage = PayUtils.getSafeValue(tenPayResponsRetString, "externMess") }; List <WCRedEnvelopesReceiverInfo> observables = new List <WCRedEnvelopesReceiverInfo>(); foreach (Dictionary <string, object> dictionary in PayUtils.getSafeArray(tenPayResponsRetString, "record")) { WCRedEnvelopesReceiverInfo receiverInfoFromDictionary = RedEnvelopesUtils.GetReceiverInfoFromDictionary(dictionary, info.m_nsReceiveId); if (receiverInfoFromDictionary != null) { observables.Add(receiverInfoFromDictionary); } } info.m_arrReceiveList = observables; if (Callback != null) { Callback(info); } //PayEventService.post("RedEnvelopesOpen", 0, "", info, null, 0, 0); }
private static void TenPayGetTenpaySecureCtrlSalt_onResponse(Dictionary <string, object> tenPayResponsRetString, TenPayRequest tenPayRequest) { if (Util.stringToInt(PayUtils.getSafeValue(tenPayResponsRetString, "retcode")) == 0) { string str = PayUtils.getSafeValue(tenPayResponsRetString, "time_stamp"); //1470371694 if (!string.IsNullOrEmpty(str)) { Log.w("TenPayCtrlSalt", "update salt success, timp_stamp = " + str); //m_nsTenpaySaltStamp = str; // mLastUpdateTime = Util.getNowSeconds(); //PayContext.instance.mPayMoneyOnCallback.onUpdatedTenPaySalt(); } } }
protected override void onSuccess(HongBaoReq request, HongBaoRes response) { string jo = Util.nullAsNil(response.RetText.Buffer.ToStringUtf8()); Log.w("LuckMoney", string.Concat(new object[] { "hongbao response success", "\n", jo })); if (response.BaseResponse.Ret != 0) { Log.e("NetSceneRedEnvelopes", string.Concat(new object[] { "tenpay response error, funid = ", this.mTenpayFunName, ", response.ret = ", response.BaseResponse.Ret })); Log.e("NetSceneRedEnvelopes", string.Concat(new object[] { "wechat retText = ", jo, ",platRet = ", response.PlatRet, ", platMsg = ", response.PlatMsg })); //string platMsg = jo; //if (string.IsNullOrEmpty(platMsg)) //{ // platMsg = response.PlatMsg; //} //if (this.FailedCallback != null) //{ // this.FailedCallback(-20001, "", this.Tag); //} //else //{ // PayContext.instance.mPayMoneyOnCallback.onFailedinRedEnvelopes(this.mTenpayFunName, response.BaseResponse.Ret, platMsg, this.Tag); //} } else { int length = jo.Length; if (length > 0x40) { length = 0x40; } Log.i("NetSceneRedEnvelopes", "TenPay response success, funid = " + this.mTenpayFunName + ", retText = " + jo.Substring(0, length) + " ..."); Dictionary <string, object> responseDic = PayUtils.deserializeToDictionaryEx(jo); int errorType = response.ErrorType; string errorMsg = response.ErrorMsg; if ((responseDic == null) || (responseDic.Count <= 0)) { Log.e("NetSceneRedEnvelopes", "no member in responseDic !!!!!!!!please line to tenpay!!!!!"); responseDic = new Dictionary <string, object>(); } responseDic.Add("wx_error_type", errorType); responseDic.Add("wx_error_msg", errorMsg); this.onTenPayResponse(response.CgiCmdid, responseDic, request); } }
//if(!empty(public tring orderInfo)){ // public string orderInfo = strToHex(public tring orderInfo); //} //public tring txnString = public tring version."|".public tring transCode."|".public tring merchantId."|".public tring merOrderNum."|".public tring bussId."|".public tring tranAmt."|".public tring sysTraceNum // ."|".public tring tranDateTime."|".public tring currencyType."|".public tring merUrl."|".public tring backUrl."|".public tring orderInfo."|".public tring userId; //public tring signValue = md5(public tring txnString.public tring datakey); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { tranAmt = this.Request.Form["tranAmt"].ToString().Trim(); merOrderNum = this.Request.Form["merOrderNum"].ToString().Trim(); orderInfo = this.Request.Form["orderInfo"].ToString().Trim(); tranDateTime = DateTime.Now.ToString("yyyyMMddHHmmss"); //date('YmdHis'); sysTraceNum = DateTime.Now.ToFileTime().ToString(); //tranDateTime.floor(microtime()*1000); //请求流水号,需要保持唯一 userId = ""; //易通支付会员ID代码,可为空 if (orderInfo != "") { orderInfo = PayUtils.StringToHexString(orderInfo); } string txnString = version + "|" + transCode + "|" + merchantId + "|" + merOrderNum + "|" + bussId + "|" + tranAmt + "|" + sysTraceNum + "|" + tranDateTime + "|" + currencyType + "|" + merUrl + "|" + backUrl + "|" + orderInfo + "|" + userId; signValue = PayUtils.md5(txnString + datakey); } }
private static void TenPayVerifyPayPassword_onResponse(Dictionary <string, object> tenPayResponsRetString, TenPayRequest tenPayRequest) { //_instance = null; int num = Util.stringToInt(PayUtils.getSafeValue(tenPayResponsRetString, "retcode")); uint num2 = (uint)Util.stringToInt(PayUtils.getSafeValue(tenPayResponsRetString, "wx_error_type")); string retmsg = PayUtils.getSafeValue(tenPayResponsRetString, "wx_error_msg"); Log.i("TenPayVerifyPayPassword", string.Concat(new object[] { "reponse: retCode = ", num, ",wx_error_type = ", num2, ",wxErrorMsg= ", retmsg })); if (num != 0) { switch (num2) { case 0x191: { int num3 = Util.stringToInt(PayUtils.getSafeValue(tenPayResponsRetString, "err_cnt")); int num4 = Util.stringToInt(PayUtils.getSafeValue(tenPayResponsRetString, "lock_cnt")); //PayEventService.post("verifypaypwd", -10006, retmsg, null, null, num3, num4); return; } case 0x197: //TenPayGetTenpaySecureCtrlSalt.doScene(); //PayEventService.post("verifypaypwd", -10008, retmsg, null, null, 0, 0); return; } if (string.IsNullOrEmpty(retmsg)) { retmsg = PayUtils.getSafeValue(tenPayResponsRetString, "retmsg"); } //PayEventService.post("verifypaypwd", -40001, retmsg, null, null, 0, 0); } else { //PayEventService.post("verifypaypwd", 0, "", null, null, 0, 0); } }
protected override void onSuccess(TenPayRequest request, TenPayResponse response) { string jo = Util.nullAsNil(response.RetText.Buffer.ToStringUtf8()); if (response.BaseResponse.Ret != 0) { Log.e("NetSceneTenPay", string.Concat(new object[] { "tenpay response error, funid = ", this.mTenpayFunName, ", response.ret = ", response.BaseResponse.Ret })); Log.e("NetSceneTenPay", string.Concat(new object[] { "wechat retText = ", jo, ",platRet = ", response.PlatRet, ", platMsg = ", response.PlatMsg })); string platMsg = jo; if (string.IsNullOrEmpty(platMsg)) { platMsg = response.PlatMsg; } // PayEventService.post(this.mTenpayFunName, -30001, platMsg, null, null, 0, 0); } else { int length = jo.Length; if (length > 0x40) { length = 0x40; } Log.i("NetSceneTenPay", "TenPay response success, funid = " + this.mTenpayFunName + ", retText = " + jo.Substring(0, length) + " ..."); Dictionary <string, object> responseDic = PayUtils.deserializeToDictionaryEx(jo); int tenpayErrType = response.TenpayErrType; string tenpayErrMsg = response.TenpayErrMsg; if ((responseDic == null) || (responseDic.Count <= 0)) { Log.e("NetSceneTenPay", "no member in responseDic !!!!!!!!please line to tenpay!!!!!"); responseDic = new Dictionary <string, object>(); } responseDic.Add("wx_error_type", tenpayErrType); responseDic.Add("wx_error_msg", tenpayErrMsg); this.onTenPayResponse(response.CgiCmdid, responseDic, request); } }
private void onTenPayResponse(int cmdid, Dictionary <string, object> responseDic, HongBaoReq tenPayRequest) { Log.i("NetSceneRedEnvelopes", "onTenPayResponse, cmdid = " + cmdid); int num = PayUtils.getSafeInt(responseDic, "retcode"); uint num2 = PayUtils.getSafeUInt(responseDic, "wx_error_type"); string str = PayUtils.getSafeValue(responseDic, "wx_error_msg"); Log.i("NetSceneRedEnvelopes", string.Concat(new object[] { "onResponse: retCode = ", num, ",wx_error_type = ", num2, ",wxErrorMsg= ", str })); if (num != 0) { if (string.IsNullOrEmpty(str)) { str = PayUtils.getSafeValue(responseDic, "retmsg"); } if (this.FailedCallback != null) { this.FailedCallback((int)num2, str, this.Tag); } else { //PayContext.instance.mPayMoneyOnCallback.onFailedinRedEnvelopes(this.mTenpayFunName, (int) num2, str, this.Tag); } } else if (this.mCmdUri == "/cgi-bin/mmpay-bin/hongbao") { switch (cmdid) { case 0: //RedEnvelopesQueryUserInfo.onResponse(responseDic, tenPayRequest); return; case 1: // RedEnvelopesPayRequest.onResponse(responseDic, tenPayRequest); return; case 2: // RedEnvelopesSendAppMsg.onResponse(responseDic, tenPayRequest); return; case 3: //RedEnvelopesQueryRequest.onResponse(responseDic, tenPayRequest); return; case 4: Log.w("LuckMoney", string.Concat(new object[] { "hongbao response success" })); RedEnvelopesOpen.onResponse(responseDic, tenPayRequest); return; case 5: // RedEnvelopesQueryDetail.onResponse(responseDic, tenPayRequest); return; case 6: // RedEnvelopesQueryList.onResponse(this, responseDic, tenPayRequest); return; case 7: return; case 8: //RedEnvelopesThanks.onResponse(responseDic, tenPayRequest); return; } } else if (this.mCmdUri == "businesshongbao") { switch (cmdid) { case 0: //RedEnvelopesBizQueryRequest.onResponse(responseDic, tenPayRequest); return; case 1: //RedEnvelopesBizOpen.onResponse(responseDic, tenPayRequest); return; case 2: // RedEnvelopesBizCheckAuthRequest.onResponse(responseDic, tenPayRequest); break; default: return; } } }
protected void Page_Load(object sender, EventArgs e) { string transCode = this.Request["transCode"]; string merchantId = this.Request["merchantId"]; string respCode = this.Request["respCode"]; string sysTraceNum = this.Request["sysTraceNum"]; string merOrderNum = this.Request["merOrderNum"]; string orderId = this.Request["orderId"]; string bussId = this.Request["bussId"]; string tranAmt = this.Request["tranAmt"]; string orderAmt = this.Request["orderAmt"]; string bankFeeAmt = this.Request["bankFeeAmt"]; string integralAmt = this.Request["integralAmt"]; string vaAmt = this.Request["vaAmt"]; string bankAmt = this.Request["bankAmt"]; string bankId = this.Request["bankId"]; string integralSeq = this.Request["integralSeq"]; string vaSeq = this.Request["vaSeq"]; string bankSeq = this.Request["bankSeq"]; string tranDateTime = this.Request["tranDateTime"]; string payMentTime = this.Request["payMentTime"]; string settleDate = this.Request["settleDate"]; string currencyType = this.Request["currencyType"]; string orderInfo = this.Request["orderInfo"]; string userId = this.Request["userId"]; string userIp = this.Request["userIp"]; string reserver1 = this.Request["reserver1"]; string reserver2 = this.Request["reserver2"]; string reserver3 = this.Request["reserver3"]; string reserver4 = this.Request["reserver4"]; string signValue = this.Request["signValue"]; StringBuilder sb = new StringBuilder(""); sb.Append("transCode:" + transCode + "<br/>"); sb.Append("merchantId:" + merchantId + "<br/>"); sb.Append("respCode:" + respCode + "<br/>"); sb.Append("sysTraceNum:" + sysTraceNum + "<br/>"); sb.Append("merOrderNum:" + merOrderNum + "<br/>"); sb.Append("orderId:" + orderId + "<br/>"); sb.Append("bussId:" + bussId + "<br/>"); sb.Append("tranAmt:" + tranAmt + "<br/>"); sb.Append("orderAmt:" + orderAmt + "<br/>"); sb.Append("integralAmt:" + integralAmt + "<br/>"); sb.Append("vaAmt:" + vaAmt + "<br/>"); sb.Append("bankAmt:" + bankAmt + "<br/>"); sb.Append("bankId:" + bankId + "<br/>"); sb.Append("sysTraceNum:" + sysTraceNum + "<br/>"); sb.Append("integralSeq:" + integralSeq + "<br/>"); sb.Append("vaSeq:" + vaSeq + "<br/>"); sb.Append("bankSeq:" + bankSeq + "<br/>"); sb.Append("tranDateTime:" + tranDateTime + "<br/>"); sb.Append("payMentTime:" + payMentTime + "<br/>"); sb.Append("settleDate:" + settleDate + "<br/>"); sb.Append("currencyType:" + currencyType + "<br/>"); sb.Append("orderInfo:" + orderInfo + "<br/>"); sb.Append("userId:" + userId + "<br/>"); sb.Append("userIp:" + userIp + "<br/>"); sb.Append("reserver1:" + reserver1 + "<br/>"); sb.Append("reserver2:" + reserver2 + "<br/>"); sb.Append("reserver3:" + reserver3 + "<br/>"); sb.Append("reserver4:" + reserver4 + "<br/>"); sb.Append("signValue:" + signValue + "<br/>"); string txnString = transCode + "|" + merchantId + "|" + respCode + "|" + sysTraceNum + "|" + merOrderNum + "|" + orderId + "|" + bussId + "|" + tranAmt + "|" + orderAmt + "|" + bankFeeAmt + "|" + integralAmt + "|" + vaAmt + "|" + bankAmt + "|" + bankId + "|" + integralSeq + "|" + vaSeq + "|" + bankSeq + "|" + tranDateTime + "|" + payMentTime + "|" + settleDate + "|" + currencyType + "|" + orderInfo + "|" + userId; String md5 = PayUtils.md5(txnString + datakey); string verifySign = (md5 == signValue) ? "成功" : "签名不对"; //判断签名验证是否通过 if (verifySign == "成功" && respCode == "0000") { { if (!BLL.HKModel.tempList.Contains(merOrderNum)) { BLL.HKModel.tempList.Add(merOrderNum); try { if (zx326.BLL.Member.ManageMember.SHPayHB(merOrderNum)) { Response.Write("交易成功!"); Response.End(); } else { Response.Write("交易失败!"); Response.End(); } } finally { if (BLL.HKModel.tempList.Contains(merOrderNum)) { BLL.HKModel.tempList.Remove(merOrderNum); } } } Response.Write("支付结果:" + respCode + ";签名结果:" + verifySign); Response.End(); } } else { Response.Write("签名不正确或支付失败!"); } //sb.Append("<br>"); //sb.Append("success"); //sb.Append("<br>"); //sb.Append("支付结果:" + respCode); //sb.Append("<br>"); //sb.Append("签名验证结果:" + verifySign); //sb.Append("<br>"); //this.Response.Write(sb.ToString()); }
protected void Page_Load(object sender, EventArgs e) { { string transCode = this.Request["transCode"]; string merchantId = this.Request["merchantId"]; string respCode = this.Request["respCode"]; string sysTraceNum = this.Request["sysTraceNum"]; string merOrderNum = this.Request["merOrderNum"]; string orderId = this.Request["orderId"]; string bussId = this.Request["bussId"]; string tranAmt = this.Request["tranAmt"]; string orderAmt = this.Request["orderAmt"]; string bankFeeAmt = this.Request["bankFeeAmt"]; string integralAmt = this.Request["integralAmt"]; string vaAmt = this.Request["vaAmt"]; string bankAmt = this.Request["bankAmt"]; string bankId = this.Request["bankId"]; string integralSeq = this.Request["integralSeq"]; string vaSeq = this.Request["vaSeq"]; string bankSeq = this.Request["bankSeq"]; string tranDateTime = this.Request["tranDateTime"]; string payMentTime = this.Request["payMentTime"]; string settleDate = this.Request["settleDate"]; string currencyType = this.Request["currencyType"]; string orderInfo = this.Request["orderInfo"]; string userId = this.Request["userId"]; string userIp = this.Request["userIp"]; string reserver1 = this.Request["reserver1"]; string reserver2 = this.Request["reserver2"]; string reserver3 = this.Request["reserver3"]; string reserver4 = this.Request["reserver4"]; string signValue = this.Request["signValue"]; StringBuilder sb = new StringBuilder(""); sb.Append("transCode:" + transCode + "<br/>"); sb.Append("merchantId:" + merchantId + "<br/>"); sb.Append("respCode:" + respCode + "<br/>"); sb.Append("sysTraceNum:" + sysTraceNum + "<br/>"); sb.Append("merOrderNum:" + merOrderNum + "<br/>"); sb.Append("orderId:" + orderId + "<br/>"); sb.Append("bussId:" + bussId + "<br/>"); sb.Append("tranAmt:" + tranAmt + "<br/>"); sb.Append("orderAmt:" + orderAmt + "<br/>"); sb.Append("integralAmt:" + integralAmt + "<br/>"); sb.Append("vaAmt:" + vaAmt + "<br/>"); sb.Append("bankAmt:" + bankAmt + "<br/>"); sb.Append("bankId:" + bankId + "<br/>"); sb.Append("sysTraceNum:" + sysTraceNum + "<br/>"); sb.Append("integralSeq:" + integralSeq + "<br/>"); sb.Append("vaSeq:" + vaSeq + "<br/>"); sb.Append("bankSeq:" + bankSeq + "<br/>"); sb.Append("tranDateTime:" + tranDateTime + "<br/>"); sb.Append("payMentTime:" + payMentTime + "<br/>"); sb.Append("settleDate:" + settleDate + "<br/>"); sb.Append("currencyType:" + currencyType + "<br/>"); sb.Append("orderInfo:" + orderInfo + "<br/>"); sb.Append("userId:" + userId + "<br/>"); sb.Append("userIp:" + userIp + "<br/>"); sb.Append("reserver1:" + reserver1 + "<br/>"); sb.Append("reserver2:" + reserver2 + "<br/>"); sb.Append("reserver3:" + reserver3 + "<br/>"); sb.Append("reserver4:" + reserver4 + "<br/>"); sb.Append("signValue:" + signValue + "<br/>"); string txnString = transCode + "|" + merchantId + "|" + respCode + "|" + sysTraceNum + "|" + merOrderNum + "|" + orderId + "|" + bussId + "|" + tranAmt + "|" + orderAmt + "|" + bankFeeAmt + "|" + integralAmt + "|" + vaAmt + "|" + bankAmt + "|" + bankId + "|" + integralSeq + "|" + vaSeq + "|" + bankSeq + "|" + tranDateTime + "|" + payMentTime + "|" + settleDate + "|" + currencyType + "|" + orderInfo + "|" + userId; String md5 = PayUtils.md5(txnString + datakey); string verifySign = (md5 == signValue) ? "成功" : "失败"; sb.Append("<br>"); sb.Append("success"); sb.Append("<br>"); sb.Append("支付结果:" + respCode); sb.Append("<br>"); sb.Append("签名验证结果:" + verifySign); sb.Append("<br>"); if (verifySign == "成功") { string postForm = ""; postForm = "<form name=\"payForm\" id=\"payForm\" method=\"post\" action=\"" + payUrl + "\">"; postForm += "<br>"; postForm += "success"; postForm += "<br>"; postForm += "支付结果:" + respCode; postForm += "<br>"; postForm += "签名验证结果:" + verifySign; postForm += "<br>"; postForm += "</form>"; //自动提交该表单到测试网关 postForm += "<script type=\"text/javascript\" language=\"javascript\">setTimeout(\"document.getElementById('payForm').submit();\",100);</script>"; Response.Write(postForm); } } }
protected void Page_Load(object sender, EventArgs e) { string transCode = this.Request["transCode"]; string merchantId = this.Request["merchantId"]; string respCode = this.Request["respCode"]; string sysTraceNum = this.Request["sysTraceNum"]; string merOrderNum = this.Request["merOrderNum"]; string orderId = this.Request["orderId"]; string bussId = this.Request["bussId"]; string tranAmt = this.Request["tranAmt"]; string orderAmt = this.Request["orderAmt"]; string bankFeeAmt = this.Request["bankFeeAmt"]; string integralAmt = this.Request["integralAmt"]; string vaAmt = this.Request["vaAmt"]; string bankAmt = this.Request["bankAmt"]; string bankId = this.Request["bankId"]; string integralSeq = this.Request["integralSeq"]; string vaSeq = this.Request["vaSeq"]; string bankSeq = this.Request["bankSeq"]; string tranDateTime = this.Request["tranDateTime"]; string payMentTime = this.Request["payMentTime"]; string settleDate = this.Request["settleDate"]; string currencyType = this.Request["currencyType"]; string orderInfo = this.Request["orderInfo"]; string userId = this.Request["userId"]; string userIp = this.Request["userIp"]; string reserver1 = this.Request["reserver1"]; string reserver2 = this.Request["reserver2"]; string reserver3 = this.Request["reserver3"]; string reserver4 = this.Request["reserver4"]; string signValue = this.Request["signValue"]; StringBuilder sb = new StringBuilder(""); sb.Append("transCode:" + transCode + "<br/>"); sb.Append("merchantId:" + merchantId + "<br/>"); sb.Append("respCode:" + respCode + "<br/>"); sb.Append("sysTraceNum:" + sysTraceNum + "<br/>"); sb.Append("merOrderNum:" + merOrderNum + "<br/>"); sb.Append("orderId:" + orderId + "<br/>"); sb.Append("bussId:" + bussId + "<br/>"); sb.Append("tranAmt:" + tranAmt + "<br/>"); sb.Append("orderAmt:" + orderAmt + "<br/>"); sb.Append("integralAmt:" + integralAmt + "<br/>"); sb.Append("vaAmt:" + vaAmt + "<br/>"); sb.Append("bankAmt:" + bankAmt + "<br/>"); sb.Append("bankId:" + bankId + "<br/>"); sb.Append("sysTraceNum:" + sysTraceNum + "<br/>"); sb.Append("integralSeq:" + integralSeq + "<br/>"); sb.Append("vaSeq:" + vaSeq + "<br/>"); sb.Append("bankSeq:" + bankSeq + "<br/>"); sb.Append("tranDateTime:" + tranDateTime + "<br/>"); sb.Append("payMentTime:" + payMentTime + "<br/>"); sb.Append("settleDate:" + settleDate + "<br/>"); sb.Append("currencyType:" + currencyType + "<br/>"); sb.Append("orderInfo:" + orderInfo + "<br/>"); sb.Append("userId:" + userId + "<br/>"); sb.Append("userIp:" + userIp + "<br/>"); sb.Append("reserver1:" + reserver1 + "<br/>"); sb.Append("reserver2:" + reserver2 + "<br/>"); sb.Append("reserver3:" + reserver3 + "<br/>"); sb.Append("reserver4:" + reserver4 + "<br/>"); sb.Append("signValue:" + signValue + "<br/>"); string txnString = transCode + "|" + merchantId + "|" + respCode + "|" + sysTraceNum + "|" + merOrderNum + "|" + orderId + "|" + bussId + "|" + tranAmt + "|" + orderAmt + "|" + bankFeeAmt + "|" + integralAmt + "|" + vaAmt + "|" + bankAmt + "|" + bankId + "|" + integralSeq + "|" + vaSeq + "|" + bankSeq + "|" + tranDateTime + "|" + payMentTime + "|" + settleDate + "|" + currencyType + "|" + orderInfo + "|" + userId; String md5 = PayUtils.md5(txnString + datakey); string verifySign = (md5 == signValue) ? "成功" : "失败"; sb.Append("<br>"); sb.Append("success"); sb.Append("<br>"); sb.Append("支付结果:" + respCode); sb.Append("<br>"); sb.Append("签名验证结果:" + verifySign); sb.Append("<br>"); this.Response.Write(sb.ToString()); }
protected void Page_Load(object sender, EventArgs e) { string bussId = ""; if (!IsPostBack) { HKModel hkModel = HKModel; BLL.HKModel.Insert(hkModel); tranAmt = (hkModel.RealMoney * 100).ToString().Trim(); //交易金额 merOrderNum = hkModel.HKCode.Trim(); //订单号 orderInfo = ""; tranDateTime = hkModel.HKCreateDate.ToString("yyyyMMddHHmmss"); //date('YmdHis'); sysTraceNum = hkModel.HKCreateDate.ToFileTime().ToString().Substring(0, 15); //tranDateTime.floor(microtime()*1000); //请求流水号,需要保持唯一 if (hkModel.FromBank == "yh") { bussId = "888219"; } else if (hkModel.FromBank == "sm") { bussId = "888220"; } else { bussId = "888317"; } userId = ""; //易通支付会员ID代码,可为空 if (orderInfo != "") { orderInfo = PayUtils.StringToHexString(orderInfo); } string txnString = version + "|" + transCode + "|" + merchantId + "|" + merOrderNum + "|" + bussId + "|" + tranAmt + "|" + sysTraceNum + "|" + tranDateTime + "|" + currencyType + "|" + merUrl + "|" + backUrl + "|" + orderInfo + "|" + userId; signValue = PayUtils.md5(txnString + datakey); postForm = "<form name=\"payForm\" id=\"payForm\" method=\"post\" action=\"" + payUrl + "\">"; postForm += "<input type=\"hidden\" name=\"version\" value=\"" + version + "\" />"; postForm += "<input type=\"hidden\" name=\"transCode\" value=\"" + transCode + "\" />"; postForm += "<input type=\"hidden\" name=\"merchantId\" value=\"" + merchantId + "\" />"; postForm += "<input type=\"hidden\" name=\"merOrderNum\" value=\"" + merOrderNum + "\" />"; postForm += "<input type=\"hidden\" name=\"bussId\" value=\"" + bussId + "\" />"; postForm += "<input type=\"hidden\" name=\"tranAmt\" value=\"" + tranAmt + "\" />"; postForm += "<input type=\"hidden\" name=\"sysTraceNum\" id=\"sysTraceNum\" value=\"" + sysTraceNum + "\" />"; postForm += "<input type=\"hidden\" name=\"tranDateTime\" id=\"tranDateTime\" value=\"" + tranDateTime + "\" />"; postForm += "<input type=\"hidden\" name=\"currencyType\" value=\"" + currencyType + "\" />"; postForm += "<input type=\"hidden\" name=\"merURL\" value=\"" + merUrl + "\" />"; postForm += "<input type=\"hidden\" name=\"orderInfo\" value=\"" + orderInfo + "\" />"; postForm += "<input type=\"hidden\" name=\"bankId\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"stlmId\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"userId\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"userIp\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"backURL\" value=\"" + backUrl + "\" />"; postForm += "<input type=\"hidden\" name=\"reserver1\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"reserver2\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"reserver3\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"reserver4\" value=\"" + "" + "\" />"; postForm += "<input type=\"hidden\" name=\"entryType\" value=\"" + "1" + "\" />"; postForm += "<input type=\"hidden\" name=\"signValue\" value=\"" + signValue + "\" />"; postForm += "</form>"; //自动提交该表单到测试网关 postForm += "<script type=\"text/javascript\" language=\"javascript\">setTimeout(\"document.getElementById('payForm').submit();\",100);</script>"; Response.Write(postForm); } }