mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-21 02:58:06 +08:00
feat(tenpayv3): 移除部分已被标记为废弃的配置项参数
This commit is contained in:
@@ -230,7 +230,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
string publicKey;
|
string publicKey;
|
||||||
if (string.IsNullOrEmpty(request.WechatpaySerialNumber))
|
if (string.IsNullOrEmpty(request.WechatpaySerialNumber))
|
||||||
{
|
{
|
||||||
// 如果未在请求中指定特定的平台公钥序列号,从管理器中取第一个
|
// 如果未在请求中指定特定的平台公钥 ID,从管理器中取第一个
|
||||||
IEnumerable<PublicKeyEntry> entries = client.PlatformPublicKeyManager.AllEntries()
|
IEnumerable<PublicKeyEntry> entries = client.PlatformPublicKeyManager.AllEntries()
|
||||||
.Where(e => e.AlgorithmType == algorithmType);
|
.Where(e => e.AlgorithmType == algorithmType);
|
||||||
if (!entries.Any())
|
if (!entries.Any())
|
||||||
@@ -244,7 +244,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 如果已在请求中指定特定的平台公钥序列号,直接从管理器中取值
|
// 如果已在请求中指定特定的平台公钥 ID,直接从管理器中取值
|
||||||
PublicKeyEntry? entry = client.PlatformPublicKeyManager.GetEntry(request.WechatpaySerialNumber!);
|
PublicKeyEntry? entry = client.PlatformPublicKeyManager.GetEntry(request.WechatpaySerialNumber!);
|
||||||
if (!entry.HasValue)
|
if (!entry.HasValue)
|
||||||
{
|
{
|
||||||
@@ -308,7 +308,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
if (client.PlatformPublicKeyManager is null)
|
if (client.PlatformPublicKeyManager is null)
|
||||||
throw new WechatTenpayException("Failed to encrypt request, because the platform public key manager is not initialized.");
|
throw new WechatTenpayException("Failed to encrypt request, because the platform public key manager is not initialized.");
|
||||||
|
|
||||||
// 如果未在请求中指定特定的平台公钥序列号,从管理器中第一个
|
// 如果未在请求中指定特定的平台公钥 ID,从管理器中第一个
|
||||||
IEnumerable<PublicKeyEntry> entries = await ((IPublicKeyManagerAsync)client.PlatformPublicKeyManager).AllEntriesAsync(cancellationToken).ConfigureAwait(false);
|
IEnumerable<PublicKeyEntry> entries = await ((IPublicKeyManagerAsync)client.PlatformPublicKeyManager).AllEntriesAsync(cancellationToken).ConfigureAwait(false);
|
||||||
entries = entries.Where(e => e.AlgorithmType == algorithmType);
|
entries = entries.Where(e => e.AlgorithmType == algorithmType);
|
||||||
if (!entries.Any())
|
if (!entries.Any())
|
||||||
@@ -322,7 +322,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 如果已在请求中指定特定的平台公钥序列号,直接从管理器中取值
|
// 如果已在请求中指定特定的平台公钥 ID,直接从管理器中取值
|
||||||
PublicKeyEntry? entry = await ((IPublicKeyManagerAsync)client.PlatformPublicKeyManager).GetEntryAsync(request.WechatpaySerialNumber!, cancellationToken).ConfigureAwait(false);
|
PublicKeyEntry? entry = await ((IPublicKeyManagerAsync)client.PlatformPublicKeyManager).GetEntryAsync(request.WechatpaySerialNumber!, cancellationToken).ConfigureAwait(false);
|
||||||
if (!entry.HasValue)
|
if (!entry.HasValue)
|
||||||
{
|
{
|
||||||
|
@@ -24,7 +24,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings
|
|||||||
public string AlgorithmType { get; }
|
public string AlgorithmType { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取公钥序列号。
|
/// 获取公钥 ID。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SerialNumber { get; }
|
public string SerialNumber { get; }
|
||||||
|
|
||||||
|
@@ -25,14 +25,14 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings
|
|||||||
void AddEntry(PublicKeyEntry entry);
|
void AddEntry(PublicKeyEntry entry);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据公钥序列号获取公钥实体。
|
/// 根据公钥 ID 获取公钥实体。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serialNumber"></param>
|
/// <param name="serialNumber"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
PublicKeyEntry? GetEntry(string serialNumber);
|
PublicKeyEntry? GetEntry(string serialNumber);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据公钥序列号移除公钥实体。
|
/// 根据公钥 ID 移除公钥实体。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serialNumber"></param>
|
/// <param name="serialNumber"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
@@ -60,7 +60,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings
|
|||||||
Task AddEntryAsync(PublicKeyEntry entry, CancellationToken cancellationToken = default);
|
Task AddEntryAsync(PublicKeyEntry entry, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 异步根据公钥序列号获取公钥实体。
|
/// 异步根据公钥 ID 获取公钥实体。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serialNumber"></param>
|
/// <param name="serialNumber"></param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
@@ -68,7 +68,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Settings
|
|||||||
Task<PublicKeyEntry?> GetEntryAsync(string serialNumber, CancellationToken cancellationToken = default);
|
Task<PublicKeyEntry?> GetEntryAsync(string serialNumber, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 异步根据公钥序列号移除公钥实体。
|
/// 异步根据公钥 ID 移除公钥实体。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serialNumber"></param>
|
/// <param name="serialNumber"></param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
|
@@ -8,15 +8,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
public abstract class WechatTenpayRequest : CommonRequestBase, ICommonRequest
|
public abstract class WechatTenpayRequest : CommonRequestBase, ICommonRequest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置微信请求使用的微信支付平台证书序列号。
|
/// 获取或设置微信请求使用的微信支付平台证书或公钥 ID。
|
||||||
/// </summary>
|
|
||||||
[Obsolete("后续版本该属性将被移除,请使用 `WechatpaySerialNumber` 属性替代。", error: true)]
|
|
||||||
[Newtonsoft.Json.JsonIgnore]
|
|
||||||
[System.Text.Json.Serialization.JsonIgnore]
|
|
||||||
public virtual string? WechatpayCertificateSerialNumber { get { return WechatpaySerialNumber; } set { WechatpaySerialNumber = value; } }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或设置微信请求使用的微信支付平台证书或公钥序列号。
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonIgnore]
|
[Newtonsoft.Json.JsonIgnore]
|
||||||
[System.Text.Json.Serialization.JsonIgnore]
|
[System.Text.Json.Serialization.JsonIgnore]
|
||||||
|
@@ -65,15 +65,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
|||||||
public string WechatpaySignatureType { get { return GetRawHeaders().GetFirstValueOrEmpty("Wechatpay-Signature-Type"); } }
|
public string WechatpaySignatureType { get { return GetRawHeaders().GetFirstValueOrEmpty("Wechatpay-Signature-Type"); } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取微信应答签名使用的微信支付平台证书序列号。
|
/// 获取微信应答签名使用的微信支付平台证书或公钥 ID。
|
||||||
/// </summary>
|
|
||||||
[Obsolete("后续版本该属性将被移除,请使用 `WechatpaySerialNumber` 属性替代。", error: true)]
|
|
||||||
[Newtonsoft.Json.JsonIgnore]
|
|
||||||
[System.Text.Json.Serialization.JsonIgnore]
|
|
||||||
public string WechatpayCertificateSerialNumber { get { return WechatpaySerialNumber; } }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取微信应答签名使用的微信支付平台证书或公钥序列号。
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonIgnore]
|
[Newtonsoft.Json.JsonIgnore]
|
||||||
[System.Text.Json.Serialization.JsonIgnore]
|
[System.Text.Json.Serialization.JsonIgnore]
|
||||||
|
Reference in New Issue
Block a user