feat(wxapi): 新增交易组件修改订单备注相关接口

This commit is contained in:
Fu Diwei 2021-09-18 12:58:34 +08:00
parent 42667807e2
commit 9b1f2407b5
5 changed files with 65 additions and 0 deletions

View File

@ -1216,6 +1216,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.ProductOrderChangeOrderPriceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /product/order/change_merchant_notes 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/change_merchant_notes.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ProductOrderChangeMerchantNotesResponse> ExecuteProductOrderChangeMerchantNotesAsync(this WechatApiClient client, Models.ProductOrderChangeMerchantNotesRequest 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, "product", "order", "change_merchant_notes")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ProductOrderChangeMerchantNotesResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Coupon

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /product/order/change_merchant_notes 接口的请求。</para>
/// </summary>
public class ProductOrderChangeMerchantNotesRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
public long OrderId { get; set; }
/// <summary>
/// 获取或设置商家备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_notes")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_notes")]
public string MerchantNotes { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /product/order/change_merchant_notes 接口的响应。</para>
/// </summary>
public class ProductOrderChangeMerchantNotesResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,4 @@
{
"order_id": 123456,
"merchant_notes": "abc"
}