From 9b4e6c12c1b3f0091b682681ee0796310865a4cd Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Thu, 7 Oct 2021 16:49:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E6=A0=87?= =?UTF-8?q?=E5=87=86=E7=89=88=E4=BA=A4=E6=98=93=E7=BB=84=E4=BB=B6=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...WechatApiClientExecuteProductExtensions.cs | 82 ++++++ .../ProductOrderAcceptApplyRequest.cs | 18 ++ .../ProductOrderAcceptApplyResponse.cs | 12 + ...oductOrderBatchGetAftersaleOrderRequest.cs | 18 ++ ...ductOrderBatchGetAftersaleOrderResponse.cs | 262 ++++++++++++++++++ .../ProductOrderGetAftersaleOrderRequest.cs | 18 ++ .../ProductOrderGetAftersaleOrderResponse.cs | 25 ++ .../ProductOrderRejectRefundRequest.cs | 25 ++ .../ProductOrderRejectRefundResponse.cs | 12 + ...ductOrderUploadRefundCertificateRequest.cs | 32 +++ ...uctOrderUploadRefundCertificateResponse.cs | 12 + .../ProductOrderAcceptApplyRequest.json | 3 + .../ProductOrderAcceptApplyResponse.json | 3 + ...uctOrderBatchGetAftersaleOrderRequest.json | 3 + ...ctOrderBatchGetAftersaleOrderResponse.json | 83 ++++++ .../ProductOrderGetAftersaleOrderRequest.json | 3 + ...ProductOrderGetAftersaleOrderResponse.json | 42 +++ .../ProductOrderRejectRefundRequest.json | 4 + .../ProductOrderRejectRefundResponse.json | 3 + ...ctOrderUploadRefundCertificateRequest.json | 5 + ...tOrderUploadRefundCertificateResponse.json | 3 + 21 files changed, 668 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.json diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs index d864e593..7fc28735 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs @@ -1236,6 +1236,88 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } + + #region Aftersale + /// + /// 异步调用 [POST] /product/order/batchgetaftersaleorder 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/batchgetaftersaleorder.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductOrderBatchGetAftersaleOrderAsync(this WechatApiClient client, Models.ProductOrderBatchGetAftersaleOrderRequest 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", "batchgetaftersaleorder") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/order/getaftersaleorder 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/getaftersaleorder.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductOrderGetAftersaleOrderAsync(this WechatApiClient client, Models.ProductOrderGetAftersaleOrderRequest 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", "getaftersaleorder") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/order/acceptapply 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/acceptapply.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductOrderAcceptApplyAsync(this WechatApiClient client, Models.ProductOrderAcceptApplyRequest 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", "acceptapply") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/order/rejectrefund 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/order/rejectrefund.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductOrderRejectRefundAsync(this WechatApiClient client, Models.ProductOrderRejectRefundRequest 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", "rejectrefund") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion #endregion #region Coupon diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.cs new file mode 100644 index 00000000..94c87d6b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/acceptapply 接口的请求。 + /// + public class ProductOrderAcceptApplyRequest : WechatApiRequest + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public long AftersaleOrderId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.cs new file mode 100644 index 00000000..9299a65a --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/acceptapply 接口的响应。 + /// + public class ProductOrderAcceptApplyResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.cs new file mode 100644 index 00000000..3ddac3d2 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/batchgetaftersaleorder 接口的请求。 + /// + public class ProductOrderBatchGetAftersaleOrderRequest : WechatApiRequest + { + /// + /// 获取或设置售后单号列表。 + /// + [Newtonsoft.Json.JsonProperty("after_sale_order_id_list")] + [System.Text.Json.Serialization.JsonPropertyName("after_sale_order_id_list")] + public IList AftersaleOrderIdList { get; set; } = new List(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.cs new file mode 100644 index 00000000..08a48b10 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.cs @@ -0,0 +1,262 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/batchgetaftersaleorder 接口的响应。 + /// + public class ProductOrderBatchGetAftersaleOrderResponse : WechatApiResponse + { + public static class Types + { + public class Aftersale + { + public static class Types + { + public class Product + { + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("product_id")] + [System.Text.Json.Serialization.JsonPropertyName("product_id")] + public long ProductId { get; set; } + + /// + /// 获取或设置 SKU ID。 + /// + [Newtonsoft.Json.JsonProperty("sku_id")] + [System.Text.Json.Serialization.JsonPropertyName("sku_id")] + public long SKUId { get; set; } + + /// + /// 获取或设置商品数量。 + /// + [Newtonsoft.Json.JsonProperty("count")] + [System.Text.Json.Serialization.JsonPropertyName("count")] + public int Count { get; set; } + } + + public class Refund + { + /// + /// 获取或设置退款金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + } + + public class RefundResponse + { + /// + /// 获取或设置返回码。 + /// + [Newtonsoft.Json.JsonProperty("ret")] + [System.Text.Json.Serialization.JsonPropertyName("ret")] + public int ReturnCode { get; set; } + + /// + /// 获取或设置错误码。 + /// + [Newtonsoft.Json.JsonProperty("code")] + [System.Text.Json.Serialization.JsonPropertyName("code")] + public string? ErrorCode { get; set; } + + /// + /// 获取或设置错误描述。 + /// + [Newtonsoft.Json.JsonProperty("message")] + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string? ErrorMessage { get; set; } + } + + public class Return + { + /// + /// 获取或设置退货快递单号。 + /// + [Newtonsoft.Json.JsonProperty("waybill_id")] + [System.Text.Json.Serialization.JsonPropertyName("waybill_id")] + public string WaybillId { get; set; } = default!; + + /// + /// 获取或设置退货物流公司 ID。 + /// + [Newtonsoft.Json.JsonProperty("delivery_id")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_id")] + public string DeliveryId { get; set; } = default!; + + /// + /// 获取或设置退货物流公司名称。 + /// + [Newtonsoft.Json.JsonProperty("delivery_name")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_name")] + public string DeliveryName { get; set; } = default!; + } + + public class Detail + { + /// + /// 获取或设置描述。 + /// + [Newtonsoft.Json.JsonProperty("desc")] + [System.Text.Json.Serialization.JsonPropertyName("desc")] + public string Description { get; set; } = default!; + + /// + /// 获取或设置退款的数量。 + /// + [Newtonsoft.Json.JsonProperty("num")] + [System.Text.Json.Serialization.JsonPropertyName("num")] + public int Count { get; set; } + + /// + /// 获取或设置取消时间戳。 + /// + [Newtonsoft.Json.JsonProperty("cancel_time")] + [System.Text.Json.Serialization.JsonPropertyName("cancel_time")] + public long? CancelTimestamp { get; set; } + + /// + /// 获取或设置用户电话号码。 + /// + [Newtonsoft.Json.JsonProperty("tel_number")] + [System.Text.Json.Serialization.JsonPropertyName("tel_number")] + public string? PhoneNumber { get; set; } + + /// + /// 获取或设置退款凭证图片 URL 列表。 + /// + [Newtonsoft.Json.JsonProperty("prove_imgs")] + [System.Text.Json.Serialization.JsonPropertyName("prove_imgs")] + public string[]? ProofImageUrlList { get; set; } + } + + public class MerchantUploadInformation + { + /// + /// 获取或设置退款凭证图片 URL 列表。 + /// + [Newtonsoft.Json.JsonProperty("refund_certificates")] + [System.Text.Json.Serialization.JsonPropertyName("refund_certificates")] + public string[]? RefundCertificateUrlList { get; set; } + + /// + /// 获取或设置拒绝原因。 + /// + [Newtonsoft.Json.JsonProperty("reject_reason")] + [System.Text.Json.Serialization.JsonPropertyName("reject_reason")] + public string? RejectReason { get; set; } + } + } + + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置售后单对应的订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("original_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("original_order_id")] + public long OriginalOrderId { get; set; } + + /// + /// 获取或设置售后单状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置用户 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("openid")] + [System.Text.Json.Serialization.JsonPropertyName("openid")] + public string OpenId { get; set; } = default!; + + /// + /// 获取或设置退款原因。 + /// + [Newtonsoft.Json.JsonProperty("reason")] + [System.Text.Json.Serialization.JsonPropertyName("reason")] + public string Reason { get; set; } = default!; + + /// + /// 获取或设置退款方式。 + /// + [Newtonsoft.Json.JsonProperty("type")] + [System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = default!; + + /// + /// 获取或设置商品信息。 + /// + [Newtonsoft.Json.JsonProperty("product_info")] + [System.Text.Json.Serialization.JsonPropertyName("product_info")] + public Types.Product Product { get; set; } = default!; + + /// + /// 获取或设置售后详细信息。 + /// + [Newtonsoft.Json.JsonProperty("details")] + [System.Text.Json.Serialization.JsonPropertyName("details")] + public Types.Detail Detail { get; set; } = default!; + + /// + /// 获取或设置退款信息。 + /// + [Newtonsoft.Json.JsonProperty("refund_info")] + [System.Text.Json.Serialization.JsonPropertyName("refund_info")] + public Types.Refund? Refund { get; set; } + + /// + /// 获取或设置退款响应信息。 + /// + [Newtonsoft.Json.JsonProperty("refund_resp")] + [System.Text.Json.Serialization.JsonPropertyName("refund_resp")] + public Types.RefundResponse? RefundResponse { get; set; } + + /// + /// 获取或设置退货信息。 + /// + [Newtonsoft.Json.JsonProperty("return_info")] + [System.Text.Json.Serialization.JsonPropertyName("return_info")] + public Types.Return? Return { get; set; } + + /// + /// 获取或设置商家上传信息。 + /// + [Newtonsoft.Json.JsonProperty("merchant_upload_info")] + [System.Text.Json.Serialization.JsonPropertyName("merchant_upload_info")] + public Types.MerchantUploadInformation? MerchantUploadInformation { get; set; } + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("update_time")] + [System.Text.Json.Serialization.JsonPropertyName("update_time")] + public long UpdateTimestamp { get; set; } + + /// + /// 获取或设置创建时间戳。 + /// + [Newtonsoft.Json.JsonProperty("create_time")] + [System.Text.Json.Serialization.JsonPropertyName("create_time")] + public long CreateTimestamp { get; set; } + } + } + + /// + /// 获取或设置售后单列表。 + /// + [Newtonsoft.Json.JsonProperty("after_sale_order_list")] + [System.Text.Json.Serialization.JsonPropertyName("after_sale_order_list")] + public Types.Aftersale[] AftersaleOrderList { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.cs new file mode 100644 index 00000000..3736c7cb --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/getaftersaleorder 接口的请求。 + /// + public class ProductOrderGetAftersaleOrderRequest : WechatApiRequest + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("after_sale_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("after_sale_order_id")] + public long AftersaleOrderId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.cs new file mode 100644 index 00000000..631b0748 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/getaftersaleorder 接口的响应。 + /// + public class ProductOrderGetAftersaleOrderResponse : WechatApiResponse + { + public static class Types + { + public class Aftersale : ProductOrderBatchGetAftersaleOrderResponse.Types.Aftersale + { + } + } + + /// + /// 获取或设置售后单信息。 + /// + [Newtonsoft.Json.JsonProperty("after_sale_order")] + [System.Text.Json.Serialization.JsonPropertyName("after_sale_order")] + public Types.Aftersale AftersaleOrder { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundRequest.cs new file mode 100644 index 00000000..370a98e7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/rejectrefund 接口的请求。 + /// + public class ProductOrderRejectRefundRequest : WechatApiRequest + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置拒绝原因。 + /// + [Newtonsoft.Json.JsonProperty("reject_reason")] + [System.Text.Json.Serialization.JsonPropertyName("reject_reason")] + public string RejectReason { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundResponse.cs new file mode 100644 index 00000000..0629ee79 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderRejectRefundResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/rejectrefund 接口的响应。 + /// + public class ProductOrderRejectRefundResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.cs new file mode 100644 index 00000000..8ae356ae --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/upload_refund_certificate 接口的请求。 + /// + public class ProductOrderUploadRefundCertificateRequest : WechatApiRequest + { + /// + /// 获取或设置售后单号。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public long AftersaleOrderId { get; set; } + + /// + /// 获取或设置退款凭证图片 MediaId 列表。 + /// + [Newtonsoft.Json.JsonProperty("refund_certificates")] + [System.Text.Json.Serialization.JsonPropertyName("refund_certificates")] + public IList? RefundCertificateMediaIdList { get; set; } = new List(); + + /// + /// 获取或设置描述。 + /// + [Newtonsoft.Json.JsonProperty("desc")] + [System.Text.Json.Serialization.JsonPropertyName("desc")] + public string? Description { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.cs new file mode 100644 index 00000000..46089254 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/order/upload_refund_certificate 接口的响应。 + /// + public class ProductOrderUploadRefundCertificateResponse : WechatApiResponse + { + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.json new file mode 100644 index 00000000..1691ad10 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyRequest.json @@ -0,0 +1,3 @@ +{ + "order_id": 1768034782998651 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.json new file mode 100644 index 00000000..52df185e --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderAcceptApplyResponse.json @@ -0,0 +1,3 @@ +{ + "errcode": 0 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.json new file mode 100644 index 00000000..2592328e --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderRequest.json @@ -0,0 +1,3 @@ +{ + "after_sale_order_id_list": [ 7011, 1030 ] +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.json new file mode 100644 index 00000000..5f1578ba --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderBatchGetAftersaleOrderResponse.json @@ -0,0 +1,83 @@ +{ + "errmsg": "", + "after_sale_order_list": [ + { + "order_id": 1030, + "status": "MERCHANT_REFUND_SUCCESS", + "openid": "oTVP50Ks6gr9NU2hvc1YF22naK0Y", + "original_order_id": 1342466, + "product_info": { + "product_id": 3286, + "sku_id": 4740, + "count": 1 + }, + "details": { + "num": 1, + "desc": "", + "cancel_time": 0, + "prove_imgs": [], + "tel_number": "" + }, + "refund_info": { + "amount": 11 + }, + "return_info": { + "waybill_id": "", + "delivery_id": "", + "delivery_name": "" + }, + "merchant_upload_info": { + "reject_reason": "", + "refund_certificates": [] + }, + "create_time": 1591183059, + "update_time": 1612754443, + "reason": "NO_LONGER_WANT", + "refund_resp": { + "code": "", + "ret": 0, + "message": "" + }, + "type": "REFUND" + }, + { + "order_id": 7011, + "status": "MERCHANT_REFUND_SUCCESS", + "openid": "oTVP50Ks6gr9NU2hvc1YF22naK0Y", + "original_order_id": 1768683047558651, + "product_info": { + "product_id": 3286, + "sku_id": 4740, + "count": 1 + }, + "details": { + "num": 1, + "desc": "1234", + "cancel_time": 0, + "prove_imgs": [], + "tel_number": "" + }, + "refund_info": { + "amount": 11 + }, + "return_info": { + "waybill_id": "", + "delivery_id": "", + "delivery_name": "" + }, + "merchant_upload_info": { + "reject_reason": "", + "refund_certificates": [] + }, + "create_time": 1591319454, + "update_time": 1612754444, + "reason": "NO_LONGER_WANT", + "refund_resp": { + "code": "", + "ret": 0, + "message": "" + }, + "type": "REFUND" + } + ] +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.json new file mode 100644 index 00000000..2c23406d --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderRequest.json @@ -0,0 +1,3 @@ +{ + "after_sale_order_id": 7011 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.json new file mode 100644 index 00000000..094cdcaf --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderGetAftersaleOrderResponse.json @@ -0,0 +1,42 @@ +{ + "errcode": 0, + "after_sale_order": { + "order_id": 7011, + "status": "MERCHANT_REFUND_SUCCESS", + "openid": "oTVP50Ks6gr9NU2hvc1YF22naK0Y", + "original_order_id": 1768683047558651, + "product_info": { + "product_id": 3286, + "sku_id": 4740, + "count": 1 + }, + "details": { + "num": 1, + "desc": "1234", + "cancel_time": 0, + "prove_imgs": [], + "tel_number": "" + }, + "refund_info": { + "amount": 11 + }, + "return_info": { + "waybill_id": "", + "delivery_id": "", + "delivery_name": "" + }, + "merchant_upload_info": { + "reject_reason": "", + "refund_certificates": [] + }, + "create_time": 1591319454, + "update_time": 1612754444, + "reason": "NO_LONGER_WANT", + "refund_resp": { + "code": "", + "ret": 0, + "message": "" + }, + "type": "REFUND" + } +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundRequest.json new file mode 100644 index 00000000..35c22390 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundRequest.json @@ -0,0 +1,4 @@ +{ + "order_id": 1768715750567651, + "reject_reason": "123" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundResponse.json new file mode 100644 index 00000000..27dc7b40 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderRejectRefundResponse.json @@ -0,0 +1,3 @@ +{ + "errcode": 0 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.json new file mode 100644 index 00000000..23382f27 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateRequest.json @@ -0,0 +1,5 @@ +{ + "order_id": 1768715750567651, + "refund_certificates": [ "media_id1", "media_id2" ], + "desc": "" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.json new file mode 100644 index 00000000..52df185e --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Order/Aftersale/ProductOrderUploadRefundCertificateResponse.json @@ -0,0 +1,3 @@ +{ + "errcode": 0 +}