Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
 public static GlobalParam getInstance()
 {
     if (instance == null)
     {
         instance = new GlobalParam();
     }
     return(instance);
 }
Exemplo n.º 3
0
        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);
        }