fix(tenpayv3): 修复解密响应中敏感数据中部分情况下抛出异常的问题

This commit is contained in:
Fu Diwei
2024-02-19 19:41:31 +08:00
parent f6c23b8c45
commit 0655a28b89

View File

@@ -34,8 +34,8 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
{
case EncryptionAlgorithms.AEAD_AES_256_GCM:
{
if (string.IsNullOrEmpty(client.Credentials.MerchantCertificatePrivateKey))
throw new WechatTenpayException("Failed to decrypt response, because the merchant private key is not set.");
if (string.IsNullOrEmpty(client.Credentials.MerchantV3Secret))
throw new WechatTenpayException("Failed to decrypt response, because the merchant APIv3 secret is not set.");
certificate.EncryptCertificate.CipherText = AESUtility.DecryptWithGCM(
encodingKey: new EncodedString(client.Credentials.MerchantV3Secret, EncodingKinds.Literal),