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
8adcc9fdcf
commit
7a48901232
@ -1353,7 +1353,9 @@
|
||||
|
||||
- 扣款服务
|
||||
|
||||
- 预扣费通知:`NotifyPartnerPAPayContract`
|
||||
- 预扣费通知:`CreatePartnerPAPayContractNotification`
|
||||
|
||||
- 重试扣费通知:`CreatePartnerPAPayContractFailedNotification`
|
||||
|
||||
- 代扣服务切卡组件
|
||||
|
||||
|
@ -32,5 +32,30 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePartnerPAPayContractNotificationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /partner-papay/contracts/{contract_id}/fail-notify 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/wiki/doc/api/wxpay_v2/papay/chapter5_16.shtml ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreatePartnerPAPayContractFailedNotificationResponse> ExecuteCreatePartnerPAPayContractFailedNotificationAsync(this WechatTenpayClient client, Models.CreatePartnerPAPayContractFailedNotificationRequest 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, "partner-papay", "contracts", request.ContractId, "fail-notify");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreatePartnerPAPayContractFailedNotificationResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /partner-papay/contracts/{contract_id}/fail-notify 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreatePartnerPAPayContractFailedNotificationRequest : 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("sp_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
|
||||
public string? SubAppId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /partner-papay/contracts/{contract_id}/fail-notify 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreatePartnerPAPayContractFailedNotificationResponse : WechatTenpayResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -45,7 +45,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
|
||||
public string? SubAppid { get; set; }
|
||||
public string? SubAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置预计扣费金额信息。
|
||||
|
Loading…
Reference in New Issue
Block a user