mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(tenpayv3): 新增消费者投诉图片下载接口
This commit is contained in:
parent
a48c79c996
commit
8885be2f80
@ -123,7 +123,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Get, request.DownloadUrl);
|
||||
.CreateRequest(request, HttpMethod.Get);
|
||||
flurlReq.Url = new Url(new Uri(request.DownloadUrl));
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.DownloadBillFileResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
@ -257,5 +257,26 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
|
||||
return await client.SendRequestAsync<Models.UploadMerchantServiceImageResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /{download_url} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_18.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter10_2_18.shtml </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.DownloadMerchantServiceImageResponse> ExecuteDownloadMerchantServiceImageAsync(this WechatTenpayClient client, Models.DownloadMerchantServiceImageRequest 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);
|
||||
flurlReq.Url = new Url(new Uri(request.DownloadUrl));
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.DownloadMerchantServiceImageResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /{download_url} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class DownloadMerchantServiceImageRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片下载地址。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string DownloadUrl { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /{download_url} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class DownloadMerchantServiceImageResponse : WechatTenpayResponse
|
||||
{
|
||||
public override bool IsSuccessful()
|
||||
{
|
||||
return base.IsSuccessful() && RawBytes.Length > 0;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user