feat(tenpayv3): 新增批量转账到零钱相关 API 封装

This commit is contained in:
Fu Diwei 2021-07-19 21:02:25 +08:00
parent c7ef593735
commit 7442c0476d
25 changed files with 1388 additions and 18 deletions

View File

@ -108,6 +108,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_5_8.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter5_1_19.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_9_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>

View File

@ -17,6 +17,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <summary>
/// <para>异步调用 [GET] /merchant/fund/balance/{account_type} 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_7_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter5_1.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
@ -36,6 +37,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <summary>
/// <para>异步调用 [GET] /merchant/fund/dayendbalance/{account_type} 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_7_4.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter5_2.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Flurl;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
{
/// <summary>
/// 为 <see cref="WechatTenpayClient"/> 提供来账识别相关的 API 扩展方法。
/// </summary>
public static class WechatTenpayClientExecuteMerchantFundIncomeRecordsExtensions
{
/// <summary>
/// <para>异步调用 [GET] /merchantfund/merchant/income-records 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_7.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.QueryMerchantFundIncomeRecordsResponse> ExecuteQueryMerchantFundIncomeRecordsAsync(this WechatTenpayClient client, Models.QueryMerchantFundIncomeRecordsRequest 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
.CreateRequest(request, HttpMethod.Get, "merchantfund", "merchant", "income-records")
.SetQueryParam("account_type", request.AccountType)
.SetQueryParam("date", request.DateString)
.SetQueryParam("limit", request.Limit);
if (request.Offset.HasValue)
flurlReq.SetQueryParam("offset", request.Offset);
return await client.SendRequestWithJsonAsync<Models.QueryMerchantFundIncomeRecordsResponse>(flurlReq, cancellationToken: cancellationToken);
}
}
}

View File

