Exemple #1
0
        public override Task <QueryReturnModel> OrderQuery(string OrderNumber)
        {
            QueryReturnModel returnModel = new QueryReturnModel();

            returnModel.ReturnMsg = "ok";
            returnModel.IsPay     = true;
            return(Task.Run(() => returnModel));
        }
Exemple #2
0
        public override Task <QueryReturnModel> OrderQuery(string OrderNumber)
        {
            QueryReturnModel queryReturn = new QueryReturnModel();

            queryReturn.ReturnMsg = "暂无接口";
            queryReturn.IsPay     = false;
            return(Task.FromResult <QueryReturnModel>(queryReturn));

            IDictionary <string, string> dic = new SortedDictionary <string, string>();

            dic.Add("rid", this.MchID);
            dic.Add("order_sn", OrderNumber);
            string response = HttpHelper.Post(this.Plat.Req_gateway, JsonConvert.SerializeObject(dic));

            Dos.Common.LogHelper.Debug("第三方查询结果:" + response);
            dynamic m     = JsonConvert.DeserializeObject(response);
            string  errno = m["errno"];
            string  msg   = m["msg"];

            if (errno == "0")
            {
                bool isPaid = m["data"]["isPaid"];
                if (isPaid)
                {
                    decimal amount = 0;
                    string  money  = m["data"]["money"];
                    queryReturn.ReturnMsg    = "支付成功";
                    queryReturn.Attach       = queryReturn.ReturnMsg;
                    queryReturn.OrderNumber  = OrderNumber;
                    queryReturn.SerialNumber = OrderNumber;
                    decimal.TryParse(money, out amount);
                    queryReturn.Totalfee = amount / 1m;
                    queryReturn.IsPay    = true;
                    return(Task.FromResult <QueryReturnModel>(queryReturn));
                }
            }
            queryReturn.ReturnMsg    = "未支付";
            queryReturn.Attach       = queryReturn.ReturnMsg;
            queryReturn.OrderNumber  = OrderNumber;
            queryReturn.SerialNumber = OrderNumber;
            queryReturn.Totalfee     = 0;
            queryReturn.IsPay        = false;

            return(Task.FromResult <QueryReturnModel>(queryReturn));
        }
Exemple #3
0
        public override Task <QueryReturnModel> OrderQuery(string OrderNumber)
        {
            QueryReturnModel queryReturn = new QueryReturnModel();

            return(new Task <QueryReturnModel>(() => queryReturn));
        }