feat(tenpayv3): 新增服务商平台收付通商家转账相关接口

This commit is contained in:
Fu Diwei 2024-07-02 11:23:08 +08:00
parent f0ab585147
commit 4869479583
57 changed files with 2752 additions and 3 deletions

View File

@ -941,6 +941,30 @@
- 下载账单:`DownloadBillFile`
- 平台收付通(商家转账)
- 批量商家转账
- 受理商家转账:`ApplyPlatformSolutionMerchantTransferBatch`
- 微信支付转账批次单号查询批次单:`GetPlatformSolutionMerchantTransferBatchByBatchId`
- 微信支付转账明细单号查询明细单:`GetPlatformSolutionMerchantTransferBatchDetailByDetailId`
- 商户转账批次单号查询批次单:`GetPlatformSolutionMerchantTransferBatchByOutBatchNumber`
- 商户明细单号查询明细单:`GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumber`
- 预约商家转账
- 受理单次预约商家转账:`ApplyPlatformSolutionMerchantTransferReservation`
- 商户预约单号查询预约商家转账记录:`GetPlatformSolutionMerchantTransferReservationByOutReservationNumber`
- 关闭预约商家转账记录:`ClosePlatformSolutionMerchantTransferReservation`
- 微信支付预约单号查询预约商家转账记录:`GetPlatformSolutionMerchantTransferReservationByReservationId`
- 代金券
- 创建代金券批次:`CreateMarketingFavorStock`

View File

