mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-11-26 10:19:42 +08:00
feat(tenpayv3): 新增服务商申请单个子商户资金账单相关接口
This commit is contained in:
@@ -93,6 +93,34 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBillFundflowBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /bill/sub-merchant-fundflowbill 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_12.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetBillSubMerchantFundflowBillResponse> ExecuteGetBillSubMerchantFundflowBillAsync(this WechatTenpayClient client, Models.GetBillSubMerchantFundflowBillRequest 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, "bill", "sub-merchant-fundflowbill")
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId)
|
||||
.SetQueryParam("bill_date", request.BillDateString)
|
||||
.SetQueryParam("algorithm", request.Algorithm);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.AccountType))
|
||||
flurlReq.SetQueryParam("account_type", request.AccountType);
|
||||
|
||||
if (!string.IsNullOrEmpty(request.TarType))
|
||||
flurlReq.SetQueryParam("tar_type", request.TarType);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetBillSubMerchantFundflowBillResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /{download_url} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_8.shtml </para>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /bill/sub-merchant-fundflowbill 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetBillSubMerchantFundflowBillRequest : GetBillFundflowBillRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置加密算法。
|
||||
/// <para>默认值:<see cref="Constants.EncryptionAlgorithms.AEAD_AES_256_GCM"/></para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string Algorithm { get; set; } = Constants.EncryptionAlgorithms.AEAD_AES_256_GCM;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /bill/sub-merchant-fundflowbill 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetBillSubMerchantFundflowBillResponse : WechatTenpayResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class DownloadBill
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置账单文件序号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bill_sequence")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bill_sequence")]
|
||||
public int BillSequence { get; set; }
|
||||
|
||||
/// <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!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单加密密钥(需使用商户私钥解密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("encrypt_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("encrypt_key")]
|
||||
public string EncryptKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单加密使用的随机字符串。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("nonce")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("nonce")]
|
||||
public string Nonce { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单文件总数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("download_bill_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("download_bill_count")]
|
||||
public int DownloadBillCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置账单文件列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("download_bill_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("download_bill_list")]
|
||||
public Types.DownloadBill[] DownloadBillList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user