mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-03-10 00:13:36 +08:00
feat: 重命名 ICertificateStorer 接口为 ICertificateManager
This commit is contained in:
@@ -35,13 +35,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (callbackSignature == null) throw new ArgumentNullException(nameof(callbackSignature));
|
||||
if (callbackSerialNumber == null) throw new ArgumentNullException(nameof(callbackSerialNumber));
|
||||
|
||||
if (client.WechatCertificateStorer == null)
|
||||
if (client.WechatCertificateManager == null)
|
||||
{
|
||||
throw new Exceptions.WechatTenpayResponseVerificationException($"You must set an instance of `{nameof(Settings.ICertificateStorer)}` at first.");
|
||||
throw new Exceptions.WechatTenpayResponseVerificationException($"You must set an instance of `{nameof(Settings.ICertificateManager)}` at first.");
|
||||
}
|
||||
else
|
||||
{
|
||||
string? certificate = client.WechatCertificateStorer.Get(callbackSerialNumber);
|
||||
string? certificate = client.WechatCertificateManager.GetCertificate(callbackSerialNumber);
|
||||
if (certificate == null)
|
||||
throw new Exceptions.WechatTenpayResponseVerificationException("Cannot get certificate by the serial number, may not be stored.");
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_8.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_5_8.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter5_1_19.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_1_12.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_8.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_2_8.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_3_8.shtml </para>
|
||||
@@ -108,6 +109,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_5_8.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter5_1_19.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_9_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_1_12.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer/chapter4_3.shtml </para>
|
||||
/// <para>REF: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transfer_partner/chapter4_3.shtml </para>
|
||||
/// </summary>
|
||||
|
||||
@@ -23,16 +23,16 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
|
||||
if (client == null) throw new ArgumentNullException(nameof(client));
|
||||
if (response == null) throw new ArgumentNullException(nameof(response));
|
||||
|
||||
if (client.WechatCertificateStorer == null)
|
||||
if (client.WechatCertificateManager == null)
|
||||
{
|
||||
throw new Exceptions.WechatTenpayResponseVerificationException($"You must set an instance of `{nameof(Settings.ICertificateStorer)}` at first.");
|
||||
throw new Exceptions.WechatTenpayResponseVerificationException($"You must set an instance of `{nameof(Settings.ICertificateManager)}` at first.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (response.WechatpayCertSerialNumber == null)
|
||||
throw new Exceptions.WechatTenpayResponseVerificationException("Cannot read the serial number in headers of this response.");
|
||||
|
||||
string? certificate = client.WechatCertificateStorer.Get(response.WechatpayCertSerialNumber);
|
||||
string? certificate = client.WechatCertificateManager.GetCertificate(response.WechatpayCertSerialNumber);
|
||||
if (certificate == null)
|
||||
throw new Exceptions.WechatTenpayResponseVerificationException("Cannot get certificate by the serial number, may not be stored.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user