@ -311,6 +311,142 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
}
#endregion
#region MerchantTransfer
/// <summary>
/// <para>异步调用 [POST] /ecommerce/mch-transfer/authorizations 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/authorization/create-authorization.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateEcommerceMerchantTransferAuthorizationResponse> ExecuteCreateEcommerceMerchantTransferAuthorizationAsync(this WechatTenpayClient client, Models.CreateEcommerceMerchantTransferAuthorizationRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "ecommerce", "mch-transfer", "authorizations");
return await client.SendFlurlRequestAsJsonAsync<Models.CreateEcommerceMerchantTransferAuthorizationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /ecommerce/mch-transfer/authorizations/{sub_mchid} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/authorization/get-authorization.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetEcommerceMerchantTransferAuthorizationBySubMerchantIdResponse> ExecuteGetEcommerceMerchantTransferAuthorizationBySubMerchantIdAsync(this WechatTenpayClient client, Models.GetEcommerceMerchantTransferAuthorizationBySubMerchantIdRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "ecommerce", "mch-transfer", "authorizations", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetEcommerceMerchantTransferAuthorizationBySubMerchantIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /ecommerce/mch-transfer/transfer-bills 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-bill/transfer-to-user.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateEcommerceMerchantTransferBillResponse> ExecuteCreateEcommerceMerchantTransferBillAsync(this WechatTenpayClient client, Models.CreateEcommerceMerchantTransferBillRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "ecommerce", "mch-transfer", "transfer-bills");
return await client.SendFlurlRequestAsJsonAsync<Models.CreateEcommerceMerchantTransferBillResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /ecommerce/mch-transfer/transfer-bills/out-bill-no/{out_bill_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-bill/get-transfer-bill-by-out-no.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetEcommerceMerchantTransferBillByOutBillNumberResponse> ExecuteGetEcommerceMerchantTransferBillByOutBillNumberAsync(this WechatTenpayClient client, Models.GetEcommerceMerchantTransferBillByOutBillNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "ecommerce", "mch-transfer", "transfer-bills", "out-bill-no", request.OutBillNumber)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetEcommerceMerchantTransferBillByOutBillNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /ecommerce/mch-transfer/transfer-bills/transfer-bill-no/{transfer_bill_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-bill/get-transfer-bill-by-no.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetEcommerceMerchantTransferBillByTransferBillNumberResponse> ExecuteGetEcommerceMerchantTransferBillByTransferBillNumberAsync(this WechatTenpayClient client, Models.GetEcommerceMerchantTransferBillByTransferBillNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "ecommerce", "mch-transfer", "transfer-bills", "transfer-bill-no", request.TransferBillNumber)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetEcommerceMerchantTransferBillByTransferBillNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /ecommerce/mch-transfer/transfer-bills/out-bill-no/{out_bill_no}/cancel 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-bill/cancel-transfer.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CancelEcommerceMerchantTransferBillResponse> ExecuteCancelEcommerceMerchantTransferBillAsync(this WechatTenpayClient client, Models.CancelEcommerceMerchantTransferBillRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "ecommerce", "mch-transfer", "transfer-bills", "out-bill-no", request.OutBillNumber, "cancel");
return await client.SendFlurlRequestAsJsonAsync<Models.CancelEcommerceMerchantTransferBillResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region ProfitSharing
/// <summary>
/// <para>异步调用 [POST] /ecommerce/profitsharing/orders 接口。</para>

View File

@ -50,7 +50,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "partner-transfer", "batches", "out-batch-no", request.OutBatchNumber)
.SetQueryParam("need_query_detail", request.RequireQueryDetail);
.SetQueryParam("need_query_detail", request.RequireQueryDetail ? "true" : "false");
if (request.DetailStatus is not null)
flurlReq.SetQueryParam("detail_status", request.DetailStatus);

View File

@ -0,0 +1,237 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
{
public static class WechatTenpayClientExecutePlatformSolutionExtensions
{
#region MerchantTransfer
/// <summary>
/// <para>异步调用 [POST] /platsolution/mch-transfer/batches/apply 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-batch/transfer-batch-apply.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ApplyPlatformSolutionMerchantTransferBatchResponse> ExecuteApplyPlatformSolutionMerchantTransferBatchAsync(this WechatTenpayClient client, Models.ApplyPlatformSolutionMerchantTransferBatchRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "platsolution", "mch-transfer", "batches", "apply");
return await client.SendFlurlRequestAsJsonAsync<Models.ApplyPlatformSolutionMerchantTransferBatchResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /platsolution/mch-transfer/batches/out-batch-no/{out_batch_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-batch/transfer-batch-get-by-out-code.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetPlatformSolutionMerchantTransferBatchByOutBatchNumberResponse> ExecuteGetPlatformSolutionMerchantTransferBatchByOutBatchNumberAsync(this WechatTenpayClient client, Models.GetPlatformSolutionMerchantTransferBatchByOutBatchNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "platsolution", "mch-transfer", "batches", "out-batch-no", request.OutBatchNumber)
.SetQueryParam("sub_mchid", request.SubMerchantId)
.SetQueryParam("need_query_detail", request.RequireQueryDetail ? "true" : "false");
if (request.DetailState is not null)
flurlReq.SetQueryParam("detail_state", request.DetailState);
if (request.Offset is not null)
flurlReq.SetQueryParam("offset", request.Offset.Value);
if (request.Limit is not null)
flurlReq.SetQueryParam("limit", request.Limit.Value);
return await client.SendFlurlRequestAsJsonAsync<Models.GetPlatformSolutionMerchantTransferBatchByOutBatchNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /platsolution/mch-transfer/batches/batch-id/{batch_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-batch/transfer-batch-get-by-id.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetPlatformSolutionMerchantTransferBatchByBatchIdResponse> ExecuteGetPlatformSolutionMerchantTransferBatchByBatchIdAsync(this WechatTenpayClient client, Models.GetPlatformSolutionMerchantTransferBatchByBatchIdRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "platsolution", "mch-transfer", "batches", "batch-id", request.BatchId)
.SetQueryParam("sub_mchid", request.SubMerchantId)
.SetQueryParam("need_query_detail", request.RequireQueryDetail ? "true" : "false");
if (request.DetailState is not null)
flurlReq.SetQueryParam("detail_state", request.DetailState);
if (request.Offset is not null)
flurlReq.SetQueryParam("offset", request.Offset.Value);
if (request.Limit is not null)
flurlReq.SetQueryParam("limit", request.Limit.Value);
return await client.SendFlurlRequestAsJsonAsync<Models.GetPlatformSolutionMerchantTransferBatchByBatchIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /platsolution/mch-transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-batch/transfer-batch-get-detail-by-out-no.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse> ExecuteGetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberAsync(this WechatTenpayClient client, Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "platsolution", "mch-transfer", "batches", "out-batch-no", request.OutBatchNumber, "details", "out-detail-no", request.OutDetailNumber)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /platsolution/mch-transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-batch/get-transfer-detail-by-no.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdResponse> ExecuteGetPlatformSolutionMerchantTransferBatchDetailByDetailIdAsync(this WechatTenpayClient client, Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "platsolution", "mch-transfer", "batches", "out-batch-no", request.BatchId, "details", "detail-id", request.DetailId)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /platsolution/mch-transfer/reservation/apply 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-reservation/transfer-reservation-apply.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ApplyPlatformSolutionMerchantTransferReservationResponse> ExecuteApplyPlatformSolutionMerchantTransferReservationAsync(this WechatTenpayClient client, Models.ApplyPlatformSolutionMerchantTransferReservationRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "platsolution", "mch-transfer", "reservation", "apply");
return await client.SendFlurlRequestAsJsonAsync<Models.ApplyPlatformSolutionMerchantTransferReservationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /platsolution/mch-transfer/reservation/out-reservation-no/{out_reservation_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-reservation/transfer-reservation-get-by-out-no.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetPlatformSolutionMerchantTransferReservationByOutReservationNumberResponse> ExecuteGetPlatformSolutionMerchantTransferReservationByOutReservationNumberAsync(this WechatTenpayClient client, Models.GetPlatformSolutionMerchantTransferReservationByOutReservationNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "platsolution", "mch-transfer", "reservation", "out-reservation-no", request.OutReservationNumber)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetPlatformSolutionMerchantTransferReservationByOutReservationNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /platsolution/mch-transfer/reservation/reservation-id/{reservation_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-reservation/transfer-reservation-get-by-id.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetPlatformSolutionMerchantTransferReservationByReservationIdResponse> ExecuteGetPlatformSolutionMerchantTransferReservationByReservationIdAsync(this WechatTenpayClient client, Models.GetPlatformSolutionMerchantTransferReservationByReservationIdRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "platsolution", "mch-transfer", "reservation", "reservation-id", request.ReservationId)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetPlatformSolutionMerchantTransferReservationByReservationIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /platsolution/mch-transfer/reservation/out-reservation-no/{out_reservation_no}/close 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/platsolution-mch-transfer/transfer-reservation/transfer-reservation-close.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ClosePlatformSolutionMerchantTransferReservationResponse> ExecuteClosePlatformSolutionMerchantTransferReservationAsync(this WechatTenpayClient client, Models.ClosePlatformSolutionMerchantTransferReservationRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "platsolution", "mch-transfer", "reservation", "out-reservation-no", request.OutReservationNumber, "close");
return await client.SendFlurlRequestAsJsonAsync<Models.ClosePlatformSolutionMerchantTransferReservationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /ecommerce/mch-transfer/transfer-bills/out-bill-no/{out_bill_no}/cancel 接口的请求。</para>
/// </summary>
public class CancelEcommerceMerchantTransferBillRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户转账单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutBillNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,47 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /ecommerce/mch-transfer/transfer-bills/out-bill-no/{out_bill_no}/cancel 接口的响应。</para>
/// </summary>
public class CancelEcommerceMerchantTransferBillResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置商户转账单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_bill_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_bill_no")]
public string OutBillNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信转账单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_bill_no")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_bill_no")]
public string TransferBillNumber { get; set; } = default!;
/// <summary>
/// 获取或设置单据状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置更新时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset UpdateTime { get; set; }
}
}

View File

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /ecommerce/mch-transfer/authorizations 接口的请求。</para>
/// </summary>
public class CreateEcommerceMerchantTransferAuthorizationRequest : WechatTenpayRequest
{
public static class Types
{
public class Agreement
{
/// <summary>
/// 获取或设置协议编号。
/// </summary>
[Newtonsoft.Json.JsonProperty("agreement_code")]
[System.Text.Json.Serialization.JsonPropertyName("agreement_code")]
public string AgreementCode { get; set; } = string.Empty;
/// <summary>
/// 获取或设置协议版本号。
/// </summary>
[Newtonsoft.Json.JsonProperty("agreement_version")]
[System.Text.Json.Serialization.JsonPropertyName("agreement_version")]
public string AgreementVersion { get; set; } = string.Empty;
/// <summary>
/// 获取或设置签约主体。
/// </summary>
[Newtonsoft.Json.JsonProperty("sign_organization")]
[System.Text.Json.Serialization.JsonPropertyName("sign_organization")]
public string SignOrganization { get; set; } = string.Empty;
/// <summary>
/// 获取或设置签约时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("sign_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("sign_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset SignTime { get; set; }
}
}
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置签约协议列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("agreement_list")]
[System.Text.Json.Serialization.JsonPropertyName("agreement_list")]
public IList<Types.Agreement> AgreementList { get; set; } = new List<Types.Agreement>();
}
}

View File

@ -0,0 +1,42 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /ecommerce/mch-transfer/authorizations 接口的响应。</para>
/// </summary>
public class CreateEcommerceMerchantTransferAuthorizationResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置授权状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorization_state")]
[System.Text.Json.Serialization.JsonPropertyName("authorization_state")]
public string AuthorizationState { get; set; } = default!;
/// <summary>
/// 获取或设置受理时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("accept_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("accept_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset AcceptTime { get; set; }
/// <summary>
/// 获取或设置授权时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorize_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("authorize_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? AuthorizeTime { get; set; }
}
}

View File

@ -0,0 +1,81 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /ecommerce/mch-transfer/transfer-bills 接口的请求。</para>
/// </summary>
[WechatTenpaySensitive]
public class CreateEcommerceMerchantTransferBillRequest : WechatTenpayRequest
{
public static class Types
{
public class TransferDetail : CreateTransferBatchRequest.Types.TransferDetail
{
}
}
/// <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("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户转账单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_bill_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_bill_no")]
public string OutBillNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置转账场景 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_scene_id")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_scene_id")]
public string TransferSceneId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置收款用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string? OpenId { get; set; }
/// <summary>
/// 获取或设置收款用户姓名(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? UserName { get; set; }
/// <summary>
/// 获取或设置转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_amount")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_amount")]
public int TransferAmount { get; set; }
/// <summary>
/// 获取或设置转账备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_remark")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_remark")]
public string TransferRemark { get; set; } = string.Empty;
/// <summary>
/// 获取或设置回调通知地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("notify_url")]
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
public string? NotifyUrl { get; set; }
}
}

