feat(tenpayv3): 新增企业支付相关接口

This commit is contained in:
Fu Diwei
2025-10-11 15:37:59 +08:00
parent b36c12c115
commit e34d398c17
46 changed files with 1908 additions and 45 deletions

View File

@@ -0,0 +1,329 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
{
public static class WechatTenpayClientExecuteWeBusinessPayExtensions
{
#region Bill
/// <summary>
/// <para>异步调用 [POST] /webizpay/bill/trade-bill 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507142 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayBillTradeBillResponse> ExecuteGetWeBusinessPayBillTradeBillAsync(this WechatTenpayClient client, Models.GetWeBusinessPayBillTradeBillRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "webizpay", "bill", "trade-bill");
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayBillTradeBillResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /webizpay/bill/proof 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507157 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayBillProofResponse> ExecuteGetWeBusinessPayBillProofAsync(this WechatTenpayClient client, Models.GetWeBusinessPayBillProofRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "webizpay", "bill", "proof");
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayBillProofResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region Employees
/// <summary>
/// <para>异步调用 [POST] /webizpay/employees/{employee_id}/quota-cards 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507148 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateWeBusinessPayEmployeeQuotaCardResponse> ExecuteCreateWeBusinessPayEmployeeQuotaCardAsync(this WechatTenpayClient client, Models.CreateWeBusinessPayEmployeeQuotaCardRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "webizpay", "employees", request.EmployeeId, "quota-cards");
return await client.SendFlurlRequestAsJsonAsync<Models.CreateWeBusinessPayEmployeeQuotaCardResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /webizpay/employees/{employee_id}/out-quota-cards/{out_card_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4015001625 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayEmployeeQuotaCardByOutCardNumberResponse> ExecuteGetWeBusinessPayEmployeeQuotaCardByOutCardNumberAsync(this WechatTenpayClient client, Models.GetWeBusinessPayEmployeeQuotaCardByOutCardNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "webizpay", "employees", request.EmployeeId, "out-quota-cards", request.OutCardNumber)
.SetQueryParam("sp_mchid", request.MerchantId)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayEmployeeQuotaCardByOutCardNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /webizpay/employees/{employee_id}/quota-cards/{card_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507119 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayEmployeeQuotaCardByCardNumberResponse> ExecuteGetWeBusinessPayEmployeeQuotaCardByCardNumberAsync(this WechatTenpayClient client, Models.GetWeBusinessPayEmployeeQuotaCardByCardNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "webizpay", "employees", request.EmployeeId, "quota-cards", request.CardNumber)
.SetQueryParam("sp_mchid", request.MerchantId)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayEmployeeQuotaCardByCardNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /webizpay/employees/{employee_id}/revoke 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507156 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.RevokeGetWeBusinessPayEmployeeResponse> ExecuteRevokeGetWeBusinessPayEmployeeAsync(this WechatTenpayClient client, Models.RevokeGetWeBusinessPayEmployeeRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "webizpay", "employees", request.EmployeeId, "revoke");
return await client.SendFlurlRequestAsJsonAsync<Models.RevokeGetWeBusinessPayEmployeeResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /webizpay/employees/{employee_id}/quota-cards/{card_no}/cancel 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507127 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CancelWeBusinessPayEmployeeQuotaCardResponse> ExecuteCancelWeBusinessPayEmployeeQuotaCardAsync(this WechatTenpayClient client, Models.CancelWeBusinessPayEmployeeQuotaCardRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "webizpay", "employees", request.EmployeeId, "quota-cards", request.CardNumber, "cancel");
return await client.SendFlurlRequestAsJsonAsync<Models.CancelWeBusinessPayEmployeeQuotaCardResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /webizpay/employees/{employee_id}/quota-cards/{card_no}/payment-url 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507160 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayEmployeeQuotaCardPaymentUrlResponse> ExecuteGetWeBusinessPayEmployeeQuotaCardPaymentUrlAsync(this WechatTenpayClient client, Models.GetWeBusinessPayEmployeeQuotaCardPaymentUrlRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "webizpay", "employees", request.EmployeeId, "quota-cards", request.CardNumber, "payment-url")
.SetQueryParam("sp_mchid", request.MerchantId)
.SetQueryParam("sub_mchid", request.SubMerchantId)
.SetQueryParam("application_type", request.ApplicationType);
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayEmployeeQuotaCardPaymentUrlResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region Stores
/// <summary>
/// <para>异步调用 [POST] /webizpay/stores/entity-matches 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507136 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateWeBusinessPayStoreEntityMatchResponse> ExecuteCreateWeBusinessPayStoreEntityMatchAsync(this WechatTenpayClient client, Models.CreateWeBusinessPayStoreEntityMatchRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "webizpay", "stores", "entity-matches");
return await client.SendFlurlRequestAsJsonAsync<Models.CreateWeBusinessPayStoreEntityMatchResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /webizpay/stores/entity-matches/{batch_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507133 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayStoreEntityMatchByBatchIdResponse> ExecuteGetWeBusinessPayStoreEntityMatchByBatchIdAsync(this WechatTenpayClient client, Models.GetWeBusinessPayStoreEntityMatchByBatchIdRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "webizpay", "stores", "entity-matches", request.BatchId)
.SetQueryParam("sp_mchid", request.MerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayStoreEntityMatchByBatchIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region Users
/// <summary>
/// <para>异步调用 [GET] /webizpay/users/{user_id}/authorization-state 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507163 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayUserAuthorizationStateResponse> ExecuteGetWeBusinessPayUserAuthorizationStateAsync(this WechatTenpayClient client, Models.GetWeBusinessPayUserAuthorizationStateRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "webizpay", "users", request.UserId, "authorization-state")
.SetQueryParam("sp_mchid", request.MerchantId)
.SetQueryParam("sub_mchid", request.SubMerchantId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayUserAuthorizationStateResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /webizpay/users/{user_id}/authorization-url 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014507153 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetWeBusinessPayUserAuthorizationUrlResponse> ExecuteGetWeBusinessPayUserAuthorizationUrlAsync(this WechatTenpayClient client, Models.GetWeBusinessPayUserAuthorizationUrlRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (request.MerchantId is null)
request.MerchantId = client.Credentials.MerchantId;
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "webizpay", "users", request.UserId, "authorization-url");
return await client.SendFlurlRequestAsJsonAsync<Models.GetWeBusinessPayUserAuthorizationUrlResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
}
}

View File

@@ -66,7 +66,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
public DateTimeOffset? AuthorizationCancelTime { get; set; }
/// <summary>
/// 获取或设置最近一次解除授权时间。
/// 获取或设置最近一次授权时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorization_success_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]

View File

@@ -0,0 +1,50 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/bill/proof 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayBillProofRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置开始日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("start_date")]
[System.Text.Json.Serialization.JsonPropertyName("start_date")]
public string StartDateString { get; set; } = string.Empty;
/// <summary>
/// 获取或设置结束日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("end_date")]
[System.Text.Json.Serialization.JsonPropertyName("end_date")]
public string EndDateString { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户主体名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("entity_name")]
[System.Text.Json.Serialization.JsonPropertyName("entity_name")]
public string? EntityName { get; set; }
/// <summary>
/// 获取或设置商户操作流水号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_operation_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_operation_id")]
public string? OutOperationId { get; set; }
}
}

View File

@@ -0,0 +1,91 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/bill/proof 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayBillProofResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置开始日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("start_date")]
[System.Text.Json.Serialization.JsonPropertyName("start_date")]
public string StartDateString { get; set; } = default!;
/// <summary>
/// 获取或设置结束日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("end_date")]
[System.Text.Json.Serialization.JsonPropertyName("end_date")]
public string EndDateString { get; set; } = default!;
/// <summary>
/// 获取或设置商户主体名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("entity_name")]
[System.Text.Json.Serialization.JsonPropertyName("entity_name")]
public string? EntityName { get; set; }
/// <summary>
/// 获取或设置商户操作流水号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_operation_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_operation_id")]
public string OutOperationId { get; set; } = default!;
/// <summary>
/// 获取或设置微信支付操作流水号。
/// </summary>
[Newtonsoft.Json.JsonProperty("operation_id")]
[System.Text.Json.Serialization.JsonPropertyName("operation_id")]
public string OperationId { get; set; } = default!;
/// <summary>
/// 获取或设置出资凭证申请单单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("proof_id")]
[System.Text.Json.Serialization.JsonPropertyName("proof_id")]
public string ProofId { get; set; } = default!;
/// <summary>
/// 获取或设置账单下载地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("download_url")]
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
public string DownloadUrl { get; set; } = default!;
/// <summary>
/// 获取或设置创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("created_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("created_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
/// <summary>
/// 获取或设置更新时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("updated_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("updated_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset UpdateTime { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/bill/trade-bill 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayBillTradeBillRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置账单日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("date")]
[System.Text.Json.Serialization.JsonPropertyName("date")]
public string BillDateString { get; set; } = string.Empty;
/// <summary>
/// 获取或设置账单类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string BillType { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,57 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/bill/trade-bill 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayBillTradeBillResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置账单日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("date")]
[System.Text.Json.Serialization.JsonPropertyName("date")]
public string BillDateString { get; set; } = default!;
/// <summary>
/// 获取或设置账单类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string BillType { get; set; } = default!;
/// <summary>
/// 获取或设置哈希类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("hash_type")]
[System.Text.Json.Serialization.JsonPropertyName("hash_type")]
public string HashType { get; set; } = default!;
/// <summary>
/// 获取或设置哈希值。
/// </summary>
[Newtonsoft.Json.JsonProperty("hash_value")]
[System.Text.Json.Serialization.JsonPropertyName("hash_value")]
public string HashValue { get; set; } = default!;
/// <summary>
/// 获取或设置账单下载地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("download_url")]
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
public string DownloadUrl { get; set; } = default!;
}
}

