1
0
Эх сурвалжийг харах

Merge pull request #75 from essensoft/dev-wechatpay-apiv3

实现 微信支付V3-基础支付-普通支付(服务商模式)API
Roc 5 жил өмнө
parent
commit
13a9cf1b21
24 өөрчлөгдсөн 1421 нэмэгдсэн , 16 устгасан
  1. 26 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/PartnerPayerInfo.cs
  2. 28 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/SettleInfo.cs
  3. 122 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsAppModel.cs
  4. 122 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsH5Model.cs
  5. 125 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsJsApiModel.cs
  6. 122 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsNativeModel.cs
  7. 28 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsOutTradeNoCloseModel.cs
  8. 65 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Notify/WeChatPayPartnerProfitSharingNotify.cs
  9. 156 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Notify/WeChatPayPartnerTransactionsNotify.cs
  10. 1 16
      src/Essensoft.AspNetCore.Payment.WeChatPay/Notify/WeChatPayProfitSharingNotify.cs
  11. 29 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsAppRequest.cs
  12. 29 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsH5Request.cs
  13. 38 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsIdRequest.cs
  14. 29 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsJsApiRequest.cs
  15. 29 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsNativeRequest.cs
  16. 37 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsOutTradeNoCloseRequest.cs
  17. 39 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsOutTradeNoRequest.cs
  18. 20 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsAppResponse.cs
  19. 20 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsH5Response.cs
  20. 152 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsIdResponse.cs
  21. 20 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsJsApiResponse.cs
  22. 21 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsNativeResponse.cs
  23. 11 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsOutTradeNoCloseResponse.cs
  24. 152 0
      src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsOutTradeNoResponse.cs

+ 26 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/PartnerPayerInfo.cs

@@ -0,0 +1,26 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Domain
+{
+    /// <summary>
+    /// 支付者信息
+    /// </summary>
+    public class PartnerPayerInfo : WeChatPayObject
+    {
+        /// <summary>
+        /// 用户服务标识
+        /// 用户在服务商appid下的唯一标识。
+        /// 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o
+        /// </summary>
+        [JsonPropertyName("sp_openid")]
+        public string SpOpenId { get; set; }
+
+        /// <summary>
+        /// 用户子标识
+        /// 用户在子商户appid下的唯一标识。
+        /// 示例值:oUpF8uMuAJO_M2pxb1Q9zNjWeS6o
+        /// </summary>
+        [JsonPropertyName("sub_openid")]
+        public string SubOpenId { get; set; }
+    }
+}

+ 28 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/SettleInfo.cs

@@ -0,0 +1,28 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Domain
+{
+    /// <summary>
+    /// 结算信息
+    /// </summary>    
+    public class SettleInfo : WeChatPayObject
+    {
+        /// <summary>
+        /// 是否指定分账
+        /// 是否指定分账,枚举值
+        /// true:是
+        /// false:否
+        /// 示例值:true
+        /// </summary>
+        [JsonPropertyName("profit_sharing")]
+        public bool ProfitSharing { get; set; }
+
+        /// <summary>
+        /// 补差金额	
+        /// SettleInfo.profit_sharing为true时,该金额才生效。
+        /// 示例值:10
+        /// </summary>
+        [JsonPropertyName("subsidy_amount")]
+        public string SubsidyAmount { get; set; }
+    }
+}

+ 122 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsAppModel.cs

@@ -0,0 +1,122 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Domain
+{
+    /// <summary>
+    /// APP下单API-请求参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_1.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsAppModel : WeChatPayObject
+    {
+        /// <summary>
+        /// 服务商公众号ID
+        /// 服务商申请的公众号或移动应用appid。
+        /// 示例值:wx8888888888888888
+        /// </summary>
+        [JsonPropertyName("sp_appid")]
+        public string SpAppId { get; set; }
+
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户公众号ID
+        /// 子商户申请的公众号或移动应用appid。
+        /// 示例值:wxd678efh567hg6999
+        /// </summary>
+        [JsonPropertyName("sub_appid")]
+        public string SubAppId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商品描述
+        /// 商品描述
+        /// 示例值:Image形象店-深圳腾大-QQ公仔
+        /// </summary>
+        [JsonPropertyName("description")]
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("out_trade_no")]
+        public string OutTradeNo { get; set; }
+
+        /// <summary>
+        /// 交易结束时间
+        /// 订单失效时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
+        /// 示例值:2018-06-08T10:34:56+08:00
+        /// </summary>
+        [JsonPropertyName("time_expire")]
+        public string TimeExpire { get; set; }
+
+        /// <summary>
+        /// 附加数据
+        /// 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
+        /// 示例值:自定义数据
+        /// </summary>
+        [JsonPropertyName("attach")]
+        public string Attach { get; set; }
+
+        /// <summary>
+        /// 通知地址
+        /// 通知URL必须为直接可访问的URL,不允许携带查询串。
+        /// 格式:URL
+        /// 示例值:https://www.weixin.qq.com/wxpay/pay.php
+        /// </summary>
+        [JsonPropertyName("notify_url")]
+        public string NotifyUrl { get; set; }
+
+        /// <summary>
+        /// 订单优惠标记
+        /// 订单优惠标记
+        /// 示例值:WXG
+        /// </summary>
+        [JsonPropertyName("goods_tag")]
+        public string GoodsTag { get; set; }
+
+        /// <summary>
+        /// 结算信息
+        /// 结算信息
+        /// </summary>
+        [JsonPropertyName("settle_info")]
+        public SettleInfo SettleInfo { get; set; }
+
+        /// <summary>
+        /// 订单金额
+        /// 订单金额信息
+        /// </summary>
+        [JsonPropertyName("amount")]
+        public Amount Amount { get; set; }
+
+        /// <summary>
+        /// 优惠功能
+        /// 优惠功能
+        /// </summary>
+        [JsonPropertyName("detail")]
+        public Detail Detail { get; set; }
+
+        /// <summary>
+        /// 场景信息
+        /// 支付场景描述
+        /// </summary>
+        [JsonPropertyName("scene_info")]
+        public SceneInfo SceneInfo { get; set; }
+    }
+}

