mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 18:22:24 +08:00
feat(wxapi): 新增小程序支付管理服务退款相关接口
This commit is contained in:
@@ -1510,6 +1510,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/funds/submitwithdraw 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/funds/submitwithdraw.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/wxafunds/API/funds/submitwithdraw.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -1530,6 +1531,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/funds/scanwithdraw 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/funds/scanwithdraw.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/wxafunds/API/funds/scanwithdraw.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -1550,6 +1552,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/funds/getwithdrawdetail 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/funds/getwithdrawdetail.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/wxafunds/API/funds/getwithdrawdetail.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -1930,6 +1933,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopPayProfitSharingOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /shop/pay/refundorder 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/wxafunds/API/order/refunds_order.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ShopPayRefundOrderResponse> ExecuteShopPayRefundOrderAsync(this WechatApiClient client, Models.ShopPayRefundOrderRequest 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.Post, "shop", "pay", "refundorder")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ShopPayRefundOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,57 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/pay/refundorder 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ShopPayRefundOrderRequest : WechatApiRequest, IInferable<ShopPayRefundOrderRequest, ShopPayRefundOrderResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户的 OpenId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("openid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("openid")]
|
||||
public string OpenId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trade_no")]
|
||||
public string? OutTradeNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付交易单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string? TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_no")]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单总金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total_amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total_amount")]
|
||||
public int TotalAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_amount")]
|
||||
public int RefundAmount { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /shop/pay/refundorder 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ShopPayRefundOrderResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"openid": "oTVP50O53a7jgmawAmxKukNlq3XI",
|
||||
"mchid": "1230000109",
|
||||
"trade_no": "1217752501201407033233368018",
|
||||
"transaction_id": "4208450740201411110007820472",
|
||||
"refund_no": "1217752501201407033233368018",
|
||||
"total_amount": 100,
|
||||
"refund_amount": 50
|
||||
}
|
Reference in New Issue
Block a user