View File

@@ -0,0 +1,43 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/employees/{employee_id}/quota-cards/{card_no}/cancel 接口的请求。</para>
/// </summary>
public class CancelWeBusinessPayEmployeeQuotaCardRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string EmployeeId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string CardNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置作废原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("reason")]
[System.Text.Json.Serialization.JsonPropertyName("reason")]
public string Reason { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,54 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/employees/{employee_id}/quota-cards/{card_no}/cancel 接口的响应。</para>
/// </summary>
public class CancelWeBusinessPayEmployeeQuotaCardResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("employee_id")]
[System.Text.Json.Serialization.JsonPropertyName("employee_id")]
public string EmployeeId { get; set; } = default!;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_no")]
[System.Text.Json.Serialization.JsonPropertyName("card_no")]
public string CardNumber { get; set; } = default!;
/// <summary>
/// 获取或设置卡片状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_state")]
[System.Text.Json.Serialization.JsonPropertyName("card_state")]
public string CardState { get; set; } = default!;
/// <summary>
/// 获取或设置卡片失效时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_disabled_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("card_disabled_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset DisableTime { get; set; }
}
}

View File

@@ -0,0 +1,75 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/employees/{employee_id}/quota-cards 接口的请求。</para>
/// </summary>
public class CreateWeBusinessPayEmployeeQuotaCardRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string EmployeeId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_card_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_card_no")]
public string OutCardNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业支付卡模板 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_template_id")]
[System.Text.Json.Serialization.JsonPropertyName("card_template_id")]
public string CardTemplateId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置可用金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("amount")]
[System.Text.Json.Serialization.JsonPropertyName("amount")]
public int Amount { get; set; }
/// <summary>
/// 获取或设置有效期结束时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("effective_end_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("effective_end_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset EffectiveEndTime { get; set; }
/// <summary>
/// 获取或设置卡片名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_name")]
[System.Text.Json.Serialization.JsonPropertyName("card_name")]
public string CardName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置卡片备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_remark")]
[System.Text.Json.Serialization.JsonPropertyName("card_remark")]
public string? CardRemark { get; set; }
}
}

