mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(tenpayv3): 新增扣款服务重试扣费通知接口
This commit is contained in:
parent
0885bd67b6
commit
35ee658581
@ -572,6 +572,8 @@
|
||||
|
||||
- 预扣费通知:`CreatePAPayContractNotification`
|
||||
|
||||
- 重试扣费通知:`CreatePAPayContractFailedNotification`
|
||||
|
||||
- 代扣服务切卡组件
|
||||
|
||||
- 出行券切卡组件预下单:`CreateIndustryCouponToken`
|
||||
|
@ -33,6 +33,31 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePAPayContractNotificationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/{contract_id}/fail-notify 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/api/wxpay_v2/papay/chapter3_11.shtml ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreatePAPayContractFailedNotificationResponse> ExecuteCreatePAPayContractFailedNotificationAsync(this WechatTenpayClient client, Models.CreatePAPayContractFailedNotificationRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId is null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "papay", "contracts", request.ContractId, "fail-notify");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePAPayContractFailedNotificationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
#region InsurancePayPolicyPeriods
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/insurance-pay/policy-periods/contract-id/{contract_id}/policy-period-id/{policy_period_id} 接口。</para>
|
||||
|
@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /papay/contracts/{contract_id}/fail-notify 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreatePAPayContractFailedNotificationRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置委托代扣协议 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string ContractId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /papay/contracts/{contract_id}/fail-notify 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreatePAPayContractFailedNotificationResponse : WechatTenpayResponse
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user