From 66a237923e0d98dd53426306cd24f8494fabb4c8 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Sat, 18 Sep 2021 13:56:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E7=BB=84=E4=BB=B6=E8=B5=84=E9=87=91=E7=AE=A1=E7=90=86?= =?UTF-8?q?=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 | 122 ++++++++++++++++++ .../Funds/ProductFundsGetBalanceRequest.cs | 12 ++ .../Funds/ProductFundsGetBalanceResponse.cs | 32 +++++ .../Funds/ProductFundsGetOrderFlowRequest.cs | 18 +++ .../Funds/ProductFundsGetOrderFlowResponse.cs | 25 ++++ .../ProductFundsGetWithdrawDetailRequest.cs | 18 +++ .../ProductFundsGetWithdrawDetailResponse.cs | 81 ++++++++++++ .../Funds/ProductFundsScanOrderFlowRequest.cs | 25 ++++ .../ProductFundsScanOrderFlowResponse.cs | 101 +++++++++++++++ .../Funds/ProductFundsScanWithdrawRequest.cs | 25 ++++ .../Funds/ProductFundsScanWithdrawResponse.cs | 87 +++++++++++++ .../ProductFundsSetBankAccountRequest.cs | 66 ++++++++++ .../ProductFundsSetBankAccountResponse.cs | 12 ++ .../ProductFundsSubmitWithdrawRequest.cs | 32 +++++ .../ProductFundsSubmitWithdrawResponse.cs | 18 +++ .../Funds/ProductFundsGetBalanceRequest.json | 2 + .../Funds/ProductFundsGetBalanceResponse.json | 5 + .../ProductFundsGetOrderFlowRequest.json | 3 + .../ProductFundsGetOrderFlowResponse.json | 15 +++ .../ProductFundsGetWithdrawDetailRequest.json | 3 + ...ProductFundsGetWithdrawDetailResponse.json | 11 ++ .../ProductFundsScanOrderFlowRequest.json | 4 + .../ProductFundsScanOrderFlowResponse.json | 30 +++++ .../ProductFundsScanWithdrawRequest.json | 4 + .../ProductFundsScanWithdrawResponse.json | 25 ++++ .../ProductFundsSetBankAccountRequest.json | 8 ++ .../ProductFundsSetBankAccountResponse.json | 4 + .../ProductFundsSubmitWithdrawRequest.json | 5 + .../ProductFundsSubmitWithdrawResponse.json | 5 + 29 files changed, 798 insertions(+) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawResponse.json diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs index 27acf2c1..d864e593 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteProductExtensions.cs @@ -1379,5 +1379,127 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } #endregion + + #region Funds + /// + /// 异步调用 [POST] /product/funds/getbalance 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/funds/get_balance.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductFundsGetBalanceAsync(this WechatApiClient client, Models.ProductFundsGetBalanceRequest 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", "funds", "getbalance") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/funds/scanorderflow 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/funds/scan_order_flow.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductFundsScanOrderFlowAsync(this WechatApiClient client, Models.ProductFundsScanOrderFlowRequest 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", "funds", "scanorderflow") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/funds/getorderflow 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/funds/get_order_flow.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductFundsGetOrderFlowAsync(this WechatApiClient client, Models.ProductFundsGetOrderFlowRequest 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", "funds", "getorderflow") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/funds/scanwithdraw 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/funds/scan_withdraw.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductFundsScanWithdrawAsync(this WechatApiClient client, Models.ProductFundsScanWithdrawRequest 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", "funds", "scanwithdraw") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/funds/getwithdrawdetail 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/funds/get_withdraw_detail.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductFundsGetWithdrawDetailAsync(this WechatApiClient client, Models.ProductFundsGetWithdrawDetailRequest 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", "funds", "getwithdrawdetail") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /product/funds/setbankaccount 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/funds/set_bank_account.html + /// + /// + /// + /// + /// + public static async Task ExecuteProductFundsSetBankAccountAsync(this WechatApiClient client, Models.ProductFundsSetBankAccountRequest 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", "funds", "setbankaccount") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceRequest.cs new file mode 100644 index 00000000..7599666c --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/getbalance 接口的请求。 + /// + public class ProductFundsGetBalanceRequest : WechatApiRequest + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceResponse.cs new file mode 100644 index 00000000..144831a5 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetBalanceResponse.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/getbalance 接口的响应。 + /// + public class ProductFundsGetBalanceResponse : WechatApiResponse + { + /// + /// 获取或设置可提现余额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("available_amount")] + [System.Text.Json.Serialization.JsonPropertyName("available_amount")] + public int AvailableAmount { get; set; } + + /// + /// 获取或设置待结算余额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("pending_amount")] + [System.Text.Json.Serialization.JsonPropertyName("pending_amount")] + public int PendingAmount { get; set; } + + /// + /// 获取或设置二级商户号。 + /// + [Newtonsoft.Json.JsonProperty("sub_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("sub_mchid")] + public string SubMerchantId { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowRequest.cs new file mode 100644 index 00000000..50efeab1 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/getorderflow 接口的请求。 + /// + public class ProductFundsGetOrderFlowRequest : WechatApiRequest + { + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public long OrderId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowResponse.cs new file mode 100644 index 00000000..2e1bd8a2 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetOrderFlowResponse.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/getorderflow 接口的响应。 + /// + public class ProductFundsGetOrderFlowResponse : WechatApiResponse + { + public static class Types + { + public class OrderFlow : ProductFundsScanOrderFlowResponse.Types.OrderFlow + { + } + } + + /// + /// 获取或设置订单资金流水信息。 + /// + [Newtonsoft.Json.JsonProperty("order_flow")] + [System.Text.Json.Serialization.JsonPropertyName("order_flow")] + public Types.OrderFlow OrderFlow { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailRequest.cs new file mode 100644 index 00000000..7294eecb --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/getwithdrawdetail 接口的请求。 + /// + public class ProductFundsGetWithdrawDetailRequest : WechatApiRequest + { + /// + /// 获取或设置商户提现单号。 + /// + [Newtonsoft.Json.JsonProperty("out_request_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_request_no")] + public string OutRequestNumber { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailResponse.cs new file mode 100644 index 00000000..4b580581 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsGetWithdrawDetailResponse.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/getwithdrawdetail 接口的响应。 + /// + public class ProductFundsGetWithdrawDetailResponse : WechatApiResponse + { + /// + /// 获取或设置商户提现单号。 + /// + [Newtonsoft.Json.JsonProperty("out_request_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_request_no")] + public string OutRequestNumber { get; set; } = default!; + + /// + /// 获取或设置提现状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置提现金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + + /// + /// 获取或设置失败原因。 + /// + [Newtonsoft.Json.JsonProperty("reason")] + [System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? FailReason { get; set; } + + /// + /// 获取或设置备注。 + /// + [Newtonsoft.Json.JsonProperty("remark")] + [System.Text.Json.Serialization.JsonPropertyName("remark")] + public string? Remark { get; set; } + + /// + /// 获取或设置银行账户。 + /// + [Newtonsoft.Json.JsonProperty("bank_num")] + [System.Text.Json.Serialization.JsonPropertyName("bank_num")] + public string BankAccount { get; set; } = default!; + + /// + /// 获取或设置银行名称。 + /// + [Newtonsoft.Json.JsonProperty("bank_name")] + [System.Text.Json.Serialization.JsonPropertyName("bank_name")] + public string BankName { get; set; } = default!; + + /// + /// 获取或设置银行附言。 + /// + [Newtonsoft.Json.JsonProperty("bank_memo")] + [System.Text.Json.Serialization.JsonPropertyName("bank_memo")] + public string? BankMemo { 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; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowRequest.cs new file mode 100644 index 00000000..a3a675c8 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/scanorderflow 接口的请求。 + /// + public class ProductFundsScanOrderFlowRequest : WechatApiRequest + { + /// + /// 获取或设置分页页数(从 1 开始)。 + /// + [Newtonsoft.Json.JsonProperty("page_num")] + [System.Text.Json.Serialization.JsonPropertyName("page_num")] + public int Page { get; set; } = 1; + + /// + /// 获取或设置分页每页数量。 + /// + [Newtonsoft.Json.JsonProperty("page_size")] + [System.Text.Json.Serialization.JsonPropertyName("page_size")] + public int Limit { get; set; } = 10; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowResponse.cs new file mode 100644 index 00000000..3a975fe1 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanOrderFlowResponse.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/scanorderflow 接口的响应。 + /// + public class ProductFundsScanOrderFlowResponse : WechatApiResponse + { + public static class Types + { + public class OrderFlow + { + /// + /// 获取或设置订单 ID。 + /// + [Newtonsoft.Json.JsonProperty("order_id")] + [System.Text.Json.Serialization.JsonPropertyName("order_id")] + public long OrderId { get; set; } + + /// + /// 获取或设置订单状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置商家所得金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("price")] + [System.Text.Json.Serialization.JsonPropertyName("price")] + public int Price { get; set; } + + /// + /// 获取或设置订单总金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("order_price")] + [System.Text.Json.Serialization.JsonPropertyName("order_price")] + public int TotalFee { get; set; } + + /// + /// 获取或设置打折金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("discount_fee")] + [System.Text.Json.Serialization.JsonPropertyName("discount_fee")] + public int DiscountFee { get; set; } + + /// + /// 获取或设置服务费金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("service_fee")] + [System.Text.Json.Serialization.JsonPropertyName("service_fee")] + public int ServiceFee { get; set; } + + /// + /// 获取或设置手续费金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("handling_fee")] + [System.Text.Json.Serialization.JsonPropertyName("handling_fee")] + public int HandlingFee { get; set; } + + /// + /// 获取或设置退款类型。 + /// + [Newtonsoft.Json.JsonProperty("refunding_type")] + [System.Text.Json.Serialization.JsonPropertyName("refunding_type")] + public int RefundType { get; set; } + + /// + /// 获取或设置已退款金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("refund_fee")] + [System.Text.Json.Serialization.JsonPropertyName("refund_fee")] + public int RefundFee { get; set; } + + /// + /// 获取或设置结算时间戳。 + /// + [Newtonsoft.Json.JsonProperty("settled_time")] + [System.Text.Json.Serialization.JsonPropertyName("settled_time")] + public long? SettleTimestamp { get; set; } + + /// + /// 获取或设置下单时间戳。 + /// + [Newtonsoft.Json.JsonProperty("order_time")] + [System.Text.Json.Serialization.JsonPropertyName("order_time")] + public long OrderTimestamp { get; set; } + } + } + + /// + /// 获取或设置订单资金流水列表。 + /// + [Newtonsoft.Json.JsonProperty("order_flow")] + [System.Text.Json.Serialization.JsonPropertyName("order_flow")] + public Types.OrderFlow[] OrderFlowList { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawRequest.cs new file mode 100644 index 00000000..f56fbde1 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/scanwithdraw 接口的请求。 + /// + public class ProductFundsScanWithdrawRequest : WechatApiRequest + { + /// + /// 获取或设置分页页数(从 1 开始)。 + /// + [Newtonsoft.Json.JsonProperty("page_num")] + [System.Text.Json.Serialization.JsonPropertyName("page_num")] + public int Page { get; set; } = 1; + + /// + /// 获取或设置分页每页数量。 + /// + [Newtonsoft.Json.JsonProperty("page_size")] + [System.Text.Json.Serialization.JsonPropertyName("page_size")] + public int Limit { get; set; } = 10; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawResponse.cs new file mode 100644 index 00000000..31fbbb6e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsScanWithdrawResponse.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/scanwithdraw 接口的响应。 + /// + public class ProductFundsScanWithdrawResponse : WechatApiResponse + { + public static class Types + { + public class Withdraw + { + /// + /// 获取或设置商户提现单号。 + /// + [Newtonsoft.Json.JsonProperty("out_request_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_request_no")] + public string OutRequestNumber { get; set; } = default!; + + /// + /// 获取或设置提现状态。 + /// + [Newtonsoft.Json.JsonProperty("status")] + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + /// + /// 获取或设置提现金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + + /// + /// 获取或设置失败原因。 + /// + [Newtonsoft.Json.JsonProperty("reason")] + [System.Text.Json.Serialization.JsonPropertyName("reason")] + public string? FailReason { get; set; } + + /// + /// 获取或设置备注。 + /// + [Newtonsoft.Json.JsonProperty("remark")] + [System.Text.Json.Serialization.JsonPropertyName("remark")] + public string? Remark { get; set; } + + /// + /// 获取或设置银行附言。 + /// + [Newtonsoft.Json.JsonProperty("bank_memo")] + [System.Text.Json.Serialization.JsonPropertyName("bank_memo")] + public string? BankMemo { get; set; } + + /// + /// 获取或设置更新时间戳。 + /// + [Newtonsoft.Json.JsonProperty("wxpay_update_time")] + [System.Text.Json.Serialization.JsonPropertyName("wxpay_update_time")] + public long UpdateTimestamp { get; set; } + + /// + /// 获取或设置开始时间戳。 + /// + [Newtonsoft.Json.JsonProperty("wxpay_create_time")] + [System.Text.Json.Serialization.JsonPropertyName("wxpay_create_time")] + public long CreateTimestamp { get; set; } + } + } + + /// + /// 获取或设置提现记录列表。 + /// + [Newtonsoft.Json.JsonProperty("list")] + [System.Text.Json.Serialization.JsonPropertyName("list")] + public Types.Withdraw[] WithdrawList { get; set; } = default!; + + /// + /// 获取或设置总数量。 + /// + [Newtonsoft.Json.JsonProperty("total_num")] + [System.Text.Json.Serialization.JsonPropertyName("total_num")] + public int TotalCount { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountRequest.cs new file mode 100644 index 00000000..316fce46 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountRequest.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/setbankaccount 接口的请求。 + /// + public class ProductFundsSetBankAccountRequest : WechatApiRequest + { + public static class Types + { + public class Account + { + /// + /// 获取或设置银行账户类型。 + /// + [Newtonsoft.Json.JsonProperty("bank_account_type")] + [System.Text.Json.Serialization.JsonPropertyName("bank_account_type")] + public string BankAccountType { get; set; } = string.Empty; + + /// + /// 获取或设置银行账户。 + /// + [Newtonsoft.Json.JsonProperty("account_number")] + [System.Text.Json.Serialization.JsonPropertyName("account_number")] + public string BankAccount { get; set; } = string.Empty; + + /// + /// 获取或设置银行名称。 + /// + [Newtonsoft.Json.JsonProperty("account_bank")] + [System.Text.Json.Serialization.JsonPropertyName("account_bank")] + public string BankName { get; set; } = string.Empty; + + /// + /// 获取或设置银行名称前端展示值。 + /// + [Newtonsoft.Json.JsonProperty("account_bank4show")] + [System.Text.Json.Serialization.JsonPropertyName("account_bank4show")] + public string? BankNameForShow { get; set; } + + /// + /// 获取或设置银行省市编码。 + /// + [Newtonsoft.Json.JsonProperty("bank_address_code")] + [System.Text.Json.Serialization.JsonPropertyName("bank_address_code")] + public string BankAddressCode { get; set; } = string.Empty; + + /// + /// 获取或设置开户银行联行号。 + /// + [Newtonsoft.Json.JsonProperty("bank_branch_id")] + [System.Text.Json.Serialization.JsonPropertyName("bank_branch_id")] + public string? BankBranchId { get; set; } + } + } + + /// + /// 获取或设置账户信息。 + /// + [Newtonsoft.Json.JsonProperty("account_info")] + [System.Text.Json.Serialization.JsonPropertyName("account_info")] + public Types.Account Account { get; set; } = new Types.Account(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountResponse.cs new file mode 100644 index 00000000..b297c24e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSetBankAccountResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/setbankaccount 接口的响应。 + /// + public class ProductFundsSetBankAccountResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawRequest.cs new file mode 100644 index 00000000..9e61ceac --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawRequest.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/submitwithdraw 接口的请求。 + /// + public class ProductFundsSubmitWithdrawRequest : WechatApiRequest + { + /// + /// 获取或设置提现金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + + /// + /// 获取或设置备注。 + /// + [Newtonsoft.Json.JsonProperty("remark")] + [System.Text.Json.Serialization.JsonPropertyName("remark")] + public string? Remark { get; set; } + + /// + /// 获取或设置银行附言。 + /// + [Newtonsoft.Json.JsonProperty("bank_memo")] + [System.Text.Json.Serialization.JsonPropertyName("bank_memo")] + public string? BankMemo { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawResponse.cs new file mode 100644 index 00000000..4c63ac49 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Product/Funds/ProductFundsSubmitWithdrawResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /product/funds/submitwithdraw 接口的响应。 + /// + public class ProductFundsSubmitWithdrawResponse : WechatApiResponse + { + /// + /// 获取或设置二维码 Ticket。 + /// + [Newtonsoft.Json.JsonProperty("qrcode_ticket")] + [System.Text.Json.Serialization.JsonPropertyName("qrcode_ticket")] + public string QrcodeTicket { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceRequest.json new file mode 100644 index 00000000..8593c62d --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceRequest.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceResponse.json new file mode 100644 index 00000000..04c66f5b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetBalanceResponse.json @@ -0,0 +1,5 @@ +{ + "available_amount": 45331, + "pending_amount": 7549, + "sub_mchid": "1588759201" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowRequest.json new file mode 100644 index 00000000..71541b38 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowRequest.json @@ -0,0 +1,3 @@ +{ + "order_id": 1651031426690650 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowResponse.json new file mode 100644 index 00000000..9970f4c5 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetOrderFlowResponse.json @@ -0,0 +1,15 @@ +{ + "order_flow": { + "order_id": 1651031426690650, + "status": "ORDER_FLOW_STATUS_TRANSACTION_PENDING_SETTLED", + "price": 1, + "order_price": 1, + "discount_fee": 0, + "service_fee": 0, + "handling_fee": 0, + "refund_fee": 0, + "settled_time": 0, + "order_time": 1625390752, + "refunding_type": 0 + } +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailRequest.json new file mode 100644 index 00000000..907cd9e3 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailRequest.json @@ -0,0 +1,3 @@ +{ + "out_request_no": "wd13675014323600561372" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailResponse.json new file mode 100644 index 00000000..6f9344fb --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsGetWithdrawDetailResponse.json @@ -0,0 +1,11 @@ +{ + "amount": 7, + "create_time": 1590733930, + "update_time": 1590773555, + "reason": "", + "remark": "0529日14点31分提现", + "bank_memo": "0529日14点31分提现", + "bank_name": "", + "bank_num": "", + "status": "SUCCESS" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowRequest.json new file mode 100644 index 00000000..a7ac5fe4 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowRequest.json @@ -0,0 +1,4 @@ +{ + "page_num": 1, + "page_size": 100 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowResponse.json new file mode 100644 index 00000000..422ad414 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanOrderFlowResponse.json @@ -0,0 +1,30 @@ +{ + "order_flow": [ + { + "order_id": 123456789123, + "status": "ORDER_FLOW_STATUS_TRANSACTION_PENDING_SETTLED", + "price": 1, + "order_price": 1, + "discount_fee": 0, + "service_fee": 0, + "handling_fee": 0, + "refund_fee": 0, + "settled_time": 0, + "order_time": 1625834352, + "refunding_type": 0 + }, + { + "order_id": 12345678229, + "status": "ORDER_FLOW_STATUS_TRANSACTION_PENDING_SETTLED", + "price": 1, + "order_price": 1, + "discount_fee": 0, + "service_fee": 0, + "handling_fee": 0, + "refund_fee": 0, + "settled_time": 0, + "order_time": 1625832229, + "refunding_type": 0 + } + ] +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawRequest.json new file mode 100644 index 00000000..a797fc96 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawRequest.json @@ -0,0 +1,4 @@ +{ + "page_num": 1, + "page_size": 10 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawResponse.json new file mode 100644 index 00000000..9f987d9e --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsScanWithdrawResponse.json @@ -0,0 +1,25 @@ +{ + "list": [ + { + "out_request_no": "3163339305837870", + "amount": 1, + "status": "SUCCESS", + "reason": "", + "remark": "", + "bank_memo": "", + "wxpay_update_time": 1594408007, + "wxpay_create_time": 1594365375 + }, + { + "out_request_no": "180687538055", + "amount": 1, + "status": "SUCCESS", + "reason": "", + "remark": "", + "bank_memo": "", + "wxpay_update_time": 1594404381, + "wxpay_create_time": 1594365335 + } + ], + "total_num": 103 +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountRequest.json new file mode 100644 index 00000000..6bbddbb4 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountRequest.json @@ -0,0 +1,8 @@ +{ + "account_info": { + "bank_account_type": "ACCOUNT_TYPE_PRIVATE", + "account_bank": "招商银行", + "bank_address_code": "100000", + "account_number": "1234567890" + } +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountResponse.json new file mode 100644 index 00000000..16292a24 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSetBankAccountResponse.json @@ -0,0 +1,4 @@ +{ + "errcode": 0, + "errmsg": "OK" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawRequest.json new file mode 100644 index 00000000..f6534ca7 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawRequest.json @@ -0,0 +1,5 @@ +{ + "amount": 1, + "remark": "sss", + "bank_memo": "" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawResponse.json new file mode 100644 index 00000000..ce801117 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Product/Funds/ProductFundsSubmitWithdrawResponse.json @@ -0,0 +1,5 @@ +{ + "errcode": 0, + "errmsg": "OK", + "qrcode_ticket": "xxxxx" +} \ No newline at end of file