View File

@@ -0,0 +1,63 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/employees/{employee_id}/quota-cards 接口的响应。</para>
/// </summary>
public class CreateWeBusinessPayEmployeeQuotaCardResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("employee_id")]
[System.Text.Json.Serialization.JsonPropertyName("employee_id")]
public string EmployeeId { get; set; } = default!;
/// <summary>
/// 获取或设置商户卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_card_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_card_no")]
public string OutCardNumber { get; set; } = default!;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_no")]
[System.Text.Json.Serialization.JsonPropertyName("card_no")]
public string CardNumber { get; set; } = default!;
/// <summary>
/// 获取或设置有效期开始时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("effective_begin_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("effective_begin_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset EffectiveBeginTime { get; set; }
/// <summary>
/// 获取或设置有效期结束时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("effective_end_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("effective_end_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset EffectiveEndTime { get; set; }
}
}

View File

@@ -0,0 +1,36 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/employees/{employee_id}/quota-cards/{card_no} 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayEmployeeQuotaCardByCardNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string EmployeeId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string CardNumber { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/employees/{employee_id}/quota-cards/{card_no} 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayEmployeeQuotaCardByCardNumberResponse : GetWeBusinessPayEmployeeQuotaCardByOutCardNumberResponse
{
}
}

View File