+ 122 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsH5Model.cs

@@ -0,0 +1,122 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Domain
+{
+    /// <summary>
+    /// H5下单API-请求参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_4.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsH5Model : WeChatPayObject
+    {
+        /// <summary>
+        /// 服务商公众号ID
+        /// 服务商申请的公众号或移动应用appid。
+        /// 示例值:wx8888888888888888
+        /// </summary>
+        [JsonPropertyName("sp_appid")]
+        public string SpAppId { get; set; }
+
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户公众号ID
+        /// 子商户申请的公众号或移动应用appid。
+        /// 示例值:wxd678efh567hg6999
+        /// </summary>
+        [JsonPropertyName("sub_appid")]
+        public string SubAppId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商品描述
+        /// 商品描述
+        /// 示例值:Image形象店-深圳腾大-QQ公仔
+        /// </summary>
+        [JsonPropertyName("description")]
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("out_trade_no")]
+        public string OutTradeNo { get; set; }
+
+        /// <summary>
+        /// 交易结束时间
+        /// 订单失效时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
+        /// 示例值:2018-06-08T10:34:56+08:00
+        /// </summary>
+        [JsonPropertyName("time_expire")]
+        public string TimeExpire { get; set; }
+
+        /// <summary>
+        /// 附加数据
+        /// 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
+        /// 示例值:自定义数据
+        /// </summary>
+        [JsonPropertyName("attach")]
+        public string Attach { get; set; }
+
+        /// <summary>
+        /// 通知地址
+        /// 通知URL必须为直接可访问的URL,不允许携带查询串。
+        /// 格式:URL
+        /// 示例值:https://www.weixin.qq.com/wxpay/pay.php
+        /// </summary>
+        [JsonPropertyName("notify_url")]
+        public string NotifyUrl { get; set; }
+
+        /// <summary>
+        /// 订单优惠标记
+        /// 订单优惠标记
+        /// 示例值:WXG
+        /// </summary>
+        [JsonPropertyName("goods_tag")]
+        public string GoodsTag { get; set; }
+
+        /// <summary>
+        /// 结算信息
+        /// 结算信息
+        /// </summary>
+        [JsonPropertyName("settle_info")]
+        public SettleInfo SettleInfo { get; set; }
+
+        /// <summary>
+        /// 订单金额
+        /// 订单金额信息
+        /// </summary>
+        [JsonPropertyName("amount")]
+        public Amount Amount { get; set; }
+
+        /// <summary>
+        /// 优惠功能
+        /// 优惠功能
+        /// </summary>
+        [JsonPropertyName("detail")]
+        public Detail Detail { get; set; }
+
+        /// <summary>
+        /// 场景信息
+        /// 支付场景描述
+        /// </summary>
+        [JsonPropertyName("scene_info")]
+        public SceneInfo SceneInfo { get; set; }
+    }
+}

+ 125 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsJsApiModel.cs

