private bool parseSource(string source) { Hashtable hashtable = IPosMUtil.parseStringToMap(source); this.mHmac = (string)hashtable["hmac"]; this.mMerchantId = (string)hashtable["merchantId"]; this.mPayNo = (string)hashtable["payNo"]; this.mReturnCode = (string)hashtable["returnCode"]; this.mMessage = (string)hashtable["message"]; this.mSignType = (string)hashtable["signType"]; this.mType = (string)hashtable["type"]; this.mVersion = (string)hashtable["version"]; this.mAmount = (string)hashtable["amount"]; this.mAmtItem = (string)hashtable["amtItem"]; this.mBankAbbr = (string)hashtable["bankAbbr"]; this.mMobile = (string)hashtable["mobile"]; this.mOrderId = (string)hashtable["orderId"]; this.mPayDate = (string)hashtable["payDate"]; this.mAccountDate = (string)hashtable["accountDate"]; this.mReserved1 = (string)hashtable["reserved1"]; this.mReserved2 = (string)hashtable["reserved2"]; this.mStatus = (string)hashtable["status"]; this.mOrderDate = (string)hashtable["orderDate"]; this.mFee = (string)hashtable["fee"]; return(true); }
/// <summary> /// 后台通知验签 /// </summary> /// <param name="param">手机支付平台返回的报文</param> public HiOrderNotifyRes(NameValueCollection param) { String resSource = IPosMUtil.keyValueToString(param); log.Info("notify data: [" + resSource + "]"); this.parseSource(resSource); String sour = getSource(); if ("000000".Equals(mReturnCode)) { if ("MD5".Equals(GlobalParam.getInstance().signType)) { if (!SignUtil.verifySign(sour, GlobalParam.getInstance().signKey, mHmac)) { mErrMsg = "verify signature failed:" + "returnCode = " + mReturnCode + "&message = " + mMessage; log.Error(mErrMsg); throw new Exception(mErrMsg); } } } else { mErrMsg = "notify failed:" + "returnCode = " + mReturnCode + "&message = " + mMessage; log.Error(mErrMsg); throw new Exception(mErrMsg); } }
public HiOrderNotifyRes(NameValueCollection param) { string source = IPosMUtil.keyValueToString(param); this.parseSource(source); string str2 = this.getSource(); if ("000000".Equals(this.mReturnCode)) { if (!"MD5".Equals(GlobalParam.getInstance().signType)) { return; } if (!SignUtil.verifySign(str2, GlobalParam.getInstance().signKey, this.mHmac)) { this.mErrMsg = "verify signature failed:returnCode = " + this.mReturnCode + "&message = " + this.mMessage; throw new Exception(this.mErrMsg); } } this.mErrMsg = "notify failed:returnCode = " + this.mReturnCode + "&message = " + this.mMessage; throw new Exception(this.mErrMsg); }