mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-18 17:48:12 +08:00
feat(tenpaybusiness): 随官方更新部分接口模型
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 pay.created 通知的数据。</para>
|
||||
/// <para>表示 pay.bank_accept 通知的数据。</para>
|
||||
/// <para>表示 pay.succeeded 通知的数据。</para>
|
||||
/// <para>表示 pay.failed 通知的数据。</para>
|
||||
/// <para>表示 pay.revoked 通知的数据。</para>
|
||||
/// <para>表示 mse_payment.succeeded 通知的数据。</para>
|
||||
/// <para>表示 mse_payment.close 通知的数据。</para>
|
||||
/// <para>表示 mse_payment.revoked 通知的数据。</para>
|
||||
/// </summary>
|
||||
public class MSEPayPaymentEvent : WechatTenpayBusinessEvent<MSEPayPaymentEvent.Types.EventContent>
|
||||
public class PaymentEvent : WechatTenpayBusinessEvent<PaymentEvent.Types.EventContent>
|
||||
{
|
||||
public static class Types
|
||||
{
|
@@ -1,4 +1,4 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Events
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 product.application.finish 通知的数据。</para>
|
||||
@@ -13,19 +13,6 @@
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Account
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置企业账户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ent_acct_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ent_acct_id")]
|
||||
public string EnterpriseAccountId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置产品名称。
|
||||
/// </summary>
|
||||
@@ -39,13 +26,6 @@
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账户列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("accounts")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("accounts")]
|
||||
public Types.Account[]? AccountList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
internal static class SystemCollectionsDictionaryExtensions
|
||||
{
|
||||
public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
|
||||
{
|
||||
#pragma warning disable CS8603
|
||||
return dictionary.TryGetValue(key, out var value) ? value : default(TValue);
|
||||
#pragma warning restore CS8603
|
||||
}
|
||||
}
|
||||
}
|
@@ -12,18 +12,18 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
try
|
||||
{
|
||||
IDictionary<string, string?> dictTBEPAuthorization = strAuthorization
|
||||
IDictionary<string, string?> dictAuthorization = strAuthorization
|
||||
.Split(',')
|
||||
.Select(s => s.Trim().Split(new char[] { '=' }, 2, StringSplitOptions.RemoveEmptyEntries))
|
||||
.ToDictionary(
|
||||
k => k[0],
|
||||
v => v.Length > 1 ? v[1].TrimStart('\"').TrimEnd('\"') : null
|
||||
);
|
||||
string strTimestamp = dictTBEPAuthorization["timestamp"]!;
|
||||
string strNonce = dictTBEPAuthorization["nonce"]!;
|
||||
string strSignature = dictTBEPAuthorization["signature"]!;
|
||||
string strSignAlgorithm = dictTBEPAuthorization["signature_algorithm"]!;
|
||||
string strSerialNumber = dictTBEPAuthorization["tbep_serial_number"]!;
|
||||
string strTimestamp = dictAuthorization.GetValueOrDefault("timestamp")!;
|
||||
string strNonce = dictAuthorization.GetValueOrDefault("nonce")!;
|
||||
string strSignature = dictAuthorization.GetValueOrDefault("signature")!;
|
||||
string strSignAlgorithm = dictAuthorization.GetValueOrDefault("signature_algorithm")!;
|
||||
string strSerialNumber = dictAuthorization.GetValueOrDefault("tbep_serial_number")!;
|
||||
|
||||
return VerifySignature(
|
||||
client,
|
||||
@@ -32,7 +32,9 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
strContent: strContent,
|
||||
strSignature: strSignature,
|
||||
strSignatureAlgorithm: strSignAlgorithm,
|
||||
strSerialNumber: strSerialNumber, out error);
|
||||
strSerialNumber: strSerialNumber,
|
||||
out error
|
||||
);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -41,7 +43,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
}
|
||||
}
|
||||
|
||||
error = new Exception("Could not read value of `TBEP-Authorization`.");
|
||||
error = new Exception("Could not read value of 'TBEP-Authorization'.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
public static class WechatTenpayBusinessClientExecuteBillExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/bill-downloads 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E8%8E%B7%E5%8F%96%E8%B5%84%E9%87%91%E8%B4%A6%E5%8D%95%E4%B8%8B%E8%BD%BD%E9%93%BE%E6%8E%A5 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetBillResponse> ExecuteGetBillAsync(this WechatTenpayBusinessClient client, Models.GetBillRequest 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, "mse-pay", "bill-downloads");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBillResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/bill-downloads/trans 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E8%8E%B7%E5%8F%96%E4%BA%A4%E6%98%93%E8%B4%A6%E5%8D%95%E4%B8%8B%E8%BD%BD%E9%93%BE%E6%8E%A5 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetBillTransactionResponse> ExecuteGetBillTransactionAsync(this WechatTenpayBusinessClient client, Models.GetBillTransactionRequest 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, "mse-pay", "bill-downloads", "trans");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBillTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /{download_url} 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E8%B5%84%E9%87%91%E8%B4%A6%E5%8D%95%E4%B8%8B%E8%BD%BD </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E4%BA%A4%E6%98%93%E8%B4%A6%E5%8D%95%E4%B8%8B%E8%BD%BD </para>
|
||||
/// <para><i>(请注意此接口不受构造 <see cref="WechatTenpayBusinessClient" /> 时指定的 <see cref="WechatTenpayBusinessClientOptions.Endpoint"/> 参数控制。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.DownloadBillFileResponse> ExecuteDownloadBillFileAsync(this WechatTenpayBusinessClient client, Models.DownloadBillFileRequest 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.Get, request.DownloadUrl)
|
||||
.WithUrl(request.DownloadUrl);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.DownloadBillFileResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -9,7 +9,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
public static class WechatTenpayBusinessClientExecuteFileUploadsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /file-uploads 接口。</para>
|
||||
/// <para>异步调用 [POST] /mse-pay/file-uploads 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -30,7 +31,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
request.FileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForImage(request.FileName!) ?? "image/png";
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "file-uploads");
|
||||
.CreateRequest(request, HttpMethod.Post, "mse-pay", "file-uploads");
|
||||
|
||||
using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.FileName, fileBytes: request.FileBytes, fileContentType: request.FileContentType, fileMetaJson: client.JsonSerializer.Serialize(request));
|
||||
return await client.SendRequestAsync<Models.UploadFileResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
|
||||
|
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
public static class WechatTenpayBusinessClientExecuteMSEPayAccountsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/accounts/mse-pay/{platform_id}/bill 接口。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetMSEPayAccountBillResponse> ExecuteGetMSEPayAccountBillAsync(this WechatTenpayBusinessClient client, Models.GetMSEPayAccountBillRequest 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, "mse-pay", "accounts", "mse-pay", client.Credentials.PlatformId, "bill");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetMSEPayAccountBillResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /{download_url} 接口。</para>
|
||||
/// <para><i>(请注意此接口不受构造 <see cref="WechatTenpayBusinessClient" /> 时指定的 <see cref="WechatTenpayBusinessClientOptions.Endpoint"/> 参数控制。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.DownloadMSEPayAccountBillResponse> ExecuteDownloadMSEPayAccountBillAsync(this WechatTenpayBusinessClient client, Models.DownloadMSEPayAccountBillRequest 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.Get, request.DownloadUrl)
|
||||
.WithUrl(request.DownloadUrl);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.DownloadMSEPayAccountBillResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,83 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
public static class WechatTenpayBusinessClientExecuteMSEPayPaymentsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/payments/h5-pay 接口。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateMSEPayPaymentH5PayResponse> ExecuteCreateMSEPayPaymentH5PayAsync(this WechatTenpayBusinessClient client, Models.CreateMSEPayPaymentH5PayRequest 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, "mse-pay", "payments", "h5-pay");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateMSEPayPaymentH5PayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /mse-pay/payments/out-payment-id/{out_payment_id} 接口。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetMSEPayPaymentByOutPaymentIdResponse> ExecuteGetMSEPayPaymentByOutPaymentIdAsync(this WechatTenpayBusinessClient client, Models.GetMSEPayPaymentByOutPaymentIdRequest 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.Get, "mse-pay", "payments", "out-payment-id", request.OutPaymentId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetMSEPayPaymentByOutPaymentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /mse-pay/payments/{payment_id} 接口。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetMSEPayPaymentByPaymentIdResponse> ExecuteGetMSEPayPaymentByPaymentIdAsync(this WechatTenpayBusinessClient client, Models.GetMSEPayPaymentByPaymentIdRequest 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.Get, "mse-pay", "payments", request.PaymentId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetMSEPayPaymentByPaymentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/payments/{payment_id}/close 接口。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CloseMSEPayPaymentResponse> ExecuteCloseMSEPayPaymentAsync(this WechatTenpayBusinessClient client, Models.CloseMSEPayPaymentRequest 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, "mse-pay", "payments", request.PaymentId, "close");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CloseMSEPayPaymentResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
public static class WechatTenpayBusinessClientExecuteMSEPayRedirectsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/redirects 接口。</para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateMSEPayRedirectLinkResponse> ExecuteCreateMSEPayRedirectLinkAsync(this WechatTenpayBusinessClient client, Models.CreateMSEPayRedirectLinkRequest 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, "mse-pay", "redirects");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateMSEPayRedirectLinkResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
public static class WechatTenpayBusinessClientExecutePaymentsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/payments/h5-pay 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#h5%E6%94%AF%E4%BB%98 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreatePaymentH5PayResponse> ExecuteCreatePaymentH5PayAsync(this WechatTenpayBusinessClient client, Models.CreatePaymentH5PayRequest 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, "mse-pay", "payments", "h5-pay");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreatePaymentH5PayResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /mse-pay/payments/out-payment-id/{out_payment_id} 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%A4%96%E5%8D%95%E5%8F%B7 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%A4%96%E5%8D%95%E5%8F%B7-2 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%A4%96%E5%8D%95%E5%8F%B7-3 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%A4%96%E5%8D%95%E5%8F%B7-4 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetPaymentByOutPaymentIdResponse> ExecuteGetPaymentByOutPaymentIdAsync(this WechatTenpayBusinessClient client, Models.GetPaymentByOutPaymentIdRequest 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.Get, "mse-pay", "payments", "out-payment-id", request.OutPaymentId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetPaymentByOutPaymentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /mse-pay/payments/{payment_id} 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%86%85%E5%8D%95%E5%8F%B7 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%86%85%E5%8D%95%E5%8F%B7-2 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%86%85%E5%8D%95%E5%8F%B7-3 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95%E6%98%8E%E7%BB%86-%E5%86%85%E5%8D%95%E5%8F%B7-4 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetPaymentByPaymentIdResponse> ExecuteGetPaymentByPaymentIdAsync(this WechatTenpayBusinessClient client, Models.GetPaymentByPaymentIdRequest 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.Get, "mse-pay", "payments", request.PaymentId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetPaymentByPaymentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/payments/{payment_id}/close 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%94%AF%E4%BB%98%E5%85%B3%E5%8D%95 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%94%AF%E4%BB%98%E5%85%B3%E5%8D%95-2 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%94%AF%E4%BB%98%E5%85%B3%E5%8D%95-3 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%94%AF%E4%BB%98%E5%85%B3%E5%8D%95-4 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ClosePaymentResponse> ExecuteClosePaymentAsync(this WechatTenpayBusinessClient client, Models.ClosePaymentRequest 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, "mse-pay", "payments", request.PaymentId, "close");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ClosePaymentResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/redirects 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E8%8E%B7%E5%8F%96%E8%B7%B3%E8%BD%AC%E5%AF%B9%E8%B1%A1%E4%BF%A1%E6%81%AF </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E8%8E%B7%E5%8F%96%E8%B7%B3%E8%BD%AC%E5%AF%B9%E8%B1%A1%E4%BF%A1%E6%81%AF-2 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E8%8E%B7%E5%8F%96%E8%B7%B3%E8%BD%AC%E5%AF%B9%E8%B1%A1%E4%BF%A1%E6%81%AF-3 </para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E8%8E%B7%E5%8F%96%E8%B7%B3%E8%BD%AC%E5%AF%B9%E8%B1%A1%E4%BF%A1%E6%81%AF-4 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreatePaymentRedirectLinkResponse> ExecuteCreatePaymentRedirectLinkAsync(this WechatTenpayBusinessClient client, Models.CreatePaymentRedirectLinkRequest 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, "mse-pay", "redirects");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreatePaymentRedirectLinkResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -6,16 +6,17 @@ using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
public static class WechatTenpayBusinessClientExecuteMSEPayProductApplicationsExtensions
|
||||
public static class WechatTenpayBusinessClientExecuteProductApplicationsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/product-applications 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E7%94%B3%E8%AF%B7%E5%85%A5%E9%A9%BB </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateMSEPayProductApplicationResponse> ExecuteCreateMSEPayProductApplicationAsync(this WechatTenpayBusinessClient client, Models.CreateMSEPayProductApplicationRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.CreateProductApplicationResponse> ExecuteCreateProductApplicationAsync(this WechatTenpayBusinessClient client, Models.CreateProductApplicationRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
@@ -23,17 +24,18 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "mse-pay", "product-applications");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateMSEPayProductApplicationResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateProductApplicationResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /mse-pay/product-applications/out-request-no/{out_request_no} 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E5%85%A5%E9%A9%BB%E7%BB%93%E6%9E%9C-%E5%A4%96%E5%8D%95%E5%8F%B7 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetMSEPayProductApplicationByOutRequestNumberResponse> ExecuteGetMSEPayProductApplicationByOutRequestNumberAsync(this WechatTenpayBusinessClient client, Models.GetMSEPayProductApplicationByOutRequestNumberRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.GetProductApplicationByOutRequestNumberResponse> ExecuteGetProductApplicationByOutRequestNumberAsync(this WechatTenpayBusinessClient client, Models.GetProductApplicationByOutRequestNumberRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
@@ -41,17 +43,18 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "mse-pay", "product-applications", "out-request-no", request.OutRequestNumber);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetMSEPayProductApplicationByOutRequestNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.GetProductApplicationByOutRequestNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /mse-pay/product-applications/{request_no} 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E6%9F%A5%E8%AF%A2%E5%85%A5%E9%A9%BB%E7%BB%93%E6%9E%9C-%E5%86%85%E5%8D%95%E5%8F%B7 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetMSEPayProductApplicationByRequestNumberResponse> ExecuteGetMSEPayProductApplicationByRequestNumberAsync(this WechatTenpayBusinessClient client, Models.GetMSEPayProductApplicationByRequestNumberRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.GetProductApplicationByRequestNumberResponse> ExecuteGetProductApplicationByRequestNumberAsync(this WechatTenpayBusinessClient client, Models.GetProductApplicationByRequestNumberRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
@@ -59,17 +62,18 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "mse-pay", "product-applications", request.RequestNumber);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetMSEPayProductApplicationByRequestNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.GetProductApplicationByRequestNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /mse-pay/product-applications/{request_no}/links 接口。</para>
|
||||
/// <para>REF: https://businesspay.qq.com/p/doc/mse/api/server.html#%E5%88%9B%E5%BB%BA%E5%85%A5%E9%A9%BB%E8%B7%B3%E8%BD%AC%E9%93%BE%E6%8E%A5 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateMSEPayProductApplicationLinkResponse> ExecuteCreateMSEPayProductApplicationLinkAsync(this WechatTenpayBusinessClient client, Models.CreateMSEPayProductApplicationLinkRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.CreateProductApplicationLinkResponse> ExecuteCreateProductApplicationLinkAsync(this WechatTenpayBusinessClient client, Models.CreateProductApplicationLinkRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
@@ -77,7 +81,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "mse-pay", "product-applications", request.RequestNumber, "links");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateMSEPayProductApplicationLinkResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateProductApplicationLinkResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@@ -23,10 +23,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
bool requireEncrypt = request.GetType().GetCustomAttributes<WechatTenpayBusinessSensitiveAttribute>(inherit: true).Any();
|
||||
if (requireEncrypt)
|
||||
{
|
||||
if (request.TBEPEncryption is null)
|
||||
request.TBEPEncryption = new WechatTenpayBusinessRequestTBEPEncryption() { Algorithm = client.Credentials.SensitivePropertyEncryptionAlgorithm };
|
||||
if (request.Encryption is null)
|
||||
request.Encryption = new WechatTenpayBusinessRequestEncryption() { Algorithm = client.Credentials.SensitivePropertyEncryptionAlgorithm };
|
||||
|
||||
if (Constants.EncryptionAlgorithms.RSA_OAEP_WITH_SM4_128_CBC.Equals(request.TBEPEncryption.Algorithm))
|
||||
if (Constants.EncryptionAlgorithms.RSA_OAEP_WITH_SM4_128_CBC.Equals(request.Encryption.Algorithm))
|
||||
{
|
||||
Utilities.ReflectionUtility.ReplacePropertyStringValue(ref request, (target, currentProp, oldValue) =>
|
||||
{
|
||||
@@ -38,9 +38,9 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
string sm4Key = client.Credentials.SensitivePropertyEncryptionSM4Key!;
|
||||
string sm4EncryptedKey = Utilities.RSAUtility.EncryptWithECB(publicKey: client.Credentials.TBEPCertificatePublicKey, plainText: sm4Key);
|
||||
|
||||
request.TBEPEncryption.CertificateSerialNumber = client.Credentials.TBEPCertificateSerialNumber;
|
||||
request.TBEPEncryption.EncryptedKey = sm4EncryptedKey;
|
||||
request.TBEPEncryption.IV = sm4IV;
|
||||
request.Encryption.SerialNumber = client.Credentials.TBEPCertificateSerialNumber;
|
||||
request.Encryption.EncryptedKey = sm4EncryptedKey;
|
||||
request.Encryption.IV = sm4IV;
|
||||
|
||||
string newValue = Utilities.SM4Utility.EncryptWithCBC(key: sm4Key, iv: sm4IV, plainText: oldValue);
|
||||
return (true, newValue);
|
||||
|
@@ -26,12 +26,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
bool requireDecrypt = response.GetType().GetCustomAttributes<WechatTenpayBusinessSensitiveAttribute>(inherit: true).Any();
|
||||
if (requireDecrypt)
|
||||
{
|
||||
if (response.TBEPEncryption is null)
|
||||
throw new InvalidOperationException("Could not read value of `TBEP-Encrypt`.");
|
||||
if (response.TBEPEncryption.CertificateSerialNumber != client.Credentials.PlatformCertificateSerialNumber)
|
||||
throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Failed to decrypt response, because there is no platform certificate matched the serial number.");
|
||||
if (response.Encryption is null)
|
||||
throw new InvalidOperationException("Could not read value of 'TBEP-Encrypt'.");
|
||||
if (response.Encryption.PlatformId != null && response.Encryption.SerialNumber != client.Credentials.PlatformCertificateSerialNumber)
|
||||
throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Failed to decrypt response, because the platform certificate serial number does not match.");
|
||||
if (response.Encryption.EnterpriseId != null && response.Encryption.SerialNumber != client.Credentials.EnterpriseCertificateSerialNumber)
|
||||
throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Failed to decrypt response, because the enterprise certificate serial number does not match.");
|
||||
|
||||
if (Constants.EncryptionAlgorithms.RSA_OAEP_WITH_SM4_128_CBC.Equals(response.TBEPEncryption.Algorithm))
|
||||
if (Constants.EncryptionAlgorithms.RSA_OAEP_WITH_SM4_128_CBC.Equals(response.Encryption.Algorithm))
|
||||
{
|
||||
Utilities.ReflectionUtility.ReplacePropertyStringValue(ref response, (target, currentProp, oldValue) =>
|
||||
{
|
||||
@@ -39,9 +41,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
if (attr == null)
|
||||
return (false, oldValue);
|
||||
|
||||
string sm4EncryptedKey = response.TBEPEncryption.EncryptedKey!;
|
||||
string sm4Key = Utilities.RSAUtility.DecryptWithECB(privateKey: client.Credentials.PlatformCertificatePrivateKey, cipherText: sm4EncryptedKey);
|
||||
string sm4IV = response.TBEPEncryption.IV!;
|
||||
string sm4EncryptedKey = response.Encryption.EncryptedKey!;
|
||||
string sm4Key = Utilities.RSAUtility.DecryptWithECB(
|
||||
privateKey: response.Encryption.PlatformId != null ? client.Credentials.PlatformCertificatePrivateKey! :
|
||||
response.Encryption.EnterpriseId != null ? client.Credentials.EnterpriseCertificatePrivateKey! :
|
||||
string.Empty,
|
||||
cipherText: sm4EncryptedKey
|
||||
);
|
||||
string sm4IV = response.Encryption.IV!;
|
||||
|
||||
string newValue = Utilities.SM4Utility.DecryptWithCBC(key: sm4Key, iv: sm4IV, cipherText: oldValue);
|
||||
return (true, newValue);
|
||||
|
@@ -6,19 +6,30 @@ using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Interceptors
|
||||
{
|
||||
using SKIT.FlurlHttpClient.Constants;
|
||||
|
||||
internal class WechatTenpayBusinessRequestSignatureInterceptor : FlurlHttpCallInterceptor
|
||||
{
|
||||
private const string HTTP_HEADER_PLATFORM_AUTHORIZATION = HttpHeaders.Authorization;
|
||||
private const string HTTP_HEADER_ENTERPRISE_AUTHORIZATION = "Enterprise-Authorization";
|
||||
|
||||
private readonly string _signAlg;
|
||||
private readonly string _platformId;
|
||||
private readonly string _platformCertSn;
|
||||
private readonly string _platformCertPk;
|
||||
private readonly string? _enterpriseId;
|
||||
private readonly string? _enterpriseCertSn;
|
||||
private readonly string? _enterpriseCertPk;
|
||||
|
||||
public WechatTenpayBusinessRequestSignatureInterceptor(string signAlg, string platformId, string platformCertSn, string platformCertPk)
|
||||
public WechatTenpayBusinessRequestSignatureInterceptor(string signAlg, string platformId, string platformCertSn, string platformCertPk, string? enterpriseId, string? enterpriseCertSn, string? enterpriseCertPk)
|
||||
{
|
||||
_signAlg = signAlg;
|
||||
_platformId = platformId;
|
||||
_platformCertSn = platformCertSn;
|
||||
_platformCertPk = platformCertPk;
|
||||
_enterpriseId = enterpriseId;
|
||||
_enterpriseCertSn = enterpriseCertSn;
|
||||
_enterpriseCertPk = enterpriseCertPk;
|
||||
}
|
||||
|
||||
public override async Task BeforeCallAsync(FlurlCall flurlCall)
|
||||
@@ -49,6 +60,9 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Interceptors
|
||||
string plainText = $"{method}\n{url}\n{timestamp}\n{nonce}\n{body}\n";
|
||||
string signText;
|
||||
|
||||
bool softSignRequired = _enterpriseId != null && _enterpriseCertSn != null && _enterpriseCertPk != null;
|
||||
string? softSignText = null;
|
||||
|
||||
switch (_signAlg)
|
||||
{
|
||||
case Constants.SignAlgorithms.SHA245_WITH_RSA:
|
||||
@@ -56,6 +70,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Interceptors
|
||||
try
|
||||
{
|
||||
signText = Utilities.RSAUtility.SignWithSHA256(_platformCertPk, plainText);
|
||||
|
||||
if (softSignRequired)
|
||||
{
|
||||
byte[] keyBytes = Convert.FromBase64String(_enterpriseCertPk);
|
||||
byte[] msgBytes = Convert.FromBase64String(signText);
|
||||
softSignText = Convert.ToBase64String(Utilities.RSAUtility.SignWithSHA256(keyBytes, msgBytes));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -69,8 +90,15 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Interceptors
|
||||
}
|
||||
|
||||
string authString = $"platform_id=\"{_platformId}\",platform_serial_number=\"{_platformCertSn}\",nonce=\"{nonce}\",timestamp=\"{timestamp}\",signature=\"{signText}\",signature_algorithm=\"{_signAlg}\"";
|
||||
flurlCall.Request.Headers.Remove(FlurlHttpClient.Constants.HttpHeaders.Authorization);
|
||||
flurlCall.Request.WithHeader(FlurlHttpClient.Constants.HttpHeaders.Authorization, authString);
|
||||
flurlCall.Request.Headers.Remove(HTTP_HEADER_PLATFORM_AUTHORIZATION);
|
||||
flurlCall.Request.WithHeader(HttpHeaders.Authorization, authString);
|
||||
|
||||
if (softSignRequired)
|
||||
{
|
||||
string softAuthString = $"ent_id=\"{_enterpriseId}\",enterprise_serial_number=\"{_enterpriseCertSn}\",signature=\"{softSignText}\",signature_algorithm=\"{_signAlg}\"";
|
||||
flurlCall.Request.Headers.Remove(HTTP_HEADER_ENTERPRISE_AUTHORIZATION);
|
||||
flurlCall.Request.WithHeader(HTTP_HEADER_ENTERPRISE_AUTHORIZATION, softAuthString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /{download_url} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class DownloadMSEPayAccountBillRequest : WechatTenpayBusinessRequest
|
||||
public class DownloadBillFileRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文件下载链接。
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /{download_url} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class DownloadMSEPayAccountBillResponse : WechatTenpayBusinessResponse
|
||||
public class DownloadBillFileResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
public override bool IsSuccessful()
|
||||
{
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/bill-downloads 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetBillRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置账单日期字符串(格式:yyyy-MM-dd)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("billDate")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("billDate")]
|
||||
public string BillDateString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("billType")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("billType")]
|
||||
public string? BillType { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/bill-downloads 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetBillResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置哈希类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hash_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hash_type")]
|
||||
public string HashType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置哈希值。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hash_value")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hash_value")]
|
||||
public string HashValue { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单下载地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("download_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
|
||||
public string DownloadUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/bill-downloads/trans 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetBillTransactionRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置账单日期字符串(格式:yyyy-MM-dd)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bill_Date")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bill_Date")]
|
||||
public string BillDateString { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bill_Type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bill_Type")]
|
||||
public string? BillType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ent_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ent_id")]
|
||||
public string? EnterpriseId { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/bill-downloads/trans 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetBillTransactionResponse : GetBillResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /file-uploads 接口的请求。</para>
|
||||
/// <para>表示 [POST] /mse-pay/file-uploads 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UploadFileRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
|
@@ -1,12 +1,12 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /file-uploads 接口的响应。</para>
|
||||
/// <para>表示 [POST] /mse-pay/file-uploads 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UploadFileResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件标识 ID。
|
||||
/// 获取或设置文件 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file_id")]
|
||||
|
@@ -1,15 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/accounts/mse-pay/{platform_id}/bill 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayAccountBillRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置查询日期字符串(格式:yyyy-MM-dd)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("query_date")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("query_date")]
|
||||
public string DateString { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/accounts/mse-pay/{platform_id}/bill 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayAccountBillResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文件下载链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("download_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("download_url")]
|
||||
public string DownloadUrl { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置过期时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ExpireTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bill_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bill_status")]
|
||||
public string BillStatus { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/payments/h5-pay 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateMSEPayPaymentH5PayResponse : GetMSEPayPaymentByPaymentIdResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/product-applications/out-request-no/{out_request_no} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayProductApplicationByOutRequestNumberResponse : GetMSEPayProductApplicationByRequestNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/redirects 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateMSEPayRedirectLinkRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微企付支付单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string PaymentId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/payments/{payment_id}/close 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CloseMSEPayPaymentRequest : WechatTenpayBusinessRequest
|
||||
public class ClosePaymentRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微企付支付单号。
|
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/payments/{payment_id}/close 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CloseMSEPayPaymentResponse : WechatTenpayBusinessResponse
|
||||
public class ClosePaymentResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置平台支付单号。
|
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
@@ -7,7 +7,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
/// <para>表示 [POST] /mse-pay/payments/h5-pay 接口的请求。</para>
|
||||
/// </summary>
|
||||
[WechatTenpayBusinessSensitive]
|
||||
public class CreateMSEPayPaymentH5PayRequest : WechatTenpayBusinessRequest
|
||||
public class CreatePaymentH5PayRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ent_acct_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ent_acct_id")]
|
||||
public string EnterpriseAccountId { get; set; } = string.Empty;
|
||||
public string? EnterpriseAccountId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号后 4 位。
|
||||
@@ -43,6 +43,16 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
public string? BankAccountNumberLast4String { get; set; }
|
||||
}
|
||||
|
||||
public class Payer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bank_account_numbers")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bank_account_numbers")]
|
||||
public IList<string>? BankAccountNumberList { get; set; }
|
||||
}
|
||||
|
||||
public class Goods
|
||||
{
|
||||
/// <summary>
|
||||
@@ -56,29 +66,45 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
/// 获取或设置商品数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("good_number")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.TextualIntegerConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("good_number")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)]
|
||||
public int Count { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("good_amount")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.TextualIntegerConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("good_amount")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString)]
|
||||
public int Amount { get; set; }
|
||||
}
|
||||
|
||||
public class NotifyConfig
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class FrontendCallback
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 H5 回跳地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("h5_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("h5_url")]
|
||||
public string H5Url { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置支付结果通知 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("server_notify_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("server_notify_url")]
|
||||
public string ServerNotifyUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置前端回跳信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("front_callback_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("front_callback_url")]
|
||||
public Types.FrontendCallback? FrontendCallback { get; set; }
|
||||
}
|
||||
|
||||
public class RiskControl
|
||||
@@ -128,6 +154,43 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
public string? PickDescription { get; set; }
|
||||
}
|
||||
|
||||
public class Scene
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Store
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置门店编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置地区编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("area_code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("area_code")]
|
||||
public string? AreaCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置门店信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("store_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("store_info")]
|
||||
public Types.Store? Store { get; set; }
|
||||
}
|
||||
|
||||
public class Promotion
|
||||
{
|
||||
}
|
||||
@@ -178,6 +241,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payee")]
|
||||
public Types.Payee Payee { get; set; } = new Types.Payee();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置付款方信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer")]
|
||||
public Types.Payer? Payer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附言。
|
||||
/// </summary>
|
||||
@@ -213,11 +283,25 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
|
||||
public Types.NotifyConfig NotifyConfig { get; set; } = new Types.NotifyConfig();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置场景信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scene_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scene_info")]
|
||||
public Types.Scene? Scene { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_detail")]
|
||||
public Types.Promotion? Promotion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分账标识。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("profit_allocation_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("profit_allocation_flag")]
|
||||
public string? ProfitAllocationFlag { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/payments/h5-pay 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreatePaymentH5PayResponse : GetPaymentByPaymentIdResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/redirects 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreatePaymentRedirectLinkRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微企付支付单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微企付支付单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payment_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payment_id")]
|
||||
public string? PaymentId { get; set; }
|
||||
}
|
||||
}
|
@@ -1,56 +1,56 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/redirects 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateMSEPayRedirectLinkResponse : WechatTenpayBusinessResponse
|
||||
public class CreatePaymentRedirectLinkResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class PCWebData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 URL。
|
||||
/// 获取或设置跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string Url { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置过期时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ExpireTime { get; set; }
|
||||
}
|
||||
|
||||
public class PCPluginData
|
||||
public class QrcodeData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 Key。
|
||||
/// 获取或设置二维码 URL。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("key")]
|
||||
public string Key { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置过期时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ExpireTime { get; set; }
|
||||
[Newtonsoft.Json.JsonProperty("static_qrcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("static_qrcode")]
|
||||
public string QrcodeUrl { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class WxaQrcodeData
|
||||
public class H5Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 URL。
|
||||
/// 获取或设置 H5 收银台链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wx_h5")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wx_h5")]
|
||||
public string Url { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class AppData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 H5 收银台链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_h5")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_h5")]
|
||||
public string Url { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class WecomData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 H5 收银台链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
@@ -81,13 +81,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
public string Username { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置过期时间。
|
||||
/// 获取或设置小程序版本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expire_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ExpireTime { get; set; }
|
||||
[Newtonsoft.Json.JsonProperty("mp_version")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mp_version")]
|
||||
public string? Version { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,27 +94,41 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pc_web")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pc_web")]
|
||||
public Types.PCWebData PCWebData { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 PC 弹窗组件参数信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pc_plugin")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pc_plugin")]
|
||||
public Types.PCPluginData? PCPluginData { get; set; }
|
||||
public Types.PCWebData? PCWebData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序二维码参数信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wx_qrcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wx_qrcode")]
|
||||
public Types.WxaQrcodeData? WxaQrcodeData { get; set; }
|
||||
[Newtonsoft.Json.JsonProperty("static_qrcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("static_qrcode")]
|
||||
public Types.QrcodeData? QrcodeData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序参数信息。
|
||||
/// 获取或设置 H5 跳转链接信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("miniprogram")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("miniprogram")]
|
||||
[Newtonsoft.Json.JsonProperty("wx_h5")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wx_h5")]
|
||||
public Types.H5Data? H5Data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 App 跳转链接信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("app_h5")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("app_h5")]
|
||||
public Types.AppData? AppData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信跳转链接信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wecom_h5")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wecom_h5")]
|
||||
public Types.WecomData? WeComData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置小程序跳转参数信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mini_program")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mini_program")]
|
||||
public Types.MiniProgramData? MiniProgramData { get; set; }
|
||||
}
|
||||
}
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/payments/out-payment-id/{out_payment_id} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayPaymentByOutPaymentIdRequest : WechatTenpayBusinessRequest
|
||||
public class GetPaymentByOutPaymentIdRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置平台支付单号。
|
@@ -4,7 +4,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
/// <para>表示 [GET] /mse-pay/payments/out-payment-id/{out_payment_id} 接口的响应。</para>
|
||||
/// </summary>
|
||||
[WechatTenpayBusinessSensitive]
|
||||
public class GetMSEPayPaymentByOutPaymentIdResponse : GetMSEPayPaymentByPaymentIdResponse
|
||||
public class GetPaymentByOutPaymentIdResponse : GetPaymentByPaymentIdResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/payments/{payment_id} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayPaymentByPaymentIdRequest : WechatTenpayBusinessRequest
|
||||
public class GetPaymentByPaymentIdRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微企付支付单号。
|
@@ -1,13 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/payments/{payment_id} 接口的响应。</para>
|
||||
/// </summary>
|
||||
[WechatTenpayBusinessSensitive]
|
||||
public class GetMSEPayPaymentByPaymentIdResponse : WechatTenpayBusinessResponse
|
||||
public class GetPaymentByPaymentIdResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Payer
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微企付 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_id")]
|
||||
public string? PayerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置平台付款方 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_payer_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_payer_id")]
|
||||
public string? OutPayerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号后 4 位。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_acct_last4")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_acct_last4")]
|
||||
public string? BankAccountNumberLast4String { get; set; }
|
||||
}
|
||||
|
||||
public class Payee
|
||||
{
|
||||
/// <summary>
|
||||
@@ -18,43 +43,11 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
public string EnterpriseId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业名称(需使用平台私钥解密)。
|
||||
/// 获取或设置企业名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ent_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ent_name")]
|
||||
[WechatTenpayBusinessSensitiveProperty]
|
||||
public string EnterpriseName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业账户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ent_acct_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ent_acct_id")]
|
||||
public string EnterpriseAccountId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号后 4 位。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bank_account_number_last4")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bank_account_number_last4")]
|
||||
public string? BankAccountNumberLast4String { get; set; }
|
||||
}
|
||||
|
||||
public class FailedReason
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置失败类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("failed_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("failed_type")]
|
||||
public string? FailedType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败原因详情。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("failed_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("failed_detail")]
|
||||
public string? FailedDetail { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +79,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置付款方信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer")]
|
||||
public Types.Payer Payer { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置收款方信息。
|
||||
/// </summary>
|
||||
@@ -93,13 +93,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payee")]
|
||||
public Types.Payee Payee { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微企付用户 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_openid")]
|
||||
public string? UserOpenId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单状态。
|
||||
/// </summary>
|
||||
@@ -114,18 +107,20 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("memo")]
|
||||
public string? Memo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置失败原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("failed_reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("failed_reason")]
|
||||
public Types.FailedReason? FailedReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附加信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("attachment")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attachment")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置付款时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pay_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RegularNullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RegularNullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? PayTime { get; set; }
|
||||
}
|
||||
}
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/product-applications/{request_no}/links 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateMSEPayProductApplicationLinkRequest : WechatTenpayBusinessRequest
|
||||
public class CreateProductApplicationLinkRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微企付开户申请单号。
|
@@ -1,25 +1,25 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/product-applications/{request_no}/links 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateMSEPayProductApplicationLinkResponse : WechatTenpayBusinessResponse
|
||||
public class CreateProductApplicationLinkResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class PCWebData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置 URL。
|
||||
/// 获取或设置跳转链接。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("url")]
|
||||
public string Url { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置过期时间。
|
||||
/// 获取或设置链接过期时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
@@ -34,6 +34,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pc_web")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pc_web")]
|
||||
public Types.PCWebData PCWebData { get; set; } = default!;
|
||||
public Types.PCWebData? PCWebData { get; set; }
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
@@ -6,7 +6,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
/// <para>表示 [POST] /mse-pay/product-applications 接口的请求。</para>
|
||||
/// </summary>
|
||||
[WechatTenpayBusinessSensitive]
|
||||
public class CreateMSEPayProductApplicationRequest : WechatTenpayBusinessRequest
|
||||
public class CreateProductApplicationRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /mse-pay/product-applications 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateMSEPayProductApplicationResponse : WechatTenpayBusinessResponse
|
||||
public class CreateProductApplicationResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置业务申请编号。
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/product-applications/out-request-no/{out_request_no} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayProductApplicationByOutRequestNumberRequest : WechatTenpayBusinessRequest
|
||||
public class GetProductApplicationByOutRequestNumberRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置业务申请编号。
|
@@ -1,27 +1,14 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/product-applications/{request_no} 接口的响应。</para>
|
||||
/// <para>表示 [GET] /mse-pay/product-applications/out-request-no/{out_request_no} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayProductApplicationByRequestNumberResponse : WechatTenpayBusinessResponse
|
||||
public class GetProductApplicationByOutRequestNumberResponse : WechatTenpayBusinessResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Account
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置企业账户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ent_acct_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ent_acct_id")]
|
||||
public string EnterpriseAccountId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置产品名称。
|
||||
/// </summary>
|
||||
@@ -37,11 +24,11 @@
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账户列表。
|
||||
/// 获取或设置失败类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("accounts")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("accounts")]
|
||||
public Types.Account[]? AccountList { get; set; }
|
||||
[Newtonsoft.Json.JsonProperty("failed_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("failed_type")]
|
||||
public string? FailedType { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/product-applications/{request_no} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetMSEPayProductApplicationByRequestNumberRequest : WechatTenpayBusinessRequest
|
||||
public class GetProductApplicationByRequestNumberRequest : WechatTenpayBusinessRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微企付开户申请单号。
|
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /mse-pay/product-applications/{request_no} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetProductApplicationByRequestNumberResponse : GetProductApplicationByOutRequestNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -13,7 +13,7 @@
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat</PackageProjectUrl>
|
||||
<PackageTags>Flurl.Http Tencent Tenpay 微企付</PackageTags>
|
||||
<PackageTags>Flurl.Http Tencent Tenpay 腾讯商企付 腾讯微企付 商企付 微企付</PackageTags>
|
||||
<Version>2.0.1</Version>
|
||||
<Description>基于 Flurl.Http 的微企付 API 客户端。</Description>
|
||||
<Authors>Fu Diwei</Authors>
|
||||
|
@@ -19,10 +19,25 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Settings
|
||||
/// </summary>
|
||||
public string PlatformCertificatePrivateKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatTenpayBusinessClientOptions.EnterpriseId"/> 的副本。
|
||||
/// </summary>
|
||||
public string EnterpriseId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatTenpayBusinessClientOptions.EnterpriseCertificateSerialNumber"/> 的副本。
|
||||
/// </summary>
|
||||
public string? EnterpriseCertificateSerialNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatTenpayBusinessClientOptions.EnterpriseCertificatePrivateKey"/> 的副本。
|
||||
/// </summary>
|
||||
public string? EnterpriseCertificatePrivateKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatTenpayBusinessClientOptions.TBEPCertificateSerialNumber"/> 的副本。
|
||||
/// </summary>
|
||||
public string TBEPCertificateSerialNumber { get; }
|
||||
public string? TBEPCertificateSerialNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatTenpayBusinessClientOptions.TBEPCertificatePublicKey"/> 的副本。
|
||||
@@ -51,6 +66,9 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Settings
|
||||
PlatformId = options.PlatformId;
|
||||
PlatformCertificateSerialNumber = options.PlatformCertificateSerialNumber;
|
||||
PlatformCertificatePrivateKey = options.PlatformCertificatePrivateKey;
|
||||
EnterpriseId = options.EnterpriseId;
|
||||
EnterpriseCertificateSerialNumber = options.EnterpriseCertificateSerialNumber;
|
||||
EnterpriseCertificatePrivateKey = options.EnterpriseCertificatePrivateKey;
|
||||
TBEPCertificateSerialNumber = options.TBEPCertificateSerialNumber;
|
||||
TBEPCertificatePublicKey = options.TBEPCertificatePublicKey;
|
||||
SensitivePropertyEncryptionAlgorithm = options.SensitivePropertyEncryptionAlgorithm;
|
||||
|
@@ -52,7 +52,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
signAlg: options.SignAlgorithm,
|
||||
platformId: options.PlatformId,
|
||||
platformCertSn: options.PlatformCertificateSerialNumber,
|
||||
platformCertPk: options.PlatformCertificatePrivateKey
|
||||
platformCertPk: options.PlatformCertificatePrivateKey,
|
||||
enterpriseId: options.EnterpriseId,
|
||||
enterpriseCertSn: options.EnterpriseCertificateSerialNumber,
|
||||
enterpriseCertPk: options.EnterpriseCertificatePrivateKey
|
||||
));
|
||||
}
|
||||
|
||||
@@ -77,10 +80,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
flurlRequest.WithTimeout(TimeSpan.FromMilliseconds(request.Timeout.Value));
|
||||
}
|
||||
|
||||
if (request.TBEPEncryption != null)
|
||||
if (request.Encryption != null)
|
||||
{
|
||||
flurlRequest.Headers.Remove("TBEP-Encrypt");
|
||||
flurlRequest.WithHeader("TBEP-Encrypt", $"enc_key=\"{request.TBEPEncryption.EncryptedKey}\",iv=\"{Convert.ToBase64String(Encoding.UTF8.GetBytes(request.TBEPEncryption.IV))}\",tbep_serial_number=\"{request.TBEPEncryption.CertificateSerialNumber}\",algorithm=\"{request.TBEPEncryption.Algorithm}\"");
|
||||
flurlRequest.WithHeader("TBEP-Encrypt", $"enc_key=\"{request.Encryption.EncryptedKey}\",iv=\"{Convert.ToBase64String(Encoding.UTF8.GetBytes(request.Encryption.IV))}\",tbep_serial_number=\"{request.Encryption.SerialNumber}\",algorithm=\"{request.Encryption.Algorithm}\"");
|
||||
}
|
||||
|
||||
return flurlRequest;
|
||||
@@ -159,22 +162,23 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
TResponse result = await base.WrapResponseWithJsonAsync<TResponse>(flurlResponse, cancellationToken);
|
||||
|
||||
string? strTBEPEncryption = flurlResponse.Headers.FirstOrDefault("TBEP-Encrypt");
|
||||
if (!string.IsNullOrEmpty(strTBEPEncryption))
|
||||
string? strEncryption = flurlResponse.Headers.FirstOrDefault("TBEP-Encrypt");
|
||||
if (!string.IsNullOrEmpty(strEncryption))
|
||||
{
|
||||
IDictionary<string, string?> dictTBEPEncryption = strTBEPEncryption
|
||||
IDictionary<string, string?> dictEncryption = strEncryption
|
||||
.Split(',')
|
||||
.Select(s => s.Trim().Split(new char[] { '=' }, 2, StringSplitOptions.RemoveEmptyEntries))
|
||||
.ToDictionary(
|
||||
k => k[0],
|
||||
v => v.Length > 1 ? v[1].TrimStart('\"').TrimEnd('\"') : null
|
||||
);
|
||||
result.TBEPEncryption = new WechatTenpayBusinessResponseTBEPEncryption();
|
||||
result.TBEPEncryption.PlatformId = dictTBEPEncryption["platform_id"];
|
||||
result.TBEPEncryption.EncryptedKey = dictTBEPEncryption["enc_key"];
|
||||
result.TBEPEncryption.IV = dictTBEPEncryption["iv"];
|
||||
result.TBEPEncryption.CertificateSerialNumber = dictTBEPEncryption["platform_serial_number"];
|
||||
result.TBEPEncryption.Algorithm = dictTBEPEncryption["algorithm"];
|
||||
result.Encryption = new WechatTenpayBusinessResponseEncryption();
|
||||
result.Encryption.PlatformId = dictEncryption.GetValueOrDefault("platform_id");
|
||||
result.Encryption.EnterpriseId = dictEncryption.GetValueOrDefault("ent_id");
|
||||
result.Encryption.EncryptedKey = dictEncryption.GetValueOrDefault("enc_key");
|
||||
result.Encryption.IV = dictEncryption.GetValueOrDefault("iv");
|
||||
result.Encryption.SerialNumber = dictEncryption.GetValueOrDefault("platform_serial_number") ?? dictEncryption.GetValueOrDefault("enterprise_serial_number");
|
||||
result.Encryption.Algorithm = dictEncryption.GetValueOrDefault("algorithm");
|
||||
|
||||
if (AutoDecryptResponseSensitiveProperty && result.IsSuccessful())
|
||||
{
|
||||
|
@@ -39,12 +39,27 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
public string PlatformCertificatePrivateKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微企付证书序列号。
|
||||
/// 获取或设置微企付企业商户 ID。
|
||||
/// </summary>
|
||||
public string TBEPCertificateSerialNumber { get; set; } = default!;
|
||||
public string EnterpriseId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微企付证书公钥。
|
||||
/// 获取或设置微企付企业商户 API 证书序列号。
|
||||
/// </summary>
|
||||
public string? EnterpriseCertificateSerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微企付企业商户 API 证书私钥。
|
||||
/// </summary>
|
||||
public string? EnterpriseCertificatePrivateKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微企付 TBEP 证书序列号。
|
||||
/// </summary>
|
||||
public string? TBEPCertificateSerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微企付 TBEP 证书公钥。
|
||||
/// </summary>
|
||||
public string TBEPCertificatePublicKey { get; set; } = default!;
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示微企付 API 请求的基类。
|
||||
@@ -18,10 +18,10 @@
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public virtual WechatTenpayBusinessRequestTBEPEncryption? TBEPEncryption { get; set; }
|
||||
public virtual WechatTenpayBusinessRequestEncryption? Encryption { get; set; }
|
||||
}
|
||||
|
||||
public sealed class WechatTenpayBusinessRequestTBEPEncryption
|
||||
public sealed class WechatTenpayBusinessRequestEncryption
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置加密后的密钥值。
|
||||
@@ -42,7 +42,7 @@
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string CertificateSerialNumber { get; set; } = string.Empty;
|
||||
public string SerialNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置加密算法。
|
||||
|
@@ -60,7 +60,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public WechatTenpayBusinessResponseTBEPEncryption? TBEPEncryption { get; internal set; }
|
||||
public WechatTenpayBusinessResponseEncryption? Encryption { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取微企付请求链路 ID。
|
||||
@@ -110,7 +110,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
public IDictionary<string, string>? Details { get; set; }
|
||||
}
|
||||
|
||||
public sealed class WechatTenpayBusinessResponseTBEPEncryption
|
||||
public sealed class WechatTenpayBusinessResponseEncryption
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置平台账号。
|
||||
@@ -119,6 +119,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? PlatformId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? EnterpriseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置加密后的密钥值。
|
||||
/// </summary>
|
||||
@@ -138,7 +145,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? CertificateSerialNumber { get; set; }
|
||||
public string? SerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置加密算法。
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"api_version": "",
|
||||
"event_id": "",
|
||||
"event_type": "product.application.finish",
|
||||
@@ -13,13 +13,8 @@
|
||||
"product_details": [
|
||||
{
|
||||
"product_name": "",
|
||||
"status": "",
|
||||
"accounts": [
|
||||
{
|
||||
"ent_acct_id": ""
|
||||
}
|
||||
]
|
||||
"status": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"billDate": "2022-12-12",
|
||||
"billType": "ALL"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"hash_type": "SHA256",
|
||||
"hash_value": "79bb0f45fc4c42234a918000b2668d689e2bde04",
|
||||
"download_url": "https://api.business.qq.com/v3/mse-pay/bill-downloads/file?token=xxx"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"bill_Date": "string",
|
||||
"bill_Type": "TRANS_ALL",
|
||||
"ent_id": "stringstri"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"hash_type": "SHA256",
|
||||
"hash_value": "79bb0f45fc4c42234a918000b2668d689e2bde04",
|
||||
"download_url": "https://api.business.qq.com/v3/mse-pay/bill-downloads/trans/file?token=xxx"
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"query_date": "2021-01-01"
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"download_url": "",
|
||||
"expire_time": "2021-06-08T10:34:56+08:00",
|
||||
"bill_status": ""
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"close_reason": ""
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"payment_id": "",
|
||||
"out_payment_id": "",
|
||||
"status": "",
|
||||
"close_time": "2021-06-08T10:34:56+08:00"
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"purchaser_type": "",
|
||||
"out_payment_id": "",
|
||||
"amount": 0,
|
||||
"currency": "",
|
||||
"expire_time": "2021-06-08T10:34:56+08:00",
|
||||
"payee": {
|
||||
"ent_id": "",
|
||||
"ent_name": "",
|
||||
"ent_acct_id": "",
|
||||
"bank_account_number_last4": ""
|
||||
},
|
||||
"memo": "",
|
||||
"goods": [
|
||||
{
|
||||
"good_name": "",
|
||||
"good_number": "0",
|
||||
"good_amount": "0"
|
||||
}
|
||||
],
|
||||
"attachment": "",
|
||||
"risk_control": {
|
||||
"device_id": "",
|
||||
"payer_client_ip": "",
|
||||
"payer_ua": "",
|
||||
"create_time": "2021-06-08T10:34:56+08:00",
|
||||
"pick_type": "",
|
||||
"pick_description": ""
|
||||
},
|
||||
"notify_url": {
|
||||
"server_notify_url": ""
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"payment_id": "",
|
||||
"out_payment_id": "",
|
||||
"amount": 0,
|
||||
"currency": "",
|
||||
"payee": {
|
||||
"ent_id": "",
|
||||
"ent_name": "",
|
||||
"ent_acct_id": "",
|
||||
"bank_account_number_last4": ""
|
||||
},
|
||||
"pay_status": "",
|
||||
"memo": ""
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"payment_id": "",
|
||||
"out_payment_id": "",
|
||||
"user_openid": "",
|
||||
"amount": 0,
|
||||
"currency": "",
|
||||
"payee": {
|
||||
"ent_id": "",
|
||||
"ent_name": "",
|
||||
"ent_acct_id": "",
|
||||
"bank_account_number_last4": ""
|
||||
},
|
||||
"pay_status": "",
|
||||
"memo": "",
|
||||
"failed_reason": {
|
||||
"failed_type": "",
|
||||
"failed_detail": ""
|
||||
},
|
||||
"attachment": ""
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"pc_web": {
|
||||
"url": "",
|
||||
"expire_time": "2020-01-01T01:02:03+08:00"
|
||||
}
|
||||
}
|
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"out_request_no": "",
|
||||
"business_license": {
|
||||
"business_register_type": "",
|
||||
"unified_social_credit_code": "",
|
||||
"merchant_name": "",
|
||||
"merchant_short_name": "",
|
||||
"legal_person_name": "",
|
||||
"validity_period": [ "2024-01-01", "长期" ],
|
||||
"photocopy_file_id": ""
|
||||
},
|
||||
"legal_person_id_card": {
|
||||
"name": "",
|
||||
"number": "",
|
||||
"validity_period": [ "2024-01-01", "长期" ],
|
||||
"front_photocopy_file_id": "",
|
||||
"back_photocopy_file_id": ""
|
||||
},
|
||||
"contact_info": {
|
||||
"mobile_number": ""
|
||||
},
|
||||
"payee_accounts": [
|
||||
{
|
||||
"account_type": "",
|
||||
"bank_account_name": "",
|
||||
"bank_account_number": "",
|
||||
"bank_name": "",
|
||||
"bank_branch_id": "",
|
||||
"bank_branch_name": ""
|
||||
}
|
||||
],
|
||||
"products": [
|
||||
{
|
||||
"product_name": ""
|
||||
}
|
||||
],
|
||||
"notify_url": {
|
||||
"server_notify_url": "",
|
||||
"web_success_url": "",
|
||||
"web_refresh_url": ""
|
||||
}
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"request_no": "",
|
||||
"out_request_no": ""
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"request_no": "",
|
||||
"out_request_no": "",
|
||||
"ent_id": "",
|
||||
"status": "",
|
||||
"product_details": [
|
||||
{
|
||||
"product_name": "",
|
||||
"status": "",
|
||||
"accounts": [
|
||||
{
|
||||
"ent_acct_id": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"id": ""
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"pc_web": {
|
||||
"url": "",
|
||||
"expire_time": "2020-01-01T01:02:03+08:00"
|
||||
},
|
||||
"pc_plugin": {
|
||||
"key": "",
|
||||
"expire_time": "2020-01-01T01:02:03+08:00"
|
||||
},
|
||||
"wx_qrcode": {
|
||||
"url": ""
|
||||
},
|
||||
"miniprogram": {
|
||||
"mp_path": "",
|
||||
"mp_appid": "",
|
||||
"mp_username": "",
|
||||
"expire_time": "2020-01-01T01:02:03+08:00"
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"close_reason": "string"
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"payment_id": "string",
|
||||
"out_payment_id": "string",
|
||||
"status": "PROCESSING",
|
||||
"close_time": "2022-11-15T13:25:18.000+00:00"
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"purchaser_type": "string",
|
||||
"out_payment_id": "string",
|
||||
"amount": 0,
|
||||
"currency": "CNY",
|
||||
"expire_time": "2022-11-15T13:25:18.000+00:00",
|
||||
"payee": {
|
||||
"ent_id": "stringstri",
|
||||
"ent_name": "string"
|
||||
},
|
||||
"payer": {
|
||||
"bank_account_numbers": [ "string" ]
|
||||
},
|
||||
"memo": "string",
|
||||
"goods": [
|
||||
{
|
||||
"good_name": "string",
|
||||
"good_number": 0,
|
||||
"good_amount": 0
|
||||
}
|
||||
],
|
||||
"attachment": "string",
|
||||
"risk_control": {
|
||||
"device_id": "string",
|
||||
"payer_client_ip": "string",
|
||||
"payer_ua": "string",
|
||||
"create_time": "2022-11-15T13:25:18.000+00:00",
|
||||
"pick_type": "SELF_PICK",
|
||||
"pick_description": "string"
|
||||
},
|
||||
"notify_url": {
|
||||
"server_notify_url": "string",
|
||||
"front_callback_url": {
|
||||
"h5_url": "string"
|
||||
}
|
||||
},
|
||||
"scene_info": {
|
||||
"store_info": {
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"area_code": "string"
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"payment_id": "string",
|
||||
"out_payment_id": "string",
|
||||
"amount": 0,
|
||||
"currency": "CNY",
|
||||
"payee": {
|
||||
"ent_id": "string",
|
||||
"ent_name": "string"
|
||||
},
|
||||
"pay_status": "PROCESSING",
|
||||
"memo": "string",
|
||||
"attachment": "string"
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"id": "string",
|
||||
"payment_id": "string"
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"static_qrcode": {
|
||||
"static_qrcode": "string"
|
||||
},
|
||||
"mini_program": {
|
||||
"mp_appid": "string",
|
||||
"mp_path": "string",
|
||||
"mp_username": "string",
|
||||
"mp_version": "string"
|
||||
},
|
||||
"wx_h5": {
|
||||
"wx_h5": "string"
|
||||
},
|
||||
"app_h5": {
|
||||
"app_h5": "string"
|
||||
},
|
||||
"wecom_h5": {
|
||||
"url": "string"
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"payment_id": "string",
|
||||
"out_payment_id": "string",
|
||||
"amount": 0,
|
||||
"currency": "",
|
||||
"payer": {
|
||||
"payer_id": "string",
|
||||
"out_payer_id": "string",
|
||||
"payer_acct_last4": "1010"
|
||||
},
|
||||
"payee": {
|
||||
"ent_id": "string",
|
||||
"ent_name": "string"
|
||||
},
|
||||
"pay_status": "PROCESSING",
|
||||
"memo": "string",
|
||||
"attachment": "string",
|
||||
"pay_time": "2022-11-15 13:25:18"
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"pc_web": {
|
||||
"url": "string",
|
||||
"expire_time": "2022-11-15T13:25:18.000+00:00"
|
||||
}
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"out_request_no": "string",
|
||||
"products": [
|
||||
{
|
||||
"product_name": "MSE_PAY"
|
||||
}
|
||||
],
|
||||
"business_license": {
|
||||
"business_register_type": "ENTERPRISE",
|
||||
"unified_social_credit_code": "string",
|
||||
"merchant_name": "string",
|
||||
"merchant_short_name": "string",
|
||||
"legal_person_name": "string",
|
||||
"validity_period": [ "string", "string" ],
|
||||
"photocopy_file_id": "string"
|
||||
},
|
||||
"legal_person_id_card": {
|
||||
"name": "string",
|
||||
"number": "string",
|
||||
"validity_period": [ "string", "string" ],
|
||||
"front_photocopy_file_id": "string",
|
||||
"back_photocopy_file_id": "string"
|
||||
},
|
||||
"notify_url": {
|
||||
"server_notify_url": "string",
|
||||
"web_success_url": "string",
|
||||
"web_refresh_url": "string"
|
||||
},
|
||||
"contact_info": { "mobile_number": "string" },
|
||||
"payee_accounts": [
|
||||
{
|
||||
"account_type": "ENTERPRISE_ACCOUNT",
|
||||
"bank_account_name": "string",
|
||||
"bank_account_number": "string",
|
||||
"bank_branch_id": "string",
|
||||
"bank_branch_name": "string",
|
||||
"bank_name": "string"
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"request_no": "string",
|
||||
"out_request_no": "string"
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"request_no": "string",
|
||||
"out_request_no": "string",
|
||||
"ent_id": "string",
|
||||
"status": "PROCESSING",
|
||||
"product_details": [
|
||||
{
|
||||
"product_name": "string",
|
||||
"status": "PROCESSING"
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
{
|
||||
"TestConfig": {
|
||||
"PlatformId": "请在此填写用于测试的微信商户号",
|
||||
"PlatformId": "请在此填写用于测试的微企付商户号",
|
||||
"PlatformCertSerialNumber": "请在此填写用于测试的微企付平台 API 证书序列号",
|
||||
"PlatformCertPrivateKey": "请在此填写用于测试的微企付平台 API 证书私钥(字符串格式)",
|
||||
"TBEPCertSerialNumber": "请在此填写用于测试的微企付证书序列号",
|
||||
|
Reference in New Issue
Block a user