From 770ee8d590780b6e97474cc8b296b823a8a47bdc Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 31 Mar 2023 11:26:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(tenpayv3):=20=E6=96=B0=E5=A2=9E=E5=87=BA?= =?UTF-8?q?=E7=A7=9F=E8=BD=A6=E7=94=B5=E5=AD=90=E5=8F=91=E7=A5=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/WechatTenpayV3/Basic_ModelDefinition.md | 1 + ...payClientExecuteHirePowerBankExtensions.cs | 1 - ...enpayClientExecuteTaxiInvoiceExtensions.cs | 225 +++++++++++ .../CreateBrandProfitSharingOrderRequest.cs | 2 +- .../CreateBrandProfitSharingOrderResponse.cs | 2 +- ...erchantOperateRiskWithdrawlApplyRequest.cs | 2 +- .../CreateRateActivityApplicationRequest.cs | 2 +- ...ivityApplicationByApplicationIdResponse.cs | 2 +- .../PunchTaxiInvoiceAttendanceRequest.cs | 135 +++++++ .../PunchTaxiInvoiceAttendanceResponse.cs | 9 + .../Card/CreateTaxiInvoiceCardRequest.cs | 371 ++++++++++++++++++ .../Card/CreateTaxiInvoiceCardResponse.cs | 9 + .../Card/UploadTaxiInvoiceCardFileRequest.cs | 45 +++ .../Card/UploadTaxiInvoiceCardFileResponse.cs | 15 + .../Driver/GetTaxiInvoiceDriverRequest.cs | 22 ++ .../Driver/GetTaxiInvoiceDriverResponse.cs | 118 ++++++ .../Driver/UpdateTaxiInvoiceDriverRequest.cs | 130 ++++++ .../Driver/UpdateTaxiInvoiceDriverResponse.cs | 9 + .../Taxi/GetTaxiInvoiceTaxiRequest.cs | 22 ++ .../Taxi/GetTaxiInvoiceTaxiResponse.cs | 64 +++ .../Taxi/UpdateTaxiInvoiceTaxiRequest.cs | 64 +++ .../Taxi/UpdateTaxiInvoiceTaxiResponse.cs | 9 + .../CreateTaxiInvoiceTaxiCompanyRequest.cs | 85 ++++ .../CreateTaxiInvoiceTaxiCompanyResponse.cs | 22 ++ .../GetTaxiInvoiceTaxiCompanyRequest.cs | 22 ++ .../GetTaxiInvoiceTaxiCompanyResponse.cs | 92 +++++ ...tTaxiInvoiceUserTaxiOrderByTokenRequest.cs | 43 ++ ...TaxiInvoiceUserTaxiOrderByTokenResponse.cs | 63 +++ ...KIT.FlurlHttpClient.Wechat.TenpayV3.csproj | 2 +- .../PunchTaxiInvoiceAttendanceRequest.json | 7 + .../Card/CreateTaxiInvoiceCardRequest.json | 57 +++ .../UploadTaxiInvoiceCardFileRequest.json | 6 + .../UploadTaxiInvoiceCardFileResponse.json | 3 + .../Driver/GetTaxiInvoiceDriverResponse.json | 18 + .../UpdateTaxiInvoiceDriverRequest.json | 19 + .../Taxi/GetTaxiInvoiceTaxiResponse.json | 10 + .../Taxi/UpdateTaxiInvoiceTaxiRequest.json | 10 + .../CreateTaxiInvoiceTaxiCompanyRequest.json | 13 + .../CreateTaxiInvoiceTaxiCompanyResponse.json | 4 + .../GetTaxiInvoiceTaxiCompanyResponse.json | 14 + ...xiInvoiceUserTaxiOrderByTokenResponse.json | 9 + .../TestCase_RequestEncryptionTests.cs | 38 ++ 42 files changed, 1789 insertions(+), 7 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteTaxiInvoiceExtensions.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.json diff --git a/docs/WechatTenpayV3/Basic_ModelDefinition.md b/docs/WechatTenpayV3/Basic_ModelDefinition.md index 809cecd5..ad95e7c4 100644 --- a/docs/WechatTenpayV3/Basic_ModelDefinition.md +++ b/docs/WechatTenpayV3/Basic_ModelDefinition.md @@ -42,6 +42,7 @@ | √ | 经营能力:微信先享卡 | 直连商户 | | | √ | 经营能力:支付即服务 | 直连商户 & 服务商 | | | √ | 经营能力:点金计划 | 服务商 | | +| √ | 经营能力:出租车电子发票 | 服务商 | | | √ | 行业方案:电商收付通 | 服务商 | | | √ | 行业方案:智慧商圈 | 直连商户 & 服务商 | | | √ | 行业方案:微信支付分停车服务 | 直连商户 & 服务商 | | diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteHirePowerBankExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteHirePowerBankExtensions.cs index 7942a9e1..9f47494d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteHirePowerBankExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteHirePowerBankExtensions.cs @@ -2,7 +2,6 @@ using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using Flurl; using Flurl.Http; namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteTaxiInvoiceExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteTaxiInvoiceExtensions.cs new file mode 100644 index 00000000..69521aa7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteTaxiInvoiceExtensions.cs @@ -0,0 +1,225 @@ +using System; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Flurl.Http; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 +{ + /// + /// 为 提供出租车电子发票相关的 API 扩展方法。 + /// + public static class WechatTenpayClientExecuteTaxiInvoiceExtensions + { + #region TaxiCompany + /// + /// 异步调用 [POST] /taxi-invoice/taxi-company/create-taxi-company 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/taxi-company/create-taxi-company.html + /// + /// + /// + /// + /// + public static async Task ExecuteCreateTaxiInvoiceTaxiCompanyAsync(this WechatTenpayClient client, Models.CreateTaxiInvoiceTaxiCompanyRequest 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, "taxi-invoice", "taxi-company", "create-taxi-company"); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [GET] /taxi-invoice/taxi-companies/{company_mchid} 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/taxi-company/query-taxi-company.html + /// + /// + /// + /// + /// + public static async Task ExecuteGetTaxiInvoiceTaxiCompanyAsync(this WechatTenpayClient client, Models.GetTaxiInvoiceTaxiCompanyRequest 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.Get, "taxi-invoice", "taxi-companies", request.CompanyMerchantId) + .SetQueryParam("region_id", request.RegionId); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion + + #region Taxi + /// + /// 异步调用 [POST] /taxi-invoice/taxi/update-taxi 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/taxi/update-taxi.html + /// + /// + /// + /// + /// + public static async Task ExecuteUpdateTaxiInvoiceTaxiAsync(this WechatTenpayClient client, Models.UpdateTaxiInvoiceTaxiRequest 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, "taxi-invoice", "taxi", "update-taxi"); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [GET] /taxi-invoice/taxies/{plate_number} 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/taxi/query-taxi.html + /// + /// + /// + /// + /// + public static async Task ExecuteGetTaxiInvoiceTaxiAsync(this WechatTenpayClient client, Models.GetTaxiInvoiceTaxiRequest 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.Get, "taxi-invoice", "taxies", request.PlateNumber) + .SetQueryParam("region_id", request.RegionId); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion + + #region Driver + /// + /// 异步调用 [POST] /taxi-invoice/driver/update-driver 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/driver/update-driver.html + /// + /// + /// + /// + /// + public static async Task ExecuteUpdateTaxiInvoiceDriverAsync(this WechatTenpayClient client, Models.UpdateTaxiInvoiceDriverRequest 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, "taxi-invoice", "driver", "update-driver"); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [GET] /taxi-invoice/drivers/{driver_license} 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/driver/query-driver.html + /// + /// + /// + /// + /// + public static async Task ExecuteGetTaxiInvoiceDriverAsync(this WechatTenpayClient client, Models.GetTaxiInvoiceDriverRequest 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.Get, "taxi-invoice", "drivers", request.DriverLicenseNumber) + .SetQueryParam("region_id", request.RegionId); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion + + #region Attendance + /// + /// 异步调用 [POST] /taxi-invoice/attendance/punch 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/attendance/punch-attendance.html + /// + /// + /// + /// + /// + public static async Task ExecutePunchTaxiInvoiceAttendanceAsync(this WechatTenpayClient client, Models.PunchTaxiInvoiceAttendanceRequest 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, "taxi-invoice", "attendance", "punch"); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion + + #region UserTaxiOrder + /// + /// 异步调用 [GET] /taxi-invoice/user-taxi-order/find-by-token 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/user-taxi-order/query-user-taxi-order-by-token.html + /// + /// + /// + /// + /// + public static async Task ExecuteGetTaxiInvoiceUserTaxiOrderByTokenAsync(this WechatTenpayClient client, Models.GetTaxiInvoiceUserTaxiOrderByTokenRequest 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.Get, "taxi-invoice", "user-taxi-order", "find-by-token") + .SetQueryParam("token", request.Token) + .SetQueryParam("appid", request.AppId) + .SetQueryParam("openid", request.OpenId) + .SetQueryParam("auth_mode", request.AuthMode) + .SetQueryParam("region_id", request.RegionId); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion + + #region Card + /// + /// 异步调用 [POST] /taxi-invoice/cards/upload-file 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/taxi-invoice-card/upload-taxi-invoice-card-file.html + /// + /// + /// + /// + /// + public static async Task ExecuteUploadTaxiInvoiceCardFileAsync(this WechatTenpayClient client, Models.UploadTaxiInvoiceCardFileRequest 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, "taxi-invoice", "cards", "upload-file"); + + using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: "file.pdf", fileBytes: request.FileBytes, fileContentType: "application/pdf", fileMetaJson: client.JsonSerializer.Serialize(request)); + return await client.SendRequestAsync(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /taxi-invoice/cards 接口。 + /// REF: https://pay.weixin.qq.com/docs/partner/apis/taxi-fapiao/taxi-invoice-card/create-taxi-invoice-card.html + /// + /// + /// + /// + /// + public static async Task ExecuteCreateTaxiInvoiceCardAsync(this WechatTenpayClient client, Models.CreateTaxiInvoiceCardRequest 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, "taxi-invoice", "cards"); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderRequest.cs index e9f01a23..5a1bfbf7 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderRequest.cs @@ -52,7 +52,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models } /// - /// 获取或设置品牌主商户号 。 + /// 获取或设置品牌主商户号。 /// [Newtonsoft.Json.JsonProperty("brand_mchid")] [System.Text.Json.Serialization.JsonPropertyName("brand_mchid")] diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderResponse.cs index 72c607b6..35373719 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/BrandProfitSharing/CreateBrandProfitSharingOrderResponse.cs @@ -6,7 +6,7 @@ public class CreateBrandProfitSharingOrderResponse : GetBrandProfitSharingOrderByOutOrderNumberResponse { /// - /// 获取或设置品牌主商户号 。 + /// 获取或设置品牌主商户号。 /// [Newtonsoft.Json.JsonProperty("brand_mchid")] [System.Text.Json.Serialization.JsonPropertyName("brand_mchid")] diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/MerchantOperate/CreateMerchantOperateRiskWithdrawlApplyRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/MerchantOperate/CreateMerchantOperateRiskWithdrawlApplyRequest.cs index 0f7431a6..032b685f 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/MerchantOperate/CreateMerchantOperateRiskWithdrawlApplyRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/MerchantOperate/CreateMerchantOperateRiskWithdrawlApplyRequest.cs @@ -150,7 +150,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models } /// - /// 获取或设置从业机构特约商户号 。 + /// 获取或设置从业机构特约商户号。 /// [Newtonsoft.Json.JsonProperty("sub_mchid")] [System.Text.Json.Serialization.JsonPropertyName("sub_mchid")] diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/CreateRateActivityApplicationRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/CreateRateActivityApplicationRequest.cs index d8a5dfdd..acd99aed 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/CreateRateActivityApplicationRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/CreateRateActivityApplicationRequest.cs @@ -86,7 +86,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models public string ChannelId { get; set; } = string.Empty; /// - /// 获取或设置从业机构特约商户号 。 + /// 获取或设置从业机构特约商户号。 /// [Newtonsoft.Json.JsonProperty("sub_mchid")] [System.Text.Json.Serialization.JsonPropertyName("sub_mchid")] diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/GetRateActivityApplicationByApplicationIdResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/GetRateActivityApplicationByApplicationIdResponse.cs index 37a1f516..73c7606a 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/GetRateActivityApplicationByApplicationIdResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/RateActivity/GetRateActivityApplicationByApplicationIdResponse.cs @@ -15,7 +15,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models public string ApplicationState { get; set; } = default!; /// - /// 获取或设置从业机构特约商户号 。 + /// 获取或设置从业机构特约商户号。 /// [Newtonsoft.Json.JsonProperty("sub_mchid")] [System.Text.Json.Serialization.JsonPropertyName("sub_mchid")] diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.cs new file mode 100644 index 00000000..432beed4 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.cs @@ -0,0 +1,135 @@ +using System; +using System.Globalization; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/attendance/punch 接口的请求。 + /// + public class PunchTaxiInvoiceAttendanceRequest : WechatTenpayRequest + { + internal static class Converters + { + internal class RequestPropertyEventTimeNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter + { + internal const string DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.fffzzz"; + + public override bool CanRead { get { return true; } } + + public override bool CanWrite { get { return true; } } + + public override DateTimeOffset ReadJson(Newtonsoft.Json.JsonReader reader, Type objectType, DateTimeOffset existingValue, bool hasExistingValue, Newtonsoft.Json.JsonSerializer serializer) + { + switch (reader.TokenType) + { + case Newtonsoft.Json.JsonToken.Null: + { + return existingValue; + } + + case Newtonsoft.Json.JsonToken.String: + { + string? value = serializer.Deserialize(reader); + if (string.IsNullOrEmpty(value)) + return existingValue; + + if (DateTimeOffset.TryParseExact(value, DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out var result)) + return result; + if (DateTimeOffset.TryParse(value, out result)) + return result; + + throw new Newtonsoft.Json.JsonSerializationException("Could not parse String '" + value + "' to DateTimeOffset."); + } + + case Newtonsoft.Json.JsonToken.Date: + { + reader.DateFormatString = DATETIME_FORMAT; + return serializer.Deserialize(reader); + } + } + + throw new Newtonsoft.Json.JsonSerializationException($"Unexpected token type '{reader.TokenType}' when deserializing. Path '{reader.Path}'."); + } + + public override void WriteJson(Newtonsoft.Json.JsonWriter writer, DateTimeOffset value, Newtonsoft.Json.JsonSerializer serializer) + { + writer.WriteValue(value.ToString(DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo)); + } + } + + internal class RequestPropertyEventTimeSystemTextJsonConverter : System.Text.Json.Serialization.JsonConverter + { + internal const string DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.fffzzz"; + + public override DateTimeOffset Read(ref System.Text.Json.Utf8JsonReader reader, Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case System.Text.Json.JsonTokenType.Null: + { + return default!; + } + + case System.Text.Json.JsonTokenType.String: + { + string? value = reader.GetString(); + if (string.IsNullOrEmpty(value)) + return default; + + if (DateTimeOffset.TryParseExact(value, DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out var result)) + return result; + if (DateTimeOffset.TryParse(value, out result)) + return result; + + throw new System.Text.Json.JsonException("Could not parse String '" + value + "' to DateTimeOffset."); + } + } + + throw new System.Text.Json.JsonException($"Unexpected JSON token type '{reader.TokenType}' when reading."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, DateTimeOffset value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString(DATETIME_FORMAT, DateTimeFormatInfo.InvariantInfo)); + } + } + } + + /// + /// 获取或设置车牌号。 + /// + [Newtonsoft.Json.JsonProperty("plate_number")] + [System.Text.Json.Serialization.JsonPropertyName("plate_number")] + public string PlateNumber { get; set; } = string.Empty; + + /// + /// 获取或设置司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("driver_license")] + [System.Text.Json.Serialization.JsonPropertyName("driver_license")] + public string DriverLicenseNumber { get; set; } = string.Empty; + + /// + /// 获取或设置事件时间。 + /// + [Newtonsoft.Json.JsonProperty("event_time")] + [Newtonsoft.Json.JsonConverter(typeof(Converters.RequestPropertyEventTimeNewtonsoftJsonConverter))] + [System.Text.Json.Serialization.JsonPropertyName("event_time")] + [System.Text.Json.Serialization.JsonConverter(typeof(Converters.RequestPropertyEventTimeSystemTextJsonConverter))] + public DateTimeOffset EventTime { get; set; } + + /// + /// 获取或设置事件类型。 + /// + [Newtonsoft.Json.JsonProperty("event_type")] + [System.Text.Json.Serialization.JsonPropertyName("event_type")] + public string EventType { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceResponse.cs new file mode 100644 index 00000000..3929114e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/attendance/punch 接口的响应。 + /// + public class PunchTaxiInvoiceAttendanceResponse : WechatTenpayResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.cs new file mode 100644 index 00000000..3e73338e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.cs @@ -0,0 +1,371 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/cards 接口的请求。 + /// + public class CreateTaxiInvoiceCardRequest : WechatTenpayRequest + { + public static class Types + { + public class InvoiceCard + { + public static class Types + { + public class Buyer + { + /// + /// 获取或设置购买方类型。 + /// + [Newtonsoft.Json.JsonProperty("type")] + [System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = string.Empty; + + /// + /// 获取或设置购买方名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// + /// 获取或设置纳税人识别号。 + /// + [Newtonsoft.Json.JsonProperty("taxpayer_id")] + [System.Text.Json.Serialization.JsonPropertyName("taxpayer_id")] + public string? TaxPayerId { get; set; } + + /// + /// 获取或设置地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string? Address { get; set; } + + /// + /// 获取或设置电话。 + /// + [Newtonsoft.Json.JsonProperty("telephone")] + [System.Text.Json.Serialization.JsonPropertyName("telephone")] + public string? PhoneNumber { get; set; } + + /// + /// 获取或设置开户银行。 + /// + [Newtonsoft.Json.JsonProperty("bank_name")] + [System.Text.Json.Serialization.JsonPropertyName("bank_name")] + public string? BankName { get; set; } + + /// + /// 获取或设置银行账号。 + /// + [Newtonsoft.Json.JsonProperty("bank_account")] + [System.Text.Json.Serialization.JsonPropertyName("bank_account")] + public string? BankAccountNumber { get; set; } + } + + public class Seller + { + /// + /// 获取或设置销售方名称。 + /// + [Newtonsoft.Json.JsonProperty("name")] + [System.Text.Json.Serialization.JsonPropertyName("name")] + public string Name { get; set; } = string.Empty; + + /// + /// 获取或设置纳税人识别号。 + /// + [Newtonsoft.Json.JsonProperty("taxpayer_id")] + [System.Text.Json.Serialization.JsonPropertyName("taxpayer_id")] + public string TaxPayerId { get; set; } = string.Empty; + + /// + /// 获取或设置地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string? Address { get; set; } + + /// + /// 获取或设置电话。 + /// + [Newtonsoft.Json.JsonProperty("telephone")] + [System.Text.Json.Serialization.JsonPropertyName("telephone")] + public string? PhoneNumber { get; set; } + + /// + /// 获取或设置开户银行。 + /// + [Newtonsoft.Json.JsonProperty("bank_name")] + [System.Text.Json.Serialization.JsonPropertyName("bank_name")] + public string? BankName { get; set; } + + /// + /// 获取或设置银行账号。 + /// + [Newtonsoft.Json.JsonProperty("bank_account")] + [System.Text.Json.Serialization.JsonPropertyName("bank_account")] + public string? BankAccountNumber { get; set; } + } + + public class Extra + { + /// + /// 获取或设置收款人。 + /// + [Newtonsoft.Json.JsonProperty("payee")] + [System.Text.Json.Serialization.JsonPropertyName("payee")] + public string? Payee { get; set; } + + /// + /// 获取或设置复核人。 + /// + [Newtonsoft.Json.JsonProperty("reviewer")] + [System.Text.Json.Serialization.JsonPropertyName("reviewer")] + public string? Reviewer { get; set; } + + /// + /// 获取或设置开票人。 + /// + [Newtonsoft.Json.JsonProperty("drawer")] + [System.Text.Json.Serialization.JsonPropertyName("drawer")] + public string Drawer { get; set; } = string.Empty; + } + + public class LineItem + { + /// + /// 获取或设置货物或应税劳务或服务编码。 + /// + [Newtonsoft.Json.JsonProperty("tax_code")] + [System.Text.Json.Serialization.JsonPropertyName("tax_code")] + public string TaxCode { get; set; } = string.Empty; + + /// + /// 获取或设置货物或应税劳务或服务名称。 + /// + [Newtonsoft.Json.JsonProperty("goods_name")] + [System.Text.Json.Serialization.JsonPropertyName("goods_name")] + public string GoodsName { get; set; } = string.Empty; + + /// + /// 获取或设置规格型号。 + /// + [Newtonsoft.Json.JsonProperty("specification")] + [System.Text.Json.Serialization.JsonPropertyName("specification")] + public string? Specification { get; set; } + + /// + /// 获取或设置单位。 + /// + [Newtonsoft.Json.JsonProperty("unit")] + [System.Text.Json.Serialization.JsonPropertyName("unit")] + public string? Unit { get; set; } + + /// + /// 获取或设置数量。 + /// + [Newtonsoft.Json.JsonProperty("quantity")] + [System.Text.Json.Serialization.JsonPropertyName("quantity")] + public int Quantity { get; set; } + + /// + /// 获取或设置单价(单位:10^-6分)。 + /// + [Newtonsoft.Json.JsonProperty("unit_price")] + [System.Text.Json.Serialization.JsonPropertyName("unit_price")] + public long UnitPrice { get; set; } + + /// + /// 获取或设置单行金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + + /// + /// 获取或设置单行税额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("tax_amount")] + [System.Text.Json.Serialization.JsonPropertyName("tax_amount")] + public int TaxAmount { get; set; } + + /// + /// 获取或设置单行合计(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("total_amount")] + [System.Text.Json.Serialization.JsonPropertyName("total_amount")] + public int TotalAmount { get; set; } + + /// + /// 获取或设置税率(单位:万分数)。 + /// + [Newtonsoft.Json.JsonProperty("tax_rate")] + [System.Text.Json.Serialization.JsonPropertyName("tax_rate")] + public int TaxRate { get; set; } + + /// + /// 获取或设置税收优惠政策标识。 + /// 默认值:NO_FAVORABLE + /// + [Newtonsoft.Json.JsonProperty("tax_prefer_mark")] + [System.Text.Json.Serialization.JsonPropertyName("tax_prefer_mark")] + public string TaxPreferMark { get; set; } = "NO_FAVORABLE"; + + /// + /// 获取或设置是否是折扣行。 + /// + [Newtonsoft.Json.JsonProperty("discount")] + [System.Text.Json.Serialization.JsonPropertyName("discount")] + public bool IsDiscount { get; set; } + } + } + + /// + /// 获取或设置发票文件 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("fapiao_media_id")] + [System.Text.Json.Serialization.JsonPropertyName("fapiao_media_id")] + public string InvoiceMediaId { get; set; } = string.Empty; + + /// + /// 获取或设置发票号码。 + /// + [Newtonsoft.Json.JsonProperty("fapiao_number")] + [System.Text.Json.Serialization.JsonPropertyName("fapiao_number")] + public string InvoiceNumber { get; set; } = string.Empty; + + /// + /// 获取或设置发票代码。 + /// + [Newtonsoft.Json.JsonProperty("fapiao_code")] + [System.Text.Json.Serialization.JsonPropertyName("fapiao_code")] + public string InvoiceCode { get; set; } = string.Empty; + + /// + /// 获取或设置开票时间。 + /// + [Newtonsoft.Json.JsonProperty("fapiao_time")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))] + [System.Text.Json.Serialization.JsonPropertyName("fapiao_time")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))] + public DateTimeOffset InvoiceTime { get; set; } + + /// + /// 获取或设置校验码。 + /// + [Newtonsoft.Json.JsonProperty("check_code")] + [System.Text.Json.Serialization.JsonPropertyName("check_code")] + public string CheckCode { get; set; } = string.Empty; + + /// + /// 获取或设置密码。 + /// + [Newtonsoft.Json.JsonProperty("password")] + [System.Text.Json.Serialization.JsonPropertyName("password")] + public string Password { get; set; } = string.Empty; + + /// + /// 获取或设置总价税合计(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("total_amount")] + [System.Text.Json.Serialization.JsonPropertyName("total_amount")] + public int TotalAmount { get; set; } + + /// + /// 获取或设置总税额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("tax_amount")] + [System.Text.Json.Serialization.JsonPropertyName("tax_amount")] + public int TaxAmount { get; set; } + + /// + /// 获取或设置总金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("amount")] + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public int Amount { get; set; } + + /// + /// 获取或设置购买方信息。 + /// + [Newtonsoft.Json.JsonProperty("buyer_information")] + [System.Text.Json.Serialization.JsonPropertyName("buyer_information")] + public Types.Buyer Buyer { get; set; } = new Types.Buyer(); + + /// + /// 获取或设置销售方信息。 + /// + [Newtonsoft.Json.JsonProperty("seller_information")] + [System.Text.Json.Serialization.JsonPropertyName("seller_information")] + public Types.Seller Seller { get; set; } = new Types.Seller(); + + /// + /// 获取或设置额外信息。 + /// + [Newtonsoft.Json.JsonProperty("extra_information")] + [System.Text.Json.Serialization.JsonPropertyName("extra_information")] + public Types.Extra Extra { get; set; } = new Types.Extra(); + + /// + /// 获取或设置发票行列表。 + /// + [Newtonsoft.Json.JsonProperty("items")] + [System.Text.Json.Serialization.JsonPropertyName("items")] + public IList? LineItemList { get; set; } + + /// + /// 获取或设置备注信息。 + /// + [Newtonsoft.Json.JsonProperty("remark")] + [System.Text.Json.Serialization.JsonPropertyName("remark")] + public string? Remark { get; set; } + } + } + + /// + /// 获取或设置获取乘客行程单详情的凭证。 + /// + [Newtonsoft.Json.JsonProperty("token")] + [System.Text.Json.Serialization.JsonPropertyName("token")] + public string Token { get; set; } = string.Empty; + + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("company_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("company_mchid")] + public string CompanyMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置微信 AppId。 + /// + [Newtonsoft.Json.JsonProperty("appid")] + [System.Text.Json.Serialization.JsonPropertyName("appid")] + public string AppId { get; set; } = string.Empty; + + /// + /// 获取或设置用户的 OpenId。 + /// + [Newtonsoft.Json.JsonProperty("openid")] + [System.Text.Json.Serialization.JsonPropertyName("openid")] + public string OpenId { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置发票卡券信息。 + /// + [Newtonsoft.Json.JsonProperty("fapiao_card_information")] + [System.Text.Json.Serialization.JsonPropertyName("fapiao_card_information")] + public Types.InvoiceCard InvoiceCard { get; set; } = new Types.InvoiceCard(); + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardResponse.cs new file mode 100644 index 00000000..812b0a55 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/CreateTaxiInvoiceCardResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/cards 接口的响应。 + /// + public class CreateTaxiInvoiceCardResponse : WechatTenpayResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.cs new file mode 100644 index 00000000..08883b51 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.cs @@ -0,0 +1,45 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/cards/upload-file 接口的请求。 + /// + public class UploadTaxiInvoiceCardFileRequest : WechatTenpayRequest + { + /// + /// 获取或设置文件字节数组。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public byte[] FileBytes { get; set; } = Array.Empty(); + + /// + /// 获取或设置文件内容哈希算法。 + /// + [Newtonsoft.Json.JsonProperty("digest_algorithm")] + [System.Text.Json.Serialization.JsonPropertyName("digest_algorithm")] + public string FileHashAlgorithm { get; set; } = string.Empty; + + /// + /// 获取或设置文件内容哈希值。 + /// + [Newtonsoft.Json.JsonProperty("digest")] + [System.Text.Json.Serialization.JsonPropertyName("digest")] + public string FileHashValue { get; set; } = string.Empty; + + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("company_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("company_mchid")] + public string CompanyMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.cs new file mode 100644 index 00000000..15374bd5 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.cs @@ -0,0 +1,15 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/cards/upload-file 接口的响应。 + /// + public class UploadTaxiInvoiceCardFileResponse : WechatTenpayResponse + { + /// + /// 获取或设置发票文件 MediaId。 + /// + [Newtonsoft.Json.JsonProperty("fapiao_media_id")] + [System.Text.Json.Serialization.JsonPropertyName("fapiao_media_id")] + public string InvoiceMediaId { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverRequest.cs new file mode 100644 index 00000000..ba74a21f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/drivers/{driver_license} 接口的请求。 + /// + public class GetTaxiInvoiceDriverRequest : WechatTenpayRequest + { + /// + /// 获取或设置司机资格证号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string DriverLicenseNumber { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int RegionId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.cs new file mode 100644 index 00000000..a84ba24b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.cs @@ -0,0 +1,118 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/drivers/{driver_license} 接口的响应。 + /// + public class GetTaxiInvoiceDriverResponse : WechatTenpayResponse + { + public static class Types + { + public class Photo + { + public static class Types + { + public class Digest + { + /// + /// 获取或设置哈希类型。 + /// + [Newtonsoft.Json.JsonProperty("hash_type")] + [System.Text.Json.Serialization.JsonPropertyName("hash_type")] + public string HashType { get; set; } = default!; + + /// + /// 获取或设置哈希值。 + /// + [Newtonsoft.Json.JsonProperty("hash_value")] + [System.Text.Json.Serialization.JsonPropertyName("hash_value")] + public string HashValue { get; set; } = default!; + } + } + + /// + /// 获取或设置照片类型。 + /// + [Newtonsoft.Json.JsonProperty("photo_type")] + [System.Text.Json.Serialization.JsonPropertyName("photo_type")] + public string Type { get; set; } = default!; + + /// + /// 获取或设置照片信息摘要信息。 + /// + [Newtonsoft.Json.JsonProperty("photo_digest")] + [System.Text.Json.Serialization.JsonPropertyName("photo_digest")] + public Types.Digest? Digest { get; set; } + + /// + /// 获取或设置照片 URL。 + /// + [Newtonsoft.Json.JsonProperty("photo_url")] + [System.Text.Json.Serialization.JsonPropertyName("photo_url")] + public string? PhotoUrl { get; set; } + + /// + /// 获取或设置经 Base64 编码的照片数据。 + /// + [Newtonsoft.Json.JsonProperty("photo_data")] + [System.Text.Json.Serialization.JsonPropertyName("photo_data")] + public string? EncodingPhotoData { get; set; } + } + } + + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("company_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("company_mchid")] + public string CompanyMerchantId { get; set; } = default!; + + /// + /// 获取或设置公司名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string CompanyName { get; set; } = default!; + + /// + /// 获取或设置司机姓名。 + /// + [Newtonsoft.Json.JsonProperty("driver_name")] + [System.Text.Json.Serialization.JsonPropertyName("driver_name")] + public string DriverName { get; set; } = default!; + + /// + /// 获取或设置司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("driver_license")] + [System.Text.Json.Serialization.JsonPropertyName("driver_license")] + public string DriverLicenseNumber { get; set; } = default!; + + /// + /// 获取或设置司机类别。 + /// + [Newtonsoft.Json.JsonProperty("driver_category")] + [System.Text.Json.Serialization.JsonPropertyName("driver_category")] + public string DriverCategory { get; set; } = default!; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置岗位状态。 + /// + [Newtonsoft.Json.JsonProperty("driver_state")] + [System.Text.Json.Serialization.JsonPropertyName("driver_state")] + public string? DriverState { get; set; } + + /// + /// 获取或设置司机头像信息。 + /// + [Newtonsoft.Json.JsonProperty("driver_photo")] + [System.Text.Json.Serialization.JsonPropertyName("driver_photo")] + public Types.Photo? DriverPhoto { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.cs new file mode 100644 index 00000000..c6f245a4 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.cs @@ -0,0 +1,130 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/driver/update-driver 接口的请求。 + /// + [WechatTenpaySensitive] + public class UpdateTaxiInvoiceDriverRequest : WechatTenpayRequest + { + public static class Types + { + public class Photo + { + public static class Types + { + public class Digest + { + /// + /// 获取或设置哈希类型。 + /// + [Newtonsoft.Json.JsonProperty("hash_type")] + [System.Text.Json.Serialization.JsonPropertyName("hash_type")] + public string HashType { get; set; } = string.Empty; + + /// + /// 获取或设置哈希值。 + /// + [Newtonsoft.Json.JsonProperty("hash_value")] + [System.Text.Json.Serialization.JsonPropertyName("hash_value")] + public string HashValue { get; set; } = string.Empty; + } + } + + /// + /// 获取或设置照片类型。 + /// + [Newtonsoft.Json.JsonProperty("photo_type")] + [System.Text.Json.Serialization.JsonPropertyName("photo_type")] + public string Type { get; set; } = string.Empty; + + /// + /// 获取或设置照片信息摘要信息。 + /// + [Newtonsoft.Json.JsonProperty("photo_digest")] + [System.Text.Json.Serialization.JsonPropertyName("photo_digest")] + public Types.Digest? Digest { get; set; } + + /// + /// 获取或设置照片 URL。 + /// + [Newtonsoft.Json.JsonProperty("photo_url")] + [System.Text.Json.Serialization.JsonPropertyName("photo_url")] + public string? PhotoUrl { get; set; } + + /// + /// 获取或设置经 Base64 编码的照片数据。 + /// + [Newtonsoft.Json.JsonProperty("photo_icon")] + [System.Text.Json.Serialization.JsonPropertyName("photo_icon")] + public string? EncodingPhotoData { get; set; } + } + } + + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("mchid")] + [System.Text.Json.Serialization.JsonPropertyName("mchid")] + public string CompanyMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置公司名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string CompanyName { get; set; } = string.Empty; + + /// + /// 获取或设置司机姓名(需使用平台公钥/证书加密)。 + /// + [Newtonsoft.Json.JsonProperty("driver_name")] + [System.Text.Json.Serialization.JsonPropertyName("driver_name")] + [WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)] + [WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)] + public string DriverName { get; set; } = string.Empty; + + /// + /// 获取或设置司机身份证号(需使用平台公钥/证书加密)。 + /// + [Newtonsoft.Json.JsonProperty("id_card_number")] + [System.Text.Json.Serialization.JsonPropertyName("id_card_number")] + [WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_RSA_2048_WITH_SHA256, algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS8_OAEP_WITH_SHA1_AND_MGF1)] + [WechatTenpaySensitiveProperty(scheme: Constants.SignSchemes.WECHATPAY2_SM2_WITH_SM3, algorithm: Constants.EncryptionAlgorithms.SM2_C1C3C2_ASN1)] + public string DriverIdCardNumber { get; set; } = string.Empty; + + /// + /// 获取或设置司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("driver_license")] + [System.Text.Json.Serialization.JsonPropertyName("driver_license")] + public string DriverLicenseNumber { get; set; } = string.Empty; + + /// + /// 获取或设置司机类别。 + /// + [Newtonsoft.Json.JsonProperty("driver_category")] + [System.Text.Json.Serialization.JsonPropertyName("driver_category")] + public string DriverCategory { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置岗位状态。 + /// + [Newtonsoft.Json.JsonProperty("driver_status")] + [System.Text.Json.Serialization.JsonPropertyName("driver_status")] + public string? DriverState { get; set; } + + /// + /// 获取或设置司机头像信息。 + /// + [Newtonsoft.Json.JsonProperty("driver_photo")] + [System.Text.Json.Serialization.JsonPropertyName("driver_photo")] + public Types.Photo? DriverPhoto { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverResponse.cs new file mode 100644 index 00000000..fcd7a2d5 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/driver/update-driver 接口的响应。 + /// + public class UpdateTaxiInvoiceDriverResponse : WechatTenpayResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiRequest.cs new file mode 100644 index 00000000..d3ae50dc --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/taxies/{plate_number} 接口的请求。 + /// + public class GetTaxiInvoiceTaxiRequest : WechatTenpayRequest + { + /// + /// 获取或设置车牌号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string PlateNumber { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int RegionId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.cs new file mode 100644 index 00000000..a5449878 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.cs @@ -0,0 +1,64 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/taxies/{plate_number} 接口的响应。 + /// + public class GetTaxiInvoiceTaxiResponse : WechatTenpayResponse + { + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("company_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("company_mchid")] + public string CompanyMerchantId { get; set; } = default!; + + /// + /// 获取或设置公司名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string CompanyName { get; set; } = default!; + + /// + /// 获取或设置车牌号。 + /// + [Newtonsoft.Json.JsonProperty("plate_number")] + [System.Text.Json.Serialization.JsonPropertyName("plate_number")] + public string PlateNumber { get; set; } = default!; + + /// + /// 获取或设置主班司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("main_license")] + [System.Text.Json.Serialization.JsonPropertyName("main_license")] + public string? MainLicenseNumber { get; set; } + + /// + /// 获取或设置副班司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("deputy_license")] + [System.Text.Json.Serialization.JsonPropertyName("deputy_license")] + public string? DeputyLicenseNumber { get; set; } + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置出租车状态。 + /// + [Newtonsoft.Json.JsonProperty("taxi_state")] + [System.Text.Json.Serialization.JsonPropertyName("taxi_state")] + public string? TaxiState { get; set; } + + /// + /// 获取或设置是否支持开票。 + /// + [Newtonsoft.Json.JsonProperty("support_invoice")] + [System.Text.Json.Serialization.JsonPropertyName("support_invoice")] + public bool IsSupportInvoice { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.cs new file mode 100644 index 00000000..181ea2e6 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.cs @@ -0,0 +1,64 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/taxi/update-taxi 接口的请求。 + /// + public class UpdateTaxiInvoiceTaxiRequest : WechatTenpayRequest + { + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("mchid")] + [System.Text.Json.Serialization.JsonPropertyName("mchid")] + public string CompanyMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置公司名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string CompanyName { get; set; } = string.Empty; + + /// + /// 获取或设置车牌号。 + /// + [Newtonsoft.Json.JsonProperty("plate_number")] + [System.Text.Json.Serialization.JsonPropertyName("plate_number")] + public string PlateNumber { get; set; } = string.Empty; + + /// + /// 获取或设置主班司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("main_license")] + [System.Text.Json.Serialization.JsonPropertyName("main_license")] + public string? MainLicenseNumber { get; set; } + + /// + /// 获取或设置副班司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("deputy_license")] + [System.Text.Json.Serialization.JsonPropertyName("deputy_license")] + public string? DeputyLicenseNumber { get; set; } + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置出租车状态。 + /// + [Newtonsoft.Json.JsonProperty("taxi_state")] + [System.Text.Json.Serialization.JsonPropertyName("taxi_state")] + public string? TaxiState { get; set; } + + /// + /// 获取或设置开票标记。 + /// + [Newtonsoft.Json.JsonProperty("invoice_flag")] + [System.Text.Json.Serialization.JsonPropertyName("invoice_flag")] + public string InvoiceFlag { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiResponse.cs new file mode 100644 index 00000000..979cf30d --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiResponse.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/taxi/update-taxi 接口的响应。 + /// + public class UpdateTaxiInvoiceTaxiResponse : WechatTenpayResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.cs new file mode 100644 index 00000000..658fa517 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.cs @@ -0,0 +1,85 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/taxi-company/create-taxi-company 接口的请求。 + /// + public class CreateTaxiInvoiceTaxiCompanyRequest : WechatTenpayRequest + { + /// + /// 获取或设置企业类型。 + /// + [Newtonsoft.Json.JsonProperty("enterprise_type")] + [System.Text.Json.Serialization.JsonPropertyName("enterprise_type")] + public string EnterpriseType { get; set; } = string.Empty; + + /// + /// 获取或设置公司名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string? CompanyName { get; set; } + + /// + /// 获取或设置公司简称。 + /// + [Newtonsoft.Json.JsonProperty("short_name")] + [System.Text.Json.Serialization.JsonPropertyName("short_name")] + public string? ShortName { get; set; } + + /// + /// 获取或设置税号。 + /// + [Newtonsoft.Json.JsonProperty("tax_id")] + [System.Text.Json.Serialization.JsonPropertyName("tax_id")] + public string TaxId { get; set; } = string.Empty; + + /// + /// 获取或设置企业法人姓名。 + /// + [Newtonsoft.Json.JsonProperty("legal_person")] + [System.Text.Json.Serialization.JsonPropertyName("legal_person")] + public string LegalPerson { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置公司地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string Address { get; set; } = string.Empty; + + /// + /// 获取或设置公司电话。 + /// + [Newtonsoft.Json.JsonProperty("phone")] + [System.Text.Json.Serialization.JsonPropertyName("phone")] + public string? PhoneNumber { get; set; } + + /// + /// 获取或设置开户银行。 + /// + [Newtonsoft.Json.JsonProperty("bank_name")] + [System.Text.Json.Serialization.JsonPropertyName("bank_name")] + public string? BankName { get; set; } + + /// + /// 获取或设置银行账号。 + /// + [Newtonsoft.Json.JsonProperty("bank_account")] + [System.Text.Json.Serialization.JsonPropertyName("bank_account")] + public string? BankAccountNumber { get; set; } + + /// + /// 获取或设置开票渠道。 + /// + [Newtonsoft.Json.JsonProperty("invoice_mode")] + [System.Text.Json.Serialization.JsonPropertyName("invoice_mode")] + public string InvoiceMode { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.cs new file mode 100644 index 00000000..7066d9a8 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [POST] /taxi-invoice/taxi-company/create-taxi-company 接口的响应。 + /// + public class CreateTaxiInvoiceTaxiCompanyResponse : WechatTenpayResponse + { + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("mchid")] + [System.Text.Json.Serialization.JsonPropertyName("mchid")] + public string CompanyMerchantId { get; set; } = default!; + + /// + /// 获取或设置公司名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string CompanyName { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyRequest.cs new file mode 100644 index 00000000..5ac2eaf5 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyRequest.cs @@ -0,0 +1,22 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/taxi-companies/{company_mchid} 接口的请求。 + /// + public class GetTaxiInvoiceTaxiCompanyRequest : WechatTenpayRequest + { + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string CompanyMerchantId { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int RegionId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.cs new file mode 100644 index 00000000..4f093bb6 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.cs @@ -0,0 +1,92 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/taxi-companies/{company_mchid} 接口的响应。 + /// + public class GetTaxiInvoiceTaxiCompanyResponse : WechatTenpayResponse + { + /// + /// 获取或设置公司商户号。 + /// + [Newtonsoft.Json.JsonProperty("company_mchid")] + [System.Text.Json.Serialization.JsonPropertyName("company_mchid")] + public string CompanyMerchantId { get; set; } = default!; + + /// + /// 获取或设置企业类型。 + /// + [Newtonsoft.Json.JsonProperty("enterprise_type")] + [System.Text.Json.Serialization.JsonPropertyName("enterprise_type")] + public string EnterpriseType { get; set; } = default!; + + /// + /// 获取或设置公司名称。 + /// + [Newtonsoft.Json.JsonProperty("company_name")] + [System.Text.Json.Serialization.JsonPropertyName("company_name")] + public string CompanyName { get; set; } = default!; + + /// + /// 获取或设置公司简称。 + /// + [Newtonsoft.Json.JsonProperty("short_name")] + [System.Text.Json.Serialization.JsonPropertyName("short_name")] + public string ShortName { get; set; } = default!; + + /// + /// 获取或设置税号。 + /// + [Newtonsoft.Json.JsonProperty("tax_id")] + [System.Text.Json.Serialization.JsonPropertyName("tax_id")] + public string TaxId { get; set; } = default!; + + /// + /// 获取或设置企业法人姓名。 + /// + [Newtonsoft.Json.JsonProperty("legal_person")] + [System.Text.Json.Serialization.JsonPropertyName("legal_person")] + public string LegalPerson { get; set; } = default!; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置公司地址。 + /// + [Newtonsoft.Json.JsonProperty("address")] + [System.Text.Json.Serialization.JsonPropertyName("address")] + public string Address { get; set; } = default!; + + /// + /// 获取或设置公司电话。 + /// + [Newtonsoft.Json.JsonProperty("phone")] + [System.Text.Json.Serialization.JsonPropertyName("phone")] + public string? PhoneNumber { get; set; } + + /// + /// 获取或设置开户银行。 + /// + [Newtonsoft.Json.JsonProperty("bank_name")] + [System.Text.Json.Serialization.JsonPropertyName("bank_name")] + public string? BankName { get; set; } + + /// + /// 获取或设置银行账号。 + /// + [Newtonsoft.Json.JsonProperty("bank_account")] + [System.Text.Json.Serialization.JsonPropertyName("bank_account")] + public string? BankAccountNumber { get; set; } + + /// + /// 获取或设置开票渠道。 + /// + [Newtonsoft.Json.JsonProperty("invoice_mode")] + [System.Text.Json.Serialization.JsonPropertyName("invoice_mode")] + public string InvoiceMode { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenRequest.cs new file mode 100644 index 00000000..53c0e8cf --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenRequest.cs @@ -0,0 +1,43 @@ +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/user-taxi-order/find-by-token 接口的请求。 + /// + public class GetTaxiInvoiceUserTaxiOrderByTokenRequest : WechatTenpayRequest + { + /// + /// 获取或设置获取乘客行程单详情的凭证。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string Token { get; set; } = string.Empty; + + /// + /// 获取或设置微信 AppId。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string AppId { get; set; } = string.Empty; + + /// + /// 获取或设置用户的 OpenId。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string OpenId { get; set; } = string.Empty; + + /// + /// 获取或设置授权模式。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string AuthMode { get; set; } = string.Empty; + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public int? RegionId { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.cs new file mode 100644 index 00000000..3b8cd566 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.cs @@ -0,0 +1,63 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models +{ + /// + /// 表示 [GET] /taxi-invoice/user-taxi-order/find-by-token 接口的响应。 + /// + public class GetTaxiInvoiceUserTaxiOrderByTokenResponse : WechatTenpayResponse + { + /// + /// 获取或设置车牌号。 + /// + [Newtonsoft.Json.JsonProperty("plate_number")] + [System.Text.Json.Serialization.JsonPropertyName("plate_number")] + public string PlateNumber { get; set; } = default!; + + /// + /// 获取或设置司机资格证号。 + /// + [Newtonsoft.Json.JsonProperty("driver_license")] + [System.Text.Json.Serialization.JsonPropertyName("driver_license")] + public string DriverLicenseNumber { get; set; } = default!; + + /// + /// 获取或设置上车时间。 + /// + [Newtonsoft.Json.JsonProperty("up_time")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))] + [System.Text.Json.Serialization.JsonPropertyName("up_time")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))] + public DateTimeOffset UpTime { get; set; } + + /// + /// 获取或设置行政区划代码。 + /// + [Newtonsoft.Json.JsonProperty("region_id")] + [System.Text.Json.Serialization.JsonPropertyName("region_id")] + public int RegionId { get; set; } + + /// + /// 获取或设置乘客行程单来源。 + /// + [Newtonsoft.Json.JsonProperty("source")] + [System.Text.Json.Serialization.JsonPropertyName("source")] + public string Source { get; set; } = default!; + + /// + /// 获取或设置付款时间。 + /// + [Newtonsoft.Json.JsonProperty("pay_time")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))] + [System.Text.Json.Serialization.JsonPropertyName("pay_time")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))] + public DateTimeOffset? PayTime { get; set; } + + /// + /// 获取或设置付款金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("pay_amount")] + [System.Text.Json.Serialization.JsonPropertyName("pay_amount")] + public int? PayAmount { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj index 2f2d50ce..24a528dd 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj @@ -15,7 +15,7 @@ https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat Flurl.Http Wechat Weixin MicroMessage Tenpay WechatPay WeixinPay Wxpay 微信 微信支付 微信商户 2.16.0 - 基于 Flurl.Http 的微信支付 API v3 版客户端,支持直连商户、服务商模式,支持基础支付、代金券、商家券、委托营销、消费卡、支付有礼、银行定向促活、微信支付分、微信先享卡、支付即服务、点金计划、智慧商圈、电商收付通、二级商户进件、小微商户进件、消费者投诉、商户违规通知、批量转账到零钱、银行组件、海关报关、融合钱包、微工卡等功能。 + 基于 Flurl.Http 的微信支付 API v3 版客户端,支持直连商户、服务商模式,支持基础支付、代金券、商家券、委托营销、消费卡、支付有礼、银行定向促活、微信支付分、微信先享卡、支付即服务、点金计划、智慧商圈、电商收付通、二级商户进件、小微商户进件、消费者投诉、商户违规通知、批量转账到零钱、银行组件、海关报关、融合钱包、微工卡、电子发票等功能。 Fu Diwei git https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.json new file mode 100644 index 00000000..03f87775 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Attendance/PunchTaxiInvoiceAttendanceRequest.json @@ -0,0 +1,7 @@ +{ + "plate_number": "粤B12345", + "driver_license": "6298416", + "event_time": "2019-12-01T12:00:00.000+08:00", + "event_type": "SIGN_IN", + "region_id": 510100 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.json new file mode 100644 index 00000000..2be803e1 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/CreateTaxiInvoiceCardRequest.json @@ -0,0 +1,57 @@ +{ + "company_mchid": "1900000109", + "token": "ESvqG19gjw0qiiy1eeRA4VusLrOmIYQOMJ8rXX2V-ztUUuQvu_YBEZg9FAht0Y15r71mft9rcaMIjn7y6x0KSg", + "appid": "wxb1170446a4c0a5a2", + "openid": "oUypO5aQ1oOCaSiNZUpT5kxxJHuc", + "region_id": 310100, + "fapiao_card_information": { + "fapiao_media_id": "ASNFZ4mrze/+3LqYdlQyEA==", + "fapiao_number": "12897794", + "fapiao_code": "044001911211", + "fapiao_time": "2020-07-01T12:00:00+08:00", + "check_code": "69001808340631374774", + "password": "006>299-375/326>2+7/*0-+<351059<80<4*/5>+<11631+*3030/5*37+/-243159658+013>3409*044>4-/1+/9->*>69501*6++1997--21", + "total_amount": 382895, + "tax_amount": 44050, + "amount": 338845, + "buyer_information": { + "type": "CORPORATION", + "name": "深圳市南山区测试企业", + "taxpayer_id": "202003261233701778", + "address": "深圳市南山区深南大道10000号", + "telephone": "075512345678", + "bank_name": "测试银行", + "bank_account": "62001234567890" + }, + "seller_information": { + "name": "深圳市南山区测试公司", + "taxpayer_id": "202003261233701778", + "address": "深圳市南山区深南大道10000号", + "telephone": "075512345678", + "bank_name": "测试银行", + "bank_account": "62001234567890" + }, + "extra_information": { + "payee": "张三", + "reviewer": "李四", + "drawer": "王五" + }, + "items": [ + { + "tax_code": "3010101020203000000", + "goods_name": "出租汽车客运服务", + "specification": "A4", + "unit": "次", + "quantity": 100000000, + "unit_price": 380442000000, + "amount": 380442, + "tax_amount": 49458, + "total_amount": 429900, + "tax_rate": 1300, + "tax_prefer_mark": "NO_FAVORABLE", + "discount": false + } + ], + "remark": "备注" + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.json new file mode 100644 index 00000000..ec1fdee0 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileRequest.json @@ -0,0 +1,6 @@ +{ + "company_mchid": "1900000109", + "digest": "addca90a6a290b9642dbaccffdf01e8c22aa348940b2e96754169ba08c19e5db", + "digest_algorithm": "DIGEST_ALGORITHM_SM3", + "region_id": 310100 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.json new file mode 100644 index 00000000..3b315699 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Card/UploadTaxiInvoiceCardFileResponse.json @@ -0,0 +1,3 @@ +{ + "fapiao_media_id": "ASNFZ4mrze/+3LqYdlQyEA==" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.json new file mode 100644 index 00000000..bce52680 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/GetTaxiInvoiceDriverResponse.json @@ -0,0 +1,18 @@ +{ + "driver_name": "OpldWegML3fJ3/U5L6av0bU6GcIOaOhXf2UDYKD8aZByMIav4gGrxjcPPk/7rz7HJ1MOugpoI1KMG8nANKIGtyA75ZM7qM16j16CT0VUtmZMo2nV2/3x/058hpAOORYwkl2g/tOck3MgVwTj9ZTvq6s7wrWomyi+SY04APUv4dfFrUvfbktxSi9JI37tSIP5rXD0Lq35KCZLR0aIyVlBs/MqmAhdQ1klK+kKY2VvC2/DmIY0BmpV/o745eOjWwtlS0PzG7BQ3JYUqhtmz2SawsVeHk9sm1wwPUXFM1ssRN/t2DrNLxVUb77DCnz421UAD7US5TWiL5sVnQSz/wvsvQ==", + "company_name": "深圳市未来有限公司", + "company_mchid": "1900000109", + "driver_license": "6298416", + "driver_category": "MAIN", + "driver_photo": { + "photo_type": "PHOTO_URL", + "photo_digest": { + "hash_type": "MD5", + "hash_value": "e10adc3949ba59abbe56e057f20f883e" + }, + "photo_url": "http://www.abc.com/driver.icon", + "photo_data": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/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vE6B73Tk8y21FFISSPoY35I3r1HqD0GOfmL9ovUND1y28L63ZSSDW0i+xXquhX7RFjdHICQAcZK59wP4a9h+DfiDwv8LfgbbzwmKTVb5WmlY/MysBud39FQHHv8o719vTrKLdVyvFK/qfCSpSbVLl969jt/EGonWfEmpXZYuJJmCnttHA/lXIeIFLsIQQHJ3hj2I5H61mWfxW8LzPFF/aLxrj70ltIq/iSuBWlePb601teWVxFdQSA5khcMpGPUV8JXlKpOVSXV3Pv6ChCEYReysQ6xKs1jp97tAIZmwD0PluP51Yjj86SaPG9hhQO/QVV8Q4i0i1VVwFm2Y9OCKu2523lyD/G6R8duCT+lc5t1E/sh/7q/wDfdFWv7SH95fyoosO7Kvg6Nbrw/cRyDKlcfqR/SrPhOVn0hsnO12UfhRRT6C6nIfFvxTqPh5NKsdPm+zC+kaOSdRmVQP7pPQ++Ky9C8FaVp8El2sLT3b/M887b3YnrknrmiiumOkNDklrUdznfitoFkPC94vlnbbESwgn7hBXge3JFHw80S0l8J2jSIZN8PnMrHIZiWPI74xwKKK35n9X3+1+hzKK+t7fZ/U9Bg8P2L2ixmBdpTaRjtivPdOt28P3THTp5rXkjCNwRnoRjB/GiisYHRPc7WHV7jWvC32m42+ctyqZQYBx3I9a6GZisqMOCZXP4+STRRXMzqiZPmv8A3jRRRUFH/9k=" + }, + "region_id": 510100, + "driver_state": "ACTIVE" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.json new file mode 100644 index 00000000..f319d7ec --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Driver/UpdateTaxiInvoiceDriverRequest.json @@ -0,0 +1,19 @@ +{ + "driver_name": "OpldWegML3fJ3/U5L6av0bU6GcIOaOhXf2UDYKD8aZByMIav4gGrxjcPPk/7rz7HJ1MOugpoI1KMG8nANKIGtyA75ZM7qM16j16CT0VUtmZMo2nV2/3x/058hpAOORYwkl2g/tOck3MgVwTj9ZTvq6s7wrWomyi+SY04APUv4dfFrUvfbktxSi9JI37tSIP5rXD0Lq35KCZLR0aIyVlBs/MqmAhdQ1klK+kKY2VvC2/DmIY0BmpV/o745eOjWwtlS0PzG7BQ3JYUqhtmz2SawsVeHk9sm1wwPUXFM1ssRN/t2DrNLxVUb77DCnz421UAD7US5TWiL5sVnQSz/wvsvQ==", + "id_card_number": "OpldWegML3fJ3/U5L6av0bU6GcIOaOhXf2UDYKD8aZByMIav4gGrxjcPPk/7rz7HJ1MOugpoI1KMG8nANKIGtyA75ZM7qM16j16CT0VUtmZMo2nV2/3x/058hpAOORYwkl2g/tOck3MgVwTj9ZTvq6s7wrWomyi+SY04APUv4dfFrUvfbktxSi9JI37tSIP5rXD0Lq35KCZLR0aIyVlBs/MqmAhdQ1klK+kKY2VvC2/DmIY0BmpV/o745eOjWwtlS0PzG7BQ3JYUqhtmz2SawsVeHk9sm1wwPUXFM1ssRN/t2DrNLxVUb77DCnz421UAD7US5TWiL5sVnQSz/wvsvQ==", + "company_name": "深圳市未来有限公司", + "mchid": "1900000109", + "driver_license": "6298416", + "driver_category": "MAIN", + "driver_status": "ON_DUTY", + "driver_photo": { + "photo_type": "PHOTO_URL", + "photo_digest": { + "hash_type": "MD5", + "hash_value": "e10adc3949ba59abbe56e057f20f883e" + }, + "photo_url": "http://www.abc.com/driver.icon", + "photo_icon": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU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p2peHvE6B73Tk8y21FFISSPoY35I3r1HqD0GOfmL9ovUND1y28L63ZSSDW0i+xXquhX7RFjdHICQAcZK59wP4a9h+DfiDwv8LfgbbzwmKTVb5WmlY/MysBud39FQHHv8o719vTrKLdVyvFK/qfCSpSbVLl969jt/EGonWfEmpXZYuJJmCnttHA/lXIeIFLsIQQHJ3hj2I5H61mWfxW8LzPFF/aLxrj70ltIq/iSuBWlePb601teWVxFdQSA5khcMpGPUV8JXlKpOVSXV3Pv6ChCEYReysQ6xKs1jp97tAIZmwD0PluP51Yjj86SaPG9hhQO/QVV8Q4i0i1VVwFm2Y9OCKu2523lyD/G6R8duCT+lc5t1E/sh/7q/wDfdFWv7SH95fyoosO7Kvg6Nbrw/cRyDKlcfqR/SrPhOVn0hsnO12UfhRRT6C6nIfFvxTqPh5NKsdPm+zC+kaOSdRmVQP7pPQ++Ky9C8FaVp8El2sLT3b/M887b3YnrknrmiiumOkNDklrUdznfitoFkPC94vlnbbESwgn7hBXge3JFHw80S0l8J2jSIZN8PnMrHIZiWPI74xwKKK35n9X3+1+hzKK+t7fZ/U9Bg8P2L2ixmBdpTaRjtivPdOt28P3THTp5rXkjCNwRnoRjB/GiisYHRPc7WHV7jWvC32m42+ctyqZQYBx3I9a6GZisqMOCZXP4+STRRXMzqiZPmv8A3jRRRUFH/9k=" + }, + "region_id": 510100 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.json new file mode 100644 index 00000000..02be773e --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/GetTaxiInvoiceTaxiResponse.json @@ -0,0 +1,10 @@ +{ + "plate_number": "粤B12345", + "company_name": "深圳市未来有限公司", + "company_mchid": "1900000109", + "main_license": "6298416", + "deputy_license": "6298416", + "region_id": 510100, + "support_invoice": true, + "taxi_state": "IN_OPERATION" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.json new file mode 100644 index 00000000..15459a10 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/Taxi/UpdateTaxiInvoiceTaxiRequest.json @@ -0,0 +1,10 @@ +{ + "plate_number": "粤B12345", + "company_name": "深圳市未来有限公司", + "mchid": "1900000109", + "main_license": "6298416", + "deputy_license": "6298416", + "region_id": 510100, + "invoice_flag": "INVOICE", + "taxi_state": "IN_OPERATION" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.json new file mode 100644 index 00000000..acc6f0b8 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyRequest.json @@ -0,0 +1,13 @@ +{ + "company_name": "深圳市未来有限公司", + "tax_id": "12345678901234567J", + "address": "广东省深圳市南山区高新科技园科技中一路腾讯大厦", + "phone": "0755-86013388", + "bank_name": "中国工商银行南山支行", + "bank_account": "12345678901234", + "invoice_mode": "JIAO_WEI", + "legal_person": "张三", + "short_name": "深圳未来", + "region_id": 510100, + "enterprise_type": "ENTERPRISE" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.json new file mode 100644 index 00000000..8e71d2e0 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/CreateTaxiInvoiceTaxiCompanyResponse.json @@ -0,0 +1,4 @@ +{ + "mchid": "1900000109", + "company_name": "深圳市未来有限公司" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.json new file mode 100644 index 00000000..e6d6626c --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/TaxiCompany/GetTaxiInvoiceTaxiCompanyResponse.json @@ -0,0 +1,14 @@ +{ + "company_mchid": "1900000109", + "enterprise_type": "CORPORATION", + "company_name": "深圳市未来有限公司", + "short_name": "深圳未来", + "tax_id": "12345678901234567J", + "address": "广东省深圳市南山区高新科技园科技中一路腾讯大厦", + "phone": "0755-86013388", + "bank_name": "中国工商银行南山支行", + "bank_account": "12345678901234", + "legal_person": "张三", + "invoice_mode": "JIAOWEI", + "region_id": 510100 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.json b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.json new file mode 100644 index 00000000..407080c9 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/ModelSamples/TaxiInvoice/UserTaxiOrder/GetTaxiInvoiceUserTaxiOrderByTokenResponse.json @@ -0,0 +1,9 @@ +{ + "plate_number": "川ADT9716", + "driver_license": "08512-2", + "up_time": "2020-04-07T19:47:32+08:00", + "region_id": 310100, + "source": "SOURCE_PAY", + "pay_time": "2020-04-07T19:47:32+08:00", + "pay_amount": 5450 +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs index 1cad0632..782fd7cf 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests/TestCase_RequestEncryptionTests.cs @@ -910,6 +910,44 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests AssertMockRequestModel(reqB2, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, cipher)); } + [Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /taxi-invoice/driver/update-driver)")] + public async Task TestEncryptRequestSensitiveProperty_UpdateTaxiInvoiceDriverRequest() + { + static Models.UpdateTaxiInvoiceDriverRequest GenerateMockRequestModel() + { + return new Models.UpdateTaxiInvoiceDriverRequest() + { + DriverName = MOCK_PLAIN_STR, + DriverIdCardNumber = MOCK_PLAIN_STR + }; + } + + static void AssertMockRequestModel(Models.UpdateTaxiInvoiceDriverRequest request, Func decryptor) + { + Assert.NotEqual(MOCK_PLAIN_STR, request.DriverName!); + Assert.NotEqual(MOCK_PLAIN_STR, request.DriverIdCardNumber!); + Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.DriverName!)); + Assert.Equal(MOCK_PLAIN_STR, decryptor.Invoke(request.DriverIdCardNumber!)); + Assert.Equal(MOCK_CERT_SN, request.WechatpayCertificateSerialNumber!, ignoreCase: true); + } + + var reqA1 = GenerateMockRequestModel(); + CreateMockClientUseRSA(autoEncrypt: false).EncryptRequestSensitiveProperty(reqA1); + AssertMockRequestModel(reqA1, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, cipher)); + + var reqA2 = GenerateMockRequestModel(); + CreateMockClientUseSM2(autoEncrypt: false).EncryptRequestSensitiveProperty(reqA2); + AssertMockRequestModel(reqA2, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, cipher)); + + var reqB1 = GenerateMockRequestModel(); + await CreateMockClientUseRSA(autoEncrypt: true).ExecuteUpdateTaxiInvoiceDriverAsync(reqB1); + AssertMockRequestModel(reqB1, (cipher) => Utilities.RSAUtility.DecryptWithECB(RSA_PEM_PRIVATE_KEY, cipher)); + + var reqB2 = GenerateMockRequestModel(); + await CreateMockClientUseSM2(autoEncrypt: true).ExecuteUpdateTaxiInvoiceDriverAsync(reqB2); + AssertMockRequestModel(reqB2, (cipher) => Utilities.SM2Utility.Decrypt(SM2_PEM_PRIVATE_KEY, cipher)); + } + [Fact(DisplayName = "测试用例:加密请求中的敏感数据([POST] /transfer/batches)")] public async Task TestEncryptRequestSensitiveProperty_CreateTransferBatchRequest() {