@@ -0,0 +1,125 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Domain
+{
+    /// <summary>
+    /// JSAPI下单API-请求参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_2.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsJsApiModel : WeChatPayObject
+    {
+        /// <summary>
+        /// 服务商公众号ID
+        /// 服务商申请的公众号或移动应用appid。
+        /// 示例值:wx8888888888888888
+        /// </summary>
+        [JsonPropertyName("sp_appid")]
+        public string SpAppId { get; set; }
+
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户公众号ID
+        /// 子商户申请的公众号或移动应用appid。
+        /// 示例值:wxd678efh567hg6999
+        /// </summary>
+        [JsonPropertyName("sub_appid")]
+        public string SubAppId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商品描述
+        /// 商品描述
+        /// 示例值:Image形象店-深圳腾大-QQ公仔
+        /// </summary>
+        [JsonPropertyName("description")]
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("out_trade_no")]
+        public string OutTradeNo { get; set; }
+
+        /// <summary>
+        /// 交易结束时间
+        /// 订单失效时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
+        /// 示例值:2018-06-08T10:34:56+08:00
+        /// </summary>
+        [JsonPropertyName("time_expire")]
+        public string TimeExpire { get; set; }
+
+        /// <summary>
+        /// 附加数据
+        /// 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
+        /// 示例值:自定义数据
+        /// </summary>
+        [JsonPropertyName("attach")]
+        public string Attach { get; set; }
+
+        /// <summary>
+        /// 通知地址
+        /// 通知URL必须为直接可访问的URL,不允许携带查询串。
+        /// 格式:URL
+        /// 示例值:https://www.weixin.qq.com/wxpay/pay.php
+        /// </summary>
+        [JsonPropertyName("notify_url")]
+        public string NotifyUrl { get; set; }
+
+        /// <summary>
+        /// 订单优惠标记
+        /// 订单优惠标记
+        /// 示例值:WXG
+        /// </summary>
+        [JsonPropertyName("goods_tag")]
+        public string GoodsTag { get; set; }
+
+        /// <summary>
+        /// 结算信息
+        /// 结算信息
+        /// </summary>
+        [JsonPropertyName("settle_info")]
+        public SettleInfo SettleInfo { get; set; }
+
+        /// <summary>
+        /// 订单金额
+        /// </summary>
+        [JsonPropertyName("amount")]
+        public Amount Amount { get; set; }
+
+        /// <summary>
+        /// 支付者
+        /// </summary>
+        [JsonPropertyName("payer")]
+        public Payer Payer { get; set; }
+
+        /// <summary>
+        /// 优惠功能
+        /// </summary>
+        [JsonPropertyName("detail")]
+        public Detail Detail { get; set; }
+
+        /// <summary>
+        /// 场景信息
+        /// </summary>
+        [JsonPropertyName("scene_info")]
+        public SceneInfo SceneInfo { get; set; }
+    }
+}

+ 122 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsNativeModel.cs

@@ -0,0 +1,122 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Domain
+{
+    /// <summary>
+    /// Native下单API-请求参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_3.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsNativeModel : WeChatPayObject
+    {
+        /// <summary>
+        /// 服务商公众号ID
+        /// 服务商申请的公众号或移动应用appid。
+        /// 示例值:wx8888888888888888
+        /// </summary>
+        [JsonPropertyName("sp_appid")]
+        public string SpAppId { get; set; }
+
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户公众号ID
+        /// 子商户申请的公众号或移动应用appid。
+        /// 示例值:wxd678efh567hg6999
+        /// </summary>
+        [JsonPropertyName("sub_appid")]
+        public string SubAppId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商品描述
+        /// 商品描述
+        /// 示例值:Image形象店-深圳腾大-QQ公仔
+        /// </summary>
+        [JsonPropertyName("description")]
+        public string Description { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("out_trade_no")]
+        public string OutTradeNo { get; set; }
+
+        /// <summary>
+        /// 交易结束时间
+        /// 订单失效时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
+        /// 示例值:2018-06-08T10:34:56+08:00
+        /// </summary>
+        [JsonPropertyName("time_expire")]
+        public string TimeExpire { get; set; }
+
+        /// <summary>
+        /// 附加数据
+        /// 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
+        /// 示例值:自定义数据
+        /// </summary>
+        [JsonPropertyName("attach")]
+        public string Attach { get; set; }
+
+        /// <summary>
+        /// 通知地址
+        /// 通知URL必须为直接可访问的URL,不允许携带查询串。
+        /// 格式:URL
+        /// 示例值:https://www.weixin.qq.com/wxpay/pay.php
+        /// </summary>
+        [JsonPropertyName("notify_url")]
+        public string NotifyUrl { get; set; }
+
+        /// <summary>
+        /// 订单优惠标记
+        /// 订单优惠标记
+        /// 示例值:WXG
+        /// </summary>
+        [JsonPropertyName("goods_tag")]
+        public string GoodsTag { get; set; }
+
+        /// <summary>
+        /// 结算信息
+        /// 结算信息
+        /// </summary>
+        [JsonPropertyName("settle_info")]
+        public SettleInfo SettleInfo { get; set; }
+
+        /// <summary>
+        /// 订单金额
+        /// 订单金额信息
+        /// </summary>
+        [JsonPropertyName("amount")]
+        public Amount Amount { get; set; }
+
+        /// <summary>
+        /// 优惠功能
+        /// 优惠功能
+        /// </summary>
+        [JsonPropertyName("detail")]
+        public Detail Detail { get; set; }
+
+        /// <summary>
+        /// 场景信息
+        /// 支付场景描述
+        /// </summary>
+        [JsonPropertyName("scene_info")]
+        public SceneInfo SceneInfo { get; set; }
+    }
+}

