feat(wxapi): 新增视频号小店解码订单敏感数据接口

This commit is contained in:
Fu Diwei 2024-04-29 20:11:05 +08:00
parent 1d494910f1
commit 669d83b64f
7 changed files with 465 additions and 8 deletions

View File

@ -1246,6 +1246,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderAddressUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/sensitiveinfo/decode 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/doc/channels/API/order/decode_order_sensitive_info.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ChannelsECOrderSensitiveInfoDecodeResponse> ExecuteChannelsECOrderSensitiveInfoDecodeAsync(this WechatApiClient client, Models.ChannelsECOrderSensitiveInfoDecodeRequest 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", "order", "sensitiveinfo", "decode")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECOrderSensitiveInfoDecodeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#region ECOrder/Delivery
/// <summary>
/// <para>异步调用 [POST] /channels/ec/order/deliverycompanylist/get 接口。</para>

View File

@ -22,6 +22,52 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
public class Attribute : ChannelsECProductGetResponse.Types.Product.Types.Attribute
{
}
public class ExtraService
{
/// <summary>
/// 获取或设置是否支持七天无理由退货。
/// </summary>
[Newtonsoft.Json.JsonProperty("seven_day_return")]
[System.Text.Json.Serialization.JsonPropertyName("seven_day_return")]
public int SevenDayReturn { get; set; }
/// <summary>
/// 获取或设置是否支持运费险。
/// </summary>
[Newtonsoft.Json.JsonProperty("freight_insurance")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanConverter))]
[System.Text.Json.Serialization.JsonPropertyName("freight_insurance")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanConverter))]
public bool IsFreightInsuranceSupported { get; set; }
}
public class SKUDeliver
{
/// <summary>
/// 获取或设置商品发货类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_type")]
[System.Text.Json.Serialization.JsonPropertyName("stock_type")]
public int StockType { get; set; }
/// <summary>
/// 获取或设置预计发货时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("predict_delivery_time")]
[System.Text.Json.Serialization.JsonPropertyName("predict_delivery_time")]
public long? PredictDeliveryTimestamp { get; set; }
}
public class OrderProductCoupon
{
/// <summary>
/// 获取或设置用户优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("user_coupon_id")]
public string? UserCouponId { get; set; }
}
}
/// <summary>
@ -47,6 +93,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("sku_cnt")]
public int Count { get; set; }
/// <summary>
/// 获取或设置商品编码。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_code")]
[System.Text.Json.Serialization.JsonPropertyName("sku_code")]
public string? SKUCode { get; set; }
/// <summary>
/// 获取或设置正在售后流程中的商品数量。
/// </summary>
@ -96,12 +149,96 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("real_price")]
public int? RealPrice { get; set; }
/// <summary>
/// 获取或设置优惠后 SKU 总价(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("estimate_price")]
[System.Text.Json.Serialization.JsonPropertyName("estimate_price")]
public int? EstimatePrice { get; set; }
/// <summary>
/// 获取或设置是否修改过价格。
/// </summary>
[Newtonsoft.Json.JsonProperty("is_change_price")]
[System.Text.Json.Serialization.JsonPropertyName("is_change_price")]
public bool? IsChangePrice { get; set; }
/// <summary>
/// 获取或设置改价后 SKU 总价(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("change_price")]
[System.Text.Json.Serialization.JsonPropertyName("change_price")]
public int? ChangePrice { get; set; }
/// <summary>
/// 获取或设置是否使用了会员积分抵扣。
/// </summary>
[Newtonsoft.Json.JsonProperty("use_deduction")]
[System.Text.Json.Serialization.JsonPropertyName("use_deduction")]
public bool? IsUseDeduction { get; set; }
/// <summary>
/// 获取或设置会员积分抵扣金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("deduction_price")]
[System.Text.Json.Serialization.JsonPropertyName("deduction_price")]
public int? DeductionPrice { get; set; }
/// <summary>
/// 获取或设置商家自定义商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_product_id")]
public string? OutProductId { get; set; }
/// <summary>
/// 获取或设置商家自定义 SKU ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_sku_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_sku_id")]
public string? OutSKUId { get; set; }
/// <summary>
/// 获取或设置外部仓库 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_warehouse_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_warehouse_id")]
public string? OutWarehouseId { get; set; }
/// <summary>
/// 获取或设置商品属性列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_attrs")]
[System.Text.Json.Serialization.JsonPropertyName("sku_attrs")]
public Types.Attribute[]? AttributeList { get; set; }
/// <summary>
/// 获取或设置商品发货信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_deliver_info")]
[System.Text.Json.Serialization.JsonPropertyName("sku_deliver_info")]
public Types.SKUDeliver? SKUDeliver { get; set; }
/// <summary>
/// 获取或设置额外的服务信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("extra_service")]
[System.Text.Json.Serialization.JsonPropertyName("extra_service")]
public Types.ExtraService? ExtraService { get; set; }
/// <summary>
/// 获取或设置商品优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_product_coupon_info_list")]
[System.Text.Json.Serialization.JsonPropertyName("order_product_coupon_info_list")]
public Types.OrderProductCoupon[]? OrderProductCouponList { get; set; }
/// <summary>
/// 获取或设置商品发货截止日期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("delivery_deadline")]
[System.Text.Json.Serialization.JsonPropertyName("delivery_deadline")]
public long DeliveryDeadlineTimestamp { get; set; }
}
public class Payment
@ -133,6 +270,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[Newtonsoft.Json.JsonProperty("pay_time")]
[System.Text.Json.Serialization.JsonPropertyName("pay_time")]
public long? PayTimestamp { get; set; }
/// <summary>
/// 获取或设置支付方式。
/// </summary>
[Newtonsoft.Json.JsonProperty("payment_method")]
[System.Text.Json.Serialization.JsonPropertyName("payment_method")]
public int? PaymentMethod { get; set; }
}
public class Amount
@ -206,6 +350,20 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[Newtonsoft.Json.JsonProperty("is_change_freight")]
[System.Text.Json.Serialization.JsonPropertyName("is_change_freight")]
public bool? IsFreightChanged { get; set; }
/// <summary>
/// 获取或设置是否使用了会员积分抵扣。
/// </summary>
[Newtonsoft.Json.JsonProperty("use_deduction")]
[System.Text.Json.Serialization.JsonPropertyName("use_deduction")]
public bool? IsUseDeduction { get; set; }
/// <summary>
/// 获取或设置会员积分抵扣金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("deduction_price")]
[System.Text.Json.Serialization.JsonPropertyName("deduction_price")]
public int? DeductionPrice { get; set; }
}
public class Delivery
@ -282,11 +440,11 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
public class Address : ChannelsECMerchantAddressGetResponse.Types.AddressDetail.Types.Address
{
/// <summary>
/// 获取或设置虚拟发货订单电话号码。
/// 获取或设置虚拟号码。
/// </summary>
[Newtonsoft.Json.JsonProperty("virtual_order_tel_number")]
[System.Text.Json.Serialization.JsonPropertyName("virtual_order_tel_number")]
public string? VirtualOrderTeleNumber { get; set; }
public string? VirtualTeleNumber { get; set; }
}
}
@ -304,6 +462,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("address_info")]
public Types.Address? Address { get; set; }
/// <summary>
/// 获取或设置用户下单后申请修改的地址信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_under_review")]
[System.Text.Json.Serialization.JsonPropertyName("address_under_review")]
public Types.Address? AddressUnderReview { get; set; }
/// <summary>
/// 获取或设置发货商品信息。
/// </summary>
@ -318,6 +483,21 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("ship_done_time")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long? ShippingDoneTimestamp { get; set; }
/// <summary>
/// 获取或设置修改地址申请时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_apply_time")]
[System.Text.Json.Serialization.JsonPropertyName("address_apply_time")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long? AddressApplyTimestamp { get; set; }
/// <summary>
/// 获取或设置电子面单代发订单密文。
/// </summary>
[Newtonsoft.Json.JsonProperty("ewaybill_order_code")]
[System.Text.Json.Serialization.JsonPropertyName("ewaybill_order_code")]
public string? EWaybillOrderCode { get; set; }
}
public class Coupon
@ -346,6 +526,72 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("merchant_notes")]
public string? MerchantNotes { get; set; }
}
public class Sharer
{
/// <summary>
/// 获取或设置分享员的 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("sharer_openid")]
[System.Text.Json.Serialization.JsonPropertyName("sharer_openid")]
public string SharerOpenId { get; set; } = default!;
/// <summary>
/// 获取或设置分享员的 UnionId。
/// </summary>
[Newtonsoft.Json.JsonProperty("sharer_unionid")]
[System.Text.Json.Serialization.JsonPropertyName("sharer_unionid")]
public string? SharerUnionId { get; set; }
/// <summary>
/// 获取或设置分享员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("sharer_type")]
[System.Text.Json.Serialization.JsonPropertyName("sharer_type")]
public int SharerType { get; set; }
/// <summary>
/// 获取或设置分享场景。
/// </summary>
[Newtonsoft.Json.JsonProperty("share_scene")]
[System.Text.Json.Serialization.JsonPropertyName("share_scene")]
public int ShareScene { get; set; }
}
public class SKUSharer : Sharer
{
/// <summary>
/// 获取或设置 SKU ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_id")]
[System.Text.Json.Serialization.JsonPropertyName("sku_id")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long SKUId { get; set; }
/// <summary>
/// 获取或设置是否来自企微分享。
/// </summary>
[Newtonsoft.Json.JsonProperty("from_wecom")]
[System.Text.Json.Serialization.JsonPropertyName("from_wecom")]
public bool IsFromWecom { get; set; }
}
public class Settlement
{
/// <summary>
/// 获取或设置预计技术服务费(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("predict_commission_fee")]
[System.Text.Json.Serialization.JsonPropertyName("predict_commission_fee")]
public int PredictCommissionFee { get; set; }
/// <summary>
/// 获取或设置实际技术服务费(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("commission_fee")]
[System.Text.Json.Serialization.JsonPropertyName("commission_fee")]
public int? CommissionFee { get; set; }
}
}
/// <summary>
@ -389,6 +635,25 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[Newtonsoft.Json.JsonProperty("ext_info")]
[System.Text.Json.Serialization.JsonPropertyName("ext_info")]
public Types.Extra? Extra { get; set; }
/// 获取或设置分享员信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("sharer_info")]
[System.Text.Json.Serialization.JsonPropertyName("sharer_info")]
public Types.Sharer? Sharer { get; set; }
/// 获取或设置 SKU 分享员信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("sku_sharer_infos")]
[System.Text.Json.Serialization.JsonPropertyName("sku_sharer_infos")]
public Types.SKUSharer[]? SKUSharerList { get; set; }
/// <summary>
/// 获取或设置服务费信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("settle_info")]
[System.Text.Json.Serialization.JsonPropertyName("settle_info")]
public Types.Settlement? Settlement { get; set; }
}
public class AftersaleDetail
@ -466,6 +731,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = default!;
/// <summary>
/// 获取或设置下单用户 UnionId。
/// </summary>
[Newtonsoft.Json.JsonProperty("unionid")]
[System.Text.Json.Serialization.JsonPropertyName("unionid")]
public string? UnionId { get; set; }
/// <summary>
/// 获取或设置更新时间戳。
/// </summary>

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/sensitiveinfo/decode 接口的请求。</para>
/// </summary>
public class ChannelsECOrderSensitiveInfoDecodeRequest : WechatApiRequest, IInferable<ChannelsECOrderSensitiveInfoDecodeRequest, ChannelsECOrderSensitiveInfoDecodeResponse>
{
/// <summary>
/// 获取或设置订单 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("order_id")]
[System.Text.Json.Serialization.JsonPropertyName("order_id")]
public string OrderId { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,91 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /channels/ec/order/sensitiveinfo/decode 接口的响应。</para>
/// </summary>
public class ChannelsECOrderSensitiveInfoDecodeResponse : WechatApiResponse
{
public static class Types
{
public class Address
{
/// <summary>
/// 获取或设置收件人姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_name")]
[System.Text.Json.Serialization.JsonPropertyName("user_name")]
public string UserName { get; set; } = default!;
/// <summary>
/// 获取或设置邮政编码。
/// </summary>
[Newtonsoft.Json.JsonProperty("postal_code")]
[System.Text.Json.Serialization.JsonPropertyName("postal_code")]
public string? PostalCode { get; set; }
/// <summary>
/// 获取或设置省份。
/// </summary>
[Newtonsoft.Json.JsonProperty("province_name")]
[System.Text.Json.Serialization.JsonPropertyName("province_name")]
public string? ProvinceName { get; set; }
/// <summary>
/// 获取或设置城市。
/// </summary>
[Newtonsoft.Json.JsonProperty("city_name")]
[System.Text.Json.Serialization.JsonPropertyName("city_name")]
public string? CityName { get; set; }
/// <summary>
/// 获取或设置区县。
/// </summary>
[Newtonsoft.Json.JsonProperty("county_name")]
[System.Text.Json.Serialization.JsonPropertyName("county_name")]
public string? DistrictName { get; set; }
/// <summary>
/// 获取或设置详细地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("detail_info")]
[System.Text.Json.Serialization.JsonPropertyName("detail_info")]
public string? Detail { get; set; }
/// <summary>
/// 获取或设置国家码。
/// </summary>
[Newtonsoft.Json.JsonProperty("national_code")]
[System.Text.Json.Serialization.JsonPropertyName("national_code")]
public string? NationalCode { get; set; }
/// <summary>
/// 获取或设置电话号码。
/// </summary>
[Newtonsoft.Json.JsonProperty("tel_number")]
[System.Text.Json.Serialization.JsonPropertyName("tel_number")]
public string TeleNumber { get; set; } = default!;
/// <summary>
/// 获取或设置门牌号。
/// </summary>
[Newtonsoft.Json.JsonProperty("house_number")]
[System.Text.Json.Serialization.JsonPropertyName("house_number")]
public string? HouseNumber { get; set; }
/// <summary>
/// 获取或设置虚拟号码。
/// </summary>
[Newtonsoft.Json.JsonProperty("virtual_order_tel_number")]
[System.Text.Json.Serialization.JsonPropertyName("virtual_order_tel_number")]
public string? VirtualTeleNumber { get; set; }
}
}
/// <summary>
/// 获取或设置地址信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("address_info")]
[System.Text.Json.Serialization.JsonPropertyName("address_info")]
public Types.Address? Address { get; set; }
}
}

View File

@ -1,4 +1,4 @@
{
{
"errcode": 0,
"errmsg": "ok",
"order": {
@ -17,14 +17,33 @@
"title": "健身环",
"thumb_img": "https://mmecimage.cn/p/wx37f38d59298839c3/HJE9eJaEc5bJk-eaArVdILSB7MMaHgdK2-JIn51nMQ",
"sale_price": 2000,
"market_price": 2000
"market_price": 2000,
"sku_code": "18236414",
"sku_attrs": [
{
"attr_key": "个数",
"attr_value": "一套"
}
],
"real_price": 1900,
"out_product_id": "88",
"out_sku_id": "248",
"out_warehouse_id": "",
"sku_deliver_info": {
"stock_type": 0
},
"extra_service": {
"seven_day_return": 1,
"freight_insurance": 0
}
}
],
"pay_info": {
"prepay_id": "42526234625",
"transaction_id": "131456479687",
"prepay_time": 1658509200,
"pay_time": 1658509200
"pay_time": 1658509200,
"payment_method": 1
},
"price_info": {
"product_price": 20000,
@ -60,7 +79,8 @@
}
],
"ship_done_time": 1620738080,
"deliver_method": 0
"deliver_method": 0,
"ewaybill_order_code": "ofskfRaaNSxitNLtwCqOfLMIO4r5ZEOXXVTGjf_g_4LuMzRPsZn2CnTn97xWg3AxHoZQXydN8iQA"
},
"coupon_info": {
"user_coupon_id": "301234567890"
@ -68,7 +88,26 @@
"ext_info": {
"customer_notes": "发顺丰",
"merchant_notes": "库存不足,取消"
}
},
"sharer_info": {
"sharer_openid": "SHAREROPENID",
"sharer_unionid": "SHARERUNIONID",
"sharer_type": 1,
"share_scene": 1
},
"settle_info": {
"commission_fee": 10,
"predict_commission_fee": 10
},
"sku_sharer_infos": [
{
"sharer_openid": "SHAREROPENID",
"sharer_unionid": "SHARERUNIONID",
"sharer_type": 1,
"share_scene": 1,
"sku_id": "23424"
}
]
},
"aftersale_detail": {
"aftersale_order_list": [
@ -79,6 +118,7 @@
],
"on_aftersale_order_cnt": 1
},
"openid": "OPENID"
"openid": "OPENID",
"unionid": "UNIONID"
}
}

View File

@ -0,0 +1,13 @@
{
"errcode": 0,
"errmsg": "ok",
"address_info": {
"user_name": "陈先生",
"postal_code": "2435245",
"province_name": "广东",
"city_name": "广州",
"county_name": "海珠区",
"detail_info": "大塘",
"tel_number": "24534252"
}
}