From 60910e8a0a8fe28f7c29ca7f9b426745742cab6a Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sun, 10 Apr 2022 21:36:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E4=BA=A4=E6=98=93=E7=BB=84=E4=BB=B6=E8=BF=9B?= =?UTF-8?q?=E4=BB=B6=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WechatApiClientExecuteShopExtensions.cs | 42 ++ .../Shop/Wxpay/ShopWxpayApplyRequest.cs | 232 ++++++++++ .../Shop/Wxpay/ShopWxpayApplyResponse.cs | 9 + .../Models/Shop/Wxpay/ShopWxpayGetRequest.cs | 9 + .../Models/Shop/Wxpay/ShopWxpayGetResponse.cs | 427 ++++++++++++++++++ .../CreateEcommerceApplymentRequest.cs | 4 +- .../Shop/Wxpay/ShopWxpayApplyRequest.json | 31 ++ .../Shop/Wxpay/ShopWxpayGetResponse.json | 60 +++ 8 files changed, 812 insertions(+), 2 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayApplyRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayGetResponse.json diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs index 168ee526..f3bfedac 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteShopExtensions.cs @@ -1189,5 +1189,47 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } #endregion + + #region Wxpay + /// + /// 异步调用 [POST] /shop/wxpay/apply 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/wxpay/apply.html + /// + /// + /// + /// + /// + public static async Task ExecuteShopWxpayApplyAsync(this WechatApiClient client, Models.ShopWxpayApplyRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateRequest(request, HttpMethod.Post, "shop", "wxpay", "apply") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /shop/wxpay/get 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/wxpay/wxpay_get.html + /// + /// + /// + /// + /// + public static async Task ExecuteShopWxpayGetAsync(this WechatApiClient client, Models.ShopWxpayGetRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateRequest(request, HttpMethod.Post, "shop", "wxpay", "get") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyRequest.cs new file mode 100644 index 00000000..0e876e9e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyRequest.cs @@ -0,0 +1,232 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/wxpay/apply 接口的请求。 + /// + public class ShopWxpayApplyRequest : WechatApiRequest, IInferable + { + public static class Types + { + public class Image + { + /// + /// 获取或设置图片名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// 获取或设置图片 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("media_id")] + [System.Text.Json.Serialization.JsonPropertyName("media_id")] + public string? MediaId { get; set; } + + /// + /// 获取或设置图片 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("pay_media_id")] + [System.Text.Json.Serialization.JsonPropertyName("pay_media_id")] + public string? PayMediaId { get; set; } + } + + public class BusinessLicense + { + /// + /// 获取或设置法定代表人姓名。 + /// + [Newtonsoft.Json.JsonProperty("legal_person")] + [System.Text.Json.Serialization.JsonPropertyName("legal_person")] + public string LegalPerson { get; set; } = string.Empty; + + /// + /// 获取或设置有效期范围字符串。 + /// + [Newtonsoft.Json.JsonProperty("business_time")] + [System.Text.Json.Serialization.JsonPropertyName("business_time")] + public string ValidPeriodString { get; set; } = string.Empty; + + /// + /// 获取或设置营业执照图片信息。 + /// + [Newtonsoft.Json.JsonProperty("wxa_business_license_copy")] + [System.Text.Json.Serialization.JsonPropertyName("wxa_business_license_copy")] + public Image BusinessLicenseCopy { get; set; } = new Image(); + } + + public class IdCard + { + /// + /// 获取或设置身份证姓名。 + /// + [Newtonsoft.Json.JsonProperty("id_card_name")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_name")] + public string IdCardName { get; set; } = string.Empty; + + /// + /// 获取或设置身份证号码。 + /// + [Newtonsoft.Json.JsonProperty("id_card_number")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_number")] + public string IdCardNumber { get; set; } = string.Empty; + + /// + /// 获取或设置身份证有效期字符串(格式:yyyy-MM-dd / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("id_card_valid_time")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_valid_time")] + public string IdCardValidDateString { get; set; } = string.Empty; + + /// + /// 获取或设置身份证人像面图片信息。 + /// + [Newtonsoft.Json.JsonProperty("wxa_id_card_copy")] + [System.Text.Json.Serialization.JsonPropertyName("wxa_id_card_copy")] + public Image IdCardFrontCopy { get; set; } = new Image(); + + /// + /// 获取或设置身份证国徽面图片信息。 + /// + [Newtonsoft.Json.JsonProperty("wxa_id_card_national")] + [System.Text.Json.Serialization.JsonPropertyName("wxa_id_card_national")] + public Image IdCardBackCopy { get; set; } = new Image(); + } + + public class IdDocument + { + /// + /// 获取或设置证件姓名。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_name")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_name")] + public string IdDocumentName { get; set; } = string.Empty; + + /// + /// 获取或设置证件号码。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_number")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_number")] + public string IdDocumentNumber { get; set; } = string.Empty; + + /// + /// 获取或设置证件有效期结束时间字符串(格式:yyyy-MM-dd / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("doc_period_end")] + [System.Text.Json.Serialization.JsonPropertyName("doc_period_end")] + public string IdDocumentPeriodEndDateString { get; set; } = string.Empty; + + /// + /// 获取或设置证件图片信息。 + /// + [Newtonsoft.Json.JsonProperty("wxa_id_doc_copy")] + [System.Text.Json.Serialization.JsonPropertyName("wxa_id_doc_copy")] + public Image IdDocumentCopy { get; set; } = new Image(); + + } + + public class Contact + { + /// + /// 获取或设置联系人类型。 + /// + [Newtonsoft.Json.JsonProperty("contact_type")] + [System.Text.Json.Serialization.JsonPropertyName("contact_type")] + public string ContactType { get; set; } = string.Empty; + + /// + /// 获取或设置电子邮箱。 + /// + [Newtonsoft.Json.JsonProperty("contact_email")] + [System.Text.Json.Serialization.JsonPropertyName("contact_email")] + public string Email { get; set; } = string.Empty; + + /// + /// 获取或设置手机号码。 + /// + [Newtonsoft.Json.JsonProperty("mobile_phone")] + [System.Text.Json.Serialization.JsonPropertyName("mobile_phone")] + public string MobileNumber { get; set; } = string.Empty; + } + + public class Qualification + { + /// + /// 获取或设置图片列表。 + /// + [Newtonsoft.Json.JsonProperty("pic_file_list")] + [System.Text.Json.Serialization.JsonPropertyName("pic_file_list")] + public IList ImageList { get; set; } = new List(); + } + + public class Addition : Qualification + { + } + } + + /// + /// 获取或设置主体类型。 + /// + [Newtonsoft.Json.JsonProperty("organization_type")] + [System.Text.Json.Serialization.JsonPropertyName("organization_type")] + public int SubjectType { get; set; } + + /// + /// 获取或设置营业执照信息。 + /// + [Newtonsoft.Json.JsonProperty("business_license_info")] + [System.Text.Json.Serialization.JsonPropertyName("business_license_info")] + public Types.BusinessLicense BusinessLicense { get; set; } = new Types.BusinessLicense(); + + /// + /// 获取或设置证件类型。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_type")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_type")] + public string IdentityType { get; set; } = string.Empty; + + /// + /// 获取或设置身份证信息。 + /// + [Newtonsoft.Json.JsonProperty("id_card_info")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_info")] + public Types.IdCard? IdCard { get; set; } + + /// + /// 获取或设置其他类型证件信息。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_info")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_info")] + public Types.IdDocument? IdDocument { get; set; } + + /// + /// 获取或设置联系人信息。 + /// + [Newtonsoft.Json.JsonProperty("contact_info")] + [System.Text.Json.Serialization.JsonPropertyName("contact_info")] + public Types.Contact Contact { get; set; } = new Types.Contact(); + + /// + /// 获取或设置特殊资质信息。 + /// + [Newtonsoft.Json.JsonProperty("qualifications")] + [System.Text.Json.Serialization.JsonPropertyName("qualifications")] + public Types.Qualification? Qualification { get; set; } + + /// + /// 获取或设置补充材料信息。 + /// + [Newtonsoft.Json.JsonProperty("business_addition_pics")] + [System.Text.Json.Serialization.JsonPropertyName("business_addition_pics")] + public Types.Addition? Addition { get; set; } + + /// + /// 获取或设置补充描述。 + /// + [Newtonsoft.Json.JsonProperty("business_addition_desc")] + [System.Text.Json.Serialization.JsonPropertyName("business_addition_desc")] + public string? AdditionDescription { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyResponse.cs new file mode 100644 index 00000000..5564acb2 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayApplyResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/wxpay/apply 接口的响应。 + /// + public class ShopWxpayApplyResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetRequest.cs new file mode 100644 index 00000000..a8996553 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetRequest.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/wxpay/get 接口的请求。 + /// + public class ShopWxpayGetRequest : WechatApiRequest, IInferable + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetResponse.cs new file mode 100644 index 00000000..32816fcb --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Shop/Wxpay/ShopWxpayGetResponse.cs @@ -0,0 +1,427 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /shop/wxpay/get 接口的响应。 + /// + public class ShopWxpayGetResponse : WechatApiResponse + { + public static class Types + { + public class PayRequest + { + public static class Types + { + public class BusinessLicense + { + /// + /// 获取或设置法定代表人姓名。 + /// + [Newtonsoft.Json.JsonProperty("legal_person")] + [System.Text.Json.Serialization.JsonPropertyName("legal_person")] + public string LegalPerson { get; set; } = default!; + + /// + /// 获取或设置商户名称。 + /// + [Newtonsoft.Json.JsonProperty("merchant_name")] + [System.Text.Json.Serialization.JsonPropertyName("merchant_name")] + public string MerchantName { get; set; } = default!; + + /// + /// 获取或设置营业执照编号。 + /// + [Newtonsoft.Json.JsonProperty("business_license_number")] + [System.Text.Json.Serialization.JsonPropertyName("business_license_number")] + public string BusinessLicenseNumber { get; set; } = default!; + + /// + /// 获取或设置营业执照图片 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("business_license_copy")] + [System.Text.Json.Serialization.JsonPropertyName("business_license_copy")] + public string BusinessLicenseCopyMediaId { get; set; } = default!; + } + + public class IdCard + { + /// + /// 获取或设置身份证姓名。 + /// + [Newtonsoft.Json.JsonProperty("id_card_name")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_name")] + public string IdCardName { get; set; } = default!; + + /// + /// 获取或设置身份证号码。 + /// + [Newtonsoft.Json.JsonProperty("id_card_number")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_number")] + public string IdCardNumber { get; set; } = default!; + + /// + /// 获取或设置身份证有效期字符串(格式:yyyy-MM-dd / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("id_card_valid_time")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_valid_time")] + public string IdCardValidDateString { get; set; } = default!; + + /// + /// 获取或设置身份证人像面图片 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("id_card_copy")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_copy")] + public string IdCardFrontCopyMediaId { get; set; } = default!; + + /// + /// 获取或设置身份证国徽面图片 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("id_card_national")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_national")] + public string IdCardBackCopyMediaId { get; set; } = default!; + } + + public class IdDocument + { + /// + /// 获取或设置证件姓名。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_name")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_name")] + public string IdDocumentName { get; set; } = default!; + + /// + /// 获取或设置证件号码。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_number")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_number")] + public string IdDocumentNumber { get; set; } = default!; + + /// + /// 获取或设置证件有效期结束时间字符串(格式:yyyy-MM-dd / "长期")。 + /// + [Newtonsoft.Json.JsonProperty("doc_period_end")] + [System.Text.Json.Serialization.JsonPropertyName("doc_period_end")] + public string IdDocumentPeriodEndDateString { get; set; } = default!; + + /// + /// 获取或设置证件图片 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_copy")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_copy")] + public string IdDocumentCopyMediaId { get; set; } = default!; + + } + + public class Contact + { + /// + /// 获取或设置联系人类型。 + /// + [Newtonsoft.Json.JsonProperty("contact_type")] + [System.Text.Json.Serialization.JsonPropertyName("contact_type")] + public string ContactType { get; set; } = default!; + + /// + /// 获取或设置联系人姓名。 + /// + [Newtonsoft.Json.JsonProperty("contact_name")] + [System.Text.Json.Serialization.JsonPropertyName("contact_name")] + public string Name { get; set; } = default!; + + /// + /// 获取或设置联系人身份证号。 + /// + [Newtonsoft.Json.JsonProperty("contact_id_card_number")] + [System.Text.Json.Serialization.JsonPropertyName("contact_id_card_number")] + public string IdCardNumber { get; set; } = default!; + + /// + /// 获取或设置电子邮箱。 + /// + [Newtonsoft.Json.JsonProperty("contact_email")] + [System.Text.Json.Serialization.JsonPropertyName("contact_email")] + public string Email { get; set; } = default!; + + /// + /// 获取或设置手机号码。 + /// + [Newtonsoft.Json.JsonProperty("mobile_phone")] + [System.Text.Json.Serialization.JsonPropertyName("mobile_phone")] + public string MobileNumber { get; set; } = default!; + } + + public class SaleScene + { + /// + /// 获取或设置店铺名称。 + /// + [Newtonsoft.Json.JsonProperty("store_name")] + [System.Text.Json.Serialization.JsonPropertyName("store_name")] + public string StoreName { get; set; } = default!; + + /// + /// 获取或设置店铺链接。 + /// + [Newtonsoft.Json.JsonProperty("store_url")] + [System.Text.Json.Serialization.JsonPropertyName("store_url")] + public string? StoreUrl { get; set; } + + /// + /// 获取或设置子商户小程序 AppId。 + /// + [Newtonsoft.Json.JsonProperty("mini_program_sub_appid")] + [System.Text.Json.Serialization.JsonPropertyName("mini_program_sub_appid")] + public string? MiniProgramSubAppId { get; set; } + } + } + + /// + /// 获取或设置业务申请编号。 + /// + [Newtonsoft.Json.JsonProperty("out_request_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_request_no")] + public string OutRequestNumber { get; set; } = default!; + + /// + /// 获取或设置主体类型。 + /// + [Newtonsoft.Json.JsonProperty("organization_type")] + [System.Text.Json.Serialization.JsonPropertyName("organization_type")] + public int SubjectType { get; set; } + + /// + /// 获取或设置营业执照信息。 + /// + [Newtonsoft.Json.JsonProperty("business_license_info")] + [System.Text.Json.Serialization.JsonPropertyName("business_license_info")] + public Types.BusinessLicense BusinessLicense { get; set; } = new Types.BusinessLicense(); + + /// + /// 获取或设置证件类型。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_type")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_type")] + public string IdentityType { get; set; } = default!; + + /// + /// 获取或设置身份证信息。 + /// + [Newtonsoft.Json.JsonProperty("id_card_info")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_info")] + public Types.IdCard? IdCard { get; set; } + + /// + /// 获取或设置其他类型证件信息。 + /// + [Newtonsoft.Json.JsonProperty("id_doc_info")] + [System.Text.Json.Serialization.JsonPropertyName("id_doc_info")] + public Types.IdDocument? IdDocument { get; set; } + + /// + /// 获取或设置联系人信息。 + /// + [Newtonsoft.Json.JsonProperty("contact_info")] + [System.Text.Json.Serialization.JsonPropertyName("contact_info")] + public Types.Contact Contact { get; set; } = default!; + + /// + /// 获取或设置商户简称。 + /// + [Newtonsoft.Json.JsonProperty("merchant_shortname")] + [System.Text.Json.Serialization.JsonPropertyName("merchant_shortname")] + public string? MerchantShortName { get; set; } + + /// + /// 获取或设置是否填写结算银行账户。 + /// + [Newtonsoft.Json.JsonProperty("need_account_info")] + [System.Text.Json.Serialization.JsonPropertyName("need_account_info")] + public bool RequireBankAccount { get; set; } + + /// + /// 获取或设置销售场景信息。 + /// + [Newtonsoft.Json.JsonProperty("sales_scene_info")] + [System.Text.Json.Serialization.JsonPropertyName("sales_scene_info")] + public Types.SaleScene? SaleScene { get; set; } + } + + public class PayResponse + { + public static class Types + { + public class AccountValidation + { + /// + /// 获取或设置付款户名。 + /// + [Newtonsoft.Json.JsonProperty("account_name")] + [System.Text.Json.Serialization.JsonPropertyName("account_name")] + public string AccountName { get; set; } = default!; + + /// + /// 获取或设置付款卡号。 + /// + [Newtonsoft.Json.JsonProperty("account_no")] + [System.Text.Json.Serialization.JsonPropertyName("account_no")] + public string? AccountNumber { get; set; } + + /// + /// 获取或设置汇款金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("pay_amount")] + [System.Text.Json.Serialization.JsonPropertyName("pay_amount")] + public int PayAmount { get; set; } + + /// + /// 获取或设置收款户名。 + /// + [Newtonsoft.Json.JsonProperty("destination_account_name")] + [System.Text.Json.Serialization.JsonPropertyName("destination_account_name")] + public string DestinationAccountName { get; set; } = default!; + + /// + /// 获取或设置收款卡号。 + /// + [Newtonsoft.Json.JsonProperty("destination_account_number")] + [System.Text.Json.Serialization.JsonPropertyName("destination_account_number")] + public string DestinationAccountNumber { get; set; } = default!; + + /// + /// 获取或设置收款开户银行。 + /// + [Newtonsoft.Json.JsonProperty("destination_account_bank")] + [System.Text.Json.Serialization.JsonPropertyName("destination_account_bank")] + public string DestinationAccountBank { get; set; } = default!; + + /// + /// 获取或设置收款省市信息。 + /// + [Newtonsoft.Json.JsonProperty("city")] + [System.Text.Json.Serialization.JsonPropertyName("city")] + public string DestinationAccountCity { get; set; } = default!; + + /// + /// 获取或设置备注信息。 + /// + [Newtonsoft.Json.JsonProperty("remark")] + [System.Text.Json.Serialization.JsonPropertyName("remark")] + public string Remark { get; set; } = default!; + + /// + /// 获取或设置汇款截止时间。 + /// + [Newtonsoft.Json.JsonProperty("deadline")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RegularDateTimeOffsetConverter))] + [System.Text.Json.Serialization.JsonPropertyName("deadline")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RegularDateTimeOffsetConverter))] + public DateTimeOffset Deadline { get; set; } + } + + public class AuditDetail + { + /// + /// 获取或设置参数名称。 + /// + [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("out_request_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_request_no")] + public string OutRequestNumber { get; set; } = default!; + + /// + /// 获取或设置申请单编号。 + /// + [Newtonsoft.Json.JsonProperty("applyment_id")] + [System.Text.Json.Serialization.JsonPropertyName("applyment_id")] + public long ApplymentId { get; set; } + + /// + /// 获取或设置申请单状态。 + /// + [Newtonsoft.Json.JsonProperty("applyment_state")] + [System.Text.Json.Serialization.JsonPropertyName("applyment_state")] + public string ApplymentState { get; set; } = default!; + + /// + /// 获取或设置申请单状态描述。 + /// + [Newtonsoft.Json.JsonProperty("applyment_state_desc")] + [System.Text.Json.Serialization.JsonPropertyName("applyment_state_desc")] + public string ApplymentStateDescription { get; set; } = default!; + + /// + /// 获取或设置微信二级商户号。 + /// + [Newtonsoft.Json.JsonProperty("sub_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("sub_mchid")] + public string? SubMerchantId { get; set; } + + /// + /// 获取或设置签约状态。 + /// + [Newtonsoft.Json.JsonProperty("sign_state")] + [System.Text.Json.Serialization.JsonPropertyName("sign_state")] + public string? SignState { get; set; } + + /// + /// 获取或设置超级管理员签约链接。 + /// + [Newtonsoft.Json.JsonProperty("sign_url")] + [System.Text.Json.Serialization.JsonPropertyName("sign_url")] + public string? SignUrl { get; set; } + + /// + /// 获取或设置汇款账户验证信息。 + /// + [Newtonsoft.Json.JsonProperty("account_validation")] + [System.Text.Json.Serialization.JsonPropertyName("account_validation")] + public Types.AccountValidation? AccountValidation { get; set; } + + /// + /// 获取或设置法人验证链接。 + /// + [Newtonsoft.Json.JsonProperty("legal_validation_url")] + [System.Text.Json.Serialization.JsonPropertyName("legal_validation_url")] + public string? LegalPersonValidationUrl { get; set; } + + /// + /// 获取或设置驳回原因详情列表。 + /// + [Newtonsoft.Json.JsonProperty("audit_detail")] + [System.Text.Json.Serialization.JsonPropertyName("audit_detail")] + public Types.AuditDetail[]? AuditList { get; set; } + } + } + + /// + /// 获取或设置进件信息。 + /// + [Newtonsoft.Json.JsonProperty("pay_req")] + [System.Text.Json.Serialization.JsonPropertyName("pay_req")] + public Types.PayRequest PayRequest { get; set; } = default!; + + /// + /// 获取或设置进件状态信息。 + /// + [Newtonsoft.Json.JsonProperty("pay_resp")] + [System.Text.Json.Serialization.JsonPropertyName("pay_resp")] + public Types.PayResponse PayResponse { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/EcommerceApplyments/CreateEcommerceApplymentRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/EcommerceApplyments/CreateEcommerceApplymentRequest.cs index 08371a20..5bae1c01 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/EcommerceApplyments/CreateEcommerceApplymentRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/EcommerceApplyments/CreateEcommerceApplymentRequest.cs @@ -268,14 +268,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models /// [Newtonsoft.Json.JsonProperty("id_doc_period_begin")] [System.Text.Json.Serialization.JsonPropertyName("id_doc_period_begin")] - public string IdCardPeriodStartDateString { get; set; } = string.Empty; + public string IdDocumentPeriodStartDateString { get; set; } = string.Empty; /// /// 获取或设置证件有效期结束时间字符串(格式:yyyy-MM-dd / "长期")。 /// [Newtonsoft.Json.JsonProperty("id_doc_period_end")] [System.Text.Json.Serialization.JsonPropertyName("id_doc_period_end")] - public string IdCardPeriodEndDateString { get; set; } = string.Empty; + public string IdDocumentPeriodEndDateString { get; set; } = string.Empty; } } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayApplyRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayApplyRequest.json new file mode 100644 index 00000000..f661dd43 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayApplyRequest.json @@ -0,0 +1,31 @@ +{ + "business_license_info": { + "legal_person": "于先生", + "wxa_business_license_copy": { + "media_id": "wxashop_7q4XAkTjOdJBzsq2NwTN1LziRMTSlnabAEVD/lVYaan3vT2wzkOEconCrv/nMfo0SEDkD3Q6lvhTB6437AHymw==", + "name": "IwWfGT9fZ7UJMGSxXYld7piyITwdoLJKHow.jpg", + "pay_media_id": "jZe4zIHlHd4W-2hdRc9YJHOWaXLu-jeT_HPQ2pkR7CwW9swozIN_RtibXPsmLtNaiUH0fhrujTjVL4Noiw9PCYq0aSg32p-OwvbzSnK-k-Q" + }, + "business_time": "[\"2014-01-01\",\"长期\"]" + }, + "id_card_info": { + "id_card_name": "李先生", + "id_card_number": "xxxxxxxxxxx", + "id_card_valid_time": "yyyy-MM-dd", + "wxa_id_card_copy": { + "media_id": "wxashop_vjw8knXy8qJcbOWkxC3IfJktuHEDhKgnMwEguqzO68ROybm4ul+DVFu8Vrgo3sgjSEDkD3Q6lvhTB6437AHymw==", + "name": "wx77e672d6d34a4bed/HGM-pOfZUD0wSiqrJTZraZGcubiUJZ7o90.jpg", + "pay_media_id": "jZe4zIHlHd4W-2hdRc9YJO90E_1rLUJioHWZC0vHhO-FjK3zAnTiUnG61cpiYMx9dbzI7NdFIg55nmherZnCrZn3GkEPfCJUpg59A-dW1Ts" + }, + "wxa_id_card_national": { + "media_id": "wxashop_ndDiQPgJVT0HMZgCIM+pYe27Wyxg3iuv/yo/2nB9BOtY2aubumDb+Dy7PkCZscCuSEDkD3Q6lvhTB6437AHymw==", + "name": "2nB9BOtY2aubumDb+Dy7PkCZscCuSEDkD3Q6lvhTB6437AHymw==.jpg", + "pay_media_id": "jZe4zIHlHd4W-2hdRc9YJM4gvRIV8V5a4iEc8Oem02ywFfV6Rb4RJhbNvSEYevRaYnkFp0QEoEKA4cMoDvGfBzsM5WDjocZv96ZzFeb0arc" + } + }, + "contact_info": { + "contact_type": "65", + "contact_email": "wxg@tencent.com", + "mobile_phone": "15521050856" + } +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayGetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayGetResponse.json new file mode 100644 index 00000000..8d2e592f --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Shop/Wxpay/ShopWxpayGetResponse.json @@ -0,0 +1,60 @@ +{ + "errcode": 0, + "pay_req": { + "business_license_info": { + "business_license_copy": "jZe4zIHlHd4W-2hdRc9YJHOWaXLu-jeT_HPQ2pkR7CwW9swozIN_RtibXPsmLtNaiUH0fhrujTjVL4Noiw9PCYq0aSg32p-OwvbzSnK-k-Q", + "business_license_number": "83274MA5CN4WK0D", + "legal_person": "于先生", + "merchant_name": "魅力广州" + }, + "contact_info": { + "contact_email": "wechat@tencent.com", + "contact_id_card_number": "43112119951119003", + "contact_name": "于先生", + "contact_type": "65", + "mobile_phone": "187xxxxxxxx" + }, + "id_card_info": { + "id_card_copy": "aZe4zIHlHd4W-2hdRc9YJO90E_1rLUJioHWZC0vHhO-FjK3zAnTiUnG61cpiYMx9dbzI7NdFIg55nmherZnCrZn3GkEPfCJUpg59A-dW1Ts", + "id_card_name": "于先生", + "id_card_national": "aZe4zIHlHd4W-2hdRc9YJM4gvRIV8V5a4iEc8Oem02ywFfV6Rb4RJhbNvSEYevRaYnkFp0QEoEKA4cMoDvGfBzsM5WDjocZv96ZzFeb0arc", + "id_card_number": "43112119951119003", + "id_card_valid_time": "2022-09-21" + }, + "merchant_shortname": "魅力广州", + "need_account_info": false, + "organization_type": "2", + "out_request_no": "wx50808a0fa3b8abca", + "sales_scene_info": { + "mini_program_sub_appid": "wx50808a0fa3b8abca", + "store_name": "魅力广州", + "store_url": "http://www.wechat.qq.com/" + } + }, + "pay_resp": { + "applyment_state": "FINISH", + "applyment_state_desc": "完成", + "sign_url": "http://pay.weixin.qq.com/public/apply4ec_sign/s?applymentId=2000002126198476&sign=b207b673049a32c858f3aabd7d27c7ec", + "sub_mchid": "1542488631", + "account_validation": { + "account_name": "account_name", + "account_no": "account_no", + "pay_amount": 124, + "destination_account_number": "7222223333322332", + "destination_account_name": "财付通支付科技有限公司", + "destination_account_bank": "招商银行威盛大厦支行", + "city": "深圳", + "remark": "入驻账户验证", + "deadline": "2018-12-10 17:09:01" + }, + "audit_detail": [ + { + "param_name": "id_card_copy", + "reject_reason": "身份证背面识别失败,请上传更清晰的身份证图片。" + } + ], + "legal_validation_url": "http://pay.weixin.qq.com/public/apply4ec_sign/s?applymentId=20000032422126198476&sign=b207b673049a32c858f3aabd7d27c7ec", + "out_request_no": "APPLYMENT_00000000001", + "applyment_id": 2000002124775691 + } +} \ No newline at end of file