예제 #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;
        }
예제 #2
0
        public ChargeResult ChargeCallBack(SortedDictionary<string, string> parameters)
        {
            ChargeResult result = new ChargeResult();
            if(parameters==null)
            {
                result.Status = ChargeStatus.FAILED;
                result.Message = "回调参数错误";
                return result;
            }

            string orderStrId = null;
            if(parameters.ContainsKey("transNo"))
            {
                orderStrId = parameters["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));
                chargeMgr.CallBack(paramters);
                result.Status = ChargeStatus.SUCCEED;
                result.Message = "回调成功";
            }
            return result;
        }