Beispiel #1
0
        public ApiMessage Chongba()
        {
            ApiMessage message = new ApiMessage()
            {
                Status = "OK", Message = "成功执行回调函数"
            };

            try
            {
                this.IniRequest();
                ICharge chargeMgr = new ChongBaCharge();
                List <WebRequestParameters> paramters = new List <WebRequestParameters>();
                paramters.Add(new WebRequestParameters("orderId", request["orderId"], false));
                paramters.Add(new WebRequestParameters("respCode", request["respCode"], false));
                paramters.Add(new WebRequestParameters("respMsg", request["respMsg"], false));
                paramters.Add(new WebRequestParameters("transNo", request["transNo"], false));
                chargeMgr.CallBack(paramters);
            }
            catch (KMBitException e)
            {
                message.Status  = "ERROE";
                message.Message = e.Message;
            }
            catch (Exception ex)
            {
                message.Status  = "ERROE";
                message.Message = ex.Message;
            }

            return(message);
        }
Beispiel #2
0
        public ChargeResult ChargeCallBack(SortedDictionary <string, string> paras)
        {
            ChargeResult result = new ChargeResult();

            if (paras == null)
            {
                result.Status  = ChargeStatus.FAILED;
                result.Message = "回调参数错误";
                return(result);
            }

            string orderStrId = null;

            if (paras.ContainsKey("transNo"))
            {
                orderStrId = paras["transNo"];
                ICharge chargeMgr = new ChongBaCharge();
                List <WebRequestParameters> paramters = new List <WebRequestParameters>();
                //paramters.Add(new WebRequestParameters("orderId", parameters["orderId"], false));
                //paramters.Add(new WebRequestParameters("respCode", parameters["respCode"], false));
                //paramters.Add(new WebRequestParameters("respMsg", parameters["respMsg"], false));
                //paramters.Add(new WebRequestParameters("transNo", parameters["transNo"], false));
                if (paras != null)
                {
                    foreach (KeyValuePair <string, string> para in paras)
                    {
                        paramters.Add(new WebRequestParameters(para.Key, para.Value, false));
                    }
                }
                chargeMgr.CallBack(paramters);
                result.Status  = ChargeStatus.SUCCEED;
                result.Message = "回调成功";
            }
            return(result);
        }