Пример #1
0
        public ApiMessage ChargeBack()
        {
            ApiMessage message = new ApiMessage();

            try
            {
                this.IniRequest();
                SortedDictionary <string, string> sArray = GetRequestParameters();
                ChargeBridge bridge = new ChargeBridge();
                ChargeResult result = bridge.ChargeCallBack(sArray);
                message.Message = result.Message;
                message.Status  = "OK";
                if (result.Status != ChargeStatus.SUCCEED)
                {
                    message.Status = "ERROR";
                }
            }
            catch (KMBitException kex)
            {
                message.Status  = "ERROR";
                message.Message = kex.Message;
            }
            catch (Exception ex)
            {
                message.Status  = "ERROR";
                message.Message = "未知错误";
            }

            return(message);
        }
Пример #2
0
        public HttpResponseMessage BeibeiBack()
        {
            var    resp   = new HttpResponseMessage(HttpStatusCode.OK);
            string result = "";

            try
            {
                this.IniRequest();
                SortedDictionary <string, string> sArray = GetRequestParameters();
                ChargeBridge bridge = new ChargeBridge();
                result = bridge.ChargeCallBack(sArray, ResourceType.BeiBeiFlow);
            }
            catch
            {
                result = "fail";
            }

            resp.Content = new StringContent(result, System.Text.Encoding.UTF8, "text/plain");
            return(resp);
        }