示例#1
0
        public async Task <IActionResult> PagePayReturn()
        {
            try
            {
                var notify = await _notifyClient.ExecuteAsync <AlipayTradePagePayReturnResponse>(Request);

                return(Content("success", "text/plain"));
            }
            catch
            {
                return(Content("error", "text/plain"));
            }
        }
示例#2
0
        public async Task <IActionResult> PagePayReturn()
        {
            try
            {
                var notify = await _notifyClient.ExecuteAsync <AlipayTradePagePayReturnResponse>(Request);

                ViewData["response"] = "支付成功";
                return(View());
            }
            catch
            {
                ViewData["response"] = "出现错误";
                return(View());
            }
        }
示例#3
0
        public async Task <IActionResult> PagePayAsync()
        {
            try
            {
                var notify = await _client.ExecuteAsync <AlipayTradePagePayNotifyResponse>(Request);

                if ("TRADE_SUCCESS" == notify.TradeStatus)
                {
                    Console.WriteLine("OutTradeNo: " + notify.OutTradeNo);

                    return(Content("success", "text/plain"));
                }
                return(NoContent());
            }
            catch
            {
                return(NoContent());
            }
        }
示例#4
0
        public async Task <IActionResult> Precreate()
        {
            try
            {
                var notify = await _client.ExecuteAsync <AlipayTradePrecreateNotifyResponse>(Request);

                if ("TRADE_SUCCESS" == notify.TradeStatus)
                {
                    Console.WriteLine("OutTradeNo: " + notify.OutTradeNo);

                    return(AlipayNotifyResult.Success);
                }
                return(NoContent());
            }
            catch
            {
                return(NoContent());
            }
        }