Ejemplo n.º 1
0
        public async Task <IActionResult> AppPay(QPayUnifiedOrderViewModel viewModel)
        {
            var request = new QPayUnifiedOrderRequest
            {
                OutTradeNo     = viewModel.OutTradeNo,
                Body           = viewModel.Body,
                FeeType        = viewModel.FeeType,
                TotalFee       = viewModel.TotalFee,
                SpbillCreateIp = viewModel.SpbillCreateIp,
                TradeType      = viewModel.TradeType,
                NotifyUrl      = viewModel.NotifyUrl
            };
            var response = await _client.ExecuteAsync(request);

            ViewData["response"] = response.Body;
            return(View());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> QrCodePay(QPayUnifiedOrderViewModel viewModel)
        {
            var request = new QPayUnifiedOrderRequest
            {
                OutTradeNo     = viewModel.OutTradeNo,
                Body           = viewModel.Body,
                FeeType        = viewModel.FeeType,
                TotalFee       = viewModel.TotalFee,
                SpBillCreateIp = viewModel.SpBillCreateIp,
                TradeType      = viewModel.TradeType,
                NotifyUrl      = viewModel.NotifyUrl
            };
            var response = await _client.ExecuteAsync(request, _optionsAccessor.Value);

            ViewData["qrcode"]   = response.CodeUrl;
            ViewData["response"] = response.ResponseBody;
            return(View());
        }