View File

@ -0,0 +1,61 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /ecommerce/mch-transfer/transfer-bills 接口的响应。</para>
/// </summary>
public class CreateEcommerceMerchantTransferBillResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置商户转账单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_bill_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_bill_no")]
public string OutBillNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信转账单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_bill_no")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_bill_no")]
public string TransferBillNumber { get; set; } = default!;
/// <summary>
/// 获取或设置单据状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置失败原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("fail_reason")]
[System.Text.Json.Serialization.JsonPropertyName("fail_reason")]
public string? FailReason { get; set; }
/// <summary>
/// 获取或设置创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
/// <summary>
/// 获取或设置跳转领取页面的信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("package_info")]
[System.Text.Json.Serialization.JsonPropertyName("package_info")]
public string? PackageInfo { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /ecommerce/mch-transfer/authorizations/{sub_mchid} 接口的请求。</para>
/// </summary>
public class GetEcommerceMerchantTransferAuthorizationBySubMerchantIdRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,33 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /ecommerce/mch-transfer/authorizations/{sub_mchid} 接口的响应。</para>
/// </summary>
public class GetEcommerceMerchantTransferAuthorizationBySubMerchantIdResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置授权状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorization_state")]
[System.Text.Json.Serialization.JsonPropertyName("authorization_state")]
public string AuthorizationState { get; set; } = default!;
/// <summary>
/// 获取或设置授权时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorize_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("authorize_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? AuthorizeTime { get; set; }
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /ecommerce/mch-transfer/transfer-bills/out-bill-no/{out_bill_no} 接口的请求。</para>
/// </summary>
public class GetEcommerceMerchantTransferBillByOutBillNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户转账单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutBillNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,115 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /ecommerce/mch-transfer/transfer-bills/out-bill-no/{out_bill_no} 接口的响应。</para>
/// </summary>
[WechatTenpaySensitive]
public class GetEcommerceMerchantTransferBillByOutBillNumberResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mchid")]
[System.Text.Json.Serialization.JsonPropertyName("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("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = default!;
/// <summary>
/// 获取或设置商户转账单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_bill_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_bill_no")]
public string OutBillNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信转账单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_bill_no")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_bill_no")]
public string TransferBillNumber { get; set; } = default!;
/// <summary>
/// 获取或设置单据状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置转账场景 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_scene_id")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_scene_id")]
public string TransferSceneId { get; set; } = default!;
/// <summary>
/// 获取或设置收款用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string? OpenId { get; set; }
/// <summary>
/// 获取或设置收款用户姓名(需使用商户私钥解密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? UserName { get; set; }
/// <summary>
/// 获取或设置转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_amount")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_amount")]
public int TransferAmount { get; set; }
/// <summary>
/// 获取或设置转账备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_remark")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_remark")]
public string TransferRemark { get; set; } = default!;
/// <summary>
/// 获取或设置失败原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("fail_reason")]
[System.Text.Json.Serialization.JsonPropertyName("fail_reason")]
public string? FailReason { get; set; }
/// <summary>
/// 获取或设置创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
/// <summary>
/// 获取或设置更新时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset UpdateTime { get; set; }
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /ecommerce/mch-transfer/transfer-bills/transfer-bill-no/{transfer_bill_no} 接口的请求。</para>
/// </summary>
public class GetEcommerceMerchantTransferBillByTransferBillNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信转账单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string TransferBillNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,10 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /ecommerce/mch-transfer/transfer-bills/transfer-bill-no/{transfer_bill_no} 接口的响应。</para>
/// </summary>
[WechatTenpaySensitive]
public class GetEcommerceMerchantTransferBillByTransferBillNumberResponse : GetEcommerceMerchantTransferBillByOutBillNumberResponse
{
}
}

View File

@ -0,0 +1,128 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /platsolution/mch-transfer/batches/apply 接口的请求。</para>
/// </summary>
public class ApplyPlatformSolutionMerchantTransferBatchRequest : WechatTenpayRequest
{
public static class Types
{
public class TransferDetail
{
/// <summary>
/// 获取或设置商户明细单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_detail_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_detail_no")]
public string OutDetailNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_amount")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_amount")]
public int TransferAmount { get; set; }
/// <summary>
/// 获取或设置转账备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_remark")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_remark")]
public string TransferRemark { get; set; } = string.Empty;
/// <summary>
/// 获取或设置收款用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信转账预约单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("reservation_id")]
[System.Text.Json.Serialization.JsonPropertyName("reservation_id")]
public string ReservationId { get; set; } = string.Empty;
}
}
/// <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; }
/// <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_batch_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_no")]
public string OutBatchNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置批次名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_name")]
[System.Text.Json.Serialization.JsonPropertyName("batch_name")]
public string BatchName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置批次备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_remark")]
[System.Text.Json.Serialization.JsonPropertyName("batch_remark")]
public string BatchRemark { get; set; } = string.Empty;
/// <summary>
/// 获取或设置转账场景 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_scene_id")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_scene_id")]
public string TransferSceneId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置转账总金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_amount")]
[System.Text.Json.Serialization.JsonPropertyName("total_amount")]
public int TotalAmount { get; set; }
/// <summary>
/// 获取或设置转账总笔数。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalNumber { get; set; }
/// <summary>
/// 获取或设置转账明细列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_detail_list")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_detail_list")]
public IList<Types.TransferDetail> TransferDetailList { get; set; } = new List<Types.TransferDetail>();
/// <summary>
/// 获取或设置回调通知地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("notify_url")]
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
public string? NotifyUrl { get; set; }
}
}

View File

@ -0,0 +1,40 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /platsolution/mch-transfer/batches/apply 接口的响应。</para>
/// </summary>
public class ApplyPlatformSolutionMerchantTransferBatchResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置商户批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_batch_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_no")]
public string OutBatchNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_id")]
[System.Text.Json.Serialization.JsonPropertyName("batch_id")]
public string BatchId { get; set; } = default!;
/// <summary>
/// 获取或设置批次创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
/// <summary>
/// 获取或设置批次状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_state")]
[System.Text.Json.Serialization.JsonPropertyName("batch_state")]
public string? BatchState { get; set; }
}
}

View File