+ 28 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Domain/WeChatPayPartnerTransactionsOutTradeNoCloseModel.cs

@@ -0,0 +1,28 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Domain
+{
+    /// <summary>
+    /// 关闭订单API-请求参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_6.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsOutTradeNoCloseModel : WeChatPayObject
+    {
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+    }
+}

+ 65 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Notify/WeChatPayPartnerProfitSharingNotify.cs

@@ -0,0 +1,65 @@
+#if NETCOREAPP3_1
+
+using System.Text.Json.Serialization;
+using Essensoft.AspNetCore.Payment.WeChatPay.Domain;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Notify
+{
+    /// <summary>
+    /// 分账动账通知 (服务商)
+    /// https://pay.weixin.qq.com/wiki/doc/api/allocation_sl.php?chapter=25_9&index=9
+    /// </summary>
+    public class WeChatPayPartnerProfitSharingNotify : WeChatPayV3Notify
+    {
+        /// <summary>
+        /// 服务商商户号
+        /// 服务商模式分账发起商户
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 服务商模式分账出资商户
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchid { get; set; }
+
+        /// <summary>
+        /// 微信订单号
+        /// 微信支付订单号
+        /// </summary>
+        [JsonPropertyName("transaction_id")]
+        public string TransactionId { get; set; }
+
+        /// <summary>
+        /// 微信分账/回退单号
+        /// 微信分账/回退单号
+        /// </summary>
+        [JsonPropertyName("order_id")]
+        public string OrderId { get; set; }
+
+        /// <summary>
+        /// 商户分账/回退单号
+        /// 分账方系统内部的分账/回退单号
+        /// </summary>
+        [JsonPropertyName("out_order_no")]
+        public string OutOrderNo { get; set; }
+
+        /// <summary>
+        /// 分账接收方
+        /// 分账接收方对象
+        /// </summary>
+        [JsonPropertyName("receiver")]
+        public Receiver Receiver { get; set; }
+
+        /// <summary>
+        /// 成功时间
+        /// 成功时间,Rfc3339标准
+        /// </summary>
+        [JsonPropertyName("success_time")]
+        public string SuccessTime { get; set; }
+    }
+}
+
+#endif

+ 156 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Notify/WeChatPayPartnerTransactionsNotify.cs

@@ -0,0 +1,156 @@
+#if NETCOREAPP3_1
+
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using Essensoft.AspNetCore.Payment.WeChatPay.Domain;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Notify
+{
+    /// <summary>
+    /// 支付通知API (服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_11.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsNotify : WeChatPayV3Notify
+    {
+        /// <summary>
+        /// 服务商公众号ID
+        /// 服务商申请的公众号或移动应用appid。
+        /// 示例值:wx8888888888888888
+        /// </summary>
+        [JsonPropertyName("sp_appid")]
+        public string SpAppId { get; set; }
+
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户公众号ID
+        /// 子商户申请的公众号或移动应用appid。
+        /// 示例值:wxd678efh567hg6999
+        /// </summary>
+        [JsonPropertyName("sub_appid")]
+        public string SubAppId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("out_trade_no")]
+        public string OutTradeNo { get; set; }
+
+        /// <summary>
+        /// 微信支付订单号
+        /// 微信支付系统生成的订单号。
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("transaction_id")]
+        public string TransactionId { get; set; }
+
+        /// <summary>
+        /// 交易类型
+        /// 交易类型,枚举值:
+        /// JSAPI:公众号支付
+        /// NATIVE:扫码支付
+        /// APP:APP支付
+        /// MICROPAY:付款码支付
+        /// MWEB:H5支付
+        /// FACEPAY:刷脸支付
+        /// 示例值:MICROPAY
+        /// </summary>
+        [JsonPropertyName("trade_type")]
+        public string TradeType { get; set; }
+
+        /// <summary>
+        /// 交易状态
+        /// 交易状态,枚举值:
+        /// SUCCESS:支付成功
+        /// REFUND:转入退款
+        /// NOTPAY:未支付
+        /// CLOSED:已关闭
+        /// REVOKED:已撤销(付款码支付)
+        /// USERPAYING:用户支付中(付款码支付)
+        /// PAYERROR:支付失败(其他原因,如银行返回失败)
+        /// 示例值:SUCCESS
+        /// </summary>
+        [JsonPropertyName("trade_state")]
+        public string TradeState { get; set; }
+
+        /// <summary>
+        /// 交易状态描述
+        /// 交易状态描述
+        /// 示例值:支付失败,请重新下单支付
+        /// </summary>
+        [JsonPropertyName("trade_state_desc")]
+        public string TradeStateDesc { get; set; }
+
+        /// <summary>
+        /// 付款银行
+        /// 银行类型,采用字符串类型的银行标识。
+        /// 示例值:CMC
+        /// </summary>
+        [JsonPropertyName("bank_type")]
+        public string BankType { get; set; }
+
+        /// <summary>
+        /// 附加数据
+        /// 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
+        /// 示例值:自定义数据
+        /// </summary>
+        [JsonPropertyName("attach")]
+        public string Attach { get; set; }
+
+        /// <summary>
+        /// 支付完成时间
+        /// 支付完成时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
+        /// 示例值:2018-06-08T10:34:56+08:00
+        /// </summary>
+        [JsonPropertyName("success_time")]
+        public string SuccessTime { get; set; }
+
+        /// <summary>
+        /// 支付者
+        /// 示例值:见请求示例
+        /// </summary>
+        [JsonPropertyName("combine_payer_info")]
+        public PartnerPayerInfo CombinePayerInfo { get; set; }
+
+        /// <summary>
+        /// 订单金额
+        /// 订单金额信息
+        /// </summary>
+        [JsonPropertyName("amount")]
+        public QueryAmount Amount { get; set; }
+
+        /// <summary>
+        /// 场景信息
+        /// 支付场景描述
+        /// </summary>
+        [JsonPropertyName("scene_info")]
+        public SceneInfo SceneInfo { get; set; }
+
+        /// <summary>
+        /// 优惠功能
+        /// 优惠功能,享受优惠时返回该字段。
+        /// </summary>
+        [JsonPropertyName("promotion_detail")]
+        public List<PromotionDetail> PromotionDetail { get; set; }
+    }
+}
+
+#endif

