mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-11 18:26:20 +08:00
feat(tenpayv3): 新增境外商户委托代扣相关接口
This commit is contained in:
@@ -14,7 +14,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /customs/orders 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_1.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -37,7 +37,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /customs/orders 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_1.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -71,7 +71,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /customs/redeclare 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_4.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -94,7 +94,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [PATCH] /customs/orders 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_5.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -117,7 +117,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /customs/verify-certificate 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/declarecustom/chapter3_2.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /merchants 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/Onborading_Sub_Merchant/chapter3_1.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -38,7 +38,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /merchants/{sub_mchid} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/Onborading%20Sub%20Merchant/chapter3_2.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -63,7 +63,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [PUT] /merchants 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/Onborading_Sub_Merchant/chapter3_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
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 WechatTenpayClientExecuteHKPAPPayExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/app-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_17.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPAPPayContractEntrustAppResponse> ExecutePresignHKPAPPayContractEntrustAppAsync(this WechatTenpayClient client, Models.PresignHKPAPPayContractEntrustAppRequest 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, "papay", "contracts", "app-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPAPPayContractEntrustAppResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/jsapi-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_15.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPAPPayContractEntrustJsapiResponse> ExecutePresignHKPAPPayContractEntrustJsapiAsync(this WechatTenpayClient client, Models.PresignHKPAPPayContractEntrustJsapiRequest 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, "papay", "contracts", "jsapi-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPAPPayContractEntrustJsapiResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/miniprogram-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_1.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPAPPayContractEntrustMiniProgramResponse> ExecutePresignHKPAPPayContractEntrustMiniProgramAsync(this WechatTenpayClient client, Models.PresignHKPAPPayContractEntrustMiniProgramRequest 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, "papay", "contracts", "miniprogram-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPAPPayContractEntrustMiniProgramResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/h5-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_14.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPAPPayContractEntrustH5Response> ExecutePresignHKPAPPayContractEntrustH5Async(this WechatTenpayClient client, Models.PresignHKPAPPayContractEntrustH5Request 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, "papay", "contracts", "h5-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPAPPayContractEntrustH5Response>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/web-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_16.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPAPPayContractEntrustWebResponse> ExecutePresignHKPAPPayContractEntrustWebAsync(this WechatTenpayClient client, Models.PresignHKPAPPayContractEntrustWebRequest 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, "papay", "contracts", "web-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPAPPayContractEntrustWebResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/contracts/out-contract-code/{out_contract_code} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_3.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPAPPayContractByOutContractCodeResponse> ExecuteGetHKPAPPayContractByOutContractCodeAsync(this WechatTenpayClient client, Models.GetHKPAPPayContractByOutContractCodeRequest 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, "papay", "contracts", "out-contract-code", request.OutContractCode)
|
||||
.SetQueryParam("appid", request.AppId)
|
||||
.SetQueryParam("plan_id", request.PlanId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPAPPayContractByOutContractCodeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/contracts/{contract_id} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_2.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPAPPayContractByContractIdResponse> ExecuteGetHKPAPPayContractByContractIdAsync(this WechatTenpayClient client, Models.GetHKPAPPayContractByContractIdRequest 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, "papay", "contracts", request.ContractId)
|
||||
.SetQueryParam("appid", request.AppId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPAPPayContractByContractIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/{contract_id}/terminate 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_4.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TerminateHKPAPPayContractResponse> ExecuteTerminateHKPAPPayContractAsync(this WechatTenpayClient client, Models.TerminateHKPAPPayContractRequest 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, "papay", "contracts", request.ContractId, "terminate");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TerminateHKPAPPayContractResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/transactions 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_6.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateHKPAPPayTransactionResponse> ExecuteCreateHKPAPPayTransactionAsync(this WechatTenpayClient client, Models.CreateHKPAPPayTransactionRequest 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, "papay", "transactions");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateHKPAPPayTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/transactions/out-trade-no/{out_trade_no} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_8.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPAPPayTransactionByOutTradeNumberResponse> ExecuteGetHKPAPPayTransactionByOutTradeNumberAsync(this WechatTenpayClient client, Models.GetHKPAPPayTransactionByOutTradeNumberRequest 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, "papay", "transactions", "out-trade-no", request.OutTradeNumber);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPAPPayTransactionByOutTradeNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/transactions/{transaction_id} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_8.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPAPPayTransactionByIdResponse> ExecuteGetHKPAPPayTransactionByIdAsync(this WechatTenpayClient client, Models.GetHKPAPPayTransactionByIdRequest 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, "papay", "transactions", request.TransactionId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPAPPayTransactionByIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/transactions/out-trade-no/{out_trade_no}/reverse 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_10.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ReverseHKPAPPayTransactionResponse> ExecuteReverseHKPAPPayTransactionAsync(this WechatTenpayClient client, Models.ReverseHKPAPPayTransactionRequest 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, "papay", "transactions", "out-trade-no", request.OutTradeNumber, "reverse");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ReverseHKPAPPayTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
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 WechatTenpayClientExecuteHKPartnerPAPPayExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/app-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_17.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPartnerPAPPayContractEntrustAppResponse> ExecutePresignHKPartnerPAPPayContractEntrustAppAsync(this WechatTenpayClient client, Models.PresignHKPartnerPAPPayContractEntrustAppRequest 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, "papay", "contracts", "app-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPartnerPAPPayContractEntrustAppResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/jsapi-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_15.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPartnerPAPPayContractEntrustJsapiResponse> ExecutePresignHKPartnerPAPPayContractEntrustJsapiAsync(this WechatTenpayClient client, Models.PresignHKPartnerPAPPayContractEntrustJsapiRequest 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, "papay", "contracts", "jsapi-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPartnerPAPPayContractEntrustJsapiResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/miniprogram-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_1.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPartnerPAPPayContractEntrustMiniProgramResponse> ExecutePresignHKPartnerPAPPayContractEntrustMiniProgramAsync(this WechatTenpayClient client, Models.PresignHKPartnerPAPPayContractEntrustMiniProgramRequest 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, "papay", "contracts", "miniprogram-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPartnerPAPPayContractEntrustMiniProgramResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/h5-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_14.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPartnerPAPPayContractEntrustH5Response> ExecutePresignHKPartnerPAPPayContractEntrustH5Async(this WechatTenpayClient client, Models.PresignHKPartnerPAPPayContractEntrustH5Request 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, "papay", "contracts", "h5-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPartnerPAPPayContractEntrustH5Response>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/web-pre-entrust-sign 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_14.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PresignHKPartnerPAPPayContractEntrustWebResponse> ExecutePresignHKPartnerPAPPayContractEntrustWebAsync(this WechatTenpayClient client, Models.PresignHKPartnerPAPPayContractEntrustWebRequest 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, "papay", "contracts", "web-pre-entrust-sign");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PresignHKPartnerPAPPayContractEntrustWebResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/contracts/out-contract-code/{out_contract_code} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_3.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPartnerPAPPayContractByOutContractCodeResponse> ExecuteGetHKPartnerPAPPayContractByOutContractCodeAsync(this WechatTenpayClient client, Models.GetHKPartnerPAPPayContractByOutContractCodeRequest 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, "papay", "contracts", "out-contract-code", request.OutContractCode)
|
||||
.SetQueryParam("sp_appid", request.AppId)
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId)
|
||||
.SetQueryParam("sub_appid", request.SubAppId)
|
||||
.SetQueryParam("plan_id", request.PlanId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPartnerPAPPayContractByOutContractCodeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/contracts/{contract_id} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_2.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPartnerPAPPayContractByContractIdResponse> ExecuteGetHKPartnerPAPPayContractByContractIdAsync(this WechatTenpayClient client, Models.GetHKPartnerPAPPayContractByContractIdRequest 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, "papay", "contracts", request.ContractId)
|
||||
.SetQueryParam("sp_appid", request.AppId)
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId)
|
||||
.SetQueryParam("sub_appid", request.SubAppId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPartnerPAPPayContractByContractIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/contracts/{contract_id}/terminate 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_4.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.TerminateHKPartnerPAPPayContractResponse> ExecuteTerminateHKPartnerPAPPayContractAsync(this WechatTenpayClient client, Models.TerminateHKPartnerPAPPayContractRequest 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, "papay", "contracts", request.ContractId, "terminate");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.TerminateHKPartnerPAPPayContractResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/transactions 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_6.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateHKPartnerPAPPayTransactionResponse> ExecuteCreateHKPartnerPAPPayTransactionAsync(this WechatTenpayClient client, Models.CreateHKPartnerPAPPayTransactionRequest 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, "papay", "transactions");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateHKPartnerPAPPayTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/transactions/out-trade-no/{out_trade_no} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_8.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPartnerPAPPayTransactionByOutTradeNumberResponse> ExecuteGetHKPartnerPAPPayTransactionByOutTradeNumberAsync(this WechatTenpayClient client, Models.GetHKPartnerPAPPayTransactionByOutTradeNumberRequest 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, "papay", "transactions", "out-trade-no", request.OutTradeNumber)
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPartnerPAPPayTransactionByOutTradeNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /papay/transactions/{transaction_id} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_8.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetHKPartnerPAPPayTransactionByIdResponse> ExecuteGetHKPartnerPAPPayTransactionByIdAsync(this WechatTenpayClient client, Models.GetHKPartnerPAPPayTransactionByIdRequest 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, "papay", "transactions", request.TransactionId)
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPartnerPAPPayTransactionByIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /papay/transactions/out-trade-no/{out_trade_no}/reverse 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_10.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ReverseHKPartnerPAPPayTransactionResponse> ExecuteReverseHKPartnerPAPPayTransactionAsync(this WechatTenpayClient client, Models.ReverseHKPartnerPAPPayTransactionRequest 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, "papay", "transactions", "out-trade-no", request.OutTradeNumber, "reverse");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ReverseHKPartnerPAPPayTransactionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -20,7 +20,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <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.Endpoint"/>。)</i></para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_11.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -48,7 +49,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <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.Endpoint"/>。)</i></para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_12.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -78,7 +80,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <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.Endpoint"/>。)</i></para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_12.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -99,5 +102,40 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKPartnerRefundByIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /refunds 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_13.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.QueryHKPartnerRefundsResponse> ExecuteQueryHKPartnerRefundsAsync(this WechatTenpayClient client, Models.QueryHKPartnerRefundsRequest 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")
|
||||
.SetQueryParam("sp_mchid", request.MerchantId)
|
||||
.SetQueryParam("sub_mchid", request.SubMerchantId)
|
||||
.SetQueryParam("out_trade_no", request.OutTradeNumber)
|
||||
.SetQueryParam("transaction_id", request.TransactionId)
|
||||
.SetQueryParam("offset", request.Offset)
|
||||
.SetQueryParam("count", request.Limit);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryHKPartnerRefundsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/app 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter6_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -37,7 +37,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/mweb 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter3_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -61,7 +61,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>异步调用 [POST] /transactions/jsapi 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter5_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter7_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -84,7 +84,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/native 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter4_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -112,7 +112,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_1.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -142,7 +142,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_1.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -171,7 +171,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_6.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_6.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_6.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -194,7 +194,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/out-trade-no/{out_trade_no}/reverse 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter3_4.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -224,7 +224,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_5.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_5.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_5.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -253,7 +253,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_12.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_12.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_12.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -20,7 +20,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <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.Endpoint"/>。)</i></para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_11.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -48,7 +49,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <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.Endpoint"/>。)</i></para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_12.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -77,7 +79,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <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.Endpoint"/>。)</i></para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_12.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -97,5 +100,39 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetHKRefundByIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /refunds 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api_external/en/apis/chapter5_1_13.shtml </para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.QueryHKRefundsResponse> ExecuteQueryHKRefundsAsync(this WechatTenpayClient client, Models.QueryHKRefundsRequest 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")
|
||||
.SetQueryParam("mchid", request.MerchantId)
|
||||
.SetQueryParam("out_trade_no", request.OutTradeNumber)
|
||||
.SetQueryParam("transaction_id", request.TransactionId)
|
||||
.SetQueryParam("offset", request.Offset)
|
||||
.SetQueryParam("count", request.Limit);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.QueryHKRefundsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/app 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/In-AppPay/chapter6_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -37,7 +37,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/mweb 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/H5Payment/chapter3_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -61,7 +61,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>异步调用 [POST] /transactions/jsapi 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter5_4.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter7_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -84,7 +84,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/native 接口。</para>
|
||||
/// <para>REF: https://https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter4_3.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -112,7 +112,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_1.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -141,7 +141,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_1.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter8_1.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -169,7 +169,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/OfficialPayMent/chapter8_6.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/MiniProgramPay/chapter8_6.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/NativePay/chapter8_6.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -192,7 +192,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /transactions/out-trade-no/{out_trade_no}/reverse 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/api/wxpay/en/fusion_wallet/QuickPay/chapter3_4.shtml </para>
|
||||
/// <para><i>(请注意调用此接口需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// <para><i>(请注意此接口专为境外支付设计,调用时需在构造 <see cref="WechatTenpayClient" /> 时指定单独的 <see cref="WechatTenpayClientOptions.Endpoint"/>。)</i></para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -19,7 +19,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NotifyPAPPayContractsResponse> ExecuteNotifyPAPPayContractsAsync(this WechatTenpayClient client, Models.NotifyPAPPayContractsRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.NotifyPAPPayContractResponse> ExecuteNotifyPAPPayContractAsync(this WechatTenpayClient client, Models.NotifyPAPPayContractRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
@@ -30,7 +30,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "papay", "contracts", request.ContractId, "notify");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.NotifyPAPPayContractsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.NotifyPAPPayContractResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -19,7 +19,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.NotifyPartnerPAPPayContractsResponse> ExecuteNotifyPartnerPAPPayContractsAsync(this WechatTenpayClient client, Models.NotifyPartnerPAPPayContractsRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.NotifyPartnerPAPPayContractResponse> ExecuteNotifyPartnerPAPPayContractAsync(this WechatTenpayClient client, Models.NotifyPartnerPAPPayContractRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
@@ -30,7 +30,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "partner-papay", "contracts", request.ContractId, "notify");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.NotifyPartnerPAPPayContractsResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.NotifyPartnerPAPPayContractResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -67,7 +67,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.PreOrderWithAuthPayrollCardAuthenticationResponse> ExecutePreOrderWithAuthPayrollCardAuthenticationAsync(this WechatTenpayClient client, Models.PreOrderWithAuthPayrollCardAuthenticationRequest request, CancellationToken cancellationToken = default)
|
||||
public static async Task<Models.PreorderPayrollCardAuthenticationResponse> ExecutePreorderPayrollCardAuthenticationAsync(this WechatTenpayClient client, Models.PreorderPayrollCardAuthenticationRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
@@ -75,7 +75,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "payroll-card", "authentications", "pre-order-with-auth");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.PreOrderWithAuthPayrollCardAuthenticationResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
return await client.SendRequestWithJsonAsync<Models.PreorderPayrollCardAuthenticationResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user