feat(wxapi): 新增微信小店代用户发起退差价接口

This commit is contained in:
Fu Diwei
2025-11-27 15:36:31 +08:00
parent 215c80e15c
commit 94d09e6025
6 changed files with 121 additions and 0 deletions

View File

@@ -271,6 +271,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECAftersaleUploadRefundCertificateResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECAftersaleUploadRefundCertificateResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
} }
/// <summary>
/// <para>异步调用 [POST] /channels/ec/aftersale/refundpricediff 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-aftersale/api_refundpricediff.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECAftersaleRefundPriceDiffResponse> ExecuteChannelsECAftersaleRefundPriceDiffAsync(this WechatApiClient client, Models.ChannelsECAftersaleRefundPriceDiffRequest 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, "channels", "ec", "aftersale", "refundpricediff")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECAftersaleRefundPriceDiffResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#region ECAftersale/Complaint #region ECAftersale/Complaint
/// <summary> /// <summary>
/// <para>异步调用 [POST] /channels/ec/aftersale/addcomplaintmaterial 接口。</para> /// <para>异步调用 [POST] /channels/ec/aftersale/addcomplaintmaterial 接口。</para>

View File

@@ -0,0 +1,61 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/aftersale/refundpricediff 接口的请求。</para>
/// </summary>
public class ChannelsECAftersaleRefundPriceDiffRequest : WechatApiRequest, IInferable<ChannelsECAftersaleRefundPriceDiffRequest, ChannelsECAftersaleRefundPriceDiffResponse>
{
/// <summary>
/// 获取或设置请求唯一标识。
/// </summary>
[Newtonsoft.Json.JsonProperty("request_id")]
[System.Text.Json.Serialization.JsonPropertyName("request_id")]
public string? RequestId { get; set; }
/// <summary>
/// 获取或设置订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
public string OrderId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_id")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))]
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))]
public long ProductId { get; set; }
/// <summary>
/// 获取或设置 SKU ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_id")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.TextualNumberConverter))]
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.TextualNumberConverter))]
public long SKUId { get; set; }
/// <summary>
/// 获取或设置售后退款金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("amount")]
[System.Text.Json.Serialization.JsonPropertyName("amount")]
public int Amount { get; set; }
/// <summary>
/// 获取或设置售后原因。
/// </summary>
[Newtonsoft.Json.JsonProperty("reason")]
[System.Text.Json.Serialization.JsonPropertyName("reason")]
public string ReasonType { get; set; } = string.Empty;
/// <summary>
/// 获取或设置代发起售后补充说明。
/// </summary>
[Newtonsoft.Json.JsonProperty("desc")]
[System.Text.Json.Serialization.JsonPropertyName("desc")]
public string? Description { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/aftersale/refundpricediff 接口的响应。</para>
/// </summary>
public class ChannelsECAftersaleRefundPriceDiffResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置售后单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("after_sale_order_id")]
[System.Text.Json.Serialization.JsonPropertyName("after_sale_order_id")]
public string AftersaleOrderId { get; set; } = default!;
}
}

View File

@@ -91,6 +91,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[Newtonsoft.Json.JsonProperty("name")] [Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")] [System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = default!; public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置团长头像 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("head_img")]
[System.Text.Json.Serialization.JsonPropertyName("head_img")]
public string HeadImageUrl { get; set; } = default!;
} }
public class CooperativeInfo public class CooperativeInfo

View File

@@ -0,0 +1,9 @@
{
"request_id": "req_20240101120000_1234511",
"order_id": "3732100665787132600",
"product_id": "10000239001116",
"sku_id": "3516044037",
"amount": 10,
"reason": "10001338",
"desc": "商品价格差异退款申请原价100元现价90元申请退还10元差价"
}

View File

@@ -0,0 +1,6 @@
{
"errcode": 0,
"errmsg": "ok",
"after_sale_order_id": "2082648273412"
}