+ 1 - 16
src/Essensoft.AspNetCore.Payment.WeChatPay/Notify/WeChatPayProfitSharingNotify.cs

@@ -6,26 +6,11 @@ using Essensoft.AspNetCore.Payment.WeChatPay.Domain;
 namespace Essensoft.AspNetCore.Payment.WeChatPay.Notify
 {
     /// <summary>
-    /// 分账动账通知 (普通商户 / 服务商)
-    /// https://pay.weixin.qq.com/wiki/doc/api/allocation_sl.php?chapter=25_9&index=9
+    /// 分账动账通知 (普通商户)
     /// https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=27_9&index=9
     /// </summary>
     public class WeChatPayProfitSharingNotify : WeChatPayV3Notify
     {
-        /// <summary>
-        /// 服务商商户号
-        /// 服务商模式分账发起商户
-        /// </summary>
-        [JsonPropertyName("sp_mchid")]
-        public string SpMchId { get; set; }
-
-        /// <summary>
-        /// 子商户号
-        /// 服务商模式分账出资商户
-        /// </summary>
-        [JsonPropertyName("sub_mchid")]
-        public string SubMchid { get; set; }
-
         /// <summary>
         /// 直连商户号
         /// 直连模式分账发起和出资商户

+ 29 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsAppRequest.cs

@@ -0,0 +1,29 @@
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// APP下单API(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_1.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsAppRequest : IWeChatPayV3PostRequest<WeChatPayPartnerTransactionsAppResponse>
+    {
+        private WeChatPayObject queryModel;
+
+        public string GetRequestUrl()
+        {
+            return "https://api.mch.weixin.qq.com/v3/pay/partner/transactions/app";
+        }
+
+        public WeChatPayObject GetQueryModel()
+        {
+            return queryModel;
+        }
+
+        public void SetQueryModel(WeChatPayObject queryModel)
+        {
+            this.queryModel = queryModel;
+        }
+    }
+}

+ 29 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsH5Request.cs

@@ -0,0 +1,29 @@
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// H5下单API(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_4.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsH5Request : IWeChatPayV3PostRequest<WeChatPayPartnerTransactionsH5Response>
+    {
+        private WeChatPayObject queryModel;
+
+        public string GetRequestUrl()
+        {
+            return "https://api.mch.weixin.qq.com/v3/pay/partner/transactions/h5";
+        }
+
+        public WeChatPayObject GetQueryModel()
+        {
+            return queryModel;
+        }
+
+        public void SetQueryModel(WeChatPayObject queryModel)
+        {
+            this.queryModel = queryModel;
+        }
+    }
+}

+ 38 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsIdRequest.cs

@@ -0,0 +1,38 @@
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// 查询订单API - 微信支付订单号查询(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_5.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsIdRequest : IWeChatPayV3GetRequest<WeChatPayPartnerTransactionsIdResponse>
+    {
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 微信支付订单号
+        /// 微信支付系统生成的订单号
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        public string TransactionId { get; set; }
+
+        public string GetRequestUrl()
+        {
+            return $"https://api.mch.weixin.qq.com/v3/pay/partner/transactions/id/{TransactionId}?sp_mchid={SpMchId}&sub_mchid={SubMchId}";
+        }
+    }
+}

