mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 05:13:17 +08:00
feat(tenpayv2): 新增境外子商户进件相关接口
This commit is contained in:
parent
99fbb8f7c0
commit
ffdf4c44c9
@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
|
||||
{
|
||||
public static class WechatTenpayClientExecuteMerchantInstitutionSubExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /secapi/mch/addInstitutionsub 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/sub_merchant_entry/chapter3_1.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.AddSubMerchantInstitutionResponse> ExecuteAddSubMerchantInstitutionAsync(this WechatTenpayClient client, Models.AddSubMerchantInstitutionRequest 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, "secapi", "mch", "addInstitutionsub");
|
||||
|
||||
return await client.SendRequestWithXmlAsync<Models.AddSubMerchantInstitutionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /secapi/mch/queryInstitutionsub 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/sub_merchant_entry/chapter3_2.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetSubMerchantInstitutionResponse> ExecuteGetSubMerchantInstitutionAsync(this WechatTenpayClient client, Models.GetSubMerchantInstitutionRequest 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, "secapi", "mch", "queryInstitutionsub");
|
||||
|
||||
return await client.SendRequestWithXmlAsync<Models.GetSubMerchantInstitutionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /secapi/mch/modifyInstitutionsub 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/sub_merchant_entry/chapter3_3.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ModifySubMerchantInstitutionResponse> ExecuteModifySubMerchantInstitutionAsync(this WechatTenpayClient client, Models.ModifySubMerchantInstitutionRequest 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, "secapi", "mch", "modifyInstitutionsub");
|
||||
|
||||
return await client.SendRequestWithXmlAsync<Models.ModifySubMerchantInstitutionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
|
||||
{
|
||||
public static class WechatTenpayClientExecuteMerchantMediaExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /secapi/mch/uploadmedia 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/tool/chapter3_1.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.UploadMerchantMediaResponse> ExecuteUploadMerchantMediaAsync(this WechatTenpayClient client, Models.UploadMerchantMediaRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.FileName == null)
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".jpg";
|
||||
|
||||
if (request.FileHash == null)
|
||||
request.FileHash = Utilities.MD5Utility.Hash(request.FileBytes).ToLower();
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "secapi", "mch", "uploadmedia");
|
||||
|
||||
string boundary = "--BOUNDARY--" + DateTimeOffset.Now.Ticks.ToString("x");
|
||||
string sign = Utilities.RequestSigner.Sign(new Dictionary<string, string?>() { { "mch_id", client.Credentials.MerchantId }, { "media_hash", request.FileHash } }, client.Credentials.MerchantSecret, Constants.SignTypes.MD5);
|
||||
using var fileContent = new ByteArrayContent(request.FileBytes);
|
||||
using var httpContent = new MultipartFormDataContent(boundary);
|
||||
httpContent.Add(fileContent, "\"media\"", $"\"{HttpUtility.UrlEncode(request.FileName)}\"");
|
||||
httpContent.Add(new StringContent(client.Credentials.MerchantId, Encoding.UTF8), $"\"mch_id\"");
|
||||
httpContent.Add(new StringContent(request.FileHash, Encoding.UTF8), $"\"media_hash\"");
|
||||
httpContent.Add(new StringContent(sign, Encoding.UTF8), $"\"sign\"");
|
||||
httpContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data; boundary=" + boundary);
|
||||
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("image/jpeg");
|
||||
|
||||
return await client.SendRequestAsync<Models.UploadMerchantMediaResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -13,7 +13,7 @@
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -0,0 +1,226 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/addInstitutionsub 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class AddSubMerchantInstitutionRequest : WechatTenpaySignableRequest
|
||||
{
|
||||
internal static class Converters
|
||||
{
|
||||
internal class RequestPropertyStorePhotoMediaIdListNewtonsoftJsonConverter : Newtonsoft.Json.Converters.TextualObjectInJsonFormatConverterBase<IList<string>>
|
||||
{
|
||||
}
|
||||
|
||||
internal class RequestPropertyStorePhotoMediaIdListSystemTextJsonConverter : System.Text.Json.Converters.TextualObjectInJsonFormatConverterBase<IList<string>>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_id")]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <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_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
|
||||
public string MerchantName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户简称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_shortname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_shortname")]
|
||||
public string MerchantShortName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户备注信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_remark")]
|
||||
public string MerchantRemark { get; set; } = string.Empty;
|
||||
|
||||
/// <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("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public string BusinessCategoryCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mcc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mcc")]
|
||||
public string MerchantCategoryCode { 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("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? RegistrationCertificatePictureMediaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_type")]
|
||||
public string BusinessType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。</para>
|
||||
/// </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; }
|
||||
|
||||
/// <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")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.RequestPropertyStorePhotoMediaIdListNewtonsoftJsonConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_photos")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.RequestPropertyStorePhotoMediaIdListSystemTextJsonConverter))]
|
||||
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")]
|
||||
public string? SettlementBankNumber { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/addInstitutionsub 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class AddSubMerchantInstitutionResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mch_id")]
|
||||
public string SubMerhantId { 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,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/queryInstitutionsub 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetSubMerchantInstitutionRequest : WechatTenpaySignableRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_id")]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mch_id")]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,197 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/queryInstitutionsub 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetSubMerchantInstitutionResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mch_id")]
|
||||
public string SubMerhantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户全称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
|
||||
public string MerchantName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户简称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_shortname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_shortname")]
|
||||
public string MerchantShortName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户备注信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_remark")]
|
||||
public string MerchantRemark { 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("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public string BusinessCategoryCode { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mcc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mcc")]
|
||||
public string MerchantCategoryCode { 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("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("business_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_type")]
|
||||
public string BusinessType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。</para>
|
||||
/// </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; }
|
||||
|
||||
/// <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>
|
||||
/// 获取或设置董事姓名。</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")]
|
||||
public string? SettlementBankNumber { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,226 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/modifyInstitutionsub 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ModifySubMerchantInstitutionRequest : WechatTenpaySignableRequest
|
||||
{
|
||||
internal static class Converters
|
||||
{
|
||||
internal class RequestPropertyStorePhotoMediaIdListNewtonsoftJsonConverter : Newtonsoft.Json.Converters.TextualObjectInJsonFormatConverterBase<IList<string>>
|
||||
{
|
||||
}
|
||||
|
||||
internal class RequestPropertyStorePhotoMediaIdListSystemTextJsonConverter : System.Text.Json.Converters.TextualObjectInJsonFormatConverterBase<IList<string>>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_id")]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mch_id")]
|
||||
public string SubMerhantId { 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_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
|
||||
public string MerchantName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户简称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_shortname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_shortname")]
|
||||
public string MerchantShortName { get; set; } = string.Empty;
|
||||
|
||||
/// <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("business_category")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_category")]
|
||||
public string BusinessCategoryCode { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户类别编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mcc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mcc")]
|
||||
public string MerchantCategoryCode { 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("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? RegistrationCertificatePictureMediaId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置业务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("business_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("business_type")]
|
||||
public string BusinessType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 下载链接。</para>
|
||||
/// </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; }
|
||||
|
||||
/// <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")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Converters.RequestPropertyStorePhotoMediaIdListNewtonsoftJsonConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_photos")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(Converters.RequestPropertyStorePhotoMediaIdListSystemTextJsonConverter))]
|
||||
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")]
|
||||
public string? SettlementBankNumber { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/modifyInstitutionsub 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ModifySubMerchantInstitutionResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mch_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mch_id")]
|
||||
public string SubMerhantId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/uploadmedia 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UploadMerchantMediaRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务上传字节数组。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public byte[] FileBytes { get; set; } = new byte[0];
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务上传文件名。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务上传文件摘要。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? FileHash { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /secapi/mch/uploadmedia 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UploadMerchantMediaResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置媒体标识 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /papay/querycontract 接口的请求。</para>
|
||||
|
@ -6,14 +6,14 @@
|
||||
public class CreatePAPPayH5EntrustWebResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /papay/preentrustweb 接口的响应。</para>
|
||||
|
@ -6,14 +6,14 @@
|
||||
public class DownloadPayBillResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -6,14 +6,14 @@
|
||||
public class DownloadPayFundFlowResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -6,14 +6,14 @@
|
||||
public class SubmitPayITILReportResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -13,7 +13,7 @@
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -13,7 +13,7 @@
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -13,7 +13,7 @@
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -15,7 +15,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -15,7 +15,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -86,14 +86,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -6,14 +6,14 @@
|
||||
public class AddSubMerchantDevelopConfigResponse : WechatTenpaySignableResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -65,14 +65,14 @@
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public override string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <i>(请忽略此字段)</i>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
|
@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /vehicle/partnerpay/querystate 接口的请求。</para>
|
||||
|
@ -1,3 +1,3 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.TenpayV2.UnitTests")]
|
||||
[assembly: InternalsVisibleTo("SKIT.FlurlHttpClient.Wechat.TenpayV2.UnitTests")]
|
@ -6,7 +6,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Utilities
|
||||
{
|
||||
internal static class RequestSigner
|
||||
{
|
||||
public static string Sign(IDictionary<string, string?> paramsMap, string secret, string? signType)
|
||||
public static string Sign(IDictionary<string, string?> paramsMap, string secret, string? signType = null)
|
||||
{
|
||||
if (paramsMap == null) throw new ArgumentNullException(nameof(paramsMap));
|
||||
|
||||
@ -15,12 +15,12 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Utilities
|
||||
return SignFromSortedQueryString(sortedQueryString, secret, signType);
|
||||
}
|
||||
|
||||
public static string SignFromJson(string json, string secret, string? signType)
|
||||
public static string SignFromJson(string json, string secret, string? signType = null)
|
||||
{
|
||||
return SignFromSortedQueryString(JsonUtility.ParseToSortedQueryString(json), secret, signType);
|
||||
}
|
||||
|
||||
public static string SignFromSortedQueryString(string queryString, string secret, string? signType)
|
||||
public static string SignFromSortedQueryString(string queryString, string secret, string? signType = null)
|
||||
{
|
||||
signType = signType ?? Constants.SignTypes.MD5;
|
||||
queryString = queryString + $"&key={secret}";
|
||||
|
@ -118,6 +118,30 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
|
||||
return flurlRequest;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步发起请求。
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="flurlRequest"></param>
|
||||
/// <param name="httpContent"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<T> SendRequestAsync<T>(IFlurlRequest flurlRequest, HttpContent? httpContent = null, CancellationToken cancellationToken = default)
|
||||
where T : WechatTenpayResponse, new()
|
||||
{
|
||||
if (flurlRequest == null) throw new ArgumentNullException(nameof(flurlRequest));
|
||||
|
||||
try
|
||||
{
|
||||
using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken);
|
||||
return await WrapResponseWithJsonAsync<T>(flurlResponse, cancellationToken);
|
||||
}
|
||||
catch (FlurlHttpException ex)
|
||||
{
|
||||
throw new WechatTenpayException(ex.Message, ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步发起请求。
|
||||
/// </summary>
|
||||
@ -148,8 +172,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
|
||||
string xml = Utilities.XmlUtility.ConvertFromJson(json);
|
||||
|
||||
using HttpContent httpContent = new StringContent(xml, Encoding.UTF8, "text/xml");
|
||||
using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken);
|
||||
return await WrapResponseWithXmlAsync<T>(flurlResponse, cancellationToken);
|
||||
return await SendRequestAsync<T>(flurlRequest, httpContent: httpContent, cancellationToken);
|
||||
}
|
||||
}
|
||||
catch (FlurlHttpException ex)
|
||||
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"app_id": "wx2421b1c4370ec43b",
|
||||
"mch_id": "1230000109",
|
||||
"sign": "C47005DF5722D862EFF30E7B8964AE17",
|
||||
"merchant_name": "ABC Merchant",
|
||||
"merchant_shortname": "ABC",
|
||||
"merchant_remark": "202012041",
|
||||
"merchant_country_code": "036",
|
||||
"merchant_type": "ENTERPRISE",
|
||||
"business_category": "485",
|
||||
"mcc": "4374",
|
||||
"registration_certificate_number": "5555-8888",
|
||||
"registration_certificate_date": "2020-05-27",
|
||||
"registration_certificate_copy": "-x95m5iclsanHYauUt1__DsWXok2NqRliv2SDL42QoEmHIPs",
|
||||
"business_type": "BOTH",
|
||||
"mini_program": "Flower Plus",
|
||||
"store_address": "First Street",
|
||||
"office_phone": "+8602767883714",
|
||||
"contact_name": "bob",
|
||||
"contact_phone": "+8618688886666",
|
||||
"contact_email": "test@163.com",
|
||||
"settlement_bank_number": "55558888"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"return_code": "SUCCESS",
|
||||
"return_msg": "OK",
|
||||
"result_code": "SUCCESS",
|
||||
"sign": "C380BEC2BFD727A4B6845133519F3AD6",
|
||||
"sub_mch_id": "013467007045764"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"app_id": "wx2421b1c4370ec43b",
|
||||
"mch_id": "1230000109",
|
||||
"sign": "C380BEC2BFD727A4B6845133519F3AD6",
|
||||
"sub_mch_id": "1230000109"
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"return_code": "SUCCESS",
|
||||
"return_msg": "OK",
|
||||
"result_code": "SUCCESS",
|
||||
"sign": "C380BEC2BFD727A4B6845133519F3AD6",
|
||||
"sub_mch_id": "013467007045764",
|
||||
"merchant_name": "ABC Merchant",
|
||||
"merchant_shortname": "ABC",
|
||||
"office_phone": "075586010000",
|
||||
"contact_name": "Eric Lee",
|
||||
"contact_phone": "13000000000",
|
||||
"contact_email": "test@xxx.com",
|
||||
"business_category": "101",
|
||||
"merchant_remark": "ABC1234567",
|
||||
"business_website": "http://abc.com"
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"app_id": "wx2421b1c4370ec43b",
|
||||
"mch_id": "1230000109",
|
||||
"sub_mch_id": "013467007045764",
|
||||
"sign": "C47005DF5722D862EFF30E7B8964AE17",
|
||||
"merchant_name": "ABC Merchant",
|
||||
"merchant_shortname": "ABC",
|
||||
"merchant_country_code": "036",
|
||||
"merchant_type": "ENTERPRISE",
|
||||
"business_category": "485",
|
||||
"mcc": "4374",
|
||||
"registration_certificate_number": "5555-8888",
|
||||
"registration_certificate_date": "2020-05-27",
|
||||
"registration_certificate_copy": "-x95m5iclsanHYauUt1",
|
||||
"business_type": "BOTH",
|
||||
"mini_program": "Flower Plus",
|
||||
"store_address": "First Street",
|
||||
"office_phone": "+8602767883714",
|
||||
"contact_name": "bob",
|
||||
"contact_phone": "+8618688886666",
|
||||
"contact_email": "test@163.com",
|
||||
"settlement_bank_number": "55558888"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"return_code": "SUCCESS",
|
||||
"return_msg": "OK",
|
||||
"result_code": "SUCCESS",
|
||||
"sign": "C380BEC2BFD727A4B6845133519F3AD6",
|
||||
"sub_mch_id": "013467007045764"
|
||||
}
|
Loading…
Reference in New Issue
Block a user