Skip to content

Commit 64dd13b

Browse files
committed
feat(tenpayv3): 新增代金券获取批次核销和退款明细下载链接相关接口
1 parent f44bb80 commit 64dd13b

5 files changed

Lines changed: 126 additions & 0 deletions

src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteMarketingFavorExtensions.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,25 @@ public static class WechatTenpayClientExecuteMarketingFavorExtensions
253253
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockUseFlowResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
254254
}
255255

256+
/// <summary>
257+
/// <para>异步调用 [GET] /marketing/favor/stocks/{stock_id}/use-flow-by-day 接口。</para>
258+
/// </summary>
259+
/// <param name="client"></param>
260+
/// <param name="request"></param>
261+
/// <param name="cancellationToken"></param>
262+
/// <returns></returns>
263+
public static async Task<Models.GetMarketingFavorStockUseFlowByDayResponse> ExecuteGetMarketingFavorStockUseFlowByDayAsync(this WechatTenpayClient client, Models.GetMarketingFavorStockUseFlowByDayRequest request, CancellationToken cancellationToken = default)
264+
{
265+
if (client is null) throw new ArgumentNullException(nameof(client));
266+
if (request is null) throw new ArgumentNullException(nameof(request));
267+
268+
IFlurlRequest flurlReq = client
269+
.CreateFlurlRequest(request, HttpMethod.Get, "marketing", "favor", "stocks", request.StockId, "use-flow-by-day")
270+
.SetQueryParam("bill_date", request.BillDateString);
271+
272+
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockUseFlowByDayResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
273+
}
274+
256275
/// <summary>
257276
/// <para>异步调用 [GET] /marketing/favor/stocks/{stock_id}/refund-flow 接口。</para>
258277
/// <para>
@@ -276,6 +295,25 @@ public static class WechatTenpayClientExecuteMarketingFavorExtensions
276295
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockRefundFlowResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
277296
}
278297

298+
/// <summary>
299+
/// <para>异步调用 [GET] /marketing/favor/stocks/{stock_id}/refund-flow-by-day 接口。</para>
300+
/// </summary>
301+
/// <param name="client"></param>
302+
/// <param name="request"></param>
303+
/// <param name="cancellationToken"></param>
304+
/// <returns></returns>
305+
public static async Task<Models.GetMarketingFavorStockRefundFlowByDayResponse> ExecuteGetMarketingFavorStockRefundFlowByDayAsync(this WechatTenpayClient client, Models.GetMarketingFavorStockRefundFlowByDayRequest request, CancellationToken cancellationToken = default)
306+
{
307+
if (client is null) throw new ArgumentNullException(nameof(client));
308+
if (request is null) throw new ArgumentNullException(nameof(request));
309+
310+
IFlurlRequest flurlReq = client
311+
.CreateFlurlRequest(request, HttpMethod.Get, "marketing", "favor", "stocks", request.StockId, "refund-flow-by-day")
312+
.SetQueryParam("bill_date", request.BillDateString);
313+
314+
return await client.SendFlurlRequestAsJsonAsync<Models.GetMarketingFavorStockRefundFlowByDayResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
315+
}
316+
279317
/// <summary>
280318
/// <para>异步调用 [POST] /marketing/favor/users/{openid}/coupons 接口。</para>
281319
/// <para>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/refund-flow-by-day 接口的请求。</para>
5+
/// </summary>
6+
public class GetMarketingFavorStockRefundFlowByDayRequest : GetMarketingFavorStockRefundFlowRequest
7+
{
8+
/// <summary>
9+
/// 获取或设置账单日期字符串(格式:yyyy-MM-dd)。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonIgnore]
12+
[System.Text.Json.Serialization.JsonIgnore]
13+
public string BillDateString { get; set; } = string.Empty;
14+
}
15+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/refund-flow-by-day 接口的响应。</para>
5+
/// </summary>
6+
public class GetMarketingFavorStockRefundFlowByDayResponse : WechatTenpayResponse
7+
{
8+
/// <summary>
9+
/// 获取或设置流水文件下载地址。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonProperty("url")]
12+
[System.Text.Json.Serialization.JsonPropertyName("url")]
13+
public string Url { get; set; } = default!;
14+
15+
/// <summary>
16+
/// 获取或设置哈希值。
17+
/// </summary>
18+
[Newtonsoft.Json.JsonProperty("stock_refundflow_hash")]
19+
[System.Text.Json.Serialization.JsonPropertyName("stock_refundflow_hash")]
20+
public string HashValue { get; set; } = default!;
21+
22+
/// <summary>
23+
/// 获取或设置记录总条数。
24+
/// </summary>
25+
[Newtonsoft.Json.JsonProperty("stock_refundflow_count")]
26+
[System.Text.Json.Serialization.JsonPropertyName("stock_refundflow_count")]
27+
public int FlowCount { get; set; }
28+
}
29+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/use-flow-by-day 接口的请求。</para>
5+
/// </summary>
6+
public class GetMarketingFavorStockUseFlowByDayRequest : GetMarketingFavorStockUseFlowRequest
7+
{
8+
/// <summary>
9+
/// 获取或设置账单日期字符串(格式:yyyy-MM-dd)。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonIgnore]
12+
[System.Text.Json.Serialization.JsonIgnore]
13+
public string BillDateString { get; set; } = string.Empty;
14+
}
15+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
2+
{
3+
/// <summary>
4+
/// <para>表示 [GET] /marketing/favor/stocks/{stock_id}/use-flow-by-day 接口的响应。</para>
5+
/// </summary>
6+
public class GetMarketingFavorStockUseFlowByDayResponse : WechatTenpayResponse
7+
{
8+
/// <summary>
9+
/// 获取或设置流水文件下载地址。
10+
/// </summary>
11+
[Newtonsoft.Json.JsonProperty("url")]
12+
[System.Text.Json.Serialization.JsonPropertyName("url")]
13+
public string Url { get; set; } = default!;
14+
15+
/// <summary>
16+
/// 获取或设置哈希值。
17+
/// </summary>
18+
[Newtonsoft.Json.JsonProperty("stock_useflow_hash")]
19+
[System.Text.Json.Serialization.JsonPropertyName("stock_useflow_hash")]
20+
public string HashValue { get; set; } = default!;
21+
22+
/// <summary>
23+
/// 获取或设置记录总条数。
24+
/// </summary>
25+
[Newtonsoft.Json.JsonProperty("stock_useflow_count")]
26+
[System.Text.Json.Serialization.JsonPropertyName("stock_useflow_count")]
27+
public int FlowCount { get; set; }
28+
}
29+
}

0 commit comments

Comments
 (0)