mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 16:50:43 +08:00
feat(wxapi): 新增交易组件修改订单价格相关接口
This commit is contained in:
parent
548cbf44ec
commit
42667807e2
@ -1134,29 +1134,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
#endregion
|
||||
|
||||
#region Order
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /product/order/get 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/order/get_order_detail.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ProductOrderGetResponse> ExecuteProductOrderGetAsync(this WechatApiClient client, Models.ProductOrderGetRequest 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", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ProductOrderGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /product/order/get_list 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/order/get_order_list.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/get_order_list.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -1174,9 +1155,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.ProductOrderGetListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /product/order/get 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/order/get_order_detail.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/get_order_detail.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ProductOrderGetResponse> ExecuteProductOrderGetAsync(this WechatApiClient client, Models.ProductOrderGetRequest 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", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ProductOrderGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /product/order/search 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/order/search_order.html </para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/search_order.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -1193,6 +1196,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ProductOrderSearchResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /product/order/change_order_price 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/change_order_price.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ProductOrderChangeOrderPriceResponse> ExecuteProductOrderChangeOrderPriceAsync(this WechatApiClient client, Models.ProductOrderChangeOrderPriceRequest 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_order_price")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ProductOrderChangeOrderPriceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Coupon
|
||||
|
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /product/order/change_order_price 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ProductOrderChangeOrderPriceRequest : WechatApiRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商品 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_id")]
|
||||
public long ProductId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 SKU ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sku_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
|
||||
public long SKUId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品价格(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("change_price")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("change_price")]
|
||||
public int Price { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("change_express")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("change_express")]
|
||||
public bool RequireChangeExpress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置运费价格(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("express_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("express_fee")]
|
||||
public int? ExpressFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置修改价格的商品列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("change_order_infos")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("change_order_infos")]
|
||||
public IList<Types.Product> ProductList { get; set; } = new List<Types.Product>();
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /product/order/change_order_price 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ProductOrderChangeOrderPriceResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"order_id": 123456,
|
||||
"change_express": true,
|
||||
"express_fee": 0,
|
||||
"change_order_infos": [
|
||||
{
|
||||
"product_id": 1234,
|
||||
"sku_id": 5678,
|
||||
"change_price": 300
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok"
|
||||
}
|
Loading…
Reference in New Issue
Block a user