From 104013649f6d3741c6ba85b8bf8383077d3aec61 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 11 Aug 2023 09:35:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(tenpayv3):=20=E9=9A=8F=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B9=B3=E5=8F=B0=E6=94=B6=E4=BB=98=E9=80=9A?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=B5=84=E9=87=91=E5=87=BA=E5=A2=83=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateFundsToOverseaOrderRequest.cs | 88 +++++++++++++------ .../CreateFundsToOverseaOrderRequest.json | 8 +- 2 files changed, 70 insertions(+), 26 deletions(-) diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.cs index 83f87f7e..375d77ed 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models { @@ -40,6 +40,54 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models public int UnitPrice { get; set; } } + public class Express + { + /// + /// 获取或设置物流单号。 + /// + [Newtonsoft.Json.JsonProperty("courier_number")] + [System.Text.Json.Serialization.JsonPropertyName("courier_number")] + public string CourierNumber { get; set; } = string.Empty; + + /// + /// 获取或设置物流商名称。 + /// + [Newtonsoft.Json.JsonProperty("express_company_name")] + [System.Text.Json.Serialization.JsonPropertyName("express_company_name")] + public string ExpressCompanyName { get; set; } = string.Empty; + } + + public class Presale + { + /// + /// 获取或设置订单类型。 + /// + [Newtonsoft.Json.JsonProperty("type")] + [System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = string.Empty; + + /// + /// 获取或设置关联定金订单号。 + /// + [Newtonsoft.Json.JsonProperty("deposit_transaction_id")] + [System.Text.Json.Serialization.JsonPropertyName("deposit_transaction_id")] + public string? DepositTransactionId { get; set; } + + /// + /// 获取或设置关联尾款订单号。 + /// + [Newtonsoft.Json.JsonProperty("balance_transaction_id")] + [System.Text.Json.Serialization.JsonPropertyName("balance_transaction_id")] + public string? BalanceTransactionId { get; set; } + + /// + /// 获取或设置预售订单总金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("total_amount")] + [System.Text.Json.Serialization.JsonPropertyName("total_amount")] + public int TotalAmount { get; set; } + } + public class Seller { /// @@ -64,23 +112,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models public string SellerId { get; set; } = string.Empty; } - public class Express - { - /// - /// 获取或设置物流单号。 - /// - [Newtonsoft.Json.JsonProperty("courier_number")] - [System.Text.Json.Serialization.JsonPropertyName("courier_number")] - public string CourierNumber { get; set; } = string.Empty; - - /// - /// 获取或设置物流商名称。 - /// - [Newtonsoft.Json.JsonProperty("express_company_name")] - [System.Text.Json.Serialization.JsonPropertyName("express_company_name")] - public string ExpressCompanyName { get; set; } = string.Empty; - } - public class Payee { /// @@ -134,6 +165,20 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models [System.Text.Json.Serialization.JsonPropertyName("goods_info")] public IList? GoodsList { get; set; } + /// + /// 获取或设置物流信息。 + /// + [Newtonsoft.Json.JsonProperty("express_info")] + [System.Text.Json.Serialization.JsonPropertyName("express_info")] + public Types.Express? Express { get; set; } + + /// + /// 获取或设置预售信息。 + /// + [Newtonsoft.Json.JsonProperty("presale_info")] + [System.Text.Json.Serialization.JsonPropertyName("presale_info")] + public Types.Presale? Presale { get; set; } + /// /// 获取或设置卖家信息。 /// @@ -141,13 +186,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models [System.Text.Json.Serialization.JsonPropertyName("seller_info")] public Types.Seller Seller { get; set; } = new Types.Seller(); - /// - /// 获取或设置物流信息。 - /// - [Newtonsoft.Json.JsonProperty("express_info")] - [System.Text.Json.Serialization.JsonPropertyName("express_info")] - public Types.Express Express { get; set; } = new Types.Express(); - /// /// 获取或设置付款人信息。 /// diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.json index 303cda63..6762973a 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.json +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_Partner/FundsToOversea/CreateFundsToOverseaOrderRequest.json @@ -1,4 +1,4 @@ -{ +{ "amount": 10, "express_info": { "courier_number": "curier_number_1231", @@ -13,6 +13,12 @@ "goods_unit_price": 1 } ], + "presale_info": { + "type": "DEPOSIT", + "deposit_transaction_id": "4208450740201411110007820472", + "balance_transaction_id": "4208450740201411110007820472", + "total_amount": 10 + }, "out_order_id": "merchant_1123123", "payee_info": { "payee_id": "ID123112312"