@ -0,0 +1,219 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Flurl;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
{
/// <summary>
/// 为 <see cref="WechatTenpayClient"/> 提供转账相关的 API 扩展方法。
/// </summary>
public static class WechatTenpayClientExecuteTransferExtensions
{
#region Batches
/// <summary>
/// <para>异步调用 [POST] /transfer/batches 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_1.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateTransferBatchResponse> ExecuteCreateTransferBatchAsync(this WechatTenpayClient client, Models.CreateTransferBatchRequest 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
.CreateRequest(request, HttpMethod.Post, "transfer", "batches");
return await client.SendRequestWithJsonAsync<Models.CreateTransferBatchResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /transfer/batches/batch-id/{batch_id} 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_2.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetTransferBatchByBatchIdResponse> ExecuteGetTransferBatchByBatchIdAsync(this WechatTenpayClient client, Models.GetTransferBatchByBatchIdRequest 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
.CreateRequest(request, HttpMethod.Get, "transfer", "batches", "batch-id", request.BatchId)
.SetQueryParam("need_query_detail", request.RequireQueryDetail);
if (request.Offset.HasValue)
flurlReq.SetQueryParam("offset", request.Offset.Value);
if (request.Limit.HasValue)
flurlReq.SetQueryParam("limit", request.Limit.Value);
if (!string.IsNullOrEmpty(request.DetailStatus))
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
return await client.SendRequestWithJsonAsync<Models.GetTransferBatchByBatchIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id} 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetTransferBatchDetailByDetailIdResponse> ExecuteGetTransferBatchDetailByDetailIdAsync(this WechatTenpayClient client, Models.GetTransferBatchDetailByDetailIdRequest 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
.CreateRequest(request, HttpMethod.Get, "transfer", "batches", "batch-id", request.BatchId, "details", "detail-id", request.DetailId);
return await client.SendRequestWithJsonAsync<Models.GetTransferBatchDetailByDetailIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /transfer/batches/out-batch-no/{out_batch_no} 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_4.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetTransferBatchByOutBatchNumberResponse> ExecuteGetTransferBatchByOutBatchNumberAsync(this WechatTenpayClient client, Models.GetTransferBatchByOutBatchNumberRequest 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
.CreateRequest(request, HttpMethod.Get, "transfer", "batches", "out-batch-no", request.OutBatchNumber)
.SetQueryParam("need_query_detail", request.RequireQueryDetail);
if (request.Offset.HasValue)
flurlReq.SetQueryParam("offset", request.Offset.Value);
if (request.Limit.HasValue)
flurlReq.SetQueryParam("limit", request.Limit.Value);
if (!string.IsNullOrEmpty(request.DetailStatus))
flurlReq.SetQueryParam("detail_status", request.DetailStatus);
return await client.SendRequestWithJsonAsync<Models.GetTransferBatchByOutBatchNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter3_5.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetTransferBatchDetailByOutDetailNumberResponse> ExecuteGetTransferBatchDetailByOutDetailNumberAsync(this WechatTenpayClient client, Models.GetTransferBatchDetailByOutDetailNumberRequest 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
.CreateRequest(request, HttpMethod.Get, "transfer", "batches", "out-batch-no", request.OutBatchNumber, "details", "out-detail-no", request.OutDetailNumber);
return await client.SendRequestWithJsonAsync<Models.GetTransferBatchDetailByOutDetailNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region BillReceipt
/// <summary>
/// <para>异步调用 [POST] /transfer/bill-receipt 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_1.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateTransferBillReceiptResponse> ExecuteCreateTransferBillReceiptAsync(this WechatTenpayClient client, Models.CreateTransferBillReceiptRequest 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
.CreateRequest(request, HttpMethod.Post, "transfer", "bill-receipt");
return await client.SendRequestWithJsonAsync<Models.CreateTransferBillReceiptResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /transfer/bill-receipt/{out_batch_no} 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_2.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetTransferBillReceiptByOutBatchNumberResponse> ExecuteGetTransferBillReceiptByOutBatchNumberAsync(this WechatTenpayClient client, Models.GetTransferBillReceiptByOutBatchNumberRequest 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
.CreateRequest(request, HttpMethod.Get, "transfer", "bill-receipt", request.OutBatchNumber);
return await client.SendRequestWithJsonAsync<Models.GetTransferBillReceiptByOutBatchNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Detail
/// <summary>
/// <para>异步调用 [POST] /transfer-detail/electronic-receipts 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_4.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateTransferDetailElectronicReceiptResponse> ExecuteCreateTransferDetailElectronicReceiptAsync(this WechatTenpayClient client, Models.CreateTransferDetailElectronicReceiptRequest 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
.CreateRequest(request, HttpMethod.Post, "transfer-detail", "electronic-receipts");
return await client.SendRequestWithJsonAsync<Models.CreateTransferDetailElectronicReceiptResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /transfer-detail/electronic-receipts 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_5.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetTransferDetailElectronicReceiptByOutDetailNumberResponse> ExecuteGetTransferDetailElectronicReceiptByOutDetailNumberAsync(this WechatTenpayClient client, Models.GetTransferDetailElectronicReceiptByOutDetailNumberRequest 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
.CreateRequest(request, HttpMethod.Get, "transfer-detail", "electronic-receipts")
.SetQueryParam("accept_type", request.AcceptType)
.SetQueryParam("out_detail_no", request.OutDetailNumber);
if (!string.IsNullOrEmpty(request.OutBatchNumber))
flurlReq.SetQueryParam("out_batch_no", request.OutBatchNumber);
return await client.SendRequestWithJsonAsync<Models.GetTransferDetailElectronicReceiptByOutDetailNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@ -11,13 +11,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
{
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/wechatpay/wechatpay4_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.GetEcommerceApplymentByOutRequestNumberResponse DecryptResponseEncryptedData(this WechatTenpayClient client, Models.GetEcommerceApplymentByOutRequestNumberResponse response)
public static Models.GetEcommerceApplymentByOutRequestNumberResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.GetEcommerceApplymentByOutRequestNumberResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
@ -73,13 +71,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/wechatpay/wechatpay4_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.GetEcommerceBillFundflowBillResponse DecryptResponseEncryptedData(this WechatTenpayClient client, Models.GetEcommerceBillFundflowBillResponse response)
public static Models.GetEcommerceBillFundflowBillResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.GetEcommerceBillFundflowBillResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
@ -121,13 +117,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/wechatpay/wechatpay4_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.GetMerchantServiceComplaintByComplaintIdResponse DecryptResponseEncryptedData(this WechatTenpayClient client, Models.GetMerchantServiceComplaintByComplaintIdResponse response)
public static Models.GetMerchantServiceComplaintByComplaintIdResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.GetMerchantServiceComplaintByComplaintIdResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
@ -161,13 +155,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/wechatpay/wechatpay4_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.QueryCertificatesResponse DecryptResponseEncryptedData(this WechatTenpayClient client, Models.QueryCertificatesResponse response)
public static Models.QueryCertificatesResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.QueryCertificatesResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
@ -215,13 +207,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/wechatpay/wechatpay4_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.QueryMerchantServiceComplaintsResponse DecryptResponseEncryptedData(this WechatTenpayClient client, Models.QueryMerchantServiceComplaintsResponse response)
public static Models.QueryMerchantServiceComplaintsResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.QueryMerchantServiceComplaintsResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
@ -263,13 +253,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_3.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/wechatpay/wechatpay4_3.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.QuerySmartGuidesResponse DecryptResponseEncryptedData(this WechatTenpayClient client, Models.QuerySmartGuidesResponse response)
public static Models.QuerySmartGuidesResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.QuerySmartGuidesResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
@ -323,5 +311,75 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
return response;
}
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.GetTransferBatchDetailByOutDetailNumberResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.GetTransferBatchDetailByOutDetailNumberResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
if (string.IsNullOrEmpty(client.WechatMerchantCertPrivateKey))
throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed, because of there is no merchant private key.");
if (!response.IsSuccessful())
throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed, because of the response is not successful.");
if (!string.IsNullOrEmpty(response.UserName))
{
try
{
response.UserName = Utilities.RSAUtility.DecryptWithECB(
client.WechatMerchantCertPrivateKey,
response.UserName
);
}
catch (Exception ex)
{
throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed.", ex);
}
}
return response;
}
/// <summary>
/// <para>解密响应中返回的敏感数据。该方法会改变传入的响应信息。</para>
/// </summary>
/// <param name="client"></param>
/// <param name="response"></param>
/// <returns></returns>
public static Models.GetTransferBatchDetailByDetailIdResponse DecryptResponseEncryptedData(this WechatTenpayClient client, ref Models.GetTransferBatchDetailByDetailIdResponse response)
{
if (client == null) throw new ArgumentNullException(nameof(client));
if (response == null) throw new ArgumentNullException(nameof(response));
if (string.IsNullOrEmpty(client.WechatMerchantCertPrivateKey))
throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed, because of there is no merchant private key.");
if (!response.IsSuccessful())
throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed, because of the response is not successful.");
if (!string.IsNullOrEmpty(response.UserName))
{
try
{
response.UserName = Utilities.RSAUtility.DecryptWithECB(
client.WechatMerchantCertPrivateKey,
response.UserName
);
}
catch (Exception ex)
{
throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed.", ex);
}
}
return response;
}
}
}

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /merchantfund/merchant/income-records 接口的请求。</para>
/// </summary>
public class QueryMerchantFundIncomeRecordsRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置账户类型。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string AccountType { get; set; } = string.Empty;
/// <summary>
/// 获取或设置日期格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string DateString { get; set; } = string.Empty;
/// <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; } = 10;
}
}

View File

@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /merchantfund/merchant/income-records 接口的响应。</para>
/// </summary>
public class QueryMerchantFundIncomeRecordsResponse : WechatTenpayResponse
{
public static class Types
{
public class IncomeRecord
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mchid")]
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置账户类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("account_type")]
[System.Text.Json.Serialization.JsonPropertyName("account_type")]
public string AccountType { get; set; } = default!;
/// <summary>
/// 获取或设置银行来账类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("income_record_type")]
[System.Text.Json.Serialization.JsonPropertyName("income_record_type")]
public string IncomeRecordType { get; set; } = default!;
/// <summary>
/// 获取或设置银行来账微信单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("income_record_id")]
[System.Text.Json.Serialization.JsonPropertyName("income_record_id")]
public string IncomeRecordId { get; set; } = default!;
/// <summary>
/// 获取或设置银行来账金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("amount")]
[System.Text.Json.Serialization.JsonPropertyName("amount")]
public int Amount { get; set; }
/// <summary>
/// 获取或设置企业微信的员工工号。
/// </summary>
[Newtonsoft.Json.JsonProperty("success_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("success_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
public DateTimeOffset SuccessTime { get; set; }
/// <summary>
/// 获取或设置付款方银行名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("bank_name")]
[System.Text.Json.Serialization.JsonPropertyName("bank_name")]
public string BankName { get; set; } = default!;
/// <summary>
/// 获取或设置付款方银行户名。
/// </summary>
[Newtonsoft.Json.JsonProperty("bank_account_name")]
[System.Text.Json.Serialization.JsonPropertyName("bank_account_name")]
public string BankAccountName { get; set; } = default!;
/// <summary>
/// 获取或设置付款方银行卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("bank_account_number")]
[System.Text.Json.Serialization.JsonPropertyName("bank_account_number")]
public string BankAccountNumber { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置银行来账记录列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public Types.IncomeRecord[]? IncomeRecordList { get; set; }
/// <summary>
/// 获取或设置分页大小。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int Limit { get; set; }
/// <summary>
/// 获取或设置分页开始位置。
/// </summary>
[Newtonsoft.Json.JsonProperty("offset")]
[System.Text.Json.Serialization.JsonPropertyName("offset")]
public int Offset { get; set; }
/// <summary>
/// 获取或设置银行来账记录总数。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_count")]
[System.Text.Json.Serialization.JsonPropertyName("total_count")]
public int TotalCount { get; set; }
}
}

View File

@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /transfer/batches 接口的请求。</para>
/// </summary>
public class CreateTransferBatchRequest : 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("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string UserName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置收款用户身份证号(需使用微信支付平台公钥加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_id_card")]
[System.Text.Json.Serialization.JsonPropertyName("user_id_card")]
public string UserIdCardNumber { 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_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>
/// 获取或设置转账总金额(单位:分)。
/// </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>();
}
}

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /transfer/batches 接口的响应。</para>
/// </summary>
public class CreateTransferBatchResponse : 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.RFC3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; } = default!;
}
}