+ 29 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsJsApiRequest.cs

@@ -0,0 +1,29 @@
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// JSAPI下单API(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_2.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsJsApiRequest : IWeChatPayV3PostRequest<WeChatPayPartnerTransactionsJsApiResponse>
+    {
+        private WeChatPayObject queryModel;
+
+        public string GetRequestUrl()
+        {
+            return "https://api.mch.weixin.qq.com/v3/pay/partner/transactions/jsapi";
+        }
+
+        public WeChatPayObject GetQueryModel()
+        {
+            return queryModel;
+        }
+
+        public void SetQueryModel(WeChatPayObject queryModel)
+        {
+            this.queryModel = queryModel;
+        }
+    }
+}

+ 29 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsNativeRequest.cs

@@ -0,0 +1,29 @@
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// Native下单API(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_3.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsNativeRequest : IWeChatPayV3PostRequest<WeChatPayPartnerTransactionsNativeResponse>
+    {
+        private WeChatPayObject queryModel;
+
+        public string GetRequestUrl()
+        {
+            return "https://api.mch.weixin.qq.com/v3/pay/partner/transactions/native";
+        }
+
+        public WeChatPayObject GetQueryModel()
+        {
+            return queryModel;
+        }
+
+        public void SetQueryModel(WeChatPayObject queryModel)
+        {
+            this.queryModel = queryModel;
+        }
+    }
+}

+ 37 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsOutTradeNoCloseRequest.cs

@@ -0,0 +1,37 @@
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// 关闭订单API(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_6.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsOutTradeNoCloseRequest : IWeChatPayV3PostRequest<WeChatPayPartnerTransactionsOutTradeNoCloseResponse>
+    {
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        public string OutTradeNo { get; set; }
+
+        private WeChatPayObject queryModel;
+
+        public string GetRequestUrl()
+        {
+            return $"https://api.mch.weixin.qq.com/v3/pay/partner/transactions/out-trade-no/{OutTradeNo}/close";
+        }
+
+        public WeChatPayObject GetQueryModel()
+        {
+            return queryModel;
+        }
+
+        public void SetQueryModel(WeChatPayObject queryModel)
+        {
+            this.queryModel = queryModel;
+        }
+    }
+}

+ 39 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayPartnerTransactionsOutTradeNoRequest.cs

@@ -0,0 +1,39 @@
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// 查询订单API - 商户订单号查询(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter3_5.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsOutTradeNoRequest : IWeChatPayV3GetRequest<WeChatPayPartnerTransactionsOutTradeNoResponse>
+    {
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        public string OutTradeNo { get; set; }
+
+        public string GetRequestUrl()
+        {
+            return $"https://api.mch.weixin.qq.com/v3/pay/partner/transactions/out-trade-no/{OutTradeNo}?sp_mchid={SpMchId}&sub_mchid={SubMchId}";
+        }
+    }
+}

+ 20 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsAppResponse.cs

@@ -0,0 +1,20 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    /// <summary>
+    /// APP下单API-返回参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_1.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsAppResponse : WeChatPayV3Response
+    {
+        /// <summary>
+        /// 预支付交易会话标识
+        /// 预支付交易会话标识。
+        /// 示例值:wx201410272009395522657a690389285100
+        /// </summary>
+        [JsonPropertyName("prepay_id")]
+        public string PrepayId { get; set; }
+    }
+}

+ 20 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsH5Response.cs

@@ -0,0 +1,20 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    /// <summary>
+    /// H5下单API-返回参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_4.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsH5Response : WeChatPayV3Response
+    {
+        /// <summary>
+        /// 支付跳转链接
+        /// h5_url为拉起微信支付收银台的中间页面,可通过访问该url来拉起微信客户端,完成支付,h5_url的有效期为5分钟。
+        /// 示例值:https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx2016121516420242444321ca0631331346&package=1405458241
+        /// </summary>
+        [JsonPropertyName("h5_url")]
+        public string H5Url { get; set; }
+    }
+}

+ 152 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsIdResponse.cs

