From ab35c7ea414975174158562aea643ec47a406000 Mon Sep 17 00:00:00 2001 From: varorbc Date: Sun, 1 Apr 2018 13:54:55 +0800 Subject: [PATCH] . --- .../Controllers/AlipayController.cs | 14 ++++++++++++ sample/ICanPay.Demo/Views/Home/Index.cshtml | 22 +++++++++++++++++++ .../Response/BarcodePayResponse.cs | 10 +++++++++ src/ICanPay.Alipay/Response/BaseResponse.cs | 10 --------- src/ICanPay.Alipay/Response/CancelResponse.cs | 10 +++++++++ src/ICanPay.Alipay/Response/CloseResponse.cs | 9 ++++++++ src/ICanPay.Alipay/Response/QueryResponse.cs | 10 +++++++++ .../Response/RefundQueryResponse.cs | 10 +++++++++ src/ICanPay.Alipay/Response/RefundResponse.cs | 10 +++++++++ .../Response/ScanPayResponse.cs | 5 +++++ 10 files changed, 100 insertions(+), 10 deletions(-) diff --git a/sample/ICanPay.Demo/Controllers/AlipayController.cs b/sample/ICanPay.Demo/Controllers/AlipayController.cs index 85105b1..5a4853c 100644 --- a/sample/ICanPay.Demo/Controllers/AlipayController.cs +++ b/sample/ICanPay.Demo/Controllers/AlipayController.cs @@ -170,6 +170,20 @@ namespace ICanPay.Demo.Controllers return Json(response); } + [HttpPost] + public IActionResult Cancel(string out_trade_no, string trade_no) + { + var request = new CancelRequest(); + request.AddGatewayData(new CancelModel() + { + TradeNo = trade_no, + OutTradeNo = out_trade_no + }); + + var response = _baseGateway.Execute(request); + return Json(response); + } + [HttpPost] public IActionResult Close(string out_trade_no, string trade_no) { diff --git a/sample/ICanPay.Demo/Views/Home/Index.cshtml b/sample/ICanPay.Demo/Views/Home/Index.cshtml index f3a71d2..5140b77 100644 --- a/sample/ICanPay.Demo/Views/Home/Index.cshtml +++ b/sample/ICanPay.Demo/Views/Home/Index.cshtml @@ -40,6 +40,7 @@
  • 交易查询
  • 交易退款
  • 退款查询
  • +
  • 交易撤销
  • 交易关闭
  • 单笔转账
  • 转账查询
  • @@ -303,6 +304,27 @@

    +
    +
    +

    + + +

    +

    + + +

    +

    + + +

    +
    +
    +

    + * 查看接口 请求参数、响应参数 +

    +
    +

    diff --git a/src/ICanPay.Alipay/Response/BarcodePayResponse.cs b/src/ICanPay.Alipay/Response/BarcodePayResponse.cs index 0058747..f275694 100644 --- a/src/ICanPay.Alipay/Response/BarcodePayResponse.cs +++ b/src/ICanPay.Alipay/Response/BarcodePayResponse.cs @@ -6,6 +6,16 @@ namespace ICanPay.Alipay.Response { public class BarcodePayResponse : BaseResponse { + ///

    + /// 支付宝交易号 + /// + public string TradeNo { get; set; } + + /// + /// 商户订单号 + /// + public string OutTradeNo { get; set; } + /// /// 买家支付宝账号 /// diff --git a/src/ICanPay.Alipay/Response/BaseResponse.cs b/src/ICanPay.Alipay/Response/BaseResponse.cs index affa652..8a2cb37 100644 --- a/src/ICanPay.Alipay/Response/BaseResponse.cs +++ b/src/ICanPay.Alipay/Response/BaseResponse.cs @@ -42,15 +42,5 @@ namespace ICanPay.Alipay.Response /// 原始值 /// public string Body { get; set; } - - /// - /// 支付宝交易号 - /// - public string TradeNo { get; set; } - - /// - /// 商户订单号 - /// - public string OutTradeNo { get; set; } } } diff --git a/src/ICanPay.Alipay/Response/CancelResponse.cs b/src/ICanPay.Alipay/Response/CancelResponse.cs index 6f68e93..7eca323 100644 --- a/src/ICanPay.Alipay/Response/CancelResponse.cs +++ b/src/ICanPay.Alipay/Response/CancelResponse.cs @@ -2,6 +2,16 @@ { public class CancelResponse : BaseResponse { + /// + /// 支付宝交易号 + /// + public string TradeNo { get; set; } + + /// + /// 商户订单号 + /// + public string OutTradeNo { get; set; } + /// /// 是否需要重试 /// diff --git a/src/ICanPay.Alipay/Response/CloseResponse.cs b/src/ICanPay.Alipay/Response/CloseResponse.cs index 6c0663a..948d8ee 100644 --- a/src/ICanPay.Alipay/Response/CloseResponse.cs +++ b/src/ICanPay.Alipay/Response/CloseResponse.cs @@ -2,5 +2,14 @@ { public class CloseResponse : BaseResponse { + /// + /// 支付宝交易号 + /// + public string TradeNo { get; set; } + + /// + /// 商户订单号 + /// + public string OutTradeNo { get; set; } } } diff --git a/src/ICanPay.Alipay/Response/QueryResponse.cs b/src/ICanPay.Alipay/Response/QueryResponse.cs index f2be3ec..00d997c 100644 --- a/src/ICanPay.Alipay/Response/QueryResponse.cs +++ b/src/ICanPay.Alipay/Response/QueryResponse.cs @@ -6,6 +6,16 @@ namespace ICanPay.Alipay.Response { public class QueryResponse : BaseResponse { + /// + /// 支付宝交易号 + /// + public string TradeNo { get; set; } + + /// + /// 商户订单号 + /// + public string OutTradeNo { get; set; } + /// /// 买家支付宝账号 /// diff --git a/src/ICanPay.Alipay/Response/RefundQueryResponse.cs b/src/ICanPay.Alipay/Response/RefundQueryResponse.cs index 9680a78..5d985df 100644 --- a/src/ICanPay.Alipay/Response/RefundQueryResponse.cs +++ b/src/ICanPay.Alipay/Response/RefundQueryResponse.cs @@ -4,6 +4,16 @@ namespace ICanPay.Alipay.Response { public class RefundQueryResponse : BaseResponse { + /// + /// 支付宝交易号 + /// + public string TradeNo { get; set; } + + /// + /// 商户订单号 + /// + public string OutTradeNo { get; set; } + /// /// 本笔退款对应的退款请求号 /// diff --git a/src/ICanPay.Alipay/Response/RefundResponse.cs b/src/ICanPay.Alipay/Response/RefundResponse.cs index 371e08b..be356c6 100644 --- a/src/ICanPay.Alipay/Response/RefundResponse.cs +++ b/src/ICanPay.Alipay/Response/RefundResponse.cs @@ -7,6 +7,16 @@ namespace ICanPay.Alipay.Response { public class RefundResponse : BaseResponse { + /// + /// 支付宝交易号 + /// + public string TradeNo { get; set; } + + /// + /// 商户订单号 + /// + public string OutTradeNo { get; set; } + /// /// 买家支付宝账号 /// diff --git a/src/ICanPay.Alipay/Response/ScanPayResponse.cs b/src/ICanPay.Alipay/Response/ScanPayResponse.cs index fd0d877..6153be0 100644 --- a/src/ICanPay.Alipay/Response/ScanPayResponse.cs +++ b/src/ICanPay.Alipay/Response/ScanPayResponse.cs @@ -2,6 +2,11 @@ { public class ScanPayResponse : BaseResponse { + /// + /// 商户订单号 + /// + public string OutTradeNo { get; set; } + /// /// 当前预下单请求生成的二维码码串,可以用二维码生成工具根据该码串值生成对应的二维码 ///