@@ -0,0 +1,36 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/employees/{employee_id}/out-quota-cards/{out_card_no} 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayEmployeeQuotaCardByOutCardNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string EmployeeId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户卡号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutCardNumber { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,151 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/employees/{employee_id}/out-quota-cards/{out_card_no} 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayEmployeeQuotaCardByOutCardNumberResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("employee_id")]
[System.Text.Json.Serialization.JsonPropertyName("employee_id")]
public string EmployeeId { get; set; } = default!;
/// <summary>
/// 获取或设置商户卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_card_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_card_no")]
public string OutCardNumber { get; set; } = default!;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_no")]
[System.Text.Json.Serialization.JsonPropertyName("card_no")]
public string CardNumber { get; set; } = default!;
/// <summary>
/// 获取或设置企业支付卡模板 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_template_id")]
[System.Text.Json.Serialization.JsonPropertyName("card_template_id")]
public string CardTemplateId { get; set; } = default!;
/// <summary>
/// 获取或设置使用规则。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_rule")]
[System.Text.Json.Serialization.JsonPropertyName("card_rule")]
public string CardRule { get; set; } = default!;
/// <summary>
/// 获取或设置退款规则。
/// </summary>
[Newtonsoft.Json.JsonProperty("refund_rule")]
[System.Text.Json.Serialization.JsonPropertyName("refund_rule")]
public string RefundRule { 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("remain_amount")]
[System.Text.Json.Serialization.JsonPropertyName("remain_amount")]
public int RemainAmount { get; set; }
/// <summary>
/// 获取或设置有效期开始时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("effective_begin_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("effective_begin_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset EffectiveBeginTime { get; set; }
/// <summary>
/// 获取或设置有效期结束时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("effective_end_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("effective_end_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset EffectiveEndTime { get; set; }
/// <summary>
/// 获取或设置卡片状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_state")]
[System.Text.Json.Serialization.JsonPropertyName("card_state")]
public string CardState { get; set; } = default!;
/// <summary>
/// 获取或设置卡片名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_name")]
[System.Text.Json.Serialization.JsonPropertyName("card_name")]
public string CardName { get; set; } = default!;
/// <summary>
/// 获取或设置卡片备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_remark")]
[System.Text.Json.Serialization.JsonPropertyName("card_remark")]
public string? CardRemark { get; set; }
/// <summary>
/// 获取或设置卡片失效时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_disabled_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("card_disabled_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? DisableTime { get; set; }
/// <summary>
/// 获取或设置失效原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("reason")]
[System.Text.Json.Serialization.JsonPropertyName("reason")]
public string? DisableReason { get; set; }
/// <summary>
/// 获取或设置最近一次使用时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_usage_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("card_usage_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? LastUsageTime { get; set; }
/// <summary>
/// 获取或设置最近一次关联微信支付订单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("transaction_id")]
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
public string? LastTransactionId { get; set; }
}
}

