feat(tenpayv3): 新增申请修改商家简称相关接口

This commit is contained in:
Fu Diwei
2025-10-13 21:27:27 +08:00
parent 9ab7761a48
commit 0eeac87b8c
15 changed files with 295 additions and 1 deletions

View File

@@ -98,6 +98,96 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
}
#endregion
#region MerchantName
/// <summary>
/// <para>异步调用 [POST] /mchalterapply/merchantnamealterapplyment 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4016166071 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateMerchantAlterApplyMerchantNameAlterApplymentResponse> ExecuteCreateMerchantAlterApplyMerchantNameAlterApplymentAsync(this WechatTenpayClient client, Models.CreateMerchantAlterApplyMerchantNameAlterApplymentRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "mchalterapply", "merchantnamealterapplyment");
return await client.SendFlurlRequestAsJsonAsync<Models.CreateMerchantAlterApplyMerchantNameAlterApplymentResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /mchalterapply/merchantnamealterapplyment/{apply_id}/revoke 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4016166090 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.RevokeMerchantAlterApplyMerchantNameAlterApplymentResponse> ExecuteRevokeMerchantAlterApplyMerchantNameAlterApplymentAsync(this WechatTenpayClient client, Models.RevokeMerchantAlterApplyMerchantNameAlterApplymentRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Post, "mchalterapply", "merchantnamealterapplyment", request.ApplymentId, "revoke");
return await client.SendFlurlRequestAsJsonAsync<Models.RevokeMerchantAlterApplyMerchantNameAlterApplymentResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /mchalterapply/merchantnamealterapplyment/merchant/{sub_mchid}/out-request-no/{out_request_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4016166085 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetMerchantAlterApplyMerchantNameAlterApplymentByOutRequestNumberResponse> ExecuteGetMerchantAlterApplyMerchantNameAlterApplymentByOutRequestNumberAsync(this WechatTenpayClient client, Models.GetMerchantAlterApplyMerchantNameAlterApplymentByOutRequestNumberRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "mchalterapply", "merchantnamealterapplyment", "merchant", request.SubMerchantId, "out-request-no", request.OutRequestNumber);
return await client.SendFlurlRequestAsJsonAsync<Models.GetMerchantAlterApplyMerchantNameAlterApplymentByOutRequestNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /mchalterapply/merchantnamealterapplyment/{apply_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4016166074 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetMerchantAlterApplyMerchantNameAlterApplymentByApplymentIdResponse> ExecuteGetMerchantAlterApplyMerchantNameAlterApplymentByApplymentIdAsync(this WechatTenpayClient client, Models.GetMerchantAlterApplyMerchantNameAlterApplymentByApplymentIdRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateFlurlRequest(request, HttpMethod.Get, "mchalterapply", "merchantnamealterapplyment", request.ApplymentId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetMerchantAlterApplyMerchantNameAlterApplymentByApplymentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region MerchantSubject
/// <summary>
/// <para>异步调用 [POST] /mchalterapply/mchsubjectalterapplyment 接口。</para>

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /mchalterapply/merchantnamealterapplyment 接口的请求。</para>
/// </summary>
public class CreateMerchantAlterApplyMerchantNameAlterApplymentRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置特约商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置业务申请编号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_request_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_request_no")]
public string OutRequestNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商户简称。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_shortname")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_shortname")]
public string MerchantShortName { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /mchalterapply/merchantnamealterapplyment 接口的响应。</para>
/// </summary>
public class CreateMerchantAlterApplyMerchantNameAlterApplymentResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置申请单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("apply_id")]
[System.Text.Json.Serialization.JsonPropertyName("apply_id")]
public string ApplymentId { get; set; } = default!;
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /mchalterapply/merchantnamealterapplyment/{apply_id} 接口的请求。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantNameAlterApplymentByApplymentIdRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置申请单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string ApplymentId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /mchalterapply/merchantnamealterapplyment/{apply_id} 接口的响应。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantNameAlterApplymentByApplymentIdResponse : GetMerchantAlterApplyMerchantNameAlterApplymentByOutRequestNumberResponse
{
}
}

View File

@@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /mchalterapply/merchantnamealterapplyment/merchant/{sub_mchid}/out-request-no/{out_request_no} 接口的请求。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantNameAlterApplymentByOutRequestNumberRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置特约商户号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SubMerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置业务申请编号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string OutRequestNumber { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,43 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /mchalterapply/merchantnamealterapplyment/merchant/{sub_mchid}/out-request-no/{out_request_no} 接口的响应。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantNameAlterApplymentByOutRequestNumberResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置特约商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("sub_mchid")]
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
public string SubMerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置业务申请编号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_request_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_request_no")]
public string OutRequestNumber { get; set; } = default!;
/// <summary>
/// 获取或设置申请单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("apply_id")]
[System.Text.Json.Serialization.JsonPropertyName("apply_id")]
public string ApplymentId { get; set; } = default!;
/// <summary>
/// 获取或设置申请单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string ApplymentState { get; set; } = default!;
/// <summary>
/// 获取或设置驳回原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("audit_reject_reason")]
[System.Text.Json.Serialization.JsonPropertyName("audit_reject_reason")]
public string? AuditRejectReason { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /mchalterapply/merchantnamealterapplyment/{apply_id}/revoke 接口的请求。</para>
/// </summary>
public class RevokeMerchantAlterApplyMerchantNameAlterApplymentRequest : WechatTenpayRequest
{
/// <summary>
/// 获取或设置申请单号。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string ApplymentId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /mchalterapply/merchantnamealterapplyment/{apply_id}/revoke 接口的响应。</para>
/// </summary>
public class RevokeMerchantAlterApplyMerchantNameAlterApplymentResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置申请单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("apply_id")]
[System.Text.Json.Serialization.JsonPropertyName("apply_id")]
public string ApplymentId { get; set; } = default!;
/// <summary>
/// 获取或设置申请单状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string ApplymentState { get; set; } = default!;
}
}