Przeglądaj źródła

wesmiler 报恩寺项目

wesmiler 4 lat temu
rodzic
commit
f0553dfac8
1 zmienionych plików z 7 dodań i 3 usunięć
  1. 7 3
      app/Services/WechatService.php

+ 7 - 3
app/Services/WechatService.php

@@ -846,11 +846,15 @@ class WechatService extends BaseService
             return false;
         }
 
+        // 证书序列号
+        $serial = WechatService::getConfigs('wx_mch_cert_no');
+        $checkSerial = isset($notifyData['serial'])? $notifyData['serial'] : '';
+        if($serial != $checkSerial){
+            return false;
+        }
+
         return true;
         $sign = stripslashes($sign);
-        var_dump($signStr);
-        var_dump($sign);
-        var_dump($notifyData);
         $signature = base64_decode($sign);
         $publicKey = openssl_pkey_get_public(file_get_contents(self::$certPaths['cert_path']));
         return openssl_verify($signStr, $signature, $publicKey, 'sha256WithRSAEncryption');