Пример #1
0
        public async Task <IActionResult> QrCodePay(JDPayUnifiedOrderViewModel viewModel)
        {
            var request = new JDPayUnifiedOrderRequest
            {
                TradeNum  = viewModel.TradeNum,
                TradeName = viewModel.TradeName,
                TradeTime = viewModel.TradeTime,
                Amount    = viewModel.Amount,
                OrderType = viewModel.OrderType,
                Currency  = viewModel.Currency,
                NotifyUrl = viewModel.NotifyUrl,
                TradeType = viewModel.TradeType
            };

            var response = await _client.ExecuteAsync(request);

            ViewData["qrcode"]   = response.QrCode;
            ViewData["response"] = response.Body;
            return(View());
        }
Пример #2
0
        public async Task <IActionResult> Uniorder(string tradeNum, string tradeName, string tradeDesc, string tradeTime, string amount,
                                                   string orderType, string currency, string note, string notifyUrl, string tradeType)
        {
            var request = new JDPayUnifiedOrderRequest()
            {
                TradeNum  = tradeNum,
                TradeName = tradeName,
                TradeDesc = tradeDesc,
                TradeTime = tradeTime,
                Amount    = amount,
                OrderType = orderType,
                Currency  = currency,
                Note      = note,
                NotifyUrl = notifyUrl,
                TradeType = tradeType
            };

            var response = await _client.ExecuteAsync(request);

            return(Content(response.Body));
        }