@ -0,0 +1,160 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /platsolution/mch-transfer/reservation/apply 接口的请求。</para>
/// </summary>
[WechatTenpaySensitive]
public class ApplyPlatformSolutionMerchantTransferReservationRequest : WechatTenpayRequest
{
public static class Types
{
public class SceneReportData
{
public static class Types
{
public class InsurancePolicy
{
/// <summary>
/// 获取或设置保险产品备案编号。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_registration_no")]
[System.Text.Json.Serialization.JsonPropertyName("product_registration_no")]
public string? ProductRegistrationNumber { get; set; }
/// <summary>
/// 获取或设置保险单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("policy_no")]
[System.Text.Json.Serialization.JsonPropertyName("policy_no")]
public string PolicyNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置保险名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 获取或设置取现单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("withdrawal_no")]
[System.Text.Json.Serialization.JsonPropertyName("withdrawal_no")]
public string? WithdrawalNumber { get; set; }
/// <summary>
/// 获取或设置理赔单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("claim_no")]
[System.Text.Json.Serialization.JsonPropertyName("claim_no")]
public string? ClaimNumber { get; set; }
}
}
/// <summary>
/// 获取或设置保险保单报备信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("insurance_policy")]
[System.Text.Json.Serialization.JsonPropertyName("insurance_policy")]
public Types.InsurancePolicy? InsurancePolicy { 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("out_reservation_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_reservation_no")]
public string OutReservationNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置转账场景 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_scene_id")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_scene_id")]
public string TransferSceneId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置预计最晚转账日期。
/// </summary>
[Newtonsoft.Json.JsonProperty("estimated_date")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("estimated_date")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? EstimatedDate { get; set; }
/// <summary>
/// 获取或设置预计最大转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("estimated_max_amount")]
[System.Text.Json.Serialization.JsonPropertyName("estimated_max_amount")]
public int? EstimatedMaxAmount { get; set; }
/// <summary>
/// 获取或设置准确转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("exact_amount")]
[System.Text.Json.Serialization.JsonPropertyName("exact_amount")]
public int? ExactAmount { get; set; }
/// <summary>
/// 获取或设置收款用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置收款用户姓名(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_real_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_real_name")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? UserName { get; set; }
/// <summary>
/// 获取或设置预约备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("reserve_remark")]
[System.Text.Json.Serialization.JsonPropertyName("reserve_remark")]
public string ReserveRemark { get; set; } = string.Empty;
/// <summary>
/// 获取或设置回调通知地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("notify_url")]
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
public string? NotifyUrl { get; set; }
/// <summary>
/// 获取或设置场景报备信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("scene_report_data")]
[System.Text.Json.Serialization.JsonPropertyName("scene_report_data")]
public Types.SceneReportData? SceneReportData { get; set; }
}
}

View File

@ -0,0 +1,54 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /platsolution/mch-transfer/reservation/apply 接口的响应。</para>
/// </summary>
public class ApplyPlatformSolutionMerchantTransferReservationResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置商户预约单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_reservation_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_reservation_no")]
public string OutReservationNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信预约单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("reservation_id")]
[System.Text.Json.Serialization.JsonPropertyName("reservation_id")]
public string ReservationId { get; set; } = default!;
/// <summary>
/// 获取或设置预约记录状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置预约受理时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("accept_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("accept_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset AcceptTime { get; set; }
/// <summary>
/// 获取或设置跳转预约页面的信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("package_info")]
[System.Text.Json.Serialization.JsonPropertyName("package_info")]
public string? PackageInfo { get; set; }
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /platsolution/mch-transfer/reservation/out-reservation-no/{out_reservation_no}/close 接口的请求。</para>
/// </summary>
public class ClosePlatformSolutionMerchantTransferReservationRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户预约单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutReservationNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /platsolution/mch-transfer/reservation/out-reservation-no/{out_reservation_no}/close 接口的响应。</para>
/// </summary>
public class ClosePlatformSolutionMerchantTransferReservationResponse : GetPlatformSolutionMerchantTransferReservationByOutReservationNumberResponse
{
}
}

View File

@ -0,0 +1,50 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/batch-id/{batch_id} 接口的请求。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferBatchByBatchIdRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信批次单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string BatchId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置是否查询转账明细单。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public bool RequireQueryDetail { get; set; }
/// <summary>
/// 获取或设置分页开始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页大小。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Limit { get; set; }
/// <summary>
/// 获取或设置明细状态。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? DetailState { get; set; }
}
}

View File

@ -0,0 +1,47 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/batch-id/{batch_id} 接口的响应。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferBatchByBatchIdResponse : WechatTenpayResponse
{
public static class Types
{
public class TransferBatch : GetPlatformSolutionMerchantTransferBatchByOutBatchNumberResponse.Types.TransferBatch
{
}
public class TransferDetail : GetPlatformSolutionMerchantTransferBatchByOutBatchNumberResponse.Types.TransferDetail
{
}
}
/// <summary>
/// 获取或设置转账批次信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_batch")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_batch")]
public Types.TransferBatch TransferBatch { get; set; } = default!;
/// <summary>
/// 获取或设置转账明细单列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.TransferDetail[]? TransferDetailList { get; set; }
/// <summary>
/// 获取或设置分页开始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页大小。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Limit { get; set; }
}
}

View File

@ -0,0 +1,50 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/out-batch-no/{out_batch_no} 接口的请求。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferBatchByOutBatchNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户批次单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutBatchNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置是否查询转账明细单。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public bool RequireQueryDetail { get; set; }
/// <summary>
/// 获取或设置分页开始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页大小。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Limit { get; set; }
/// <summary>
/// 获取或设置明细状态。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? DetailState { get; set; }
}
}

View File

@ -0,0 +1,196 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/out-batch-no/{out_batch_no} 接口的响应。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferBatchByOutBatchNumberResponse : WechatTenpayResponse
{
public static class Types
{
public class TransferBatch
{
/// <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; } = default!;
/// <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_batch_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_no")]
public string OutBatchNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_id")]
[System.Text.Json.Serialization.JsonPropertyName("batch_id")]
public string BatchId { get; set; } = default!;
/// <summary>
/// 获取或设置批次状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_state")]
[System.Text.Json.Serialization.JsonPropertyName("batch_state")]
public string BatchState { get; set; } = default!;
/// <summary>
/// 获取或设置批次名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_name")]
[System.Text.Json.Serialization.JsonPropertyName("batch_name")]
public string BatchName { get; set; } = default!;
/// <summary>
/// 获取或设置批次备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_remark")]
[System.Text.Json.Serialization.JsonPropertyName("batch_remark")]
public string BatchRemark { get; set; } = default!;
/// <summary>
/// 获取或设置转账场景 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_scene_id")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_scene_id")]
public string TransferSceneId { get; set; } = default!;
/// <summary>
/// 获取或设置批次关闭原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("close_reason")]
[System.Text.Json.Serialization.JsonPropertyName("close_reason")]
public string? CloseReason { get; set; }
/// <summary>
/// 获取或设置转账总金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_amount")]
[System.Text.Json.Serialization.JsonPropertyName("total_amount")]
public int TotalAmount { get; set; }
/// <summary>
/// 获取或设置转账总笔数。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalNumber { get; set; }
/// <summary>
/// 获取或设置批次创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
/// <summary>
/// 获取或设置转账成功金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("success_amount")]
[System.Text.Json.Serialization.JsonPropertyName("success_amount")]
public int SuccessAmount { get; set; }
/// <summary>
/// 获取或设置转账成功笔数。
/// </summary>
[Newtonsoft.Json.JsonProperty("success_num")]
[System.Text.Json.Serialization.JsonPropertyName("success_num")]
public int SuccessNumber { get; set; }
/// <summary>
/// 获取或设置转账失败金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("failed_amount")]
[System.Text.Json.Serialization.JsonPropertyName("failed_amount")]
public int FailAmount { get; set; }
/// <summary>
/// 获取或设置转账失败笔数。
/// </summary>
[Newtonsoft.Json.JsonProperty("failed_num")]
[System.Text.Json.Serialization.JsonPropertyName("failed_num")]
public int FailNumber { get; set; }
}
public class TransferDetail
{
/// <summary>
/// 获取或设置商户明细单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_detail_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_detail_no")]
public string OutDetailNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信明细单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("detail_id")]
[System.Text.Json.Serialization.JsonPropertyName("detail_id")]
public string DetailId { get; set; } = default!;
/// <summary>
/// 获取或设置明细状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("detail_state")]
[System.Text.Json.Serialization.JsonPropertyName("detail_state")]
public string DetailState { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置转账批次信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_batch")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_batch")]
public Types.TransferBatch TransferBatch { get; set; } = default!;
/// <summary>
/// 获取或设置转账明细单列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.TransferDetail[]? TransferDetailList { get; set; }
/// <summary>
/// 获取或设置分页开始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页大小。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Limit { get; set; }
}
}

