feat(tenpayv3): 新增代金券获取批次核销和退款明细下载链接相关接口

This commit is contained in:
Fu Diwei
2025-10-20 21:26:15 +08:00
parent f44bb80c58
commit 64dd13bc56
5 changed files with 126 additions and 0 deletions

View File

@@ -253,6 +253,25 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockUseFlowResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /marketing/favor/stocks/{stock_id}/use-flow-by-day 接口。</para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetMarketingFavorStockUseFlowByDayResponse> ExecuteGetMarketingFavorStockUseFlowByDayAsync(this WechatTenpayClient client, Models.GetMarketingFavorStockUseFlowByDayRequest 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
.CreateFlurlRequest(request, HttpMethod.Get, "marketing", "favor", "stocks", request.StockId, "use-flow-by-day")
.SetQueryParam("bill_date", request.BillDateString);
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockUseFlowByDayResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /marketing/favor/stocks/{stock_id}/refund-flow 接口。</para>
/// <para>
@@ -276,6 +295,25 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockRefundFlowResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [GET] /marketing/favor/stocks/{stock_id}/refund-flow-by-day 接口。</para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetMarketingFavorStockRefundFlowByDayResponse> ExecuteGetMarketingFavorStockRefundFlowByDayAsync(this WechatTenpayClient client, Models.GetMarketingFavorStockRefundFlowByDayRequest 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
.CreateFlurlRequest(request, HttpMethod.Get, "marketing", "favor", "stocks", request.StockId, "refund-flow-by-day")
.SetQueryParam("bill_date", request.BillDateString);
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockRefundFlowByDayResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /marketing/favor/users/{openid}/coupons 接口。</para>
/// <para>

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/refund-flow-by-day 接口的请求。</para>
/// </summary>
public class GetMarketingFavorStockRefundFlowByDayRequest : GetMarketingFavorStockRefundFlowRequest
{
/// <summary>
/// 获取或设置账单日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string BillDateString { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/refund-flow-by-day 接口的响应。</para>
/// </summary>
public class GetMarketingFavorStockRefundFlowByDayResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置流水文件下载地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("url")]
[System.Text.Json.Serialization.JsonPropertyName("url")]
public string Url { get; set; } = default!;
/// <summary>
/// 获取或设置哈希值。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_refundflow_hash")]
[System.Text.Json.Serialization.JsonPropertyName("stock_refundflow_hash")]
public string HashValue { get; set; } = default!;
/// <summary>
/// 获取或设置记录总条数。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_refundflow_count")]
[System.Text.Json.Serialization.JsonPropertyName("stock_refundflow_count")]
public int FlowCount { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/use-flow-by-day 接口的请求。</para>
/// </summary>
public class GetMarketingFavorStockUseFlowByDayRequest : GetMarketingFavorStockUseFlowRequest
{
/// <summary>
/// 获取或设置账单日期字符串格式yyyy-MM-dd
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string BillDateString { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
{
/// <summary>
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/use-flow-by-day 接口的响应。</para>
/// </summary>
public class GetMarketingFavorStockUseFlowByDayResponse : WechatTenpayResponse
{
/// <summary>
/// 获取或设置流水文件下载地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("url")]
[System.Text.Json.Serialization.JsonPropertyName("url")]
public string Url { get; set; } = default!;
/// <summary>
/// 获取或设置哈希值。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_useflow_hash")]
[System.Text.Json.Serialization.JsonPropertyName("stock_useflow_hash")]
public string HashValue { get; set; } = default!;
/// <summary>
/// 获取或设置记录总条数。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_useflow_count")]
[System.Text.Json.Serialization.JsonPropertyName("stock_useflow_count")]
public int FlowCount { get; set; }
}
}