View File

@@ -0,0 +1,43 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/employees/{employee_id}/quota-cards/{card_no}/payment-url 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayEmployeeQuotaCardPaymentUrlRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string EmployeeId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string CardNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业应用类型。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string ApplicationType { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,75 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/employees/{employee_id}/quota-cards/{card_no}/payment-url 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayEmployeeQuotaCardPaymentUrlResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("employee_id")]
[System.Text.Json.Serialization.JsonPropertyName("employee_id")]
public string EmployeeId { get; set; } = default!;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_no")]
[System.Text.Json.Serialization.JsonPropertyName("card_no")]
public string CardNumber { get; set; } = default!;
/// <summary>
/// 获取或设置企业应用类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("application_type")]
[System.Text.Json.Serialization.JsonPropertyName("application_type")]
public string ApplicationType { get; set; } = default!;
/// <summary>
/// 获取或设置跳转链接。
/// </summary>
[Newtonsoft.Json.JsonProperty("payment_url")]
[System.Text.Json.Serialization.JsonPropertyName("payment_url")]
public string? PaymentUrl { get; set; }
/// <summary>
/// 获取或设置小程序查询参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("mp_query")]
[System.Text.Json.Serialization.JsonPropertyName("mp_query")]
public string? MiniProgramQueryString { get; set; }
/// <summary>
/// 获取或设置小程序业务类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("mp_business_type")]
[System.Text.Json.Serialization.JsonPropertyName("mp_business_type")]
public string? MiniProgramBusinessType { get; set; }
/// <summary>
/// 获取或设置链接失效时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("expire_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset ExpireTime { get; set; }
}
}

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/employees/{employee_id}/revoke 接口的请求。</para>
/// </summary>
public class RevokeGetWeBusinessPayEmployeeRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string EmployeeId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,54 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/employees/{employee_id}/revoke 接口的响应。</para>
/// </summary>
public class RevokeGetWeBusinessPayEmployeeResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置商户企业员工 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_id")]
[System.Text.Json.Serialization.JsonPropertyName("user_id")]
public string UserId { 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("authorization_revoked_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("authorization_revoked_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset RevokeTime { get; set; }
/// <summary>
/// 获取或设置失效原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("reason")]
[System.Text.Json.Serialization.JsonPropertyName("reason")]
public string? Reason { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/stores/entity-matches 接口的请求。</para>
/// </summary>
public class CreateWeBusinessPayStoreEntityMatchRequest : WechatTenpayRequest
{
public static class Types
{
public class MatchDetail
{
/// <summary>
/// 获取或设置门店统一社会信用代码。
/// </summary>
[Newtonsoft.Json.JsonProperty("organization_code")]
[System.Text.Json.Serialization.JsonPropertyName("organization_code")]
public string OrganizationCode { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("store_name")]
[System.Text.Json.Serialization.JsonPropertyName("store_name")]
public string StoreName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置需要查询的支付产品。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_type")]
[System.Text.Json.Serialization.JsonPropertyName("product_type")]
public string? ProductType { get; set; }
}
}
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置商户主体匹配批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_batch_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_id")]
public string OutBatchId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置主体匹配明细列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("match_details")]
[System.Text.Json.Serialization.JsonPropertyName("match_details")]
public IList<Types.MatchDetail>? MatchDetailList { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/stores/entity-matches 接口的响应。</para>
/// </summary>
public class CreateWeBusinessPayStoreEntityMatchResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置商户主体匹配批次单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_batch_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_id")]
public string OutBatchId { 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("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置创建时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset CreateTime { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/stores/entity-matches/{batch_id} 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayStoreEntityMatchByBatchIdRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置微信支付主体匹配批次单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string BatchId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,70 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/stores/entity-matches/{batch_id} 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayStoreEntityMatchByBatchIdResponse : WechatTenpayResponse
{
public static class Types
{
public class MatchResult
{
/// <summary>
/// 获取或设置门店统一社会信用代码。
/// </summary>
[Newtonsoft.Json.JsonProperty("organization_code")]
[System.Text.Json.Serialization.JsonPropertyName("organization_code")]
public string OrganizationCode { get; set; } = default!;
/// <summary>
/// 获取或设置门店名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("store_name")]
[System.Text.Json.Serialization.JsonPropertyName("store_name")]
public string StoreName { get; set; } = default!;
/// <summary>
/// 获取或设置是否存在满足条件微信支付商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("has_valid_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("has_valid_mchid")]
public bool HasValidMerchantId { 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("out_batch_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_batch_id")]
public string OutBatchId { 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("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string State { get; set; } = default!;
/// <summary>
/// 获取或设置主体匹配明细列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("match_results")]
[System.Text.Json.Serialization.JsonPropertyName("match_results")]
public Types.MatchResult[] MatchResultList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/users/{user_id}/authorization-state 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayUserAuthorizationStateRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业员工 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string UserId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,76 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /webizpay/users/{user_id}/authorization-state 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayUserAuthorizationStateResponse : WechatTenpayResponse
{
public static class Types
{
public class Employee
{
/// <summary>
/// 获取或设置微信授权关系 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("employee_id")]
[System.Text.Json.Serialization.JsonPropertyName("employee_id")]
public string EmployeeId { 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("authorization_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("authorization_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset AuthorizeTime { get; set; }
/// <summary>
/// 获取或设置解除授权时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorization_revoked_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("authorization_revoked_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset? RevokeTime { 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>
/// 获取或设置商户企业员工 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_id")]
[System.Text.Json.Serialization.JsonPropertyName("user_id")]
public string UserId { get; set; } = default!;
/// <summary>
/// 获取或设置微信授权关系列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("employee_list")]
[System.Text.Json.Serialization.JsonPropertyName("employee_list")]
public Types.Employee[]? EmployeeList { get; set; }
}
}

View File

@@ -0,0 +1,43 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/users/{user_id}/authorization-url 接口的请求。</para>
/// </summary>
public class GetWeBusinessPayUserAuthorizationUrlRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayGlobalClient"/> 时的 <see cref="WechatTenpayGlobalClientOptions.MerchantId"/> 参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string? MerchantId { get; set; }
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户企业员工 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string UserId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业支付额度卡卡号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string CardNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置企业应用类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("application_type")]
[System.Text.Json.Serialization.JsonPropertyName("application_type")]
public string ApplicationType { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,68 @@
using System;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /webizpay/users/{user_id}/authorization-url 接口的响应。</para>
/// </summary>
public class GetWeBusinessPayUserAuthorizationUrlResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置微信商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置子商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置商户企业员工 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_id")]
[System.Text.Json.Serialization.JsonPropertyName("user_id")]
public string UserId { get; set; } = default!;
/// <summary>
/// 获取或设置企业应用类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("application_type")]
[System.Text.Json.Serialization.JsonPropertyName("application_type")]
public string ApplicationType { get; set; } = default!;
/// <summary>
/// 获取或设置跳转链接。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorization_url")]
[System.Text.Json.Serialization.JsonPropertyName("authorization_url")]
public string? AuthorizationUrl { get; set; }
/// <summary>
/// 获取或设置小程序查询参数。
/// </summary>
[Newtonsoft.Json.JsonProperty("mp_query")]
[System.Text.Json.Serialization.JsonPropertyName("mp_query")]
public string? MiniProgramQueryString { get; set; }
/// <summary>
/// 获取或设置小程序业务类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("mp_business_type")]
[System.Text.Json.Serialization.JsonPropertyName("mp_business_type")]
public string? MiniProgramBusinessType { get; set; }
/// <summary>
/// 获取或设置链接失效时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("expire_time")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))]
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))]
public DateTimeOffset ExpireTime { get; set; }
}
}