mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-12-29 18:04:42 +08:00
feat(tenpayv3): 新增平台收付通发起异常退款相关接口
This commit is contained in:
@@ -804,6 +804,28 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.GetEcommerceRefundReturnAdvanceResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /ecommerce/refunds/{refund_id}/apply-abnormal-refund 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/docs/partner/apis/ecommerce-refund/refunds/create-abnormal-refund.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateEcommerceAbnormalRefundApplyResponse> ExecuteCreateEcommerceAbnormalRefundApplyAsync(this WechatTenpayClient client, Models.CreateEcommerceAbnormalRefundApplyRequest 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.Post, "ecommerce", "refunds", request.RefundId, "apply-abnormal-refund");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CreateEcommerceAbnormalRefundApplyResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Subsidies
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /ecommerce/refunds/{refund_id}/apply-abnormal-refund 接口的请求。</para>
|
||||
/// </summary>
|
||||
[WechatTenpaySensitive]
|
||||
public class CreateEcommerceAbnormalRefundApplyRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置原订单金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total")]
|
||||
public int Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund")]
|
||||
public int Refund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款币种。
|
||||
/// <para>默认值:"CNY"</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = "CNY";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信二级商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string RefundId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置个人收款方受理授权 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("individual_auth_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("individual_auth_id")]
|
||||
public string? IndividualAuthId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置异常退款处理方式。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置收款开户银行。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bank_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bank_type")]
|
||||
public string? BankName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置收款银行卡号(需使用平台公钥/证书加密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bank_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bank_account")]
|
||||
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
|
||||
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
|
||||
public string? BankAccountNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置收款用户姓名(需使用平台公钥/证书加密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("real_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("real_name")]
|
||||
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)]
|
||||
[WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)]
|
||||
public string? RealName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /ecommerce/refunds/{refund_id}/apply-abnormal-refund 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateEcommerceAbnormalRefundApplyResponse : GetEcommerceRefundByOutRefundNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
@@ -11,6 +11,26 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
public class Amount
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class From
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置出资账户类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("account")]
|
||||
public string Account { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置出资金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public int Amount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额(单位:分)。
|
||||
/// </summary>
|
||||
@@ -32,12 +52,26 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("discount_refund")]
|
||||
public int DiscountRefund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置电商平台垫付金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("advance")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("advance")]
|
||||
public int? Advance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款出资账户及金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("from")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("from")]
|
||||
public Types.From[]? From { get; set; }
|
||||
}
|
||||
|
||||
public class Promotion
|
||||
|
||||
Reference in New Issue
Block a user