コード例 #1
0
ファイル: NotifyController.cs プロジェクト: zgk1994/payment
        public async Task <IActionResult> Async()
        {
            try
            {
                var notify = await _client.ExecuteAsync <JDPayAsyncNotify>(Request, _optionsAccessor.Value);

                Console.WriteLine("TradeNum: " + notify.TradeNum + " tradeType :" + notify.TradeType);// notify.TradeType 0-消费 1-退款
                return(JDPayNotifyResult.Success);
            }
            catch
            {
                return(NoContent());
            }
        }
コード例 #2
0
        public async Task <IActionResult> Return()
        {
            try
            {
                var notify = await _notifyClient.ExecuteAsync <JDPaySyncReturn>(Request);

                ViewData["response"] = "支付成功";
                return(View());
            }
            catch
            {
                ViewData["response"] = "出现错误";
                return(View());
            }
        }