feat(tenpayv3): 新增特约商户修改主体信息相关接口

This commit is contained in:
Fu Diwei 2025-04-21 16:30:48 +08:00
parent a9ae60e9e4
commit ae2815f7d2
18 changed files with 819 additions and 4 deletions

View File

@ -1358,6 +1358,14 @@
- 视频上传:`UploadMerchantMediaVideo`
- 修改主体信息
- 提交申请单:`CreateMerchantAlterApplyMerchantSubjectAlterApplyment`
- 撤销申请单:`RevokeMerchantAlterApplyMerchantSubjectAlterApplyment`
- 查询申请单状态:`GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentId` / `GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumber`
- 商户开户意愿确认
- 提交申请单:`CreateApplyForSubjectApplyment`

View File

@ -78,7 +78,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.ExtendedSDK.Global
/// <param name="httpContent"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async new Task<T> SendFlurlRequestAsync<T>(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default)
public new async Task<T> SendFlurlRequestAsync<T>(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default)
where T : WechatTenpayGlobalResponse, new()
{
if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest));
@ -95,7 +95,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.ExtendedSDK.Global
/// <param name="data"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async new Task<T> SendFlurlRequestAsJsonAsync<T>(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default)
public new async Task<T> SendFlurlRequestAsJsonAsync<T>(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default)
where T : WechatTenpayGlobalResponse, new()
{
if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest));

View File

