mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-03-10 00:13:36 +08:00
feat(tenpayv3): 新增境外支付报关相关接口
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
/// <summary>
|
||||
/// 为 <see cref="WechatTenpayClient"/> 提供境外支付报关相关的 API 扩展方法。
|
||||
/// </summary>
|
||||
public static class WechatTenpayClientExecuteCustomsExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /customs/orders 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_1.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateCustomsOrderResponse> ExecuteCreateCustomsOrderAsync(this WechatTenpayClient client, Models.CreateCustomsOrderRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "customs", "orders");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateCustomsOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /customs/orders 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_1.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.QueryCustomsOrdersResponse> ExecuteQueryCustomsOrdersAsync(this WechatTenpayClient client, Models.QueryCustomsOrdersRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, "customs", "orders")
|
||||
.SetQueryParam("mchid", request.MerchantId)
|
||||
.SetQueryParam("appid", request.AppId)
|
||||
.SetQueryParam("order_type", request.OrderType)
|
||||
.SetQueryParam("order_no", request.OrderNumber)
|
||||
.SetQueryParam("customs", request.Customs);
|
||||
|
||||
if (request.Offset != null)
|
||||
flurlReq.SetQueryParam("offset", request.Offset);
|
||||
|
||||
if (request.Limit != null)
|
||||
flurlReq.SetQueryParam("limit", request.Limit);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryCustomsOrdersResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /customs/redeclare 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_4.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.RedeclareCustomsOrderResponse> ExecuteRedeclareCustomsOrderAsync(this WechatTenpayClient client, Models.RedeclareCustomsOrderRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "customs", "redeclare");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.RedeclareCustomsOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [PATCH] /customs/orders 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_5.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ModifyCustomsOrderResponse> ExecuteModifyCustomsOrderAsync(this WechatTenpayClient client, Models.ModifyCustomsOrderRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, new HttpMethod("PATCH"), "customs", "orders");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ModifyCustomsOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /customs/verify-certificate 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_2.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.VerifyCustomsCertificateResponse> ExecuteVerifyCustomsCertificateAsync(this WechatTenpayClient client, Models.VerifyCustomsCertificateRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.MerchantId == null)
|
||||
request.MerchantId = client.Credentials.MerchantId;
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "customs", "verify-certificate");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.VerifyCustomsCertificateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /customs/orders 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateCustomsOrderRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string TransactionId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_no")]
|
||||
public string? SubOrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置海关代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("customs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("customs")]
|
||||
public string Customs { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户海关备案号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_customs_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_customs_no")]
|
||||
public string MerchantCustomsNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关税(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("duty")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("duty")]
|
||||
public int? Duty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fee_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fee_type")]
|
||||
public string? FeeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应付金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_fee")]
|
||||
public int? OrderFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置物流费(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transport_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transport_fee")]
|
||||
public int? TransportFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品价格(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_fee")]
|
||||
public int? ProductFee { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /customs/orders 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateCustomsOrderResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置状态码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string State { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string TransactionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_no")]
|
||||
public string? SubOrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_id")]
|
||||
public string? SubOrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置验核机构。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("verify_department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("verify_department")]
|
||||
public string? VerifyDepartment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置验核机构交易流水号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("verify_department_trade_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("verify_department_trade_id")]
|
||||
public string? VerifyDepartmentTradeId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [PATCH] /customs/orders 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ModifyCustomsOrderRequest : CreateCustomsOrderRequest
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [PATCH] /customs/orders 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ModifyCustomsOrderResponse : CreateCustomsOrderResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置最后更新时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("modify_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("modify_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ModifyTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /customs/orders 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class QueryCustomsOrdersRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OrderType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单编号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OrderNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置海关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string Customs { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页大小。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页开始位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public int? Offset { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /customs/orders 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class QueryCustomsOrdersResponse : WechatTenpayResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Record
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置状态码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string State { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_no")]
|
||||
public string? SubOrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_id")]
|
||||
public string? SubOrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置海关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("customs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("customs")]
|
||||
public string Customs { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户海关备案号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mch_customs_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mch_customs_no")]
|
||||
public string MerchantCustomsNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关税(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("duty")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("duty")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||
public int? Duty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fee_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fee_type")]
|
||||
public string? FeeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应付金额(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("order_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("order_fee")]
|
||||
public int? OrderFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置物流费(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transport_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transport_fee")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||
public int? TransportFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商品价格(单位:分)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("product_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("product_fee")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||
public int? ProductFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置最后更新时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("modify_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("modify_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ModifyTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申报结果说明。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("explanation")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("explanation")]
|
||||
public string? Explanation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string TransactionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置记录列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public Types.Record[] RecordList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置记录总数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total_count")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total_count")]
|
||||
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页大小。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int Limit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页开始位置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("offset")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("offset")]
|
||||
public int Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置验核机构。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("verify_department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("verify_department")]
|
||||
public string? VerifyDepartment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置验核机构交易流水号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("verify_department_trade_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("verify_department_trade_id")]
|
||||
public string? VerifyDepartmentTradeId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /customs/redeclare 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class RedeclareCustomsOrderRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string? OutTradeNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string? TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_no")]
|
||||
public string? SubOrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_id")]
|
||||
public string? SubOrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置海关代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("customs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("customs")]
|
||||
public string Customs { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户海关备案号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_customs_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_customs_no")]
|
||||
public string MerchantCustomsNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /customs/redeclare 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class RedeclareCustomsOrderResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置状态码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string State { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string TransactionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_no")]
|
||||
public string? SubOrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_id")]
|
||||
public string? SubOrderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置最后更新时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("modify_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("modify_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset ModifyTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申报结果说明。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("explanation")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("explanation")]
|
||||
public string? Explanation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /customs/verify-certificate 接口的请求。</para>
|
||||
/// </summary>
|
||||
[WechatTenpaySensitive]
|
||||
public class VerifyCustomsCertificateRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string? OutTradeNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string? TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户子订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_order_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_order_no")]
|
||||
public string? SubOrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置海关代码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("customs")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("customs")]
|
||||
public string Customs { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户海关备案号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("merchant_customs_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("merchant_customs_no")]
|
||||
public string MerchantCustomsNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置证件类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("certificate_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("certificate_type")]
|
||||
public string CertificateType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置证件号码(需使用平台公钥/证书加密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("certificate_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("certificate_id")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string CertificateId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置证件姓名(需使用平台公钥/证书加密)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("certificate_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("certificate_name")]
|
||||
[WechatTenpaySensitiveProperty(algorithm: Constants.EncryptionAlgorithms.RSA_2048_ECB_PKCS1)]
|
||||
public string CertificateName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /customs/verify-certificate 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class VerifyCustomsCertificateResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("appid")]
|
||||
public string AppId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string TransactionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置身份核验结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("certificate_check_result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("certificate_check_result")]
|
||||
public string CertificateCheckResult { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
/// <summary>
|
||||
/// 全球域名。
|
||||
/// </summary>
|
||||
public const string REGION_GLOBAL = "https://api.mch.weixin.qq.com/global/v3";
|
||||
public const string REGION_HONGKONG_GLOBAL = "https://apihk.mch.weixin.qq.com/global/v3";
|
||||
|
||||
/// <summary>
|
||||
/// 沙箱域名。
|
||||
|
||||
Reference in New Issue
Block a user