diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientEventExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientEventExtensions.cs index 8c92f778..95662b24 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientEventExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientEventExtensions.cs @@ -40,7 +40,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api if (callbackJson.Contains("\"Encrypt\"")) { if (string.IsNullOrEmpty(client.Credentials.PushEncodingAESKey)) - throw new Exceptions.WechatApiEventSerializationException("Decrypt event failed, because there is no encoding AES key."); + throw new Exceptions.WechatApiEventSerializationException("Failed to decrypt event data, because there is no encoding AES key."); InnerEncryptedEvent encryptedEvent = client.JsonSerializer.Deserialize(callbackJson); callbackJson = Utilities.WxMsgCryptor.AESDecrypt(cipherText: encryptedEvent.EncryptedData, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _); @@ -54,7 +54,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } catch (Exception ex) { - throw new Exceptions.WechatApiEventSerializationException("Deserialize event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatApiEventSerializationException("Failed to deserialize event data. Please see the inner exception for more details.", ex); } } @@ -69,7 +69,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api if (callbackXml.Contains("") && callbackXml.Contains("")) { if (!Utilities.WxMsgCryptor.TryParseXml(callbackXml, out string encryptedXml)) - throw new Exceptions.WechatApiEventSerializationException("Decrypt event failed, because of empty encrypted data."); + throw new Exceptions.WechatApiEventSerializationException("Failed to decrypt event data, because of empty encrypted data."); callbackXml = Utilities.WxMsgCryptor.AESDecrypt(cipherText: encryptedXml, encodingAESKey: client.Credentials.PushEncodingAESKey!, out _); } @@ -82,7 +82,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } catch (Exception ex) { - throw new Exceptions.WechatApiEventSerializationException("Deserialize event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatApiEventSerializationException("Failed to deserialize event data. Please see the inner exception for more details.", ex); } } @@ -153,15 +153,15 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } catch (Exception ex) { - throw new Exceptions.WechatApiEventSerializationException("Serialize event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatApiEventSerializationException("Failed to serialize event data. Please see the inner exception for more details.", ex); } if (safety) { if (string.IsNullOrEmpty(client.Credentials.PushEncodingAESKey)) - throw new Exceptions.WechatApiEventSerializationException("Encrypt event failed, because there is no encoding AES key."); + throw new Exceptions.WechatApiEventSerializationException("Failed to encrypt event data, because there is no encoding AES key."); if (string.IsNullOrEmpty(client.Credentials.PushToken)) - throw new Exceptions.WechatApiEventSerializationException("Encrypt event failed, because there is no token."); + throw new Exceptions.WechatApiEventSerializationException("Failed to encrypt event data, because there is no token."); try { @@ -189,7 +189,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } catch (Exception ex) { - throw new Exceptions.WechatApiEventSerializationException("Encrypt event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatApiEventSerializationException("Failed to encrypt event data. Please see the inner exception for more details.", ex); } } @@ -215,15 +215,15 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } catch (Exception ex) { - throw new Exceptions.WechatApiEventSerializationException("Serialize event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatApiEventSerializationException("Failed to serialize event data. Please see the inner exception for more details.", ex); } if (safety) { if (string.IsNullOrEmpty(client.Credentials.PushEncodingAESKey)) - throw new Exceptions.WechatApiEventSerializationException("Encrypt event failed, because there is no encoding AES key."); + throw new Exceptions.WechatApiEventSerializationException("Failed to encrypt event data, because there is no encoding AES key."); if (string.IsNullOrEmpty(client.Credentials.PushToken)) - throw new Exceptions.WechatApiEventSerializationException("Encrypt event failed, because there is no token."); + throw new Exceptions.WechatApiEventSerializationException("Failed to encrypt event data, because there is no token."); try { @@ -237,7 +237,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } catch (Exception ex) { - throw new Exceptions.WechatApiEventSerializationException("Encrypt event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatApiEventSerializationException("Failed to encrypt event data. Please see the inner exception for more details.", ex); } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientEventExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientEventExtensions.cs index fb9bec73..3e634c48 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientEventExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Extensions/WechatOpenAIClientEventExtensions.cs @@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI try { if (!Utilities.WxMsgCryptor.TryParseXml(callbackXml, out string? encryptedXml)) - throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed, because of empty encrypted data."); + throw new Exceptions.WechatOpenAIEventSerializationException("Failed to encrypt event data, because of empty encrypted data."); callbackXml = Utilities.WxMsgCryptor.AESDecrypt(cipherText: encryptedXml!, encodingAESKey: client.Credentials.EncodingAESKey!, out _); return Utilities.XmlUtility.Deserialize(callbackXml); @@ -27,7 +27,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI } catch (Exception ex) { - throw new Exceptions.WechatOpenAIEventSerializationException("Deserialize event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatOpenAIEventSerializationException("Failed to deserialize event data. Please see the inner exception for more details.", ex); } } @@ -73,13 +73,13 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI } catch (Exception ex) { - throw new Exceptions.WechatOpenAIEventSerializationException("Serialize event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatOpenAIEventSerializationException("Failed to serialize event data. Please see the inner exception for more details.", ex); } if (string.IsNullOrEmpty(client.Credentials.EncodingAESKey)) - throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed, because there is no encoding AES key."); + throw new Exceptions.WechatOpenAIEventSerializationException("Failed to encrypt event data, because there is no encoding AES key."); if (string.IsNullOrEmpty(client.Credentials.Token)) - throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed, because there is no token."); + throw new Exceptions.WechatOpenAIEventSerializationException("Failed to encrypt event data, because there is no token."); try { @@ -93,7 +93,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI } catch (Exception ex) { - throw new Exceptions.WechatOpenAIEventSerializationException("Encrypt event failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatOpenAIEventSerializationException("Failed to encrypt event data. Please see the inner exception for more details.", ex); } return xml; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientEventVerificationExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientEventVerificationExtensions.cs index 2df5bdf2..b3d9d0d4 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientEventVerificationExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientEventVerificationExtensions.cs @@ -39,7 +39,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness if (error != null) { - error = new Exceptions.WechatTenpayBusinessEventVerificationException("Verify signature of event failed. Please see the `InnerException` for more details.", error); + error = new Exceptions.WechatTenpayBusinessEventVerificationException("Verify signature of event failed. Please see the inner exception for more details.", error); } return ret; @@ -150,7 +150,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness if (error != null) { - error = new Exceptions.WechatTenpayBusinessEventVerificationException("Verify signature of event failed. Please see the `InnerException` for more details.", error); + error = new Exceptions.WechatTenpayBusinessEventVerificationException("Verify signature of event failed. Please see the inner exception for more details.", error); } return ret; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientRequestEncryptionExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientRequestEncryptionExtensions.cs index 047ed1df..fb98c47d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientRequestEncryptionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientRequestEncryptionExtensions.cs @@ -54,7 +54,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness } catch (Exception ex) when (!(ex is Exceptions.WechatTenpayBusinessRequestEncryptionException)) { - throw new Exceptions.WechatTenpayBusinessRequestEncryptionException("Encrypt request failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayBusinessRequestEncryptionException("Failed to encrypt request. Please see the inner exception for more details.", ex); } return request; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseDecryptionExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseDecryptionExtensions.cs index 768be45d..90b5a145 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseDecryptionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseDecryptionExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Reflection; @@ -19,7 +19,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness if (response == null) throw new ArgumentNullException(nameof(response)); if (!response.IsSuccessful()) - throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Decrypt response failed, because the response is not successful."); + throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Failed to decrypt response, because the response is not successful."); try { @@ -29,7 +29,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness if (response.TBEPEncryption is null) throw new InvalidOperationException("Could not read value of `TBEP-Encrypt`."); if (response.TBEPEncryption.CertificateSerialNumber != client.Credentials.PlatformCertificateSerialNumber) - throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Decrypt response failed, because there is no platform certificate matched the serial number."); + throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Failed to decrypt response, because there is no platform certificate matched the serial number."); if (Constants.EncryptionAlgorithms.RSA_OAEP_WITH_SM4_128_CBC.Equals(response.TBEPEncryption.Algorithm)) { @@ -55,7 +55,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness } catch (Exception ex) when (!(ex is Exceptions.WechatTenpayBusinessResponseDecryptionException)) { - throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Decrypt response failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayBusinessResponseDecryptionException("Failed to decrypt response. Please see the inner exception for more details.", ex); } return response; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseVerificationExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseVerificationExtensions.cs index 2416d20b..a5afd307 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseVerificationExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Extensions/WechatTenpayBusinessClientResponseVerificationExtensions.cs @@ -41,7 +41,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness if (error != null) { - error = new Exceptions.WechatTenpayBusinessResponseVerificationException("Verify signature of response failed. Please see the `InnerException` for more details.", error); + error = new Exceptions.WechatTenpayBusinessResponseVerificationException("Verify signature of response failed. Please see the inner exception for more details.", error); } return ret; @@ -150,7 +150,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness if (error != null) { - error = new Exceptions.WechatTenpayBusinessResponseVerificationException("Verify signature of response failed. Please see the `InnerException` for more details.", error); + error = new Exceptions.WechatTenpayBusinessResponseVerificationException("Verify signature of response failed. Please see the inner exception for more details.", error); } return ret; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Interceptors/WechatTenpayBusinessRequestSignatureInterceptor.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Interceptors/WechatTenpayBusinessRequestSignatureInterceptor.cs index 44b8836a..ee7b7a72 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Interceptors/WechatTenpayBusinessRequestSignatureInterceptor.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Interceptors/WechatTenpayBusinessRequestSignatureInterceptor.cs @@ -59,7 +59,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Interceptors } catch (Exception ex) { - throw new Exceptions.WechatTenpayBusinessRequestSignatureException("Generate signature of request failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayBusinessRequestSignatureException("Failed to generate signature of request. Please see the inner exception for more details.", ex); } } break; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventDecryptionExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventDecryptionExtensions.cs index f9673473..fd6fefa5 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventDecryptionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventDecryptionExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; namespace SKIT.FlurlHttpClient.Wechat.TenpayV2 @@ -49,7 +49,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2 } catch (Exception ex) { - throw new Exceptions.WechatTenpayEventDecryptionException("Decrypt event resource failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayEventDecryptionException("Failed to decrypt event resource data. Please see the inner exception for more details.", ex); } return client.JsonSerializer.Deserialize(plainJson); diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventVerificationExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventVerificationExtensions.cs index b9479dfa..4c4f65b2 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventVerificationExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Extensions/WechatTenpayClientEventVerificationExtensions.cs @@ -55,7 +55,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2 } catch (Exception ex) { - error = new Exceptions.WechatTenpayEventVerificationException("Verify signature of event failed. Please see the `InnerException` for more details.", ex); + error = new Exceptions.WechatTenpayEventVerificationException("Verify signature of event failed. Please see the inner exception for more details.", ex); return false; } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs index 783f19fd..5cf5accf 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs @@ -110,7 +110,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2 } catch (Exception ex) { - throw new Exceptions.WechatTenpayRequestSignatureException("Generate signature of request failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayRequestSignatureException("Failed to generate signature of request. Please see the inner exception for more details.", ex); } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventDecryptionExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventDecryptionExtensions.cs index 12b8393e..138f4574 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventDecryptionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventDecryptionExtensions.cs @@ -67,7 +67,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 } catch (Exception ex) { - throw new Exceptions.WechatTenpayEventDecryptionException("Decrypt event resource failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayEventDecryptionException("Failed to decrypt event resource data. Please see the inner exception for more details.", ex); } } break; @@ -92,7 +92,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 } catch (Exception ex) { - throw new Exceptions.WechatTenpayEventDecryptionException("Decrypt event resource failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayEventDecryptionException("Failed to decrypt event resource data. Please see the inner exception for more details.", ex); } } break; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventVerificationExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventVerificationExtensions.cs index fb37abdd..aa89d494 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventVerificationExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientEventVerificationExtensions.cs @@ -123,7 +123,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 if (error != null) { - error = new Exceptions.WechatTenpayEventVerificationException("Verify signature of event failed. Please see the `InnerException` for more details.", error); + error = new Exceptions.WechatTenpayEventVerificationException("Verify signature of event failed. Please see the inner exception for more details.", error); } return ret; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientRequestEncryptionExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientRequestEncryptionExtensions.cs index 42e8c64a..dacddbca 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientRequestEncryptionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientRequestEncryptionExtensions.cs @@ -22,7 +22,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 return (false, oldValue); if (client.PlatformCertificateManager == null) - throw new Exceptions.WechatTenpayRequestEncryptionException("Encrypt request failed, because the platform certificate manager is not initialized."); + throw new Exceptions.WechatTenpayRequestEncryptionException("Failed to encrypt request, because the platform certificate manager is not initialized."); string certificate; if (string.IsNullOrEmpty(request.WechatpayCertificateSerialNumber)) @@ -33,7 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 .OrderByDescending(e => e.ExpireTime); if (!entries.Any()) { - throw new Exceptions.WechatTenpayEventVerificationException("Encrypt request failed, because there is no platform certificate in the manager, please make sure you have downloaded platform certificates first."); + throw new Exceptions.WechatTenpayEventVerificationException("Failed to encrypt request, because there is no platform certificate in the manager, please make sure you have downloaded platform certificates first."); } var entry = entries.First(); @@ -46,7 +46,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 var entry = client.PlatformCertificateManager.GetEntry(request.WechatpayCertificateSerialNumber!); if (!entry.HasValue) { - throw new Exceptions.WechatTenpayEventVerificationException($"Encrypt request failed, because there is no platform certificate matched the serial number: \"{request.WechatpayCertificateSerialNumber}\", please make sure you have downloaded platform certificates first."); + throw new Exceptions.WechatTenpayEventVerificationException($"Failed to encrypt request, because there is no platform certificate matched the serial number: \"{request.WechatpayCertificateSerialNumber}\", please make sure you have downloaded platform certificates first."); } certificate = entry.Value.Certificate; @@ -97,7 +97,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 return (false, oldValue); if (client.PlatformCertificateManager == null) - throw new Exceptions.WechatTenpayRequestEncryptionException("Encrypt request failed, because the platform certificate manager is not initialized."); + throw new Exceptions.WechatTenpayRequestEncryptionException("Failed to encrypt request, because the platform certificate manager is not initialized."); string certificate; if (string.IsNullOrEmpty(request.WechatpayCertificateSerialNumber)) @@ -108,7 +108,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 .OrderByDescending(e => e.ExpireTime); if (!entries.Any()) { - throw new Exceptions.WechatTenpayEventVerificationException("Encrypt request failed, because there is no platform certificate in the manager, please make sure you have downloaded platform certificates first."); + throw new Exceptions.WechatTenpayEventVerificationException("Failed to encrypt request, because there is no platform certificate in the manager, please make sure you have downloaded platform certificates first."); } var entry = entries.First(); @@ -121,7 +121,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 var entry = client.PlatformCertificateManager.GetEntry(request.WechatpayCertificateSerialNumber!); if (!entry.HasValue) { - throw new Exceptions.WechatTenpayEventVerificationException($"Encrypt request failed, because there is no platform certificate matched the serial number: \"{request.WechatpayCertificateSerialNumber}\", please make sure you have downloaded platform certificates first."); + throw new Exceptions.WechatTenpayEventVerificationException($"Failed to encrypt request, because there is no platform certificate matched the serial number: \"{request.WechatpayCertificateSerialNumber}\", please make sure you have downloaded platform certificates first."); } certificate = entry.Value.Certificate; @@ -187,7 +187,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 } catch (Exception ex) { - throw new Exceptions.WechatTenpayRequestEncryptionException("Encrypt request failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayRequestEncryptionException("Failed to encrypt request. Please see the inner exception for more details.", ex); } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseDecryptionExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseDecryptionExtensions.cs index 54d64b99..b43dede1 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseDecryptionExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseDecryptionExtensions.cs @@ -26,7 +26,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 case Constants.EncryptionAlgorithms.AEAD_AES_256_GCM: { if (string.IsNullOrEmpty(client.Credentials.MerchantCertificatePrivateKey)) - throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed, because there is no merchant private key."); + throw new Exceptions.WechatTenpayResponseDecryptionException("Failed to decrypt response, because there is no merchant private key."); certificate.EncryptCertificate.CipherText = Utilities.AESUtility.DecryptWithGCM( key: client.Credentials.MerchantV3Secret, @@ -40,7 +40,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 case Constants.EncryptionAlgorithms.AEAD_SM4_128_GCM: { if (string.IsNullOrEmpty(client.Credentials.MerchantV3Secret)) - throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed, because there is no merchant APIv3 secret."); + throw new Exceptions.WechatTenpayResponseDecryptionException("Failed to decrypt response, because there is no merchant APIv3 secret."); // REF: https://pay.weixin.qq.com/docs/merchant/development/shangmi/guide.html // 由于 SM4 密钥长度的限制,密钥由 APIv3 密钥通过国密 SM3 Hash 计算生成。SM4 密钥取其摘要(256bit)的前 128bit。 @@ -160,7 +160,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 if (response == null) throw new ArgumentNullException(nameof(response)); if (!response.IsSuccessful()) - throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed, because the response is not successful."); + throw new Exceptions.WechatTenpayResponseDecryptionException("Failed to decrypt response, because the response is not successful."); try { @@ -192,7 +192,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 } catch (Exception ex) { - throw new Exceptions.WechatTenpayResponseDecryptionException("Decrypt response failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayResponseDecryptionException("Failed to decrypt response. Please see the inner exception for more details.", ex); } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseVerificationExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseVerificationExtensions.cs index 66c56021..c886e3d2 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseVerificationExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientResponseVerificationExtensions.cs @@ -167,7 +167,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 if (error != null) { - error = new Exceptions.WechatTenpayEventVerificationException("Verify signature of response failed. Please see the `InnerException` for more details.", error); + error = new Exceptions.WechatTenpayEventVerificationException("Verify signature of response failed. Please see the inner exception for more details.", error); } return ret; diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Interceptors/WechatTenpayRequestSignatureInterceptor.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Interceptors/WechatTenpayRequestSignatureInterceptor.cs index 8e34ffbe..3a30f796 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Interceptors/WechatTenpayRequestSignatureInterceptor.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Interceptors/WechatTenpayRequestSignatureInterceptor.cs @@ -59,7 +59,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Interceptors } catch (Exception ex) { - throw new Exceptions.WechatTenpayRequestSignatureException("Generate signature of request failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayRequestSignatureException("Failed to generate signature of request. Please see the inner exception for more details.", ex); } } break; @@ -72,7 +72,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Interceptors } catch (Exception ex) { - throw new Exceptions.WechatTenpayRequestSignatureException("Generate signature of request failed. Please see the `InnerException` for more details.", ex); + throw new Exceptions.WechatTenpayRequestSignatureException("Failed to generate signature of request. Please see the inner exception for more details.", ex); } } break;