mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(tenpaybusiness): 支持新版域名
This commit is contained in:
parent
cd153248da
commit
31ad3bec49
@ -2,15 +2,15 @@
|
||||
|
||||
[](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat) [](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat) [](https://www.nuget.org/packages/SKIT.FlurlHttpClient.Wechat.TenpayBusiness) [](https://mit-license.org/)
|
||||
|
||||
基于 `Flurl.Http` 的腾讯微企付 HTTP API SDK。
|
||||
基于 `Flurl.Http` 的微企付 HTTP API SDK。
|
||||
|
||||
---
|
||||
|
||||
### 【功能特性】
|
||||
|
||||
- 基于腾讯微企付 API 封装。
|
||||
- 基于微企付 API 封装。
|
||||
- 请求时自动生成签名,无需开发者手动干预。
|
||||
- 提供了腾讯微企付所需的 RSA、SM3、SM4、SHA-256 等算法工具类。
|
||||
- 提供了微企付所需的 RSA、SM3、SM4、SHA-256 等算法工具类。
|
||||
- 提供了解析回调通知事件等扩展方法。
|
||||
|
||||
---
|
||||
|
@ -13,9 +13,9 @@
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat</PackageProjectUrl>
|
||||
<PackageTags>Flurl.Http Tencent Tenpay 腾讯 微企付</PackageTags>
|
||||
<PackageTags>Flurl.Http Tencent Tenpay 微企付</PackageTags>
|
||||
<Version>2.0.1</Version>
|
||||
<Description>基于 Flurl.Http 的腾讯微企付 API 客户端。</Description>
|
||||
<Description>基于 Flurl.Http 的微企付 API 客户端。</Description>
|
||||
<Authors>Fu Diwei</Authors>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git</RepositoryUrl>
|
||||
|
@ -11,12 +11,12 @@ using Flurl.Http;
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
/// <summary>
|
||||
/// 一个腾讯微企付 API HTTP 客户端。
|
||||
/// 一个微企付 API HTTP 客户端。
|
||||
/// </summary>
|
||||
public class WechatTenpayBusinessClient : CommonClientBase, ICommonClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取当前客户端使用的腾讯微企付平台凭证。
|
||||
/// 获取当前客户端使用的微企付平台凭证。
|
||||
/// </summary>
|
||||
public Settings.Credentials Credentials { get; }
|
||||
|
||||
|
@ -12,39 +12,39 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
public int Timeout { get; set; } = 30 * 1000;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置腾讯微企付 API 入口点。
|
||||
/// 获取或设置微企付 API 入口点。
|
||||
/// <para>默认值:<see cref="WechatTenpayBusinessEndpoints.DEFAULT"/></para>
|
||||
/// </summary>
|
||||
public string Endpoint { get; set; } = WechatTenpayBusinessEndpoints.DEFAULT;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置腾讯微企付 API 签名认证方式。
|
||||
/// 获取或设置微企付 API 签名认证方式。
|
||||
/// <para>默认值:<see cref="Constants.SignAlgorithms.SHA245_WITH_RSA"/></para>
|
||||
/// </summary>
|
||||
public string SignAlgorithm { get; set; } = Constants.SignAlgorithms.SHA245_WITH_RSA;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置腾讯微企付平台账号。
|
||||
/// 获取或设置微企付平台账号。
|
||||
/// </summary>
|
||||
public string PlatformId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置腾讯微企付平台 API 证书序列号。
|
||||
/// 获取或设置微企付平台 API 证书序列号。
|
||||
/// </summary>
|
||||
public string PlatformCertificateSerialNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置腾讯微企付平台 API 证书私钥。
|
||||
/// 获取或设置微企付平台 API 证书私钥。
|
||||
/// </summary>
|
||||
public string PlatformCertificatePrivateKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置腾讯微企付证书序列号。
|
||||
/// 获取或设置微企付证书序列号。
|
||||
/// </summary>
|
||||
public string TBEPCertificateSerialNumber { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置腾讯微企付证书公钥。
|
||||
/// 获取或设置微企付证书公钥。
|
||||
/// </summary>
|
||||
public string TBEPCertificatePublicKey { get; set; } = default!;
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
/// <summary>
|
||||
/// 腾讯微企付 API 接口域名。
|
||||
/// 微企付 API 接口域名。
|
||||
/// </summary>
|
||||
public static class WechatTenpayBusinessEndpoints
|
||||
{
|
||||
/// <summary>
|
||||
/// 主域名(默认)。
|
||||
/// </summary>
|
||||
public const string DEFAULT = "https://api-business.tenpay.com/v3";
|
||||
public const string DEFAULT = "https://api.businesspay.qq.com/v3";
|
||||
|
||||
/// <summary>
|
||||
/// 测试域名。
|
||||
/// 沙箱域名。
|
||||
/// </summary>
|
||||
public const string DEVELOPMENT = "https://dev-api-business.tenpay.com/v3";
|
||||
public const string SANDBOX = "https://sandbox-api.businesspay.qq.com/v3";
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示腾讯微企付 API 回调通知事件的基类。
|
||||
/// 表示微企付 API 回调通知事件的基类。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class WechatTenpayBusinessEvent
|
||||
@ -55,7 +55,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 表示腾讯微企付 API 回调通知事件的基类。
|
||||
/// 表示微企付 API 回调通知事件的基类。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class WechatTenpayBusinessEvent<TEventContent> : WechatTenpayBusinessEvent
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
/// <summary>
|
||||
/// 当调用腾讯微企付 API 出错时引发的异常。
|
||||
/// 当调用微企付 API 出错时引发的异常。
|
||||
/// </summary>
|
||||
public class WechatTenpayBusinessException : CommonExceptionBase
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示腾讯微企付 API 请求的基类。
|
||||
/// 表示微企付 API 请求的基类。
|
||||
/// </summary>
|
||||
public abstract class WechatTenpayBusinessRequest : ICommonRequest
|
||||
{
|
||||
@ -13,7 +13,7 @@
|
||||
public virtual int? Timeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置请求使用的腾讯微企付敏感字段加密参数。
|
||||
/// 获取或设置请求使用的微企付敏感字段加密参数。
|
||||
/// <para>如果启用了 <see cref="WechatTenpayBusinessClientOptions.AutoEncryptRequestSensitiveProperty"/> 参数,将由系统自动生成。</para>
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示腾讯微企付 API 响应的基类。
|
||||
/// 表示微企付 API 响应的基类。
|
||||
/// </summary>
|
||||
public abstract class WechatTenpayBusinessResponse : ICommonResponse
|
||||
{
|
||||
@ -56,28 +56,28 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取腾讯微企付 API 返回的敏感字段加密参数。
|
||||
/// 获取微企付 API 返回的敏感字段加密参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public WechatTenpayBusinessResponseTBEPEncryption? TBEPEncryption { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取腾讯微企付请求链路 ID。
|
||||
/// 获取微企付请求链路 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("trace_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("trace_id")]
|
||||
public virtual string? TraceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取腾讯微企付 API 返回的错误详细信息。
|
||||
/// 获取微企付 API 返回的错误详细信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("error")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("error")]
|
||||
public virtual WechatTenpayBusinessResponseError? Error { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个值,该值指示调用腾讯微企付 API 是否成功(即 HTTP 状态码为 200、202 或 204)。
|
||||
/// 获取一个值,该值指示调用微企付 API 是否成功(即 HTTP 状态码为 200、202 或 204)。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual bool IsSuccessful()
|
||||
|
Loading…
Reference in New Issue
Block a user