Browse Source

fix replace

tags/2.0.3
0nepeop1e 3 years ago
parent
commit
714d7d6b34
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/SenangPayDriver.php

+ 2
- 1
src/SenangPayDriver.php View File

@@ -89,7 +89,8 @@ class SenangPayDriver implements PaymentGatewayDriver
89 89
     public function computeHash($payload)
90 90
     {
91 91
         $query = http_build_query($payload);
92
-        $query = preg_replace('/(^|&)hash=[^&]*($|&)/','$1hash=[HASH]$2', $query);
92
+        $key = preg_quote(http_build_query([$this->keyMap['hash']=>'']), '/');
93
+        $query = preg_replace('/(^|&)'.$key.'[^&]*($|&)/','$1hash=[HASH]$2', $query);
93 94
         return md5($this->secret_key . '?' . $query);
94 95
     }
95 96
 }

Loading…
Cancel
Save