@@ -0,0 +1,152 @@
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using Essensoft.AspNetCore.Payment.WeChatPay.Domain;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    /// <summary>
+    /// 查询订单API-微信支付订单号查询-返回参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_5.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsIdResponse : WeChatPayV3Response
+    {
+        /// <summary>
+        /// 服务商公众号ID
+        /// 服务商申请的公众号或移动应用appid。
+        /// 示例值:wx8888888888888888
+        /// </summary>
+        [JsonPropertyName("sp_appid")]
+        public string SpAppId { get; set; }
+
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户公众号ID
+        /// 子商户申请的公众号或移动应用appid。
+        /// 示例值:wxd678efh567hg6999
+        /// </summary>
+        [JsonPropertyName("sub_appid")]
+        public string SubAppId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("out_trade_no")]
+        public string OutTradeNo { get; set; }
+
+        /// <summary>
+        /// 微信支付订单号
+        /// 微信支付系统生成的订单号。
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("transaction_id")]
+        public string TransactionId { get; set; }
+
+        /// <summary>
+        /// 交易类型
+        /// 交易类型,枚举值:
+        /// JSAPI:公众号支付
+        /// NATIVE:扫码支付
+        /// APP:APP支付
+        /// MICROPAY:付款码支付
+        /// MWEB:H5支付
+        /// FACEPAY:刷脸支付
+        /// 示例值:MICROPAY
+        /// </summary>
+        [JsonPropertyName("trade_type")]
+        public string TradeType { get; set; }
+
+        /// <summary>
+        /// 交易状态
+        /// 交易状态,枚举值:
+        /// SUCCESS:支付成功
+        /// REFUND:转入退款
+        /// NOTPAY:未支付
+        /// CLOSED:已关闭
+        /// REVOKED:已撤销(付款码支付)
+        /// USERPAYING:用户支付中(付款码支付)
+        /// PAYERROR:支付失败(其他原因,如银行返回失败)
+        /// 示例值:SUCCESS
+        /// </summary>
+        [JsonPropertyName("trade_state")]
+        public string TradeState { get; set; }
+
+        /// <summary>
+        /// 交易状态描述
+        /// 交易状态描述
+        /// 示例值:支付失败,请重新下单支付
+        /// </summary>
+        [JsonPropertyName("trade_state_desc")]
+        public string TradeStateDesc { get; set; }
+
+        /// <summary>
+        /// 付款银行
+        /// 银行类型,采用字符串类型的银行标识。
+        /// 示例值:CMC
+        /// </summary>
+        [JsonPropertyName("bank_type")]
+        public string BankType { get; set; }
+
+        /// <summary>
+        /// 附加数据
+        /// 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
+        /// 示例值:自定义数据
+        /// </summary>
+        [JsonPropertyName("attach")]
+        public string Attach { get; set; }
+
+        /// <summary>
+        /// 支付完成时间
+        /// 支付完成时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
+        /// 示例值:2018-06-08T10:34:56+08:00
+        /// </summary>
+        [JsonPropertyName("success_time")]
+        public string SuccessTime { get; set; }
+
+        /// <summary>
+        /// 支付者
+        /// 示例值:见请求示例
+        /// </summary>
+        [JsonPropertyName("payer")]
+        public PartnerPayerInfo Payer { get; set; }
+
+        /// <summary>
+        /// 订单金额
+        /// 订单金额信息
+        /// </summary>
+        [JsonPropertyName("amount")]
+        public QueryAmount Amount { get; set; }
+
+        /// <summary>
+        /// 场景信息
+        /// 支付场景描述
+        /// </summary>
+        [JsonPropertyName("scene_info")]
+        public SceneInfo SceneInfo { get; set; }
+
+        /// <summary>
+        /// 优惠功能
+        /// 优惠功能,享受优惠时返回该字段。
+        /// </summary>
+        [JsonPropertyName("promotion_detail")]
+        public List<PromotionDetail> PromotionDetail { get; set; }
+    }
+}

+ 20 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsJsApiResponse.cs

@@ -0,0 +1,20 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    /// <summary>
+    /// JSAPI下单API-返回参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_2.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsJsApiResponse : WeChatPayV3Response
+    {
+        /// <summary>
+        /// 预支付交易会话标识	
+        /// 预支付交易会话标识。
+        /// 示例值:wx201410272009395522657a690389285100
+        /// </summary>
+        [JsonPropertyName("prepay_id")]
+        public string PrepayId { get; set; }
+    }
+}

+ 21 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsNativeResponse.cs

@@ -0,0 +1,21 @@
+using System.Text.Json.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    /// <summary>
+    /// Native下单API-返回参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_3.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsNativeResponse : WeChatPayV3Response
+    {
+        /// <summary>
+        /// 二维码链接
+        /// 此URL用于生成支付二维码,然后提供给用户扫码支付。
+        /// 注意:code_url并非固定值,使用时按照URL格式转成二维码即可。
+        /// 示例值:weixin://wxpay/bizpayurl/up?pr=NwY5Mz9&groupid=00
+        /// </summary>
+        [JsonPropertyName("code_url")]
+        public string CodeUrl { get; set; }
+    }
+}

+ 11 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsOutTradeNoCloseResponse.cs

@@ -0,0 +1,11 @@
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    /// <summary>
+    /// 关闭订单API-返回参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_6.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsOutTradeNoCloseResponse : WeChatPayV3Response
+    {
+    }
+}

+ 152 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayPartnerTransactionsOutTradeNoResponse.cs

