using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
{
public static class WechatTenpayClientExecuteXDCExtensions
{
///
/// 异步调用 [POST] /xdc/apiv2getsignkey/sign/getsignkey 接口。
/// REF: https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=23_1&index=1
/// REF: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/micropay_sl.php?chapter=23_1&index=1
/// REF: https://pay.weixin.qq.com/wiki/doc/api/jsapi_sl.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/native_sl.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/app/app_sl.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/H5_sl.php?chapter=23_1&index=2
/// REF: https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_sl_api.php?chapter=23_1&index=2
///
///
///
///
///
public static async Task ExecuteGetSandboxSignKeyAsync(this WechatTenpayClient client, Models.GetSandboxSignKeyRequest 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, "xdc", "apiv2getsignkey", "sign", "getsignkey");
return await client.SendRequestWithXmlAsync(flurlReq, data: request, cancellationToken: cancellationToken);
}
}
}