View File

@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id} 接口的请求。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferBatchDetailByDetailIdRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信批次单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string BatchId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信明细单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string DetailId { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id} 接口的响应。</para>
/// </summary>
[WechatTenpaySensitive]
public class GetPlatformSolutionMerchantTransferBatchDetailByDetailIdResponse : GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse
{
}
}

View File

@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} 接口的请求。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户批次单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutBatchNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户明细单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutDetailNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,138 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} 接口的响应。</para>
/// </summary>
[WechatTenpaySensitive]
public class GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse : WechatTenpayResponse
{
/// <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; } = default!;
/// <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_batch_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_no")]
public string OutBatchNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_id")]
[System.Text.Json.Serialization.JsonPropertyName("batch_id")]
public string BatchId { get; set; } = default!;
/// <summary>
/// 获取或设置商户明细单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_detail_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_detail_no")]
public string OutDetailNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信明细单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("detail_id")]
[System.Text.Json.Serialization.JsonPropertyName("detail_id")]
public string DetailId { get; set; } = default!;
/// <summary>
/// 获取或设置明细状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("detail_state")]
[System.Text.Json.Serialization.JsonPropertyName("detail_state")]
public string DetailState { get; set; } = default!;
/// <summary>
/// 获取或设置转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_amount")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_amount")]
public int TransferAmount { get; set; }
/// <summary>
/// 获取或设置转账备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_remark")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_remark")]
public string TransferRemark { get; set; } = default!;
/// <summary>
/// 获取或设置失败原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("fail_reason")]
[System.Text.Json.Serialization.JsonPropertyName("fail_reason")]
public string? FailReason { get; set; }
/// <summary>
/// 获取或设置收款用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = default!;
/// <summary>
/// 获取或设置收款银行类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("bank_type")]
[System.Text.Json.Serialization.JsonPropertyName("bank_type")]
public string? BankType { get; set; }
/// <summary>
/// 获取或设置收款用户姓名(需使用商户私钥解密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? UserName { get; set; }
/// <summary>
/// 获取或设置创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
/// <summary>
/// 获取或设置转账完成时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_finish_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("transfer_finish_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? TransferFinishTime { get; set; }
/// <summary>
/// 获取或设置银行退票时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("bank_refund_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("bank_refund_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? BankRefundTime { get; set; }
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/reservation/out-reservation-no/{out_reservation_no} 接口的请求。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferReservationByOutReservationNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户预约单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutReservationNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,150 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/reservation/out-reservation-no/{out_reservation_no} 接口的响应。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferReservationByOutReservationNumberResponse : WechatTenpayResponse
{
public static class Types
{
public class CloseInfo
{
/// <summary>
/// 获取或设置关闭原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("close_reason")]
[System.Text.Json.Serialization.JsonPropertyName("close_reason")]
public string CloseReason { get; set; } = default!;
/// <summary>
/// 获取或设置关闭时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("close_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("close_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CloseTime { get; set; }
}
}
/// <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; } = default!;
/// <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_reservation_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_reservation_no")]
public string OutReservationNumber { get; set; } = default!;
/// <summary>
/// 获取或设置微信预约单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("reservation_id")]
[System.Text.Json.Serialization.JsonPropertyName("reservation_id")]
public string ReservationId { get; set; } = default!;
/// <summary>
/// 获取或设置转账场景 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("transfer_scene_id")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_scene_id")]
public string TransferSceneId { get; set; } = default!;
/// <summary>
/// 获取或设置预计最晚转账日期。
/// </summary>
[Newtonsoft.Json.JsonProperty("estimated_date")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("estimated_date")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? EstimatedDate { get; set; }
/// <summary>
/// 获取或设置预计最大转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("estimated_max_amount")]
[System.Text.Json.Serialization.JsonPropertyName("estimated_max_amount")]
public int? EstimatedMaxAmount { get; set; }
/// <summary>
/// 获取或设置准确转账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("exact_amount")]
[System.Text.Json.Serialization.JsonPropertyName("exact_amount")]
public int? ExactAmount { get; set; }
/// <summary>
/// 获取或设置收款用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = default!;
/// <summary>
/// 获取或设置收款银行类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("bank_type")]
[System.Text.Json.Serialization.JsonPropertyName("bank_type")]
public string? BankType { get; set; }
/// <summary>
/// 获取或设置预约记录状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置预约受理时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("accept_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("accept_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset AcceptTime { get; set; }
/// <summary>
/// 获取或设置确认预约时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("reserve_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("reserve_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? ReserveTime { get; set; }
/// <summary>
/// 获取或设置预约关闭信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("close_info")]
[System.Text.Json.Serialization.JsonPropertyName("close_info")]
public Types.CloseInfo? CloseInfo { get; set; }
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/reservation/reservation-id/{reservation_id} 接口的请求。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferReservationByReservationIdRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置二级商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信预约单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string ReservationId { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,11 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /platsolution/mch-transfer/reservation/reservation-id/{reservation_id} 接口的响应。</para>
/// </summary>
public class GetPlatformSolutionMerchantTransferReservationByReservationIdResponse : GetPlatformSolutionMerchantTransferReservationByOutReservationNumberResponse
{
}
}

View File

@ -1,10 +1,11 @@
using System.Collections.Generic;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /partner-transfer/batches 接口的请求。</para>
/// </summary>
[WechatTenpaySensitive]
public class CreatePartnerTransferBatchRequest : WechatTenpayRequest
{
public static class Types

View File

@ -0,0 +1,7 @@
{
"sub_mchid": "1900001109",
"out_bill_no": "plfk2020042013",
"transfer_bill_no": "1330000071100999991182020050700019480001",
"state": "CANCELING",
"update_time": "2015-05-20T13:29:35.120+08:00"
}

View File

@ -0,0 +1,11 @@
{
"sub_mchid": "1900001109",
"agreement_list": [
{
"agreement_code": "1",
"agreement_version": "20230101",
"sign_organization": "示例有限责任公司",
"sign_time": "2015-05-20T13:29:35.120+08:00"
}
]
}

View File

@ -0,0 +1,6 @@
{
"sub_mchid": "1900001109",
"authorization_state": "AUTHORIZE_PROCESSING",
"accept_time": "2015-05-20T13:29:35.120+08:00",
"authorize_time": "2015-05-20T13:29:35.120+08:00"
}

View File

@ -0,0 +1,11 @@
{
"sub_mchid": "1900001109",
"appid": "wxf636efh567hg4356",
"out_bill_no": "plfk2020042013",
"transfer_scene_id": "1000",
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"user_name": "757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45",
"transfer_amount": 400000,
"transfer_remark": "2020年4月报销",
"notify_url": "https://www.weixin.qq.com/wxpay/pay.php"
}

View File

@ -0,0 +1,9 @@
{
"sub_mchid": "1900001109",
"out_bill_no": "plfk2020042013",
"transfer_bill_no": "1330000071100999991182020050700019480001",
"create_time": "2015-05-20T13:29:35.120+08:00",
"state": "ACCEPTED",
"fail_reason": "PAYEE_ACCOUNT_ABNORMAL",
"package_info": "affffddafdfafddffda=="
}

View File

@ -0,0 +1,5 @@
{
"sub_mchid": "1900001109",
"authorization_state": "AUTHORIZE_PROCESSING",
"authorize_time": "2015-05-20T13:29:35.120+08:00"
}

View File

@ -0,0 +1,16 @@
{
"mchid": "1900001109",
"sub_mchid": "1900001121",
"out_bill_no": "plfk2020042013",
"transfer_bill_no": "1330000071100999991182020050700019480001",
"appid": "wxf636efh567hg4356",
"transfer_scene_id": "10001",
"state": "ACCEPTED",
"transfer_amount": 400000,
"transfer_remark": "2020年4月报销",
"fail_reason": "PAYEE_ACCOUNT_ABNORMAL",
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"user_name": "757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45",
"create_time": "2015-05-20T13:29:35.120+08:00",
"update_time": "2015-05-20T13:29:35.120+08:00"
}

View File

@ -0,0 +1,16 @@
{
"mchid": "1900001109",
"sub_mchid": "1900001121",
"out_bill_no": "plfk2020042013",
"transfer_bill_no": "1330000071100999991182020050700019480001",
"appid": "wxf636efh567hg4356",
"transfer_scene_id": "10001",
"state": "ACCEPTED",
"transfer_amount": 400000,
"transfer_remark": "2020年4月报销",
"fail_reason": "PAYEE_ACCOUNT_ABNORMAL",
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"user_name": "757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45",
"create_time": "2015-05-20T13:29:35.120+08:00",
"update_time": "2015-05-20T13:29:35.120+08:00"
}

View File

@ -0,0 +1,21 @@
{
"sub_mchid": "1900001109",
"sp_appid": "wxf636efh567hg4356",
"sub_appid": "wxf636efh567hg4356",
"out_batch_no": "sjzz20230223",
"batch_name": "2023年2月深圳分部报销单",
"batch_remark": "2023年2月深圳分部报销单",
"total_amount": 4000000,
"total_num": 200,
"transfer_scene_id": "1000",
"transfer_detail_list": [
{
"out_detail_no": "x23zy545Bd5436",
"transfer_amount": 200000,
"transfer_remark": "2023年2月报销",
"reservation_id": "1330000071100999991182020050700019480001",
"openid": "o-MYE42l80oelYMDE34nYD456Xoy"
}
],
"notify_url": "https://www.weixin.qq.com/wxpay/pay.php"
}

View File

@ -0,0 +1,6 @@
{
"out_batch_no": "sjzz20230223",
"batch_id": "131000011085109987515042023022300246500006",
"create_time": "2023-02-23T13:29:35+08:00",
"batch_state": "ACCEPTED"
}

View File

@ -0,0 +1,23 @@
{
"sub_mchid": "1900001109",
"sp_appid": "wxf636efh567hg4356",
"sub_appid": "wxf636efh567hg4356",
"out_reservation_no": "plfk2020042013",
"transfer_scene_id": "1000",
"estimated_date": "2019-11-22",
"estimated_max_amount": 400000,
"exact_amount": 100000,
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"user_real_name": "757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45",
"reserve_remark": "由于存在收益波动,实际到账资金可能不等于当前金额",
"notify_url": "https://www.weixin.qq.com/wxpay/pay.php",
"scene_report_data": {
"insurance_policy": {
"product_registration_no": "40058541257",
"policy_no": "202301011651",
"name": "养老保险",
"withdrawal_no": "202310410941",
"claim_no": "202310410941"
}
}
}

View File

@ -0,0 +1,8 @@
{
"sub_mchid": "1900001109",
"out_reservation_no": "plfk2020042013",
"reservation_id": "1330000071100999991182020050700019480001",
"accept_time": "2015-05-20T13:29:35.120+08:00",
"state": "ACCEPTED",
"package_info": "affffddafdfafddffda=="
}

View File

@ -0,0 +1,21 @@
{
"sp_mchid": "1900001109",
"sub_mchid": "1900001109",
"sp_appid": "wxf636efh567hg4356",
"sub_appid": "wxf636efh567hg4356",
"reservation_id": "1330000071100999991182020050700019480001",
"out_reservation_no": "plfk2020042013",
"transfer_scene_id": "1000",
"estimated_date": "2019-11-22",
"estimated_max_amount": 400000,
"exact_amount": 100000,
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"bank_type": "ICBC_DEBIT",
"state": "ACCEPTED",
"accept_time": "2015-05-20T13:29:35.120+08:00",
"reserve_time": "2015-05-20T13:29:35.120+08:00",
"close_info": {
"close_time": "2015-05-20T13:29:35.120+08:00",
"close_reason": "USER_OVERDUE_UNCONFIRMED"
}
}

View File

@ -0,0 +1,30 @@
{
"transfer_batch": {
"out_batch_no": "sjzz20230223",
"batch_id": "131000011085109987515042023022300246500006",
"sp_appid": "wxf636efh567hg4356",
"sub_mchid": "1900000109",
"sub_appid": "wxf636efh567hg4356",
"batch_state": "ACCEPTED",
"batch_name": "2023年2月深圳分部转账单",
"batch_remark": "2023年2月深圳分部报销单",
"close_reason": "MERCHANT_REVOCATION",
"total_amount": 4000000,
"total_num": 200,
"create_time": "2023-02-23T13:29:35+08:00",
"success_amount": 3900000,
"success_num": 199,
"failed_amount": 100000,
"failed_num": 1,
"transfer_scene_id": "1000"
},
"data": [
{
"detail_id": "132000011085109987515042023022300246521006",
"out_detail_no": "x23zy545Bd5436",
"detail_state": "INIT"
}
],
"offset": 0,
"limit": 20
}

View File

@ -0,0 +1,30 @@
{
"transfer_batch": {
"out_batch_no": "sjzz20230223",
"batch_id": "131000011085109987515042023022300246500006",
"sp_appid": "wxf636efh567hg4356",
"sub_mchid": "1900000109",
"sub_appid": "wxf636efh567hg4356",
"batch_state": "ACCEPTED",
"batch_name": "2023年2月深圳分部转账单",
"batch_remark": "2023年2月深圳分部报销单",
"close_reason": "MERCHANT_REVOCATION",
"total_amount": 4000000,
"total_num": 200,
"create_time": "2023-02-23T13:29:35+08:00",
"success_amount": 3900000,
"success_num": 199,
"failed_amount": 100000,
"failed_num": 1,
"transfer_scene_id": "1000"
},
"data": [
{
"detail_id": "132000011085109987515042023022300246521006",
"out_detail_no": "x23zy545Bd5436",
"detail_state": "INIT"
}
],
"offset": 0,
"limit": 20
}

View File

@ -0,0 +1,19 @@
{
"out_batch_no": "sjzz20230223",
"batch_id": "131000011085109987515042023022300246500006",
"out_detail_no": "x23zy545Bd5436",
"detail_id": "132000011085109987515042023022300246521006",
"sp_appid": "wxf636efh567hg4356",
"sub_mchid": "1900000109",
"sub_appid": "wxf636efh567hg4356",
"create_time": "2023-02-23T13:29:35+08:00",
"detail_state": "INIT",
"transfer_amount": 20000,
"transfer_remark": "2023年2月报销",
"fail_reason": "ACCOUNT_FROZEN",
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"bank_type": "ICBC_DEBIT",
"user_name": "757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45",
"transfer_finish_time": "2023-02-23T13:29:35+08:00",
"bank_refund_time": "2023-02-23T13:29:35+08:00"
}

View File

@ -0,0 +1,19 @@
{
"out_batch_no": "sjzz20230223",
"batch_id": "131000011085109987515042023022300246500006",
"out_detail_no": "x23zy545Bd5436",
"detail_id": "132000011085109987515042023022300246521006",
"sp_appid": "wxf636efh567hg4356",
"sub_mchid": "1900000109",
"sub_appid": "wxf636efh567hg4356",
"create_time": "2023-02-23T13:29:35+08:00",
"detail_state": "INIT",
"transfer_amount": 20000,
"transfer_remark": "2023年2月报销",
"fail_reason": "ACCOUNT_FROZEN",
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"bank_type": "ICBC_DEBIT",
"user_name": "757b340b45ebef5467rter35gf464344v3542sdf4t6re4tb4f54ty45t4yyry45",
"transfer_finish_time": "2023-02-23T13:29:35+08:00",
"bank_refund_time": "2023-02-23T13:29:35+08:00"
}

View File

@ -0,0 +1,21 @@
{
"sp_mchid": "1900001109",
"sub_mchid": "1900001109",
"sp_appid": "wxf636efh567hg4356",
"sub_appid": "wxf636efh567hg4356",
"reservation_id": "1330000071100999991182020050700019480001",
"out_reservation_no": "plfk2020042013",
"transfer_scene_id": "1000",
"estimated_date": "2019-11-22",
"estimated_max_amount": 400000,
"exact_amount": 100000,
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"bank_type": "ICBC_DEBIT",
"state": "ACCEPTED",
"accept_time": "2015-05-20T13:29:35.120+08:00",
"reserve_time": "2015-05-20T13:29:35.120+08:00",
"close_info": {
"close_time": "2015-05-20T13:29:35.120+08:00",
"close_reason": "USER_OVERDUE_UNCONFIRMED"
}
}

View File

@ -0,0 +1,21 @@
{
"sp_mchid": "1900001109",
"sub_mchid": "1900001109",
"sp_appid": "wxf636efh567hg4356",
"sub_appid": "wxf636efh567hg4356",
"reservation_id": "1330000071100999991182020050700019480001",
"out_reservation_no": "plfk2020042013",
"transfer_scene_id": "1000",
"estimated_date": "2019-11-22",
"estimated_max_amount": 400000,
"exact_amount": 100000,
"openid": "o-MYE42l80oelYMDE34nYD456Xoy",
"bank_type": "ICBC_DEBIT",
"state": "ACCEPTED",
"accept_time": "2015-05-20T13:29:35.120+08:00",
"reserve_time": "2015-05-20T13:29:35.120+08:00",
"close_info": {
"close_time": "2015-05-20T13:29:35.120+08:00",
"close_reason": "USER_OVERDUE_UNCONFIRMED"
}
}

View File

@ -512,6 +512,59 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
}
}
[Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /ecommerce/mch-transfer/transfer-bills")]
public async Task TestEncryptRequestSensitiveProperty_CreateEcommerceMerchantTransferBillRequest()
{
static Models.CreateEcommerceMerchantTransferBillRequest GenerateMockRequestModel()
{
return new Models.CreateEcommerceMerchantTransferBillRequest()
{
UserName = MOCK_PLAIN_STR
};
}
static void AssertMockRequestModel(Models.CreateEcommerceMerchantTransferBillRequest request, Func<string, string> decryptor)
{
Assert.NotEqual(MOCK_PLAIN_STR, request.UserName!);
Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.UserName!));
Assert.Equal(MOCK_CERT_SN, request.WechatpayCertificateSerialNumber!, ignoreCase: true);
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantRSACertificatePrivateKey))
{
using (var client = CreateMockClientUseRSA(autoEncrypt: false))
{
var request = GenerateMockRequestModel();
client.EncryptRequestSensitiveProperty(request);
AssertMockRequestModel(request, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
using (var client = CreateMockClientUseRSA(autoEncrypt: true))
{
var request = GenerateMockRequestModel();
await client.ExecuteCreateEcommerceMerchantTransferBillAsync(request);
AssertMockRequestModel(request, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantSM2CertificatePrivateKey))
{
using (var client = CreateMockClientUseSM2(autoEncrypt: false))
{
var request = GenerateMockRequestModel();
client.EncryptRequestSensitiveProperty(request);
AssertMockRequestModel(request, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
using (var client = CreateMockClientUseSM2(autoEncrypt: true))
{
var request = GenerateMockRequestModel();
await client.ExecuteCreateEcommerceMerchantTransferBillAsync(request);
AssertMockRequestModel(request, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
}
}
[Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /ecommerce/profitsharing/orders")]
public async Task TestEncryptRequestSensitiveProperty_CreateEcommerceProfitSharingOrderRequest()
{
@ -1392,6 +1445,58 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
}
}
[Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /platsolution/mch-transfer/reservation/apply")]
public async Task TestEncryptRequestSensitiveProperty_ApplyPlatformSolutionMerchantTransferReservationRequest()
{
static Models.ApplyPlatformSolutionMerchantTransferReservationRequest GenerateMockRequestModel()
{
return new Models.ApplyPlatformSolutionMerchantTransferReservationRequest()
{
UserName = MOCK_PLAIN_STR
};
}
static void AssertMockRequestModel(Models.ApplyPlatformSolutionMerchantTransferReservationRequest request, Func<string, string> decryptor)
{
Assert.NotEqual(MOCK_PLAIN_STR, request.UserName!);
Assert.Equal(MOCK_CERT_SN, request.WechatpayCertificateSerialNumber!, ignoreCase: true);
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantRSACertificatePrivateKey))
{
using (var client = CreateMockClientUseRSA(autoEncrypt: false))
{
var request = GenerateMockRequestModel();
client.EncryptRequestSensitiveProperty(request);
AssertMockRequestModel(request, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
using (var client = CreateMockClientUseRSA(autoEncrypt: true))
{
var request = GenerateMockRequestModel();
await client.ExecuteApplyPlatformSolutionMerchantTransferReservationAsync(request);
AssertMockRequestModel(request, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantSM2CertificatePrivateKey))
{
using (var client = CreateMockClientUseSM2(autoEncrypt: false))
{
var request = GenerateMockRequestModel();
client.EncryptRequestSensitiveProperty(request);
AssertMockRequestModel(request, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
using (var client = CreateMockClientUseSM2(autoEncrypt: true))
{
var request = GenerateMockRequestModel();
await client.ExecuteApplyPlatformSolutionMerchantTransferReservationAsync(request);
AssertMockRequestModel(request, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
}
}
[Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /profitsharing/orders")]
public async Task TestEncryptRequestSensitiveProperty_CreateProfitSharingOrderRequest()
{

View File

@ -9,7 +9,6 @@ using Xunit;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
{
using SKIT.FlurlHttpClient.Internal;
using SKIT.FlurlHttpClient.Primitives;
public partial class TestCase_ResponseDecryptionTests
{
@ -310,6 +309,128 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
}
}
[Fact(DisplayName = "测试用例:解密响应中的敏感数据([GET] /ecommerce/mch-transfer/transfer-bills/out-bill-no/{out_bill_no}")]
public async Task TestDecryptResponseSensitiveProperty_GetEcommerceMerchantTransferBillByOutBillNumberResponse()
{
static Models.GetEcommerceMerchantTransferBillByOutBillNumberResponse GenerateMockResponseModel(Func<string, string> encryptor)
{
return SetMockResponseRawStatusAsOk(new Models.GetEcommerceMerchantTransferBillByOutBillNumberResponse()
{
UserName = encryptor.Invoke(MOCK_PLAIN_STR)
});
}
static void AssertMockResponseModel(Models.GetEcommerceMerchantTransferBillByOutBillNumberResponse response)
{
Assert.Equal(MOCK_PLAIN_STR, response.UserName!);
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantRSACertificatePrivateKey))
{
using (var client = CreateMockClientUseRSA(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseRSA(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetEcommerceMerchantTransferBillByOutBillNumberRequest();
var response = await client.ExecuteGetEcommerceMerchantTransferBillByOutBillNumberAsync(request);
AssertMockResponseModel(response);
}
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantSM2CertificatePrivateKey))
{
using (var client = CreateMockClientUseSM2(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseSM2(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetEcommerceMerchantTransferBillByOutBillNumberRequest();
var response = await client.ExecuteGetEcommerceMerchantTransferBillByOutBillNumberAsync(request);
AssertMockResponseModel(response);
}
}
}
[Fact(DisplayName = "测试用例:解密响应中的敏感数据([GET] /ecommerce/mch-transfer/transfer-bills/transfer-bill-no/{transfer_bill_no}")]
public async Task TestDecryptResponseSensitiveProperty_GetEcommerceMerchantTransferBillByTransferBillNumberResponse()
{
static Models.GetEcommerceMerchantTransferBillByTransferBillNumberResponse GenerateMockResponseModel(Func<string, string> encryptor)
{
return SetMockResponseRawStatusAsOk(new Models.GetEcommerceMerchantTransferBillByTransferBillNumberResponse()
{
UserName = encryptor.Invoke(MOCK_PLAIN_STR)
});
}
static void AssertMockResponseModel(Models.GetEcommerceMerchantTransferBillByTransferBillNumberResponse response)
{
Assert.Equal(MOCK_PLAIN_STR, response.UserName!);
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantRSACertificatePrivateKey))
{
using (var client = CreateMockClientUseRSA(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseRSA(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetEcommerceMerchantTransferBillByTransferBillNumberRequest();
var response = await client.ExecuteGetEcommerceMerchantTransferBillByTransferBillNumberAsync(request);
AssertMockResponseModel(response);
}
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantSM2CertificatePrivateKey))
{
using (var client = CreateMockClientUseSM2(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseSM2(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetEcommerceMerchantTransferBillByTransferBillNumberRequest();
var response = await client.ExecuteGetEcommerceMerchantTransferBillByTransferBillNumberAsync(request);
AssertMockResponseModel(response);
}
}
}
[Fact(DisplayName = "测试用例:解密响应中的敏感数据([GET] /marketing/shopping-receipt/shoppingreceipts")]
public async Task TestDecryptResponseSensitiveProperty_UploadMarketingShoppingReceiptResponse()
{
@ -829,6 +950,128 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
}
}
[Fact(DisplayName = "测试用例:解密响应中的敏感数据([GET] /platsolution/mch-transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id}")]
public async Task TestDecryptResponseSensitiveProperty_GetPlatformSolutionMerchantTransferBatchDetailByDetailIdResponse()
{
static Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdResponse GenerateMockResponseModel(Func<string, string> encryptor)
{
return SetMockResponseRawStatusAsOk(new Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdResponse()
{
UserName = encryptor.Invoke(MOCK_PLAIN_STR)
});
}
static void AssertMockResponseModel(Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdResponse response)
{
Assert.Equal(MOCK_PLAIN_STR, response.UserName!);
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantRSACertificatePrivateKey))
{
using (var client = CreateMockClientUseRSA(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseRSA(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdRequest();
var response = await client.ExecuteGetPlatformSolutionMerchantTransferBatchDetailByDetailIdAsync(request);
AssertMockResponseModel(response);
}
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantSM2CertificatePrivateKey))
{
using (var client = CreateMockClientUseSM2(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseSM2(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetPlatformSolutionMerchantTransferBatchDetailByDetailIdRequest();
var response = await client.ExecuteGetPlatformSolutionMerchantTransferBatchDetailByDetailIdAsync(request);
AssertMockResponseModel(response);
}
}
}
[Fact(DisplayName = "测试用例:解密响应中的敏感数据([GET] /platsolution/mch-transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no}")]
public async Task TestDecryptResponseSensitiveProperty_GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse()
{
static Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse GenerateMockResponseModel(Func<string, string> encryptor)
{
return SetMockResponseRawStatusAsOk(new Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse()
{
UserName = encryptor.Invoke(MOCK_PLAIN_STR)
});
}
static void AssertMockResponseModel(Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberResponse response)
{
Assert.Equal(MOCK_PLAIN_STR, response.UserName!);
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantRSACertificatePrivateKey))
{
using (var client = CreateMockClientUseRSA(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseRSA(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.RSAUtility.EncryptWithECBByCertificate(RSA_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberRequest();
var response = await client.ExecuteGetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberAsync(request);
AssertMockResponseModel(response);
}
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantSM2CertificatePrivateKey))
{
using (var client = CreateMockClientUseSM2(autoDecrypt: false))
{
var response = GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!);
client.DecryptResponseSensitiveProperty(response);
AssertMockResponseModel(response);
}
using (var client = CreateMockClientUseSM2(
autoDecrypt: true,
mockResponseContent: new SystemTextJsonSerializer().Serialize(
GenerateMockResponseModel((plain) => Utilities.SM2Utility.EncryptByCertificate(SM2_PEM_CERTIFICATE, plain)!)
)
))
{
var request = new Models.GetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberRequest();
var response = await client.ExecuteGetPlatformSolutionMerchantTransferBatchDetailByOutDetailNumberAsync(request);
AssertMockResponseModel(response);
}
}
}
[Fact(DisplayName = "测试用例:解密响应中的敏感数据([GET] /smartguide/guides")]
public async Task TestDecryptResponseSensitiveProperty_QuerySmartGuidesResponse()
{