1
0
Roc 11 сар өмнө
parent
commit
3f6379780a

+ 1 - 1
src/Essensoft.Paylink.WeChatPay/V3/WeChatPayClient.cs

@@ -265,7 +265,7 @@ namespace Essensoft.Paylink.WeChatPay.V3
                 throw new WeChatPayException($"sign check fail: {nameof(headers.Signature)} is empty!");
             }
 
-            if (headers.Serial.StartsWith("PUB_KEY_ID_")) // 微信支付公钥
+            if (headers.Serial.StartsWith(WeChatPayConsts.WeChatPayPublicKeyIdPrefix)) // 微信支付公钥
             {
                 if (!string.IsNullOrEmpty(options.WeChatPayPublicKeyId) && headers.Serial == options.WeChatPayPublicKeyId)
                 {

+ 1 - 1
src/Essensoft.Paylink.WeChatPay/V3/WeChatPayNotifyClient.cs

@@ -114,7 +114,7 @@ namespace Essensoft.Paylink.WeChatPay.V3
                 throw new WeChatPayException("sign check fail: body is empty!");
             }
 
-            if(headers.Serial.StartsWith("PUB_KEY_ID_")) // 微信支付公钥
+            if(headers.Serial.StartsWith(WeChatPayConsts.WeChatPayPublicKeyIdPrefix)) // 微信支付公钥
             {
                 if (!string.IsNullOrEmpty(options.WeChatPayPublicKeyId) && headers.Serial == options.WeChatPayPublicKeyId)
                 {

+ 2 - 0
src/Essensoft.Paylink.WeChatPay/WeChatPayConsts.cs

@@ -41,5 +41,7 @@
         public const string Wechatpay_Timestamp = "Wechatpay-Timestamp";
         public const string Wechatpay_Nonce = "Wechatpay-Nonce";
         public const string Wechatpay_Signature = "Wechatpay-Signature";
+
+        public const string WeChatPayPublicKeyIdPrefix = "PUB_KEY_ID_";
     }
 }