diff --git a/docs/WechatTenpayV3/Basic_ModelDefinition.md b/docs/WechatTenpayV3/Basic_ModelDefinition.md index 8e189b16..f263d86a 100644 --- a/docs/WechatTenpayV3/Basic_ModelDefinition.md +++ b/docs/WechatTenpayV3/Basic_ModelDefinition.md @@ -1002,6 +1002,12 @@ - 关闭充值:`ClosePlatformSolutionEcommerceRecharge` + - 平台收付通(赔付) + + - 开通保险理赔功能:`ApplyPlatformSolutionEcommerceInsuranceCompensationContract` + + - 查询保险理赔功能开通状态:`GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantId` + - 代金券 - 创建代金券批次:`CreateMarketingFavorStock` diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecutePlatformSolutionExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecutePlatformSolutionExtensions.cs index 4630f018..29b1f7bf 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecutePlatformSolutionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecutePlatformSolutionExtensions.cs @@ -8,6 +8,53 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 { public static class WechatTenpayClientExecutePlatformSolutionExtensions { + #region EcommerceInsuranceCompensationContracts + /// + /// 异步调用 [POST] /platsolution/ecommerce/insurance-compensation-contracts 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteApplyPlatformSolutionEcommerceInsuranceCompensationContractAsync(this WechatTenpayClient client, Models.ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest 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, "platsolution", "ecommerce", "insurance-compensation-contracts"); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + + /// + /// 异步调用 [GET] /platsolution/ecommerce/insurance-compensation-contracts/sub-mchid/{sub_mchid}/check-opened 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteGetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdAsync(this WechatTenpayClient client, Models.GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdRequest 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.Get, "platsolution", "ecommerce", "insurance-compensation-contracts", "sub-mchid", request.SubMerchantId, "check-opened") + .SetQueryParam("sub_mchid", request.SubMerchantId); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion + #region EcommerceRecharges /// /// 异步调用 [POST] /platsolution/ecommerce/recharges/apply 接口。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest.cs new file mode 100644 index 00000000..b0ee69f1 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /platsolution/ecommerce/insurance-compensation-contracts 接口的请求。 + /// + public class ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest : WechatTenpayRequest + { + public static class Types + { + public class Agreement + { + /// + /// 获取或设置协议编号。 + /// + [Newtonsoft.Json.JsonProperty("agreement_code")] + [System.Text.Json.Serialization.JsonPropertyName("agreement_code")] + public string AgreementCode { get; set; } = string.Empty; + + /// + /// 获取或设置协议版本号。 + /// + [Newtonsoft.Json.JsonProperty("agreement_version")] + [System.Text.Json.Serialization.JsonPropertyName("agreement_version")] + public string AgreementVersion { get; set; } = string.Empty; + + /// + /// 获取或设置签约主体。 + /// + [Newtonsoft.Json.JsonProperty("sign_organization")] + [System.Text.Json.Serialization.JsonPropertyName("sign_organization")] + public string SignOrganization { get; set; } = string.Empty; + + /// + /// 获取或设置签约时间。 + /// + [Newtonsoft.Json.JsonProperty("sign_time")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))] + [System.Text.Json.Serialization.JsonPropertyName("sign_time")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))] + public DateTimeOffset SignTime { get; set; } + } + } + + /// + /// 获取或设置二级商户号。 + /// + [Newtonsoft.Json.JsonProperty("sub_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("sub_mchid")] + public string SubMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置商户申请单号。 + /// + [Newtonsoft.Json.JsonProperty("out_apply_no")] + [System.Text.Json.Serialization.JsonPropertyName("out_apply_no")] + public string OutApplyNumber { get; set; } = string.Empty; + + /// + /// 获取或设置签约协议列表。 + /// + [Newtonsoft.Json.JsonProperty("agreement_list")] + [System.Text.Json.Serialization.JsonPropertyName("agreement_list")] + public IList AgreementList { get; set; } = new List(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractResponse.cs new file mode 100644 index 00000000..8bf5d996 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /platsolution/ecommerce/insurance-compensation-contracts 接口的响应。 + /// + public class ApplyPlatformSolutionEcommerceInsuranceCompensationContractResponse : GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdRequest.cs new file mode 100644 index 00000000..3ba04699 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdRequest.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /platsolution/ecommerce/insurance-compensation-contracts/sub-mchid/{sub_mchid}/check-opened 接口的请求。 + /// + public class GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdRequest : WechatTenpayRequest + { + /// + /// 获取或设置二级商户号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string SubMerchantId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdResponse.cs new file mode 100644 index 00000000..fe263997 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Insurance/GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdResponse.cs @@ -0,0 +1,33 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /platsolution/ecommerce/insurance-compensation-contracts/sub-mchid/{sub_mchid}/check-opened 接口的响应。 + /// + public class GetPlatformSolutionEcommerceInsuranceCompensationContractBySubMerchantIdResponse : WechatTenpayResponse + { + /// + /// 获取或设置二级商户号。 + /// + [Newtonsoft.Json.JsonProperty("sub_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("sub_mchid")] + public string SubMerchantId { get; set; } = default!; + + /// + /// 获取或设置是否开通成功。 + /// + [Newtonsoft.Json.JsonProperty("opened")] + [System.Text.Json.Serialization.JsonPropertyName("opened")] + public bool IsOpened { get; set; } + + /// + /// 获取或设置开通成功时间。 + /// + [Newtonsoft.Json.JsonProperty("success_time")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.Rfc3339DateTimeOffsetConverter))] + [System.Text.Json.Serialization.JsonPropertyName("success_time")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.Rfc3339DateTimeOffsetConverter))] + public DateTimeOffset? SuccessTime { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeRequest.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeRequest.cs rename to src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeRequest.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeResponse.cs similarity index 98% rename from src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeResponse.cs rename to src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeResponse.cs index dc3ff8c0..9dc6b98d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeResponse.cs @@ -1,5 +1,3 @@ -using System; - namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models { /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ClosePlatformSolutionEcommerceRechargeRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ClosePlatformSolutionEcommerceRechargeRequest.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ClosePlatformSolutionEcommerceRechargeRequest.cs rename to src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ClosePlatformSolutionEcommerceRechargeRequest.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ClosePlatformSolutionEcommerceRechargeResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ClosePlatformSolutionEcommerceRechargeResponse.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/ClosePlatformSolutionEcommerceRechargeResponse.cs rename to src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/ClosePlatformSolutionEcommerceRechargeResponse.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberRequest.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberRequest.cs rename to src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberRequest.cs diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.cs similarity index 100% rename from src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/EcommerceRecharges/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.cs rename to src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/_Partner/PlatformSolution/Ecommerce/Recharge/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.cs diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest.json new file mode 100644 index 00000000..7e8fb237 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractRequest.json @@ -0,0 +1,12 @@ +{ + "out_apply_no": "No123456", + "sub_mchid": "1900000109", + "agreement_list": [ + { + "agreement_code": "微信支付运营功能服务协议(平台二级商户)", + "agreement_version": "20240815", + "sign_organization": "温州名优贸易", + "sign_time": "2024-08-08T10:34:56+08:00" + } + ] +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractResponse.json new file mode 100644 index 00000000..cb2d9f32 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Insurance/ApplyPlatformSolutionEcommerceInsuranceCompensationContractResponse.json @@ -0,0 +1,5 @@ +{ + "sub_mchid": "1900000109", + "opened": true, + "success_time": "2024-08-09T13:29:35.120+08:00" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeRequest.json similarity index 100% rename from test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeRequest.json rename to test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeRequest.json diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeResponse.json similarity index 100% rename from test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/ApplyPlatformSolutionEcommerceRechargeResponse.json rename to test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/ApplyPlatformSolutionEcommerceRechargeResponse.json diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/ClosePlatformSolutionEcommerceRechargeResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/ClosePlatformSolutionEcommerceRechargeResponse.json similarity index 100% rename from test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/ClosePlatformSolutionEcommerceRechargeResponse.json rename to test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/ClosePlatformSolutionEcommerceRechargeResponse.json diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.json similarity index 100% rename from test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/EcommerceRecharges/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.json rename to test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/_/_Partner/PlatformSolution/Ecommerce/Recharge/GetPlatformSolutionEcommerceRechargeByOutRechargeNumberResponse.json