|
@@ -64,6 +64,7 @@ class PayUtil
|
|
|
|
|
|
public function checkSign($signature, $data)
|
|
|
{
|
|
|
+ dd($this->verifySign_sort($signature,$data,$this->config['huiRsaPublicKey']));
|
|
|
return $this->verifySign_sort($signature,$data,$this->config['huiRsaPublicKey']);
|
|
|
}
|
|
|
|
|
@@ -101,7 +102,12 @@ class PayUtil
|
|
|
{
|
|
|
$key = "-----BEGIN PUBLIC KEY-----\n" . wordwrap($rsaPublicKey, 64, "\n", true) . "\n-----END PUBLIC KEY-----";
|
|
|
ksort($data);
|
|
|
- return openssl_verify(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), base64_decode($signature), $key, $alg);
|
|
|
+ try {
|
|
|
+ return openssl_verify(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), base64_decode($signature), $key, $alg);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $this->message = $e->getMessage();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private function success($message = '', $data = [])
|