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:
@@ -102,7 +102,7 @@
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pay_net_fee")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay_net_fee")]
|
||||
public int PaymentNetFee { get; set; }
|
||||
public int NetFee { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手续费金额(单位:指定货币的最小单位)。
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 REFUND.SUCCESS (仅限服务商 For HK)通知的数据。</para>
|
||||
/// <para>表示 REFUND.ABNORMAL (仅限服务商 For HK)通知的数据。</para>
|
||||
/// <para>表示 REFUND.CLOSED (仅限服务商 For HK)通知的数据。</para>
|
||||
/// </summary>
|
||||
public class HKPartnerRefundResource : WechatTenpayEvent.Types.IDecryptedResource
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : Models.GetHKPartnerRefundByOutRefundNumberResponse.Types.Amount
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置服务商商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
|
||||
public string MerchantId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { 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("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付退款号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_id")]
|
||||
public string RefundId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_status")]
|
||||
public string RefundStatus { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款入账账户。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("recv_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("recv_account")]
|
||||
public string ReceiveAccount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fund_source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fund_source")]
|
||||
public string? FundSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款成功时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("success_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("success_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 REFUND.SUCCESS (仅限直连商户 For HK)通知的数据。</para>
|
||||
/// <para>表示 REFUND.ABNORMAL (仅限直连商户 For HK)通知的数据。</para>
|
||||
/// <para>表示 REFUND.CLOSED (仅限直连商户 For HK)通知的数据。</para>
|
||||
/// </summary>
|
||||
public class HKRefundResource : WechatTenpayEvent.Types.IDecryptedResource
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : Models.GetHKRefundByOutRefundNumberResponse.Types.Amount
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mchid")]
|
||||
public string MerchantId { 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("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付退款号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_id")]
|
||||
public string RefundId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_status")]
|
||||
public string RefundStatus { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款入账账户。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("recv_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("recv_account")]
|
||||
public string ReceiveAccount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fund_source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fund_source")]
|
||||
public string? FundSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款成功时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("success_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("success_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 REFUND.SUCCESS (仅服务商)通知的数据。</para>
|
||||
/// <para>表示 REFUND.ABNORMAL (仅服务商)通知的数据。</para>
|
||||
/// <para>表示 REFUND.CLOSED (仅服务商)通知的数据。</para>
|
||||
/// <para>表示 REFUND.SUCCESS (仅限服务商)通知的数据。</para>
|
||||
/// <para>表示 REFUND.ABNORMAL (仅限服务商)通知的数据。</para>
|
||||
/// <para>表示 REFUND.CLOSED (仅限服务商)通知的数据。</para>
|
||||
/// </summary>
|
||||
public class PartnerRefundResource : WechatTenpayEvent.Types.IDecryptedResource
|
||||
{
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 REFUND.SUCCESS (仅直连商户)通知的数据。</para>
|
||||
/// <para>表示 REFUND.ABNORMAL (仅直连商户)通知的数据。</para>
|
||||
/// <para>表示 REFUND.CLOSED (仅直连商户)通知的数据。</para>
|
||||
/// <para>表示 REFUND.SUCCESS (仅限直连商户)通知的数据。</para>
|
||||
/// <para>表示 REFUND.ABNORMAL (仅限直连商户)通知的数据。</para>
|
||||
/// <para>表示 REFUND.CLOSED (仅限直连商户)通知的数据。</para>
|
||||
/// </summary>
|
||||
public class RefundResource : WechatTenpayEvent.Types.IDecryptedResource
|
||||
{
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
/// <summary>
|
||||
/// 为 <see cref="WechatTenpayClient"/> 提供境外支付退款(For HK)相关的 API 扩展方法。
|
||||
/// </summary>
|
||||
public static class WechatTenpayClientExecuteHKPartnerRefundExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /refunds 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_2.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定特殊的 <see cref="WechatTenpayClientOptions.Endpoints"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateHKPartnerRefundResponse> ExecuteCreateHKPartnerRefundAsync(this WechatTenpayClient client, Models.CreateHKPartnerRefundRequest 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, "refunds");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateHKPartnerRefundResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /refunds/out-refund-no/{out_refund_no} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定特殊的 <see cref="WechatTenpayClientOptions.Endpoints"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPartnerRefundByOutRefundNumberResponse> ExecuteGetHKPartnerRefundByOutRefundNumberAsync(this WechatTenpayClient client, Models.GetHKPartnerRefundByOutRefundNumberRequest 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, "refunds", "out-refund-no", request.OutRefundNumber)
|
||||
.SetQueryParam("sp_mchid", request.MerchantId)
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPartnerRefundByOutRefundNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /refunds/id/{refund_id} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定特殊的 <see cref="WechatTenpayClientOptions.Endpoints"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPartnerRefundByIdResponse> ExecuteGetHKPartnerRefundByIdAsync(this WechatTenpayClient client, Models.GetHKPartnerRefundByIdRequest 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, "refunds", "id", request.RefundId)
|
||||
.SetQueryParam("sp_mchid", request.MerchantId)
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPartnerRefundByIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
/// <summary>
|
||||
/// 为 <see cref="WechatTenpayClient"/> 提供境外支付退款(For HK)相关的 API 扩展方法。
|
||||
/// </summary>
|
||||
public static class WechatTenpayClientExecuteHKRefundExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /refunds 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_2.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_2.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定特殊的 <see cref="WechatTenpayClientOptions.Endpoints"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateHKRefundResponse> ExecuteCreateHKRefundAsync(this WechatTenpayClient client, Models.CreateHKRefundRequest 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, "refunds");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateHKRefundResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /refunds/out-refund-no/{out_refund_no} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定特殊的 <see cref="WechatTenpayClientOptions.Endpoints"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKRefundByOutRefundNumberResponse> ExecuteGetHKRefundByOutRefundNumberAsync(this WechatTenpayClient client, Models.GetHKRefundByOutRefundNumberRequest 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, "refunds", "out-refund-no", request.OutRefundNumber)
|
||||
.SetQueryParam("mchid", request.MerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKRefundByOutRefundNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /refunds/id/{refund_id} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定特殊的 <see cref="WechatTenpayClientOptions.Endpoints"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKRefundByIdResponse> ExecuteGetHKRefundByIdAsync(this WechatTenpayClient client, Models.GetHKRefundByIdRequest 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, "refunds", "id", request.RefundId)
|
||||
.SetQueryParam("mchid", request.MerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKRefundByIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /refunds 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateHKPartnerRefundRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : CreateHKRefundRequest.Types.Amount
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_mchid")]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sp_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sp_appid")]
|
||||
public string? AppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户 AppId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_appid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_appid")]
|
||||
public string? SubAppId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。与字段 <see cref="OutTradeNumber"/> 二选一。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string? TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。与字段 <see cref="TransactionId"/> 二选一。
|
||||
/// </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("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("reason")]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回调通知地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("notify_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
|
||||
public string? NotifyUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = new Types.Amount();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("source")]
|
||||
public string? FundSource { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /refunds 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateHKPartnerRefundResponse : GetHKPartnerRefundByOutRefundNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/id/{refund_id} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetHKPartnerRefundByIdRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string RefundId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/id/{refund_id} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetHKPartnerRefundByIdResponse : GetHKPartnerRefundByOutRefundNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/out-refund-no/{out_refund_no} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetHKPartnerRefundByOutRefundNumberRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置子商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/out-refund-no/{out_refund_no} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetHKPartnerRefundByOutRefundNumberResponse : WechatTenpayResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : GetHKRefundByOutRefundNumberResponse.Types.Amount
|
||||
{
|
||||
}
|
||||
|
||||
public class Promotion : GetHKRefundByOutRefundNumberResponse.Types.Promotion
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string RefundId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { 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("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款渠道。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("channel")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("channel")]
|
||||
public string Channel { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fund_source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fund_source")]
|
||||
public string FundSource { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款入账账户。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("recv_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("recv_account")]
|
||||
public string ReceiveAccount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款成功时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("success_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("success_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款创建时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("create_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠退款信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_detail")]
|
||||
public Types.Promotion[]? PromotionList { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -18,14 +18,14 @@
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("settled")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("settled")]
|
||||
public int SettledAmount { get; set; }
|
||||
public int Settled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置未划账金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("unsettle")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("unsettle")]
|
||||
public int UnsettledAmount { get; set; }
|
||||
public int Unsettled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结算币种。
|
||||
@@ -39,21 +39,21 @@
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("pay")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pay")]
|
||||
public int PayAmount { get; set; }
|
||||
public int Payment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置该结算周期内退款总金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund")]
|
||||
public int RefundAmount { get; set; }
|
||||
public int Refund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置该结算周期交易与退款总金额之差(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("net")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("net")]
|
||||
public int NetAmount { get; set; }
|
||||
public int Net { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手续费金额(单位:指定货币的最小单位)。
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /refunds 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateHKRefundRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置原订单金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total")]
|
||||
public int Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund")]
|
||||
public int Refund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款币种。
|
||||
/// <para>默认值:HKD</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string Currency { get; set; } = "HKD";
|
||||
}
|
||||
}
|
||||
|
||||
/// <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; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。与字段 <see cref="OutTradeNumber"/> 二选一。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
|
||||
public string? TransactionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户订单号。与字段 <see cref="TransactionId"/> 二选一。
|
||||
/// </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("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("reason")]
|
||||
public string? Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回调通知地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("notify_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("notify_url")]
|
||||
public string? NotifyUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = new Types.Amount();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("source")]
|
||||
public string? FundSource { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /refunds 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateHKRefundResponse : GetHKRefundByOutRefundNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/id/{refund_id} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetHKRefundByIdRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string RefundId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/id/{refund_id} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetHKRefundByIdResponse : GetHKRefundByOutRefundNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/out-refund-no/{out_refund_no} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetHKRefundByOutRefundNumberRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置微信商户号。如果不指定将使用构造 <see cref="WechatTenpayClient"/> 时的 <see cref="WechatTenpayClientOptions.MerchantId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? MerchantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付订单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OutRefundNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /refunds/out-refund-no/{out_refund_no} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetHKRefundByOutRefundNumberResponse : WechatTenpayResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ExchangeRate : GetHKTransactionByOutTradeNumberResponse.Types.Amount.Types.ExchangeRate
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置原订单金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("total")]
|
||||
public int? Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund")]
|
||||
public int Refund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string? Currency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户支付金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_total")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_total")]
|
||||
public int PayerTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户退款金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_refund")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_refund")]
|
||||
public int PayerRefund { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户支付币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("payer_currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("payer_currency")]
|
||||
public string PayerCurrency { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置汇率信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exchange_rate")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exchange_rate")]
|
||||
public Types.ExchangeRate? ExchangeRate { get; set; }
|
||||
}
|
||||
|
||||
public class Promotion
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置券 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_id")]
|
||||
public string PromotionId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠范围。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("scope")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("scope")]
|
||||
public string? Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠券面额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public int Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠券退款金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_amount")]
|
||||
public int? RefundAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠币种。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("currency")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("currency")]
|
||||
public string? Currency { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信支付退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string RefundId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户退款单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_refund_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
|
||||
public string OutRefundNumber { 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("out_trade_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
|
||||
public string OutTradeNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款渠道。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("channel")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("channel")]
|
||||
public string Channel { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fund_source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fund_source")]
|
||||
public string FundSource { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款入账账户。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("recv_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("recv_account")]
|
||||
public string ReceiveAccount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款成功时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("success_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("success_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? SuccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款创建时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("create_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠退款信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("promotion_detail")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("promotion_detail")]
|
||||
public Types.Promotion[]? PromotionList { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -122,6 +122,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public int Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置优惠券退款金额(单位:指定货币的最小单位)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("refund_amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("refund_amount")]
|
||||
public int? RefundAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置活动 ID。
|
||||
/// </summary>
|
||||
|
||||
@@ -232,6 +232,20 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_received_account")]
|
||||
public string UserReceivedAccount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("funds_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("funds_account")]
|
||||
public string FundsAccount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款成功时间。
|
||||
/// </summary>
|
||||
@@ -250,20 +264,6 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339DateTimeOffsetConverter))]
|
||||
public DateTimeOffset CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public string Status { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款资金来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("funds_account")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("funds_account")]
|
||||
public string FundsAccount { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置退款金额信息。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user