View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/batch-id/{batch_id} 接口的请求。</para>
/// </summary>
public class GetTransferBatchByBatchIdRequest : WechatTenpayRequest
{
/// <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? DetailStatus { get; set; }
}
}

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/batch-id/{batch_id} 接口的响应。</para>
/// </summary>
public class GetTransferBatchByBatchIdResponse : WechatTenpayResponse
{
public static class Types
{
public class TransferBatch : GetTransferBatchByOutBatchNumberResponse.Types.TransferBatch
{
}
public class TransferDetail : GetTransferBatchByOutBatchNumberResponse.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("transfer_detail_list")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_detail_list")]
public Types.TransferDetail[]? TransferDetailList { get; set; }
}
}

View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/out-batch-no/{out_batch_no} 接口的请求。</para>
/// </summary>
public class GetTransferBatchByOutBatchNumberRequest : WechatTenpayRequest
{
/// <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? DetailStatus { get; set; }
}
}

View File

@ -0,0 +1,192 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/out-batch-no/{out_batch_no} 接口的响应。</para>
/// </summary>
public class GetTransferBatchByOutBatchNumberResponse : WechatTenpayResponse
{
public static class Types
{
public class TransferBatch
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mchid")]
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = default!;
/// <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_status")]
[System.Text.Json.Serialization.JsonPropertyName("batch_status")]
public string BatchStatus { get; set; } = default!;
/// <summary>
/// 获取或设置批次类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("batch_type")]
[System.Text.Json.Serialization.JsonPropertyName("batch_type")]
public string BatchType { 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>
/// 获取或设置批次关闭原因。
/// </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.RFC3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
/// <summary>
/// 获取或设置批次更新时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
public DateTimeOffset? UpdateTime { 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("fail_amount")]
[System.Text.Json.Serialization.JsonPropertyName("fail_amount")]
public int FailAmount { get; set; }
/// <summary>
/// 获取或设置转账失败笔数。
/// </summary>
[Newtonsoft.Json.JsonProperty("fail_num")]
[System.Text.Json.Serialization.JsonPropertyName("fail_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_status")]
[System.Text.Json.Serialization.JsonPropertyName("detail_status")]
public string DetailStatus { 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("transfer_detail_list")]
[System.Text.Json.Serialization.JsonPropertyName("transfer_detail_list")]
public Types.TransferDetail[]? TransferDetailList { get; set; }
/// <summary>
/// 获取或设置分页开始位置。
/// </summary>
[Newtonsoft.Json.JsonProperty("offset")]
[System.Text.Json.Serialization.JsonPropertyName("offset")]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int? Limit { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id} 接口的请求。</para>
/// </summary>
public class GetTransferBatchDetailByDetailIdRequest : WechatTenpayRequest
{
/// <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,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/batch-id/{batch_id}/details/detail-id/{detail_id} 接口的响应。</para>
/// </summary>
public class GetTransferBatchDetailByDetailIdResponse : GetTransferBatchDetailByOutDetailNumberResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mchid")]
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
public string MerchantId { get; set; } = default!;
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} 接口的请求。</para>
/// </summary>
public class GetTransferBatchDetailByOutDetailNumberRequest : WechatTenpayRequest
{
/// <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,106 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/batches/out-batch-no/{out_batch_no}/details/out-detail-no/{out_detail_no} 接口的响应。</para>
/// </summary>
public class GetTransferBatchDetailByOutDetailNumberResponse : WechatTenpayResponse
{
/// <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_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_status")]
[System.Text.Json.Serialization.JsonPropertyName("detail_status")]
public string DetailStatus { 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("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string UserName { get; set; } = default!;
/// <summary>
/// 获取或设置转账发起时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("initiate_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("initiate_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
public DateTimeOffset InitiateTime { get; set; }
/// <summary>
/// 获取或设置明细更新时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
public DateTimeOffset UpdateTime { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /transfer/bill-receipt 接口的请求。</para>
/// </summary>
public class CreateTransferBillReceiptRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置商户批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_batch_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_no")]
public string OutBatchNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /transfer/bill-receipt 接口的响应。</para>
/// </summary>
public class CreateTransferBillReceiptResponse : GetTransferBillReceiptByOutBatchNumberResponse
{
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/bill-receipt/{out_batch_no} 接口的请求。</para>
/// </summary>
public class GetTransferBillReceiptByOutBatchNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置商户批次单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutBatchNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer/bill-receipt/{out_batch_no} 接口的响应。</para>
/// </summary>
public class GetTransferBillReceiptByOutBatchNumberResponse : 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("signature_no")]
[System.Text.Json.Serialization.JsonPropertyName("signature_no")]
public string SignatureNumber { get; set; } = default!;
/// <summary>
/// 获取或设置电子回单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("signature_status")]
[System.Text.Json.Serialization.JsonPropertyName("signature_status")]
public string? SignatureStatus { get; set; }
/// <summary>
/// 获取或设置电子回单文件的哈希方法。
/// </summary>
[Newtonsoft.Json.JsonProperty("hash_type")]
[System.Text.Json.Serialization.JsonPropertyName("hash_type")]
public string? HashType { get; set; }
/// <summary>
/// 获取或设置电子回单文件的哈希值。
/// </summary>
[Newtonsoft.Json.JsonProperty("hash_value")]
[System.Text.Json.Serialization.JsonPropertyName("hash_value")]
public string? HashValue { get; set; }
/// <summary>
/// 获取或设置电子回单文件的下载地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("download_url")]
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
public string? DownloadUrl { get; set; }
/// <summary>
/// 获取或设置创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
public DateTimeOffset? CreateTime { get; set; }
/// <summary>
/// 获取或设置更新时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
public DateTimeOffset? UpdateTime { get; set; }
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /transfer-detail/electronic-receipts 接口的请求。</para>
/// </summary>
public class CreateTransferDetailElectronicReceiptRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置受理类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("accept_type")]
[System.Text.Json.Serialization.JsonPropertyName("accept_type")]
public string AcceptType { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_batch_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_no")]
public string? OutBatchNumber { get; set; }
/// <summary>
/// 获取或设置商户明细单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_detail_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_detail_no")]
public string OutDetailNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /transfer-detail/electronic-receipts 接口的响应。</para>
/// </summary>
public class CreateTransferDetailElectronicReceiptResponse : GetTransferDetailElectronicReceiptByOutDetailNumberResponse
{
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer-detail/electronic-receipts 接口的请求。</para>
/// </summary>
public class GetTransferDetailElectronicReceiptByOutDetailNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置受理类型。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string AcceptType { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户批次单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? OutBatchNumber { get; set; }
/// <summary>
/// 获取或设置商户明细单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutDetailNumber { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /transfer-detail/electronic-receipts 接口的响应。</para>
/// </summary>
public class GetTransferDetailElectronicReceiptByOutDetailNumberResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置受理类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("accept_type")]
[System.Text.Json.Serialization.JsonPropertyName("accept_type")]
public string AcceptType { get; set; } = default!;
/// <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("out_detail_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_detail_no")]
public string OutDetailNumber { get; set; } = default!;
/// <summary>
/// 获取或设置电子回单申请单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("signature_no")]
[System.Text.Json.Serialization.JsonPropertyName("signature_no")]
public string SignatureNumber { get; set; } = default!;
/// <summary>
/// 获取或设置电子回单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("signature_status")]
[System.Text.Json.Serialization.JsonPropertyName("signature_status")]
public string? SignatureStatus { get; set; }
/// <summary>
/// 获取或设置电子回单文件的哈希方法。
/// </summary>
[Newtonsoft.Json.JsonProperty("hash_type")]
[System.Text.Json.Serialization.JsonPropertyName("hash_type")]
public string? HashType { get; set; }
/// <summary>
/// 获取或设置电子回单文件的哈希值。
/// </summary>
[Newtonsoft.Json.JsonProperty("hash_value")]
[System.Text.Json.Serialization.JsonPropertyName("hash_value")]
public string? HashValue { get; set; }
/// <summary>
/// 获取或设置电子回单文件的下载地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("download_url")]
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
public string? DownloadUrl { get; set; }
}
}