feat(tenpayv3): 新增获取分账账单相关接口

This commit is contained in:
Fu Diwei
2021-07-26 23:59:14 +08:00
parent a3880f7c4e
commit ab8fe63df9
3 changed files with 93 additions and 0 deletions

View File

@@ -199,5 +199,34 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
return await client.SendRequestWithJsonAsync<Models.DeleteProfitSharingReceiverResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#region Bills
/// <summary>
/// <para>异步调用 [GET] /profitsharing/bills 接口。</para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_1_11.shtml </para>
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_1_11.shtml </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.GetProfitSharingBillResponse> ExecuteGetProfitSharingBillAsync(this WechatTenpayClient client, Models.GetProfitSharingBillRequest 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, "profitsharing", "bills")
.SetQueryParam("bill_date", request.BillDateString);
if (!string.IsNullOrEmpty(request.SubMerchantId))
flurlReq.SetQueryParam("sub_mchid", request.SubMerchantId);
if (!string.IsNullOrEmpty(request.TarType))
flurlReq.SetQueryParam("tar_type", request.TarType);
return await client.SendRequestWithJsonAsync<Models.GetProfitSharingBillResponse>(flurlReq, cancellationToken: cancellationToken);
}
#endregion
}
}