We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64dd32b commit 86f5f01Copy full SHA for 86f5f01
1 file changed
server/Application/Handler/DatatransHandler.php
@@ -84,7 +84,7 @@ private function checkSignature(array $body, string $key): void
84
$aliasCC = $body['aliasCC'] ?? '';
85
$valueToSign = $aliasCC . @$body['merchantId'] . @$body['amount'] . @$body['currency'] . @$body['refno'];
86
$expectedSign = hash_hmac('sha256', mb_trim($valueToSign), hex2bin(mb_trim($key)));
87
- if ($expectedSign !== $body['sign']) {
+ if (!hash_equals($expectedSign, $body['sign'])) {
88
throw new Exception('Invalid HMAC signature');
89
}
90
0 commit comments