mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 02:29:40 +08:00
feat(tenpayv3): 新增付款码支付相关接口
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
| √ | 支付产品:H5 支付 | 直连商户 & 合作伙伴 | |
|
||||
| √ | 支付产品:Native 支付 | 直连商户 & 合作伙伴 | |
|
||||
| √ | 支付产品:小程序支付 | 直连商户 & 合作伙伴 | |
|
||||
| × | <del>支付产品:付款码支付</del> | 直连商户 & 合作伙伴 | 官方未提供 v3 API |
|
||||
| √ | 支付产品:付款码支付 | 直连商户 & 合作伙伴 | |
|
||||
| √ | 支付产品:合单支付 | 直连商户 & 合作伙伴 | |
|
||||
| √ | 支付产品:资金/交易账单 | 直连商户 & 合作伙伴 | |
|
||||
| √ | 支付产品:退款 | 直连商户 & 合作伙伴 | |
|
||||
@@ -144,6 +144,12 @@
|
||||
|
||||
- 关闭订单:`ClosePayTransaction`
|
||||
|
||||
- 付款码支付
|
||||
|
||||
- 付款码支付:`CreatePayTransactionCodePay`
|
||||
|
||||
- 撤销订单:`ReversePayTransaction`
|
||||
|
||||
- 合单支付
|
||||
|
||||
- 合单 APP 下单:`CreateCombineTransactionApp`
|
||||
@@ -618,6 +624,12 @@
|
||||
|
||||
- 关闭订单:`ClosePayPartnerTransaction`
|
||||
|
||||
- 付款码支付
|
||||
|
||||
- 付款码支付:`CreatePayPartnerTransactionCodePay`
|
||||
|
||||
- 撤销订单:`ReversePayPartnerTransaction`
|
||||
|
||||
- 合单支付
|
||||
|
||||
- 合单 APP 下单:`CreateCombineTransactionApp`
|
||||
@@ -1378,7 +1390,7 @@
|
||||
|
||||
---
|
||||
|
||||
### 【附】境外开发 API 模型命名速查表:
|
||||
### 【附】境外支付 API 模型命名速查表:
|
||||
|
||||
注:树形结构与[微信支付开发者文档](https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/pages/Overview.shtml)目录结构保持一致。
|
||||
|
||||
|
@@ -115,6 +115,31 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePayPartnerTransactionNativeResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /pay/partner/transactions/codepay 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/partner-code-payment-v3/partner/partner-code-pay.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreatePayPartnerTransactionCodePayResponse> ExecuteCreatePayPartnerTransactionCodePayAsync(this WechatTenpayClient client, Models.CreatePayPartnerTransactionCodePayRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId is null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "pay", "partner", "transactions", "codepay");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePayPartnerTransactionCodePayResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /pay/partner/transactions/scannedpos 接口。</para>
|
||||
/// <para>
|
||||
@@ -233,5 +258,30 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ClosePayPartnerTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /pay/partner/transactions/out-trade-no/{out_trade_no}/reverse 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/partner-code-payment-v3/partner/partner-reverse.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ReversePayPartnerTransactionResponse> ExecuteReversePayPartnerTransactionAsync(this WechatTenpayClient client, Models.ReversePayPartnerTransactionRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId is null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "pay", "partner", "transactions", "out-trade-no", request.OutTradeNumber, "reverse");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ReversePayPartnerTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -110,6 +110,31 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePayTransactionNativeResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /pay/transactions/codepay 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/code-payment-v3/direct/code-pay.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreatePayTransactionCodePayResponse> ExecuteCreatePayTransactionCodePayAsync(this WechatTenpayClient client, Models.CreatePayTransactionCodePayRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId is null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "pay", "transactions", "codepay");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePayTransactionCodePayResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /pay/transactions/out-trade-no/{out_trade_no} 接口。</para>
|
||||
/// <para>
|
||||
@@ -198,5 +223,30 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ClosePayTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /pay/transactions/out-trade-no/{out_trade_no}/reverse 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/docs/merchant/apis/code-payment-v3/direct/reverse.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ReversePayTransactionResponse> ExecuteReversePayTransactionAsync(this WechatTenpayClient client, Models.ReversePayTransactionRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId is null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "pay", "transactions", "out-trade-no", request.OutTradeNumber, "reverse");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ReversePayTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -141,7 +141,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_client_ip")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_client_ip")]
|
||||
public string ClientIp { get; set; } = string.Empty;
|
||||
public string? ClientIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户端设备号。
|
||||
@@ -150,6 +150,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_id")]
|
||||
public string? DeviceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户端设备 IP。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("device_ip")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("device_ip")]
|
||||
public string? DeviceIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户门店信息。
|
||||
/// </summary>
|
||||
|
@@ -0,0 +1,190 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/transactions/codepay 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreatePayTransactionCodePayRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Payer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置授权码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("auth_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("auth_code")]
|
||||
public string AuthCode { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class Amount : CreatePayTransactionAppRequest.Types.Amount
|
||||
{
|
||||
}
|
||||
|
||||
public class Detail
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class GoodsDetail
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户侧商品编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_goods_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_goods_id")]
|
||||
public string MerchantGoodsId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信侧商品编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wxpay_goods_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wxpay_goods_id")]
|
||||
public string? WechatpayGoodsId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_name")]
|
||||
public string? GoodsName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("quantity")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("quantity")]
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品单价(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unit_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unit_price")]
|
||||
public int UnitPrice { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单原价(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cost_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cost_price")]
|
||||
public int? CostPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品小票 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("invoice_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invoice_id")]
|
||||
public string? InvoiceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置单品列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_detail")]
|
||||
public List<Types.GoodsDetail>? GoodsList { get; set; }
|
||||
}
|
||||
|
||||
public class Scene : CreatePayTransactionAppRequest.Types.Scene
|
||||
{
|
||||
public static new class Types
|
||||
{
|
||||
public class Store : CreatePayTransactionAppRequest.Types.Scene.Types.Store
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Settlement : CreatePayTransactionAppRequest.Types.Settlement
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附加数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("attach")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attach")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单优惠标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_tag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_tag")]
|
||||
public string? GoodsTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否支持开票。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("support_fapiao")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("support_fapiao")]
|
||||
public bool? IsSupportFapiao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置支付者信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer")]
|
||||
public Types.Payer Payer { get; set; } = new Types.Payer();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = new Types.Amount();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("detail")]
|
||||
public Types.Detail? Detail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene_info")]
|
||||
public Types.Scene? Scene { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结算信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settle_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settle_info")]
|
||||
public Types.Settlement? Settlement { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/transactions/codepay 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreatePayTransactionCodePayResponse : GetPayTransactionByOutTradeNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/transactions/out-trade-no/{out_trade_no}/reverse 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ReversePayTransactionRequest : ClosePayTransactionRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/transactions/out-trade-no/{out_trade_no}/reverse 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ReversePayTransactionResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,129 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/partner/transactions/codepay 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreatePayPartnerTransactionCodePayRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : CreatePayTransactionCodePayRequest.Types.Amount
|
||||
{
|
||||
}
|
||||
|
||||
public class Payer : CreatePayTransactionCodePayRequest.Types.Payer
|
||||
{
|
||||
}
|
||||
|
||||
public class Detail : CreatePayTransactionCodePayRequest.Types.Detail
|
||||
{
|
||||
}
|
||||
|
||||
public class Scene : CreatePayTransactionCodePayRequest.Types.Scene
|
||||
{
|
||||
}
|
||||
|
||||
public class Settlement : CreatePayTransactionCodePayRequest.Types.Settlement
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
|
||||
public string? SubAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附加数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("attach")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attach")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单优惠标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_tag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_tag")]
|
||||
public string? GoodsTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否支持开票。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("support_fapiao")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("support_fapiao")]
|
||||
public bool? IsSupportFapiao { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = new Types.Amount();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置支付者信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer")]
|
||||
public Types.Payer Payer { get; set; } = new Types.Payer();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("detail")]
|
||||
public Types.Detail? Detail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene_info")]
|
||||
public Types.Scene Scene { get; set; } = new Types.Scene();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结算信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settle_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settle_info")]
|
||||
public Types.Settlement? Settlement { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/partner/transactions/codepay 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreatePayPartnerTransactionCodePayResponse : GetPayPartnerTransactionByOutTradeNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/partner/transactions/out-trade-no/{out_trade_no}/reverse 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ReversePayPartnerTransactionRequest : ClosePayPartnerTransactionRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_appid")]
|
||||
public string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
|
||||
public string? SubAppId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /pay/partner/transactions/out-trade-no/{out_trade_no}/reverse 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ReversePayPartnerTransactionResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_appid")]
|
||||
public string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
|
||||
public string? SubAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"appid": "wxd678efh567hg6787",
|
||||
"mchid": "1230000109",
|
||||
"description": "Image形象店-深圳腾大-QQ公仔",
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"attach": "自定义数据说明",
|
||||
"goods_tag": "WXG",
|
||||
"support_fapiao": false,
|
||||
"payer": {
|
||||
"auth_code": "130061098828009406"
|
||||
},
|
||||
"amount": {
|
||||
"total": 100,
|
||||
"currency": "CNY"
|
||||
},
|
||||
"scene_info": {
|
||||
"device_id": "013467007045764",
|
||||
"device_ip": "128.0.0.1",
|
||||
"store_info": {
|
||||
"id": "0001",
|
||||
"out_id": "A1111"
|
||||
}
|
||||
},
|
||||
"detail": {
|
||||
"cost_price": 608800,
|
||||
"invoice_id": "微信123",
|
||||
"goods_detail": [
|
||||
{
|
||||
"merchant_goods_id": "1246464644",
|
||||
"wxpay_goods_id": "1001",
|
||||
"goods_name": "iPhoneX 256G",
|
||||
"quantity": 1,
|
||||
"unit_price": 528800
|
||||
}
|
||||
]
|
||||
},
|
||||
"settle_info": {
|
||||
"profit_sharing": false
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"appid": "wxd678efh567hg6787",
|
||||
"mchid": "1230000109",
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"transaction_id": "1217752501201407033233368018",
|
||||
"trade_type": "MICROPAY",
|
||||
"bank_type": "CCB_DEBIT",
|
||||
"success_time": "2018-06-08T10:34:56+08:00",
|
||||
"trade_state": "SUCCESS",
|
||||
"trade_state_desc": "支付成功",
|
||||
"attach": "自定义数据说明",
|
||||
"payer": {
|
||||
"openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
|
||||
},
|
||||
"amount": {
|
||||
"total": 100,
|
||||
"payer_total": 100,
|
||||
"currency": "CNY",
|
||||
"payer_currency": "CNY"
|
||||
},
|
||||
"promotion_detail": [
|
||||
{
|
||||
"coupon_id": "109519",
|
||||
"name": "单品惠-6",
|
||||
"scope": "GLOBAL",
|
||||
"type": "CASH",
|
||||
"amount": 100,
|
||||
"stock_id": "931386",
|
||||
"wechatpay_contribute": 0,
|
||||
"merchant_contribute": 0,
|
||||
"other_contribute": 0,
|
||||
"currency": "CNY",
|
||||
"goods_detail": [
|
||||
{
|
||||
"goods_id": "M1006",
|
||||
"quantity": 1,
|
||||
"unit_price": 100,
|
||||
"discount_amount": 1,
|
||||
"goods_remark": "商品备注信息"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"appid": "wxd678efh567hg6787",
|
||||
"mchid": "1230000109"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"appid": "wxd678efh567hg6787",
|
||||
"mchid": "1230000109",
|
||||
"out_trade_no": "1217752501201407033233368018"
|
||||
}
|
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"sp_appid": "wxd678efh567hg6787",
|
||||
"sp_mchid": "1230000109",
|
||||
"sub_appid": "wxd678efh567hg6787",
|
||||
"sub_mchid": "1230000109",
|
||||
"description": "Image形象店-深圳腾大-QQ公仔",
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"attach": "自定义数据说明",
|
||||
"goods_tag": "WXG",
|
||||
"support_fapiao": false,
|
||||
"payer": {
|
||||
"auth_code": "130061098828009406"
|
||||
},
|
||||
"amount": {
|
||||
"total": 100,
|
||||
"currency": "CNY"
|
||||
},
|
||||
"scene_info": {
|
||||
"device_id": "013467007045764",
|
||||
"device_ip": "128.0.0.1",
|
||||
"store_info": {
|
||||
"id": "0001",
|
||||
"out_id": "A1111"
|
||||
}
|
||||
},
|
||||
"detail": {
|
||||
"cost_price": 608800,
|
||||
"invoice_id": "微信123",
|
||||
"goods_detail": [
|
||||
{
|
||||
"merchant_goods_id": "1246464644",
|
||||
"wxpay_goods_id": "1001",
|
||||
"goods_name": "iPhoneX 256G",
|
||||
"quantity": 1,
|
||||
"unit_price": 528800
|
||||
}
|
||||
]
|
||||
},
|
||||
"settle_info": {
|
||||
"profit_sharing": false
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"sp_appid": "wxd678efh567hg6787",
|
||||
"sp_mchid": "1230000109",
|
||||
"sub_appid": "wxd678efh567hg6787",
|
||||
"sub_mchid": "1230000109",
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"transaction_id": "1217752501201407033233368018",
|
||||
"trade_type": "MICROPAY",
|
||||
"bank_type": "CCB_DEBIT",
|
||||
"success_time": "2018-06-08T10:34:56+08:00",
|
||||
"trade_state": "SUCCESS",
|
||||
"trade_state_desc": "支付成功",
|
||||
"attach": "自定义数据说明",
|
||||
"payer": {
|
||||
"sp_openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o",
|
||||
"sub_openid": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
|
||||
},
|
||||
"amount": {
|
||||
"total": 100,
|
||||
"payer_total": 100,
|
||||
"currency": "CNY",
|
||||
"payer_currency": "CNY"
|
||||
},
|
||||
"promotion_detail": [
|
||||
{
|
||||
"coupon_id": "109519",
|
||||
"name": "单品惠-6",
|
||||
"scope": "GLOBAL",
|
||||
"type": "CASH",
|
||||
"amount": 100,
|
||||
"stock_id": "931386",
|
||||
"wechatpay_contribute": 0,
|
||||
"merchant_contribute": 0,
|
||||
"other_contribute": 0,
|
||||
"currency": "CNY",
|
||||
"goods_detail": [
|
||||
{
|
||||
"goods_id": "M1006",
|
||||
"quantity": 1,
|
||||
"unit_price": 100,
|
||||
"discount_amount": 1,
|
||||
"goods_remark": "商品备注信息"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sp_appid": "wxd678efh567hg6787",
|
||||
"sp_mchid": "1230000109",
|
||||
"sub_appid": "wxd678efh567hg6787",
|
||||
"sub_mchid": "1230000109"
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"sp_appid": "wxd678efh567hg6787",
|
||||
"sp_mchid": "1230000109",
|
||||
"sub_appid": "wxd678efh567hg6787",
|
||||
"sub_mchid": "1230000109",
|
||||
"out_trade_no": "1217752501201407033233368018"
|
||||
}
|
Reference in New Issue
Block a user