@ -0,0 +1,99 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
{
public static class WechatTenpayClientExecuteMerchantAlterApplyExtensions
{
/// <summary>
/// <para>异步调用 [POST] /mchalterapply/mchsubjectalterapplyment 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014090649 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse> ExecuteCreateMerchantAlterApplyMerchantSubjectAlterApplymentAsync(this WechatTenpayClient client, Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest 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", "mchsubjectalterapplyment");
return await client.SendFlurlRequestAsJsonAsync<Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /mchalterapply/mchsubjectalterapplyment/{apply_id}/revoke 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014090672 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse> ExecuteRevokeMerchantAlterApplyMerchantSubjectAlterApplymentAsync(this WechatTenpayClient client, Models.RevokeMerchantAlterApplyMerchantSubjectAlterApplymentRequest 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", "mchsubjectalterapplyment", request.ApplymentId, "revoke");
return await client.SendFlurlRequestAsJsonAsync<Models.RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /mchalterapply/mchsubjectalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014090667 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse> ExecuteGetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberAsync(this WechatTenpayClient client, Models.GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberRequest 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", "mchsubjectalterapplyment", "merchant", request.SubMerchantId, "out-request-no", request.OutRequestNumber);
return await client.SendFlurlRequestAsJsonAsync<Models.GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /mchalterapply/mchsubjectalterapplyment/{apply_id} 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/partner/4014090655 ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse> ExecuteGetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdAsync(this WechatTenpayClient client, Models.GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdRequest 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", "mchsubjectalterapplyment", request.ApplymentId);
return await client.SendFlurlRequestAsJsonAsync<Models.GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /applyment4sub/applyment/business_code/{business_code} 接口的响应。</para>
@ -79,6 +79,6 @@
/// </summary>
[Newtonsoft.Json.JsonProperty("audit_detail")]
[System.Text.Json.Serialization.JsonPropertyName("audit_detail")]
public Types.AuditDetail[]? AuditList { get; set; }
public Types.AuditDetail[]? AuditDetailList { get; set; }
}
}

View File

@ -0,0 +1,381 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /mchalterapply/mchsubjectalterapplyment 接口的请求。</para>
/// </summary>
[WechatTenpaySensitive]
public class CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest : WechatTenpayRequest
{
public static class Types
{
public class BusinessLicense
{
/// <summary>
/// 获取或设置营业执照注册号。
/// </summary>
[Newtonsoft.Json.JsonProperty("license_number")]
[System.Text.Json.Serialization.JsonPropertyName("license_number")]
public string LicenseNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置营业执照照片媒体文件标识 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("license_copy")]
[System.Text.Json.Serialization.JsonPropertyName("license_copy")]
public string LicenseCopyMediaId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置营业执照有效期开始日期字符串(格式:"yyyy-MM-dd")。
/// </summary>
[Newtonsoft.Json.JsonProperty("license_period_begin")]
[System.Text.Json.Serialization.JsonPropertyName("license_period_begin")]
public string? LicensePeriodBeginDateString { get; set; }
/// <summary>
/// 获取或设置营业执照有效期结束日期字符串(格式:"yyyy-MM-dd" / "长期")。
/// </summary>
[Newtonsoft.Json.JsonProperty("license_period_end")]
[System.Text.Json.Serialization.JsonPropertyName("license_period_end")]
public string? LicensePeriodEndDateString { get; set; }
/// <summary>
/// 获取或设置商户名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_name")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
public string MerchantName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置法人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("legal_person")]
[System.Text.Json.Serialization.JsonPropertyName("legal_person")]
public string LegalPerson { get; set; } = string.Empty;
/// <summary>
/// 获取或设置注册地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("company_address")]
[System.Text.Json.Serialization.JsonPropertyName("company_address")]
public string? CompanyAddress { get; set; }
}
public class FinanceInstitutionLicense : CreateApplyForSubjectApplymentRequest.Types.Subject.Types.FinanceInstitutionLicense
{
}
public class InstitutionalCertificate
{
/// <summary>
/// 获取或设置证书类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("cert_type")]
[System.Text.Json.Serialization.JsonPropertyName("cert_type")]
public string CertificateType { get; set; } = string.Empty;
/// <summary>
/// 获取或设置证书编号。
/// </summary>
[Newtonsoft.Json.JsonProperty("cert_number")]
[System.Text.Json.Serialization.JsonPropertyName("cert_number")]
public string CertificateNumber { get; set; } = string.Empty;
/// <summary>
/// 获取或设置证书照片媒体文件标识 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("cert_copy")]
[System.Text.Json.Serialization.JsonPropertyName("cert_copy")]
public string CertificateCopyMediaId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置证书有效期开始日期字符串(格式:"yyyy-MM-dd")。
/// </summary>
[Newtonsoft.Json.JsonProperty("cert_period_begin")]
[System.Text.Json.Serialization.JsonPropertyName("cert_period_begin")]
public string? CertificatePeriodBeginDateString { get; set; }
/// <summary>
/// 获取或设置证书有效期结束日期字符串(格式:"yyyy-MM-dd" / "长期")。
/// </summary>
[Newtonsoft.Json.JsonProperty("cert_period_end")]
[System.Text.Json.Serialization.JsonPropertyName("cert_period_end")]
public string? CertificatePeriodEndDateString { get; set; }
/// <summary>
/// 获取或设置商户名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_name")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
public string MerchantName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置法人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("legal_person")]
[System.Text.Json.Serialization.JsonPropertyName("legal_person")]
public string LegalPerson { get; set; } = string.Empty;
/// <summary>
/// 获取或设置注册地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("company_address")]
[System.Text.Json.Serialization.JsonPropertyName("company_address")]
public string? CompanyAddress { get; set; }
}
public class LegalPerson
{
/// <summary>
/// 获取或设置证件持有人类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("id_holder_type")]
[System.Text.Json.Serialization.JsonPropertyName("id_holder_type")]
public string? IdHolderType { get; set; }
/// <summary>
/// 获取或设置证件类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("id_doc_type")]
[System.Text.Json.Serialization.JsonPropertyName("id_doc_type")]
public string? IdentityType { get; set; }
/// <summary>
/// 获取或设置证件姓名(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_name")]
[System.Text.Json.Serialization.JsonPropertyName("card_name")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? IdName { get; set; }
/// <summary>
/// 获取或设置证件号码(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_number")]
[System.Text.Json.Serialization.JsonPropertyName("card_number")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? IdNumber { get; set; }
/// <summary>
/// 获取或设置证件地址(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_address")]
[System.Text.Json.Serialization.JsonPropertyName("card_address")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? IdAddress { get; set; }
/// <summary>
/// 获取或设置证件有效期开始日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("card_period_begin")]
[System.Text.Json.Serialization.JsonPropertyName("card_period_begin")]
public string? IdPeriodBeginDateString { get; set; }
/// <summary>
/// 获取或设置证件有效期结束日期字符串格式yyyy-MM-dd / "长期")。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_period_end")]
[System.Text.Json.Serialization.JsonPropertyName("card_period_end")]
public string? IdPeriodEndDateString { get; set; }
/// <summary>
/// 获取或设置证件正面照片媒体文件标识 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_front")]
[System.Text.Json.Serialization.JsonPropertyName("card_front")]
public string? IdFrontCopyMediaId { get; set; }
/// <summary>
/// 获取或设置证件反面照片媒体文件标识 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_back")]
[System.Text.Json.Serialization.JsonPropertyName("card_back")]
public string? IdBackCopyMediaId { get; set; }
/// <summary>
/// 获取或设置法人代表授权函媒体文件标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("authorize_letter_copy")]
[System.Text.Json.Serialization.JsonPropertyName("authorize_letter_copy")]
public string? AuthorizeLetterCopyMediaId { get; set; }
/// <summary>
/// 获取或设置法人是否为受益人。
/// </summary>
[Newtonsoft.Json.JsonProperty("as_ubo")]
[System.Text.Json.Serialization.JsonPropertyName("as_ubo")]
public bool? AsUBO { get; set; }
}
public class UBO
{
/// <summary>
/// 获取或设置证件类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("id_doc_type")]
[System.Text.Json.Serialization.JsonPropertyName("id_doc_type")]
public string? IdentityType { get; set; }
/// <summary>
/// 获取或设置证件姓名(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_name")]
[System.Text.Json.Serialization.JsonPropertyName("card_name")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? IdName { get; set; }
/// <summary>
/// 获取或设置证件号码(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_number")]
[System.Text.Json.Serialization.JsonPropertyName("card_number")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? IdNumber { get; set; }
/// <summary>
/// 获取或设置证件地址(需使用平台公钥/证书加密)。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_address")]
[System.Text.Json.Serialization.JsonPropertyName("card_address")]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
public string? IdAddress { get; set; }
/// <summary>
/// 获取或设置证件有效期开始日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonProperty("card_period_begin")]
[System.Text.Json.Serialization.JsonPropertyName("card_period_begin")]
public string? IdPeriodBeginDateString { get; set; }
/// <summary>
/// 获取或设置证件有效期结束日期字符串格式yyyy-MM-dd / "长期")。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_period_end")]
[System.Text.Json.Serialization.JsonPropertyName("card_period_end")]
public string? IdPeriodEndDateString { get; set; }
/// <summary>
/// 获取或设置证件正面照片媒体文件标识 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_front")]
[System.Text.Json.Serialization.JsonPropertyName("card_front")]
public string? IdFrontCopyMediaId { get; set; }
/// <summary>
/// 获取或设置证件反面照片媒体文件标识 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("card_back")]
[System.Text.Json.Serialization.JsonPropertyName("card_back")]
public string? IdBackCopyMediaId { get; set; }
}
public class Addition
{
/// <summary>
/// 获取或设置银行开户许可证 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("bank_openaccount_license")]
[System.Text.Json.Serialization.JsonPropertyName("bank_openaccount_license")]
public string? BankOpenAccountLicenseCopyMediaId { get; set; }
/// <summary>
/// 获取或设置开户核准通知书 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openaccount_approval")]
[System.Text.Json.Serialization.JsonPropertyName("openaccount_approval")]
public string? OpenAccountApprovalCopyMediaId { get; set; }
/// <summary>
/// 获取或设置法人身份辅助证明 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("legal_other_prove")]
[System.Text.Json.Serialization.JsonPropertyName("legal_other_prove")]
public string? LegalPersonOtherProveCopyMediaId { get; set; }
/// <summary>
/// 获取或设置发证机关证明 MediaId。
/// </summary>
[Newtonsoft.Json.JsonProperty("agency_prove")]
[System.Text.Json.Serialization.JsonPropertyName("agency_prove")]
public string? AgencyProveCopyMediaId { get; set; }
}
}
/// <summary>
/// 获取或设置特约商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_code")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_code")]
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("organization_type")]
[System.Text.Json.Serialization.JsonPropertyName("organization_type")]
public string SubjectType { get; set; } = string.Empty;
/// <summary>
/// 获取或设置是否是金融机构。
/// </summary>
[Newtonsoft.Json.JsonProperty("finance_institution")]
[System.Text.Json.Serialization.JsonPropertyName("finance_institution")]
public bool? IsFinanceInstitution { get; set; }
/// <summary>
/// 获取或设置营业执照信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("business_license_info")]
[System.Text.Json.Serialization.JsonPropertyName("business_license_info")]
public Types.BusinessLicense? BusinessLicense { get; set; }
/// <summary>
/// 获取或设置登记证书信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("certificate_info")]
[System.Text.Json.Serialization.JsonPropertyName("certificate_info")]
public Types.InstitutionalCertificate? InstitutionalCertificate { get; set; }
/// <summary>
/// 获取或设置金融机构许可证信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("finance_institution_info")]
[System.Text.Json.Serialization.JsonPropertyName("finance_institution_info")]
public Types.FinanceInstitutionLicense? FinanceInstitutionLicense { get; set; }
/// <summary>
/// 获取或设置法人身份信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("legal_person_info")]
[System.Text.Json.Serialization.JsonPropertyName("legal_person_info")]
public Types.LegalPerson? LegalPerson { get; set; }
/// <summary>
/// 获取或设置最终受益人列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("ubo_info_list")]
[System.Text.Json.Serialization.JsonPropertyName("ubo_info_list")]
public IList<Types.UBO>? UBOList { get; set; }
/// <summary>
/// 获取或设置补充材料信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("addition")]
[System.Text.Json.Serialization.JsonPropertyName("addition")]
public Types.Addition? Addition { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /mchalterapply/mchsubjectalterapplyment 接口的响应。</para>
/// </summary>
public class CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse : 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/mchsubjectalterapplyment/{apply_id} 接口的请求。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdRequest : 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/mchsubjectalterapplyment/{apply_id} 接口的响应。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse : GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse
{
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /mchalterapply/mchsubjectalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no} 接口的请求。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberRequest : 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,70 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /mchalterapply/mchsubjectalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no} 接口的响应。</para>
/// </summary>
public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse : WechatTenpayResponse
{
public static class Types
{
public class AuditRejectDetail
{
/// <summary>
/// 获取或设置参数名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("param_name")]
[System.Text.Json.Serialization.JsonPropertyName("param_name")]
public string ParameterName { get; set; } = default!;
/// <summary>
/// 获取或设置驳回原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("reject_reason")]
[System.Text.Json.Serialization.JsonPropertyName("reject_reason")]
public string RejectReason { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置特约商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_code")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_code")]
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; }
/// <summary>
/// 获取或设置驳回原因详情列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("audit_reject_detail")]
[System.Text.Json.Serialization.JsonPropertyName("audit_reject_detail")]
public Types.AuditRejectDetail[]? AuditRejectDetailList { get; set; }
}
}

View File

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

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [POST] /mchalterapply/mchsubjectalterapplyment/{apply_id}/revoke 接口的响应。</para>
/// </summary>
public class RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置撤销状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("result")]
[System.Text.Json.Serialization.JsonPropertyName("result")]
public string Result { get; set; } = default!;
}
}

View File

@ -0,0 +1,57 @@
{
"business_license_info": {
"company_address": "广东省深圳市南山区xx路xx号",
"legal_person": "李四",
"license_copy": "0P3ng6KTIW4-Q_l2FjKLZuhHjBWoMAjmVtCz7ScmhEIThCaV-4BBgVwtNkCHO_XXqK5dE5YdOmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo",
"license_number": "914201123033363296",
"license_period_begin": "2019-06-06",
"license_period_end": "2026-06-06",
"merchant_name": "李四网络有限公司"
},
"certificate_info": {
"cert_copy": "0P3ng6KTIW4-Q_l2FjKLZuhHjBWoMAjmVtCz7ScmhEIThCaV-4BBgVwtNkCHO_XXqK5dE5YdOmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo",
"cert_number": "111111111111",
"cert_period_begin": "2019-06-06",
"cert_period_end": "2026-06-06",
"cert_type": "CERTIFICATE_TYPE_2388",
"company_address": "广东省深圳市南山区xx路xx号",
"legal_person": "李四",
"merchant_name": "xx公益团体"
},
"finance_institution": true,
"finance_institution_info": {
"finance_license_pics": [
"0P3ng6KTIW4-Q_l2FjmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo",
"0P3ng6KTIW4-Q_l2FjmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo"
],
"finance_type": "FINANCE_TYPE_BANK_AGENT"
},
"legal_person_info": {
"as_ubo": true,
"authorize_letter_copy": "47ZC6GC-vnrbEny_Ie_An5-tCpqxucuxi-vByf3Gjm7KEIUv0OF4wFNIO4kqg05InE4d2I6_H7I4",
"card_address": "pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPROvwia4ibL+F6mfjbzQIzfb3HHLEjZ4YiR/cJiCrZxnAqi+pjeKIEdkwzXRAI7FUhrfPK3SNjaBTEu9GmsugMIA9r3x887Q+ODuC8HH2nzAn7NGpE/e3yiHgWhk0ps5k5DP/2qIdGdONoDzZelrxCl/NWWNUyB93K9F+jC1JX2IMttdY+aQ6zBlw0xnOiNW6Hzy7UtC+xriudjD5APomty7/mYNxLMpRSvWKIjOv/69bDnuC4EL5Kz4jBHLiCyOb+tI0m2qhZ9evAM+Jv1z0NVa8MRtelw/wDa4SzfeespQO/0kjiwfqdfg==",
"card_back": "0P3ng6KTIW4-Q_l2FjKLZuhHjBWoMAjmVtCz7ScmhEIThCaV-4BBgVwtNkCHO_XXqK5dE5YdOmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo",
"card_front": "0P3ng6KTIW4-Q_l2FjKLZuhHjBWoMAjmVtCz7ScmhEIThCaV-4BBgVwtNkCHO_XXqK5dE5YdOmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo",
"card_name": "MZnwEx6zotwIz6ctW2/iQL5z94odwP9sKiF74RPCPztcJOScaXsaGs82HJNU3K+46ndk7pMrENiPDw==",
"card_number": "MZnwEx6zotwIz6ctW2/iQL5z94odwP9sKiF74RPCPztcJOScaXsaGs82HJNU3K+46ndk7pMrENiPDw==",
"card_period_begin": "2019-06-06",
"card_period_end": "2026-06-06",
"id_doc_type": "IDENTIFICATION_TYPE_IDCARD",
"id_holder_type": "LEGAL"
},
"merchant_code": "2492185251",
"organization_type": "SUBJECT_TYPE_ENTERPRISE",
"out_request_no": "1900013511_10000",
"ubo_info_list": [
{
"card_address": "pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPROvwia4ibL+F6mfjbzQIzfb3HHLEjZ4YiR/cJiCrZxnAqi+pjeKIEdkwzXRAI7FUhrfPK3SNjaBTEu9GmsugMIA9r3x887Q+ODuC8HH2nzAn7NGpE/e3yiHgWhk0ps5k5DP/2qIdGdONoDzZelrxCl/NWWNUyB93K9F+jC1JX2IMttdY+aQ6zBlw0xnOiNW6Hzy7UtC+xriudjD5APomty7/mYNxLMpRSvWKIjOv/69bDnuC4EL5Kz4jBHLiCyOb+tI0m2qhZ9evAM+Jv1z0NVa8MRtelw/wDa4SzfeespQO/0kjiwfqdfg==",
"card_back": "0P3ng6KTIW4-Q_l2FjKLZuhHjBWoMAjmVtCz7ScmhEIThCaV-4BBgVwtNkCHO_XXqK5dE5YdOmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo",
"card_front": "0P3ng6KTIW4-Q_l2FjKLZuhHjBWoMAjmVtCz7ScmhEIThCaV-4BBgVwtNkCHO_XXqK5dE5YdOmFJBZR9FwczhJehHhAZN6BKXQPcs-VvdSo",
"card_name": "MZnwEx6zotwIz6ctW2/iQL5z94odwP9sKiF74RPCPztcJOScaXsaGs82HJNU3K+46ndk7pMrENiPDw==",
"card_number": "MZnwEx6zotwIz6ctW2/iQL5z94odwP9sKiF74RPCPztcJOScaXsaGs82HJNU3K+46ndk7pMrENiPDw==",
"card_period_begin": "2019-06-06",
"card_period_end": "2026-06-06",
"id_doc_type": "IDENTIFICATION_TYPE_IDCARD"
}
]
}

View File

@ -0,0 +1,13 @@
{
"apply_id": "20220617143306000013906025001",
"audit_reject_detail": [
{
"param_name": "ubo_info_list.card_number_0",
"reject_reason": "身份证背面识别失败,请上传更清晰的身份证图片。"
}
],
"audit_reject_reason": "身份证背面识别失败,请上传更清晰的身份证图片。",
"merchant_code": "1900006491",
"out_request_no": "1900013511_10000",
"state": "APPLYMENT_STATE_EDITTING"
}

View File

@ -0,0 +1,13 @@
{
"apply_id": "20220617143306000013906025001",
"audit_reject_detail": [
{
"param_name": "ubo_info_list.card_number_0",
"reject_reason": "身份证背面识别失败,请上传更清晰的身份证图片。"
}
],
"audit_reject_reason": "身份证背面识别失败,请上传更清晰的身份证图片。",
"merchant_code": "1900006491",
"out_request_no": "1900013511_10000",
"state": "APPLYMENT_STATE_EDITTING"
}

View File

@ -1035,6 +1035,83 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
}
}
[Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /mchalterapply/mchsubjectalterapplyment")]
public async Task TestEncryptRequestSensitiveProperty_CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest()
{
static Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest GenerateMockRequestModel()
{
return new Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest()
{
LegalPerson = new Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.Types.LegalPerson()
{
IdName = MOCK_PLAIN_STR,
IdNumber = MOCK_PLAIN_STR,
IdAddress = MOCK_PLAIN_STR
},
UBOList = new List<Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.Types.UBO>()
{
new Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.Types.UBO()
{
IdName = MOCK_PLAIN_STR,
IdNumber = MOCK_PLAIN_STR,
IdAddress = MOCK_PLAIN_STR
}
}
};
}
static void AssertMockRequestModel(Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest request, Func<string, string> decryptor)
{
Assert.NotEqual(MOCK_PLAIN_STR, request.LegalPerson!.IdName!);
Assert.NotEqual(MOCK_PLAIN_STR, request.LegalPerson!.IdNumber!);
Assert.NotEqual(MOCK_PLAIN_STR, request.LegalPerson!.IdAddress!);
Assert.NotEqual(MOCK_PLAIN_STR, request.UBOList![0].IdName!);
Assert.NotEqual(MOCK_PLAIN_STR, request.UBOList![0].IdNumber!);
Assert.NotEqual(MOCK_PLAIN_STR, request.UBOList![0].IdAddress!);
Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.LegalPerson!.IdName!));
Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.LegalPerson!.IdNumber!));
Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.LegalPerson!.IdAddress!));
Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.UBOList![0].IdName!));
Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.UBOList![0].IdNumber!));
Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.UBOList![0].IdAddress!));
Assert.Equal(MOCK_CERT_SN, request.WechatpaySerialNumber!, ignoreCase: true);
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantRSACertificatePrivateKey))
{
using (var client = CreateMockClientUseRSA(autoEncrypt: false))
{
var request = GenerateMockRequestModel();
client.EncryptRequestSensitiveProperty(request);
AssertMockRequestModel(request, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
using (var client = CreateMockClientUseRSA(autoEncrypt: true))
{
var request = GenerateMockRequestModel();
await client.ExecuteCreateMerchantAlterApplyMerchantSubjectAlterApplymentAsync(request);
AssertMockRequestModel(request, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
}
if (!string.IsNullOrEmpty(TestConfigs.WechatMerchantSM2CertificatePrivateKey))
{
using (var client = CreateMockClientUseSM2(autoEncrypt: false))
{
var request = GenerateMockRequestModel();
client.EncryptRequestSensitiveProperty(request);
AssertMockRequestModel(request, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
using (var client = CreateMockClientUseSM2(autoEncrypt: true))
{
var request = GenerateMockRequestModel();
await client.ExecuteCreateMerchantAlterApplyMerchantSubjectAlterApplymentAsync(request);
AssertMockRequestModel(request, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, (EncodedString)cipher)!);
}
}
}
[Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /merchant-risk-manage/report-trade-union-information")]
public async Task TestEncryptRequestSensitiveProperty_CreateMerchantRiskManageTradeUnionInformationReportRequest()
{