mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 18:22:24 +08:00
feat(tenpayv3): 新增境外支付子商户进件相关接口
This commit is contained in:
@@ -72,7 +72,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public string BusinessCategoryCode { get; set; } = string.Empty;
|
||||
public int BusinessCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
@@ -117,42 +117,42 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
public string BusinessType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。</para>
|
||||
/// 获取或设置 App 下载链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_download")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_download")]
|
||||
public string? AppDownloadUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务网站地址。</para>
|
||||
/// 获取或设置业务网站地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_website")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_website")]
|
||||
public string? BusinessWebsiteUrl { get; set; }
|
||||
public string? WebsiteUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公众号 AppId。</para>
|
||||
/// 获取或设置公众号 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_account")]
|
||||
public string? OfficeAccountAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序 AppId。</para>
|
||||
/// 获取或设置小程序 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mini_program")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mini_program")]
|
||||
public string? MiniProgramAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店地址。</para>
|
||||
/// 获取或设置门店地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_address")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_address")]
|
||||
public string? StoreAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店照片 MediaId 列表。</para>
|
||||
/// 获取或设置门店照片 MediaId 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_photos")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.RequestPropertyStorePhotoMediaIdListNewtonsoftJsonConverter))]
|
||||
@@ -161,63 +161,63 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
public IList<string>? StorePhotoMediaIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事姓名。</para>
|
||||
/// 获取或设置董事姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director_name")]
|
||||
public string? DirectorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事证件号码。</para>
|
||||
/// 获取或设置董事证件号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director_id_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director_id_number")]
|
||||
public string? DirectorIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人姓名。</para>
|
||||
/// 获取或设置负责人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal_name")]
|
||||
public string? PrincipalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人证件号。</para>
|
||||
/// 获取或设置负责人证件号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal_id_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal_id_number")]
|
||||
public string? PrincipalIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司电话。</para>
|
||||
/// 获取或设置公司电话。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_phone")]
|
||||
public string? OfficePhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人姓名。</para>
|
||||
/// 获取或设置联系人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_name")]
|
||||
public string? ContactName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人电话号码。</para>
|
||||
/// 获取或设置联系人电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_phone")]
|
||||
public string? ContactPhotoNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人邮箱。</para>
|
||||
/// 获取或设置联系人邮箱。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_email")]
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户结算银行账户 。</para>
|
||||
/// 获取或设置子商户结算银行账户 。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settlement_bank_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settlement_bank_number")]
|
||||
|
@@ -59,7 +59,8 @@
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public string BusinessCategoryCode { get; set; } = default!;
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||
public int BusinessCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
@@ -97,98 +98,98 @@
|
||||
public string BusinessType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。</para>
|
||||
/// 获取或设置 App 下载链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_download")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_download")]
|
||||
public string? AppDownloadUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务网站地址。</para>
|
||||
/// 获取或设置业务网站地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_website")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_website")]
|
||||
public string? BusinessWebsiteUrl { get; set; }
|
||||
public string? WebsiteUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公众号 AppId。</para>
|
||||
/// 获取或设置公众号 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_account")]
|
||||
public string? OfficeAccountAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序 AppId。</para>
|
||||
/// 获取或设置小程序 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mini_program")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mini_program")]
|
||||
public string? MiniProgramAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店地址。</para>
|
||||
/// 获取或设置门店地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_address")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_address")]
|
||||
public string? StoreAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事姓名。</para>
|
||||
/// 获取或设置董事姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director_name")]
|
||||
public string? DirectorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事证件号码。</para>
|
||||
/// 获取或设置董事证件号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director_id_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director_id_number")]
|
||||
public string? DirectorIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人姓名。</para>
|
||||
/// 获取或设置负责人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal_name")]
|
||||
public string? PrincipalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人证件号。</para>
|
||||
/// 获取或设置负责人证件号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal_id_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal_id_number")]
|
||||
public string? PrincipalIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司电话。</para>
|
||||
/// 获取或设置公司电话。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_phone")]
|
||||
public string? OfficePhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人姓名。</para>
|
||||
/// 获取或设置联系人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_name")]
|
||||
public string? ContactName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人电话号码。</para>
|
||||
/// 获取或设置联系人电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_phone")]
|
||||
public string? ContactPhotoNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人邮箱。</para>
|
||||
/// 获取或设置联系人邮箱。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_email")]
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户结算银行账户 。</para>
|
||||
/// 获取或设置子商户结算银行账户 。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settlement_bank_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settlement_bank_number")]
|
||||
|
@@ -72,7 +72,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public string BusinessCategoryCode { get; set; } = string.Empty;
|
||||
public int BusinessCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
@@ -117,42 +117,42 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
public string BusinessType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。</para>
|
||||
/// 获取或设置 App 下载链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_download")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_download")]
|
||||
public string? AppDownloadUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务网站地址。</para>
|
||||
/// 获取或设置业务网站地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_website")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_website")]
|
||||
public string? BusinessWebsiteUrl { get; set; }
|
||||
public string? WebsiteUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公众号 AppId。</para>
|
||||
/// 获取或设置公众号 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_account")]
|
||||
public string? OfficeAccountAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序 AppId。</para>
|
||||
/// 获取或设置小程序 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mini_program")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mini_program")]
|
||||
public string? MiniProgramAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店地址。</para>
|
||||
/// 获取或设置门店地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_address")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_address")]
|
||||
public string? StoreAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店照片 MediaId 列表。</para>
|
||||
/// 获取或设置门店照片 MediaId 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_photos")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.RequestPropertyStorePhotoMediaIdListNewtonsoftJsonConverter))]
|
||||
@@ -161,63 +161,63 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
public IList<string>? StorePhotoMediaIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事姓名。</para>
|
||||
/// 获取或设置董事姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director_name")]
|
||||
public string? DirectorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事证件号码。</para>
|
||||
/// 获取或设置董事证件号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director_id_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director_id_number")]
|
||||
public string? DirectorIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人姓名。</para>
|
||||
/// 获取或设置负责人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal_name")]
|
||||
public string? PrincipalName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人证件号。</para>
|
||||
/// 获取或设置负责人证件号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal_id_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal_id_number")]
|
||||
public string? PrincipalIdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司电话。</para>
|
||||
/// 获取或设置公司电话。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_phone")]
|
||||
public string? OfficePhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人姓名。</para>
|
||||
/// 获取或设置联系人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_name")]
|
||||
public string? ContactName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人电话号码。</para>
|
||||
/// 获取或设置联系人电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_phone")]
|
||||
public string? ContactPhotoNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人邮箱。</para>
|
||||
/// 获取或设置联系人邮箱。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact_email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact_email")]
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户结算银行账户 。</para>
|
||||
/// 获取或设置子商户结算银行账户 。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settlement_bank_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settlement_bank_number")]
|
||||
|
@@ -18,6 +18,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>异步调用 [POST] /merchant/media/upload 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter2_1_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter2_1_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/tool/chapter3_2.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
/// <summary>
|
||||
/// 为 <see cref="WechatTenpayClient"/> 提供境外支付子商户进件相关的 API 扩展方法。
|
||||
/// </summary>
|
||||
public static class WechatTenpayClientExecuteMerchantsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /merchants 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/Onborading_Sub_Merchant/chapter3_1.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.AddSubMerchantResponse> ExecuteAddSubMerchantAsync(this WechatTenpayClient client, Models.AddSubMerchantRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "merchants")
|
||||
.WithHeader("Idempotency-Key", request.IdempotencyKey);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.AddSubMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /merchants/{sub_mchid} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/Onborading%20Sub%20Merchant/chapter3_2.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetSubMerchantResponse> ExecuteGetSubMerchantAsync(this WechatTenpayClient client, Models.GetSubMerchantRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "merchants", request.SubMerchantId)
|
||||
.SetQueryParam("sp_mchid", request.MerchantId)
|
||||
.SetQueryParam("sp_appid", request.AppId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetSubMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [PUT] /merchants 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/Onborading_Sub_Merchant/chapter3_3.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ModifySubMerchantResponse> ExecuteModifySubMerchantAsync(this WechatTenpayClient client, Models.ModifySubMerchantRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Put, "merchants");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ModifySubMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,260 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /merchants 接口的请求。</para>
|
||||
/// </summary>
|
||||
[WechatTenpaySensitive]
|
||||
public class AddSubMerchantRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Contact
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置联系人姓名(需使用平台公钥/证书加密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系电话号码(需使用平台公钥/证书加密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系邮箱(需使用平台公钥/证书加密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("email")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class Business
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置业务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_type")]
|
||||
public string BusinessType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mcc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mcc")]
|
||||
public string? MerchantCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_download")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_download")]
|
||||
public string? AppDownloadUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务网站链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("website")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("website")]
|
||||
public string? WebsiteUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公众号 AppId。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_account")]
|
||||
public string? OfficeAccountAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序 AppId。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mini_program")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mini_program")]
|
||||
public string? MiniProgramAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店地址。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_address")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_address")]
|
||||
public string? StoreAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店照片 MediaId 列表。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_photos")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_photos")]
|
||||
public IList<string>? StorePhotoMediaIdList { get; set; }
|
||||
}
|
||||
|
||||
public class Director
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置董事姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事证件号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("number")]
|
||||
public string? IdNumber { get; set; }
|
||||
}
|
||||
|
||||
public class Principal
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置负责人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人证件号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("number")]
|
||||
public string? IdNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务请求幂等值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string IdempotencyKey { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置机构商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置机构微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置渠道号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("channel_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("channel_id")]
|
||||
public string? ChannelId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_type")]
|
||||
public string MerchantType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户全称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string MerchantName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户简称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("shortname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("shortname")]
|
||||
public string MerchantShortName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置注册国家或地区代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_country_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_country_code")]
|
||||
public string CountryCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_phone")]
|
||||
public string OfficePhoneNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact")]
|
||||
public Types.Contact Contact { get; set; } = new Types.Contact();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商业类目编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public int BusinessCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_number")]
|
||||
public string RegistrationCertificateNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件过期时间字符串(格式:yyyy-MM-dd / PERMANENT)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_date")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_date")]
|
||||
public string RegistrationCertificateDateString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件照片 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_copy")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_copy")]
|
||||
public string? RegistrationCertificateCopyMediaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户银行结算账户信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settlement_bank_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settlement_bank_number")]
|
||||
public string SettlementBankNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business")]
|
||||
public Types.Business Business { get; set; } = new Types.Business();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director")]
|
||||
public Types.Director? Director { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal")]
|
||||
public Types.Principal? Principal { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /merchants 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class AddSubMerchantResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置验证状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("verification_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("verification_status")]
|
||||
public string? VerificationStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置验证状态描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string? VerificationStatusDescription { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /merchants/{sub_mchid} 接口的请求。</para>
|
||||
/// </summary>
|
||||
[WechatTenpaySensitive]
|
||||
public class GetSubMerchantRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置机构商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置机构微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,223 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /merchants/{sub_mchid} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetSubMerchantResponse : WechatTenpayResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Contact
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置联系人姓名(需使用商户私钥解密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系电话号码(需使用商户私钥解密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string PhoneNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系邮箱(需使用商户私钥解密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("email")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string Email { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Business
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置业务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_type")]
|
||||
public string BusinessType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mcc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mcc")]
|
||||
public string? MerchantCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_download")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_download")]
|
||||
public string? AppDownloadUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务网站链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("website")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("website")]
|
||||
public string? WebsiteUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公众号 AppId。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_account")]
|
||||
public string? OfficeAccountAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序 AppId。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mini_program")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mini_program")]
|
||||
public string? MiniProgramAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店地址。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_address")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_address")]
|
||||
public string? StoreAddress { get; set; }
|
||||
}
|
||||
|
||||
public class Director
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置董事姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事证件号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("number")]
|
||||
public string? IdNumber { get; set; }
|
||||
}
|
||||
|
||||
public class Principal
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置负责人姓名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人证件号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("number")]
|
||||
public string? IdNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_type")]
|
||||
public string MerchantType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户全称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string MerchantName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户简称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("shortname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("shortname")]
|
||||
public string MerchantShortName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置注册国家或地区代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_country_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_country_code")]
|
||||
public string CountryCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_phone")]
|
||||
public string OfficePhoneNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact")]
|
||||
public Types.Contact Contact { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商业类目编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||
public int BusinessCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_number")]
|
||||
public string RegistrationCertificateNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件过期时间字符串(格式:yyyy-MM-dd / PERMANENT)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_date")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_date")]
|
||||
public string RegistrationCertificateDateString { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户银行结算账户信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settlement_bank_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settlement_bank_number")]
|
||||
public string SettlementBankNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business")]
|
||||
public Types.Business Business { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director")]
|
||||
public Types.Director? Director { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal")]
|
||||
public Types.Principal? Principal { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,154 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [PUT] /merchants 接口的请求。</para>
|
||||
/// </summary>
|
||||
[WechatTenpaySensitive]
|
||||
public class ModifySubMerchantRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Contact : AddSubMerchantRequest.Types.Contact
|
||||
{
|
||||
}
|
||||
|
||||
public class Business : AddSubMerchantRequest.Types.Business
|
||||
{
|
||||
}
|
||||
|
||||
public class Director : AddSubMerchantRequest.Types.Director
|
||||
{
|
||||
}
|
||||
|
||||
public class Principal : AddSubMerchantRequest.Types.Principal
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置机构商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置机构微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置渠道号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("channel_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("channel_id")]
|
||||
public string? ChannelId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_type")]
|
||||
public string MerchantType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户全称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string MerchantName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户简称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("shortname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("shortname")]
|
||||
public string MerchantShortName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置注册国家或地区代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_country_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_country_code")]
|
||||
public string CountryCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("office_phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("office_phone")]
|
||||
public string OfficePhoneNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置联系人信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contact")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contact")]
|
||||
public Types.Contact Contact { get; set; } = new Types.Contact();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商业类目编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public int BusinessCategoryCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_number")]
|
||||
public string RegistrationCertificateNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件过期时间字符串(格式:yyyy-MM-dd / PERMANENT)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_date")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_date")]
|
||||
public string RegistrationCertificateDateString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公司注册文件照片 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("registration_certificate_copy")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("registration_certificate_copy")]
|
||||
public string? RegistrationCertificateCopyMediaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户银行结算账户信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settlement_bank_number")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settlement_bank_number")]
|
||||
public string SettlementBankNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business")]
|
||||
public Types.Business Business { get; set; } = new Types.Business();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置董事信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("director")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("director")]
|
||||
public Types.Director? Director { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置负责人信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("principal")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("principal")]
|
||||
public Types.Principal? Principal { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [PUT] /merchants 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ModifySubMerchantResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -15,6 +15,16 @@
|
||||
/// </summary>
|
||||
public const string BACKUP = "https://api2.mch.weixin.qq.com/v3";
|
||||
|
||||
/// <summary>
|
||||
/// 香港域名。
|
||||
/// </summary>
|
||||
public const string REGION_HONGKONG = "https://api.mch.weixin.qq.com/hk/v3";
|
||||
|
||||
/// <summary>
|
||||
/// 全球域名。
|
||||
/// </summary>
|
||||
public const string REGION_GLOBAL = "https://api.mch.weixin.qq.com/global/v3";
|
||||
|
||||
/// <summary>
|
||||
/// 沙箱域名。
|
||||
/// </summary>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
"merchant_remark": "202012041",
|
||||
"merchant_country_code": "036",
|
||||
"merchant_type": "ENTERPRISE",
|
||||
"business_category": "485",
|
||||
"business_category": 485,
|
||||
"mcc": "4374",
|
||||
"registration_certificate_number": "5555-8888",
|
||||
"registration_certificate_date": "2020-05-27",
|
||||
|
@@ -7,7 +7,7 @@
|
||||
"merchant_shortname": "ABC",
|
||||
"merchant_country_code": "036",
|
||||
"merchant_type": "ENTERPRISE",
|
||||
"business_category": "485",
|
||||
"business_category": 485,
|
||||
"mcc": "4374",
|
||||
"registration_certificate_number": "5555-8888",
|
||||
"registration_certificate_date": "2020-05-27",
|
||||
|
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"sp_appid": "wx82ec4jy334ner1",
|
||||
"sp_mchid": "2422128905",
|
||||
"name": "testname",
|
||||
"shortname": "shortname",
|
||||
"office_phone": "13680534111",
|
||||
"contact": {
|
||||
"email": "gP32/1QSaIpKlaFbWgP3hr8W3+YTtiavMRbOJJ6dATymJzxx/b4YPOTKdeRApW6Nt2ZZB9reZ1x45XhIEF/Ztb6mqfFVb6LxpJlHgDL/zpUG51551XQ3Ww+/kVCJcokiIiT1bSwEcCe6tPL2cmdsOEjlTikyrasLc1bG8vaG/i361r0vX9w56O2Mgv3OnJ4fr4xnmxNcVrJnk1f/gBSIiCUWA0163f3LM4KifQelEuz/WtroeKAzRDiI0/pOvXfwrYDK==",
|
||||
"name": "Vxjsrod2RT2aGxeI5i+Z2C4arXYGXZuwE8IrRf6uYu6S5dy4Igw7kjvYWYCNfsgcdXyfjdA4KVntbgSa3zic+ERsOd5u+SNKkaFSH3SwYtpcCyaUMvICTw/6AOY/qy+He9la/gxObgi4zkxvLJmZTJVualTVJWWCIvcuDArW8Kfqp8rBl+IxDEgCojoEmqE7ymVReslGBXWiaPS1UsZx1QJyez3/ijzBa4AKch3XuPx6d3qvM+J8iMx/b94LAfpTihU/j==",
|
||||
"phone": "l8JH2dAGLNJ8P5DENoMV0eW4JgIquV2ZO4conHnZp48g/eVpgvIfMj4Ge6LRVENW4eZksErJnYCQB+EOFEGR0lMhA1LexPLu0en08iM2ghkftYWAsOD4JPkvvc36SAfWal29eoZh4maO6kOGW7G4uBua6JoMsEjR6uuw5Gw5DC2eikcdkDBGk9vHSP/oxRs3Qu8a83GikhLgdpAPitXbZX/TEPG5SUg8Fx4BCMCKOfxy8uakq2/EeCtyBMjaiheUePoA=="
|
||||
},
|
||||
"business_category": 343,
|
||||
"merchant_country_code": "344",
|
||||
"merchant_type": "ENTERPRISE",
|
||||
"registration_certificate_number": "519723407213085723",
|
||||
"registration_certificate_date": "2022-06-03",
|
||||
"settlement_bank_number": "559304578245298347923856",
|
||||
"business": {
|
||||
"business_type": "ONLINE",
|
||||
"mcc": "5344",
|
||||
"mini_program": "flowerplus"
|
||||
},
|
||||
"director": {
|
||||
"name": "Tom",
|
||||
"number": "1234567890"
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"sub_mchid": "20000100"
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"sub_mchid": "20000100",
|
||||
"name": "test mcherchan_name",
|
||||
"shortname": "mcherchan_name",
|
||||
"office_phone": "075586010000",
|
||||
"business_category": "644",
|
||||
"contact": {
|
||||
"name": "Bob Zhang",
|
||||
"phone": "+8613633334444",
|
||||
"email": "test@test.com"
|
||||
},
|
||||
"principal": {
|
||||
"name": "Bob",
|
||||
"number": "5555-8888"
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"sub_mchid": "20000100",
|
||||
"sp_appid": "wx82ec4jy334ner1",
|
||||
"sp_mchid": "2422128905",
|
||||
"name": "testname",
|
||||
"shortname": "shortname",
|
||||
"office_phone": "13680534111",
|
||||
"contact": {
|
||||
"email": "gP32/1QSaIpKlaFbWgP3hr8W3+YTtiavMRbOJJ6dATymJzxx/b4YPOTKdeRApW6Nt2ZZB9reZ1x45XhIEF/Ztb6mqfFVb6LxpJlHgDL/zpUG51551XQ3Ww+/kVCJcokiIiT1bSwEcCe6tPL2cmdsOEjlTikyrasLc1bG8vaG/i361r0vX9w56O2Mgv3OnJ4fr4xnmxNcVrJnk1f/gBSIiCUWA0163f3LM4KifQelEuz/WtroeKAzRDiI0/pOvXfwrYDK==",
|
||||
"name": "Vxjsrod2RT2aGxeI5i+Z2C4arXYGXZuwE8IrRf6uYu6S5dy4Igw7kjvYWYCNfsgcdXyfjdA4KVntbgSa3zic+ERsOd5u+SNKkaFSH3SwYtpcCyaUMvICTw/6AOY/qy+He9la/gxObgi4zkxvLJmZTJVualTVJWWCIvcuDArW8Kfqp8rBl+IxDEgCojoEmqE7ymVReslGBXWiaPS1UsZx1QJyez3/ijzBa4AKch3XuPx6d3qvM+J8iMx/b94LAfpTihU/j==",
|
||||
"phone": "l8JH2dAGLNJ8P5DENoMV0eW4JgIquV2ZO4conHnZp48g/eVpgvIfMj4Ge6LRVENW4eZksErJnYCQB+EOFEGR0lMhA1LexPLu0en08iM2ghkftYWAsOD4JPkvvc36SAfWal29eoZh4maO6kOGW7G4uBua6JoMsEjR6uuw5Gw5DC2eikcdkDBGk9vHSP/oxRs3Qu8a83GikhLgdpAPitXbZX/TEPG5SUg8Fx4BCMCKOfxy8uakq2/EeCtyBMjaiheUePoA=="
|
||||
},
|
||||
"business_category": 343,
|
||||
"merchant_country_code": "344",
|
||||
"merchant_type": "ENTERPRISE",
|
||||
"registration_certificate_number": "519723407213085723",
|
||||
"registration_certificate_date": "2022-06-03",
|
||||
"settlement_bank_number": "559304578245298347923856",
|
||||
"business": {
|
||||
"business_type": "ONLINE",
|
||||
"mcc": "5344",
|
||||
"mini_program": "flowerplus"
|
||||
},
|
||||
"director": {
|
||||
"name": "Tom",
|
||||
"number": "1234567890"
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"sub_mchid": "20000100"
|
||||
}
|
Reference in New Issue
Block a user