diff --git a/docs/WechatTenpayV3/Basic_ModelDefinition.md b/docs/WechatTenpayV3/Basic_ModelDefinition.md index c7855357..5018fd33 100644 --- a/docs/WechatTenpayV3/Basic_ModelDefinition.md +++ b/docs/WechatTenpayV3/Basic_ModelDefinition.md @@ -1358,6 +1358,14 @@ - 视频上传:`UploadMerchantMediaVideo` + - 修改主体信息 + + - 提交申请单:`CreateMerchantAlterApplyMerchantSubjectAlterApplyment` + + - 撤销申请单:`RevokeMerchantAlterApplyMerchantSubjectAlterApplyment` + + - 查询申请单状态:`GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentId` / `GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumber` + - 商户开户意愿确认 - 提交申请单:`CreateApplyForSubjectApplyment` diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/ExtendedSDK/Global/WechatTenpayGlobalClient.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/ExtendedSDK/Global/WechatTenpayGlobalClient.cs index ab7e95b1..e646fbb5 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/ExtendedSDK/Global/WechatTenpayGlobalClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/ExtendedSDK/Global/WechatTenpayGlobalClient.cs @@ -78,7 +78,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.ExtendedSDK.Global /// /// /// - public async new Task SendFlurlRequestAsync(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default) + public new async Task SendFlurlRequestAsync(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 /// /// /// - public async new Task SendFlurlRequestAsJsonAsync(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default) + public new async Task SendFlurlRequestAsJsonAsync(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default) where T : WechatTenpayGlobalResponse, new() { if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest)); diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteMerchantAlterApplyExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteMerchantAlterApplyExtensions.cs new file mode 100644 index 00000000..81afa7e4 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteMerchantAlterApplyExtensions.cs @@ -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 + { + /// + /// 异步调用 [POST] /mchalterapply/mchsubjectalterapplyment 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task 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(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [POST] /mchalterapply/mchsubjectalterapplyment/{apply_id}/revoke 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task 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(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [GET] /mchalterapply/mchsubjectalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no} 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task 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(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [GET] /mchalterapply/mchsubjectalterapplyment/{apply_id} 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task 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(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/Apply4SubMerchant/GetApplyForSubMerchantApplymentByBusinessCodeResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/Apply4SubMerchant/GetApplyForSubMerchantApplymentByBusinessCodeResponse.cs index 08f6b47b..9889eaba 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/Apply4SubMerchant/GetApplyForSubMerchantApplymentByBusinessCodeResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/Apply4SubMerchant/GetApplyForSubMerchantApplymentByBusinessCodeResponse.cs @@ -1,4 +1,4 @@ -namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models { /// /// 表示 [GET] /applyment4sub/applyment/business_code/{business_code} 接口的响应。 @@ -79,6 +79,6 @@ /// [Newtonsoft.Json.JsonProperty("audit_detail")] [System.Text.Json.Serialization.JsonPropertyName("audit_detail")] - public Types.AuditDetail[]? AuditList { get; set; } + public Types.AuditDetail[]? AuditDetailList { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.cs new file mode 100644 index 00000000..59ae0b6c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.cs @@ -0,0 +1,381 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /mchalterapply/mchsubjectalterapplyment 接口的请求。 + /// + [WechatTenpaySensitive] + public class CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest : WechatTenpayRequest + { + public static class Types + { + public class BusinessLicense + { + /// + /// 获取或设置营业执照注册号。 + /// + [Newtonsoft.Json.JsonProperty("license_number")] + [System.Text.Json.Serialization.JsonPropertyName("license_number")] + public string LicenseNumber { get; set; } = string.Empty; + + /// + /// 获取或设置营业执照照片媒体文件标识 ID。 + /// + [Newtonsoft.Json.JsonProperty("license_copy")] + [System.Text.Json.Serialization.JsonPropertyName("license_copy")] + public string LicenseCopyMediaId { get; set; } = string.Empty; + + /// + /// 获取或设置营业执照有效期开始日期字符串(格式:"yyyy-MM-dd")。 + /// + [Newtonsoft.Json.JsonProperty("license_period_begin")] + [System.Text.Json.Serialization.JsonPropertyName("license_period_begin")] + public string? LicensePeriodBeginDateString { get; set; } + + /// + /// 获取或设置营业执照有效期结束日期字符串(格式:"yyyy-MM-dd" / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("license_period_end")] + [System.Text.Json.Serialization.JsonPropertyName("license_period_end")] + public string? LicensePeriodEndDateString { get; set; } + + /// + /// 获取或设置商户名称。 + /// + [Newtonsoft.Json.JsonProperty("merchant_name")] + [System.Text.Json.Serialization.JsonPropertyName("merchant_name")] + public string MerchantName { get; set; } = string.Empty; + + /// + /// 获取或设置法人姓名。 + /// + [Newtonsoft.Json.JsonProperty("legal_person")] + [System.Text.Json.Serialization.JsonPropertyName("legal_person")] + public string LegalPerson { get; set; } = string.Empty; + + /// + /// 获取或设置注册地址。 + /// + [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 + { + /// + /// 获取或设置证书类型。 + /// + [Newtonsoft.Json.JsonProperty("cert_type")] + [System.Text.Json.Serialization.JsonPropertyName("cert_type")] + public string CertificateType { get; set; } = string.Empty; + + /// + /// 获取或设置证书编号。 + /// + [Newtonsoft.Json.JsonProperty("cert_number")] + [System.Text.Json.Serialization.JsonPropertyName("cert_number")] + public string CertificateNumber { get; set; } = string.Empty; + + /// + /// 获取或设置证书照片媒体文件标识 ID。 + /// + [Newtonsoft.Json.JsonProperty("cert_copy")] + [System.Text.Json.Serialization.JsonPropertyName("cert_copy")] + public string CertificateCopyMediaId { get; set; } = string.Empty; + + /// + /// 获取或设置证书有效期开始日期字符串(格式:"yyyy-MM-dd")。 + /// + [Newtonsoft.Json.JsonProperty("cert_period_begin")] + [System.Text.Json.Serialization.JsonPropertyName("cert_period_begin")] + public string? CertificatePeriodBeginDateString { get; set; } + + /// + /// 获取或设置证书有效期结束日期字符串(格式:"yyyy-MM-dd" / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("cert_period_end")] + [System.Text.Json.Serialization.JsonPropertyName("cert_period_end")] + public string? CertificatePeriodEndDateString { get; set; } + + /// + /// 获取或设置商户名称。 + /// + [Newtonsoft.Json.JsonProperty("merchant_name")] + [System.Text.Json.Serialization.JsonPropertyName("merchant_name")] + public string MerchantName { get; set; } = string.Empty; + + /// + /// 获取或设置法人姓名。 + /// + [Newtonsoft.Json.JsonProperty("legal_person")] + [System.Text.Json.Serialization.JsonPropertyName("legal_person")] + public string LegalPerson { get; set; } = string.Empty; + + /// + /// 获取或设置注册地址。 + /// + [Newtonsoft.Json.JsonProperty("company_address")] + [System.Text.Json.Serialization.JsonPropertyName("company_address")] + public string? CompanyAddress { get; set; } + } + + public class LegalPerson + { + /// + /// 获取或设置证件持有人类型。 + /// + [Newtonsoft.Json.JsonProperty("id_holder_type")] + [System.Text.Json.Serialization.JsonPropertyName("id_holder_type")] + public string? IdHolderType { get; set; } + + /// + /// 获取或设置证件类型。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_type")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_type")] + public string? IdentityType { get; set; } + + /// + /// 获取或设置证件姓名(需使用平台公钥/证书加密)。 + /// + [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; } + + /// + /// 获取或设置证件号码(需使用平台公钥/证书加密)。 + /// + [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; } + + /// + /// 获取或设置证件地址(需使用平台公钥/证书加密)。 + /// + [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; } + + /// + /// 获取或设置证件有效期开始日期字符串(格式:yyyy-MM-dd)。 + /// + [Newtonsoft.Json.JsonProperty("card_period_begin")] + [System.Text.Json.Serialization.JsonPropertyName("card_period_begin")] + public string? IdPeriodBeginDateString { get; set; } + + /// + /// 获取或设置证件有效期结束日期字符串(格式:yyyy-MM-dd / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("card_period_end")] + [System.Text.Json.Serialization.JsonPropertyName("card_period_end")] + public string? IdPeriodEndDateString { get; set; } + + /// + /// 获取或设置证件正面照片媒体文件标识 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_front")] + [System.Text.Json.Serialization.JsonPropertyName("card_front")] + public string? IdFrontCopyMediaId { get; set; } + + /// + /// 获取或设置证件反面照片媒体文件标识 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_back")] + [System.Text.Json.Serialization.JsonPropertyName("card_back")] + public string? IdBackCopyMediaId { get; set; } + + /// + /// 获取或设置法人代表授权函媒体文件标识。 + /// + [Newtonsoft.Json.JsonProperty("authorize_letter_copy")] + [System.Text.Json.Serialization.JsonPropertyName("authorize_letter_copy")] + public string? AuthorizeLetterCopyMediaId { get; set; } + + /// + /// 获取或设置法人是否为受益人。 + /// + [Newtonsoft.Json.JsonProperty("as_ubo")] + [System.Text.Json.Serialization.JsonPropertyName("as_ubo")] + public bool? AsUBO { get; set; } + } + + public class UBO + { + /// + /// 获取或设置证件类型。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_type")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_type")] + public string? IdentityType { get; set; } + + /// + /// 获取或设置证件姓名(需使用平台公钥/证书加密)。 + /// + [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; } + + /// + /// 获取或设置证件号码(需使用平台公钥/证书加密)。 + /// + [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; } + + /// + /// 获取或设置证件地址(需使用平台公钥/证书加密)。 + /// + [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; } + + /// + /// 获取或设置证件有效期开始日期字符串(格式:yyyy-MM-dd)。 + /// + [Newtonsoft.Json.JsonProperty("card_period_begin")] + [System.Text.Json.Serialization.JsonPropertyName("card_period_begin")] + public string? IdPeriodBeginDateString { get; set; } + + /// + /// 获取或设置证件有效期结束日期字符串(格式:yyyy-MM-dd / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("card_period_end")] + [System.Text.Json.Serialization.JsonPropertyName("card_period_end")] + public string? IdPeriodEndDateString { get; set; } + + /// + /// 获取或设置证件正面照片媒体文件标识 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_front")] + [System.Text.Json.Serialization.JsonPropertyName("card_front")] + public string? IdFrontCopyMediaId { get; set; } + + /// + /// 获取或设置证件反面照片媒体文件标识 ID。 + /// + [Newtonsoft.Json.JsonProperty("card_back")] + [System.Text.Json.Serialization.JsonPropertyName("card_back")] + public string? IdBackCopyMediaId { get; set; } + } + + public class Addition + { + /// + /// 获取或设置银行开户许可证 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("bank_openaccount_license")] + [System.Text.Json.Serialization.JsonPropertyName("bank_openaccount_license")] + public string? BankOpenAccountLicenseCopyMediaId { get; set; } + + /// + /// 获取或设置开户核准通知书 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("openaccount_approval")] + [System.Text.Json.Serialization.JsonPropertyName("openaccount_approval")] + public string? OpenAccountApprovalCopyMediaId { get; set; } + + /// + /// 获取或设置法人身份辅助证明 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("legal_other_prove")] + [System.Text.Json.Serialization.JsonPropertyName("legal_other_prove")] + public string? LegalPersonOtherProveCopyMediaId { get; set; } + + /// + /// 获取或设置发证机关证明 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("agency_prove")] + [System.Text.Json.Serialization.JsonPropertyName("agency_prove")] + public string? AgencyProveCopyMediaId { get; set; } + } + } + + /// + /// 获取或设置特约商户号。 + /// + [Newtonsoft.Json.JsonProperty("merchant_code")] + [System.Text.Json.Serialization.JsonPropertyName("merchant_code")] + public string SubMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置业务申请编号。 + /// + [Newtonsoft.Json.JsonProperty("out_request_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_request_no")] + public string OutRequestNumber { get; set; } = string.Empty; + + /// + /// 获取或设置主体类型。 + /// + [Newtonsoft.Json.JsonProperty("organization_type")] + [System.Text.Json.Serialization.JsonPropertyName("organization_type")] + public string SubjectType { get; set; } = string.Empty; + + /// + /// 获取或设置是否是金融机构。 + /// + [Newtonsoft.Json.JsonProperty("finance_institution")] + [System.Text.Json.Serialization.JsonPropertyName("finance_institution")] + public bool? IsFinanceInstitution { get; set; } + + /// + /// 获取或设置营业执照信息。 + /// + [Newtonsoft.Json.JsonProperty("business_license_info")] + [System.Text.Json.Serialization.JsonPropertyName("business_license_info")] + public Types.BusinessLicense? BusinessLicense { get; set; } + + /// + /// 获取或设置登记证书信息。 + /// + [Newtonsoft.Json.JsonProperty("certificate_info")] + [System.Text.Json.Serialization.JsonPropertyName("certificate_info")] + public Types.InstitutionalCertificate? InstitutionalCertificate { get; set; } + + /// + /// 获取或设置金融机构许可证信息。 + /// + [Newtonsoft.Json.JsonProperty("finance_institution_info")] + [System.Text.Json.Serialization.JsonPropertyName("finance_institution_info")] + public Types.FinanceInstitutionLicense? FinanceInstitutionLicense { get; set; } + + /// + /// 获取或设置法人身份信息。 + /// + [Newtonsoft.Json.JsonProperty("legal_person_info")] + [System.Text.Json.Serialization.JsonPropertyName("legal_person_info")] + public Types.LegalPerson? LegalPerson { get; set; } + + /// + /// 获取或设置最终受益人列表。 + /// + [Newtonsoft.Json.JsonProperty("ubo_info_list")] + [System.Text.Json.Serialization.JsonPropertyName("ubo_info_list")] + public IList? UBOList { get; set; } + + /// + /// 获取或设置补充材料信息。 + /// + [Newtonsoft.Json.JsonProperty("addition")] + [System.Text.Json.Serialization.JsonPropertyName("addition")] + public Types.Addition? Addition { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse.cs new file mode 100644 index 00000000..d5ea1774 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /mchalterapply/mchsubjectalterapplyment 接口的响应。 + /// + public class CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse : WechatTenpayResponse + { + /// + /// 获取或设置申请单号。 + /// + [Newtonsoft.Json.JsonProperty("apply_id")] + [System.Text.Json.Serialization.JsonPropertyName("apply_id")] + public string ApplymentId { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdRequest.cs new file mode 100644 index 00000000..c4643f8c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /mchalterapply/mchsubjectalterapplyment/{apply_id} 接口的请求。 + /// + public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdRequest : WechatTenpayRequest + { + /// + /// 获取或设置申请单号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string ApplymentId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse.cs new file mode 100644 index 00000000..d133e6ec --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /mchalterapply/mchsubjectalterapplyment/{apply_id} 接口的响应。 + /// + public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse : GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberRequest.cs new file mode 100644 index 00000000..63264937 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /mchalterapply/mchsubjectalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no} 接口的请求。 + /// + public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberRequest : WechatTenpayRequest + { + /// + /// 获取或设置特约商户号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string SubMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置业务申请编号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string OutRequestNumber { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse.cs new file mode 100644 index 00000000..e9ec0c46 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse.cs @@ -0,0 +1,70 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /mchalterapply/mchsubjectalterapplyment/merchant/{merchant_code}/out-request-no/{out_request_no} 接口的响应。 + /// + public class GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse : WechatTenpayResponse + { + public static class Types + { + public class AuditRejectDetail + { + /// + /// 获取或设置参数名称。 + /// + [Newtonsoft.Json.JsonProperty("param_name")] + [System.Text.Json.Serialization.JsonPropertyName("param_name")] + public string ParameterName { get; set; } = default!; + + /// + /// 获取或设置驳回原因。 + /// + [Newtonsoft.Json.JsonProperty("reject_reason")] + [System.Text.Json.Serialization.JsonPropertyName("reject_reason")] + public string RejectReason { get; set; } = default!; + } + } + + /// + /// 获取或设置特约商户号。 + /// + [Newtonsoft.Json.JsonProperty("merchant_code")] + [System.Text.Json.Serialization.JsonPropertyName("merchant_code")] + public string SubMerchantId { get; set; } = default!; + + /// + /// 获取或设置业务申请编号。 + /// + [Newtonsoft.Json.JsonProperty("out_request_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_request_no")] + public string OutRequestNumber { get; set; } = default!; + + /// + /// 获取或设置申请单号。 + /// + [Newtonsoft.Json.JsonProperty("apply_id")] + [System.Text.Json.Serialization.JsonPropertyName("apply_id")] + public string ApplymentId { get; set; } = default!; + + /// + /// 获取或设置申请单状态。 + /// + [Newtonsoft.Json.JsonProperty("state")] + [System.Text.Json.Serialization.JsonPropertyName("state")] + public string ApplymentState { get; set; } = default!; + + /// + /// 获取或设置驳回原因。 + /// + [Newtonsoft.Json.JsonProperty("audit_reject_reason")] + [System.Text.Json.Serialization.JsonPropertyName("audit_reject_reason")] + public string? AuditRejectReason { get; set; } + + /// + /// 获取或设置驳回原因详情列表。 + /// + [Newtonsoft.Json.JsonProperty("audit_reject_detail")] + [System.Text.Json.Serialization.JsonPropertyName("audit_reject_detail")] + public Types.AuditRejectDetail[]? AuditRejectDetailList { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentRequest.cs new file mode 100644 index 00000000..2130f881 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /mchalterapply/mchsubjectalterapplyment/{apply_id}/revoke 接口的请求。 + /// + public class RevokeMerchantAlterApplyMerchantSubjectAlterApplymentRequest : WechatTenpayRequest + { + /// + /// 获取或设置申请单号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string ApplymentId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse.cs new file mode 100644 index 00000000..247e33cc --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /mchalterapply/mchsubjectalterapplyment/{apply_id}/revoke 接口的响应。 + /// + public class RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse : WechatTenpayResponse + { + /// + /// 获取或设置撤销状态。 + /// + [Newtonsoft.Json.JsonProperty("result")] + [System.Text.Json.Serialization.JsonPropertyName("result")] + public string Result { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.json new file mode 100644 index 00000000..d763893a --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.json @@ -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" + } + ] +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse.json new file mode 100644 index 00000000..cf644311 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/CreateMerchantAlterApplyMerchantSubjectAlterApplymentResponse.json @@ -0,0 +1,3 @@ +{ + "apply_id": "20220617143306000013906025001" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse.json new file mode 100644 index 00000000..01109729 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByApplymentIdResponse.json @@ -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" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse.json new file mode 100644 index 00000000..01109729 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/GetMerchantAlterApplyMerchantSubjectAlterApplymentByOutRequestNumberResponse.json @@ -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" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse.json new file mode 100644 index 00000000..1f0cb622 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/MerchantAlterApply/RevokeMerchantAlterApplyMerchantSubjectAlterApplymentResponse.json @@ -0,0 +1,3 @@ +{ + "result": "SUCCESS" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs index 47fa7850..0b601a6c 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs @@ -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() + { + new Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest.Types.UBO() + { + IdName = MOCK_PLAIN_STR, + IdNumber = MOCK_PLAIN_STR, + IdAddress = MOCK_PLAIN_STR + } + } + }; + } + + static void AssertMockRequestModel(Models.CreateMerchantAlterApplyMerchantSubjectAlterApplymentRequest request, Func 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() {