Ejemplo n.º 1
0
        public ActionResult SystemPay(SystemPayAccount item)
        {
            //string serialNo = SerialNoHelper.Create();
            try
            {
                //var account = _accountService.GetByName(item.AccountName);
                //var rsp = account != null ? _accountDealService.Pay(new PayRequest(item.AccountName, "", item.PosName, item.Amount, serialNo, account.AccountToken, Constants.SystemShopName) { IsForce = true }) : new AccountServiceResponse(ResponseCode.NonFoundAccount);
                AccountServiceResponse rsp = item.DoPay();
                if (string.IsNullOrWhiteSpace(rsp.CodeText))
                {
                    rsp.CodeText = ModelHelper.GetBoundText(rsp, x => x.Code);
                }
                if (rsp.Code == 0)
                {
                    rsp.CodeText = "交易成功";
                }
                return(Json(rsp));
            }

            catch (Exception ex)
            {
                AccountServiceResponse rsp = new AccountServiceResponse(ResponseCode.SystemError);
                rsp.CodeText = ModelHelper.GetBoundText(rsp, x => x.Code);
                return(Json(rsp));
            }
        }
Ejemplo n.º 2
0
        public ActionResult ShowPay(SystemPayAccount item)
        {
            //AdminUser currentUser = new AdminUser();
            //AccountServiceResponse rsp = item.DoPay(currentUser);
            var result = item.ShowPay();

            return(Json(result));
        }