mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-18 17:48:12 +08:00
feat(tenpayv3): 新增鸿蒙代扣受理扣款接口
This commit is contained in:
@@ -356,6 +356,28 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ApplyPAPayPayTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/pay/harmony/transactions/apply 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://pay.weixin.qq.com/doc/v3/merchant/4013388429 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ApplyPAPayPayTransactionHarmonyResponse> ExecuteApplyPAPayPayTransactionHarmonyAsync(this WechatTenpayClient client, Models.ApplyPAPayPayTransactionHarmonyRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "papay", "pay", "harmony", "transactions", "apply");
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ApplyPAPayPayTransactionHarmonyResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ScheduledDeductSign
|
||||
|
@@ -0,0 +1,85 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /papay/pay/harmony/transactions/apply 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ApplyPAPayPayTransactionHarmonyRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : ApplyPAPayPayTransactionRequest.Types.Amount
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("description")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置委托代扣签约协议 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("contract_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("contract_id")]
|
||||
public string ContractId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置回调通知地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("transaction_notify_url")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("transaction_notify_url")]
|
||||
public string NotifyUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置订单优惠标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("goods_tag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("goods_tag")]
|
||||
public string? GoodsTag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附加数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("attach")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("attach")]
|
||||
public string? Attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置金额信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = new Types.Amount();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置鸿蒙账户 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("harmony_account_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("harmony_account_id")]
|
||||
public string HarmonyAccountId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户行业编码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mcc")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mcc")]
|
||||
public string? MerchantCategoryCode { get; set; }
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /papay/pay/harmony/transactions/apply 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ApplyPAPayPayTransactionHarmonyResponse : WechatTenpayResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Amount : ApplyPAPayPayTransactionResponse.Types.Amount
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <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("amount")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("amount")]
|
||||
public Types.Amount Amount { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"appid": "wxd678efh567hg6787",
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"description": "Image形象店-深圳腾大-QQ公仔",
|
||||
"transaction_notify_url": "https://www.qq.com/",
|
||||
"contract_id": "123124412412423431",
|
||||
"amount": {
|
||||
"total": 1,
|
||||
"currency": "CNY"
|
||||
},
|
||||
"goods_tag": "DISCOUNTS",
|
||||
"attach": "自定义数据",
|
||||
"harmony_account_id": "example_harmony_account_id",
|
||||
"mcc": "5734"
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"out_trade_no": "1217752501201407033233368018",
|
||||
"amount": {
|
||||
"total": 1,
|
||||
"currency": "CNY"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user