@@ -0,0 +1,152 @@
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using Essensoft.AspNetCore.Payment.WeChatPay.Domain;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    /// <summary>
+    /// 查询订单API-商户订单号查询-返回参数(服务商)
+    /// 最新更新时间:2020.05.26
+    /// https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter5_5.shtml
+    /// </summary>
+    public class WeChatPayPartnerTransactionsOutTradeNoResponse : WeChatPayV3Response
+    {
+        /// <summary>
+        /// 服务商公众号ID
+        /// 服务商申请的公众号或移动应用appid。
+        /// 示例值:wx8888888888888888
+        /// </summary>
+        [JsonPropertyName("sp_appid")]
+        public string SpAppId { get; set; }
+
+        /// <summary>
+        /// 服务商户号
+        /// 服务商户号,由微信支付生成并下发
+        /// 示例值:1230000109
+        /// </summary>
+        [JsonPropertyName("sp_mchid")]
+        public string SpMchId { get; set; }
+
+        /// <summary>
+        /// 子商户公众号ID
+        /// 子商户申请的公众号或移动应用appid。
+        /// 示例值:wxd678efh567hg6999
+        /// </summary>
+        [JsonPropertyName("sub_appid")]
+        public string SubAppId { get; set; }
+
+        /// <summary>
+        /// 子商户号
+        /// 子商户的商户号,有微信支付生成并下发。
+        /// 示例值:1900000109
+        /// </summary>
+        [JsonPropertyName("sub_mchid")]
+        public string SubMchId { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,详见【商户订单号】。
+        /// 特殊规则:最小字符长度为6
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("out_trade_no")]
+        public string OutTradeNo { get; set; }
+
+        /// <summary>
+        /// 微信支付订单号
+        /// 微信支付系统生成的订单号。
+        /// 示例值:1217752501201407033233368018
+        /// </summary>
+        [JsonPropertyName("transaction_id")]
+        public string TransactionId { get; set; }
+
+        /// <summary>
+        /// 交易类型
+        /// 交易类型,枚举值:
+        /// JSAPI:公众号支付
+        /// NATIVE:扫码支付
+        /// APP:APP支付
+        /// MICROPAY:付款码支付
+        /// MWEB:H5支付
+        /// FACEPAY:刷脸支付
+        /// 示例值:MICROPAY
+        /// </summary>
+        [JsonPropertyName("trade_type")]
+        public string TradeType { get; set; }
+
+        /// <summary>
+        /// 交易状态
+        /// 交易状态,枚举值:
+        /// SUCCESS:支付成功
+        /// REFUND:转入退款
+        /// NOTPAY:未支付
+        /// CLOSED:已关闭
+        /// REVOKED:已撤销(付款码支付)
+        /// USERPAYING:用户支付中(付款码支付)
+        /// PAYERROR:支付失败(其他原因,如银行返回失败)
+        /// 示例值:SUCCESS
+        /// </summary>
+        [JsonPropertyName("trade_state")]
+        public string TradeState { get; set; }
+
+        /// <summary>
+        /// 交易状态描述
+        /// 交易状态描述
+        /// 示例值:支付失败,请重新下单支付
+        /// </summary>
+        [JsonPropertyName("trade_state_desc")]
+        public string TradeStateDesc { get; set; }
+
+        /// <summary>
+        /// 付款银行
+        /// 银行类型,采用字符串类型的银行标识。
+        /// 示例值:CMC
+        /// </summary>
+        [JsonPropertyName("bank_type")]
+        public string BankType { get; set; }
+
+        /// <summary>
+        /// 附加数据
+        /// 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用
+        /// 示例值:自定义数据
+        /// </summary>
+        [JsonPropertyName("attach")]
+        public string Attach { get; set; }
+
+        /// <summary>
+        /// 支付完成时间
+        /// 支付完成时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
+        /// 示例值:2018-06-08T10:34:56+08:00
+        /// </summary>
+        [JsonPropertyName("success_time")]
+        public string SuccessTime { get; set; }
+
+        /// <summary>
+        /// 支付者
+        /// 示例值:见请求示例
+        /// </summary>
+        [JsonPropertyName("payer")]
+        public PartnerPayerInfo Payer { get; set; }
+
+        /// <summary>
+        /// 订单金额
+        /// 订单金额信息
+        /// </summary>
+        [JsonPropertyName("amount")]
+        public QueryAmount Amount { get; set; }
+
+        /// <summary>
+        /// 场景信息
+        /// 支付场景描述
+        /// </summary>
+        [JsonPropertyName("scene_info")]
+        public SceneInfo SceneInfo { get; set; }
+
+        /// <summary>
+        /// 优惠功能
+        /// 优惠功能,享受优惠时返回该字段。
+        /// </summary>
+        [JsonPropertyName("promotion_detail")]
+        public List<PromotionDetail> PromotionDetail { get; set; }
+    }
+}