mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(tenpayv3): bump version to v2.19.0
This commit is contained in:
parent
218ff7ac51
commit
3ce0404ca1
@ -547,6 +547,10 @@
|
||||
|
||||
<summary>[展开查看]</summary>
|
||||
|
||||
- Release 2.19.0
|
||||
|
||||
- **新增**:新增电商收付通注销申请相关接口。
|
||||
|
||||
- Release 2.18.0
|
||||
|
||||
- **新增**:新增电商收付通合单代扣相关接口。
|
||||
|
@ -8,6 +8,75 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
{
|
||||
public static class WechatTenpayClientExecuteEcommerceExtensions
|
||||
{
|
||||
#region Account
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /ecommerce/account/cancel-applications 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/docs/partner/apis/ecommerce-cancel/cancel-applications/create-cancel-application.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CreateEcommerceAccountCancelApplicationResponse> ExecuteCreateEcommerceAccountCancelApplicationAsync(this WechatTenpayClient client, Models.CreateEcommerceAccountCancelApplicationRequest 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, "ecommerce", "account", "cancel-applications");
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CreateEcommerceAccountCancelApplicationResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /ecommerce/account/cancel-applications/out-apply-no/{out_apply_no} 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/docs/partner/apis/ecommerce-cancel/cancel-applications/get-cancel-application.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.GetEcommerceAccountCancelApplicationByOutApplyNumberResponse> ExecuteGetEcommerceAccountCancelApplicationByOutApplyNumberAsync(this WechatTenpayClient client, Models.GetEcommerceAccountCancelApplicationByOutApplyNumberRequest 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, "ecommerce", "account", "cancel-applications", "out-apply-no", request.OutApplyNumber);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.GetEcommerceAccountCancelApplicationByOutApplyNumberResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /ecommerce/account/cancel-applications/media 接口。</para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/docs/partner/apis/ecommerce-cancel/media/upload-media.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.UploadEcommerceAccountCancelApplicationMediaResponse> ExecuteUploadEcommerceAccountCancelApplicationMediaAsync(this WechatTenpayClient client, Models.UploadEcommerceAccountCancelApplicationMediaRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
if (request.FileName == null)
|
||||
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ".png";
|
||||
|
||||
if (request.FileHash == null)
|
||||
request.FileHash = BitConverter.ToString(Utilities.SHA256Utility.Hash(request.FileBytes)).Replace("-", string.Empty).ToLower();
|
||||
|
||||
if (request.FileContentType == null)
|
||||
request.FileContentType = Utilities.FileNameToContentTypeMapper.GetContentTypeForImage(request.FileName!) ?? "image/png";
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "ecommerce", "account", "cancel-applications", "media");
|
||||
|
||||
using var httpContent = Utilities.FileHttpContentBuilder.Build(fileName: request.FileName, fileBytes: request.FileBytes, fileContentType: request.FileContentType, fileMetaJson: client.JsonSerializer.Serialize(request));
|
||||
return await client.SendRequestAsync<Models.UploadEcommerceAccountCancelApplicationMediaResponse>(flurlReq, httpContent: httpContent, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Applyments
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /ecommerce/applyments/ 接口。</para>
|
||||
|
@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /ecommerce/account/cancel-applications 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CreateEcommerceAccountCancelApplicationRequest : WechatTenpayRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ApplicationMaterial
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置申请材料类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("application_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("application_type")]
|
||||
public string Type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置申请材料 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("application_media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("application_media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置微信二级商户号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sub_mchid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sub_mchid")]
|
||||
public string SubMerchantId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置商户注销申请单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("out_apply_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_apply_no")]
|
||||
public string OutApplyNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置注销申请材料列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("application_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("application_info")]
|
||||
public IList<Types.ApplicationMaterial> ApplicationMaterialList { get; set; } = new List<Types.ApplicationMaterial>();
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /ecommerce/account/cancel-applications 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CreateEcommerceAccountCancelApplicationResponse : GetEcommerceAccountCancelApplicationByOutApplyNumberResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /ecommerce/account/cancel-applications/out-apply-no/{out_apply_no} 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class GetEcommerceAccountCancelApplicationByOutApplyNumberRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置商户注销申请单号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string OutApplyNumber { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /ecommerce/account/cancel-applications/out-apply-no/{out_apply_no} 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class GetEcommerceAccountCancelApplicationByOutApplyNumberResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <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_apply_no")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("out_apply_no")]
|
||||
public string OutApplyNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置注销状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cancel_state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cancel_state")]
|
||||
public string CancelState { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置驳回原因。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("reject_reason")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("reject_reason")]
|
||||
public string? RejectReason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置更新时间。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("update_time")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.RFC3339NullableDateTimeOffsetConverter))]
|
||||
public DateTimeOffset? UpdateTime { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /ecommerce/account/cancel-applications/media 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class UploadEcommerceAccountCancelApplicationMediaRequest : WechatTenpayRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置图片文件字节数组。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public byte[] FileBytes { get; set; } = Array.Empty<byte>();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片文件名(必须以 jpg、bmp、png 为后缀)。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file_name")]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片文件摘要。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file_digest")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file_digest")]
|
||||
public string? FileHash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置图片文件 Conent-Type。如果不指定将由系统自动生成。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? FileContentType { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /ecommerce/account/cancel-applications/media 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class UploadEcommerceAccountCancelApplicationMediaResponse : WechatTenpayResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置媒体文件标识 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat</PackageProjectUrl>
|
||||
<PackageTags>Flurl.Http Wechat Weixin MicroMessage Tenpay WechatPay WeixinPay Wxpay 微信 微信支付 微信商户</PackageTags>
|
||||
<Version>2.18.0</Version>
|
||||
<Version>2.19.0</Version>
|
||||
<Description>基于 Flurl.Http 的微信支付 API v3 版客户端,支持直连商户、服务商模式,支持基础支付、代金券、商家券、委托营销、消费卡、支付有礼、银行定向促活、微信支付分、微信先享卡、支付即服务、点金计划、智慧商圈、电商收付通、二级商户进件、小微商户进件、消费者投诉、商户违规通知、批量转账到零钱、银行组件、海关报关、融合钱包、微工卡、电子发票、车主平台、教育续费通、校园轻松付等功能。</Description>
|
||||
<Authors>Fu Diwei</Authors>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"sub_mchid": "1900000109",
|
||||
"out_apply_no": "2019061122222222122",
|
||||
"application_info": [
|
||||
{
|
||||
"application_type": "SP_MERCHANT_APPLICATION",
|
||||
"application_media_id": "abc123456"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"out_apply_no": "abcd12345FEGH",
|
||||
"sub_mchid": "123456789",
|
||||
"reject_reason": "非电商服务商,无权调用此接口",
|
||||
"cancel_state": "REVIEWING",
|
||||
"update_time": "2023-01-20T13:29:35+08:00"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"out_apply_no": "abcd12345FEGH",
|
||||
"sub_mchid": "123456789",
|
||||
"reject_reason": "非电商服务商,无权调用此接口",
|
||||
"cancel_state": "REVIEWING",
|
||||
"update_time": "2023-01-20T13:29:35+08:00"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"file_name": "",
|
||||
"file_digest": ""
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"media_id": "H1ihR9JUtVj-J7CJqBUY5ZOrG_Je75H-rKhTG7FUmg9sxNTbRN54dFiUHnhgrBQ6EKeHoGcHTJMHn5TAuLVjHUQDBInSWXcIHYXOeRa2OHA"
|
||||
}
|
Loading…
Reference in New Issue
Block a user