Open Chunaravivek opened 4 months ago
they throw exceptions.
they throw exceptions.
Yes but when if $verified has false matched (verifySignature method) , will be they throw exceptions. if $verified has true, How can know if verifySignature is true ? there get return verifySignature blank value so that's reason i have found issue. There missing return $verified last line if verifySignature has true.
$isSignatureValid = $this->verifyRazorpaySignature($razorpayOrderId, $razorpayPaymentId, $razorpay_signature);
if ($isSignatureValid) {} else {}
public function verifyRazorpaySignature($razorpayOrderId, $razorpayPaymentId, $razorpaySignature)
{
return $this->utility->verifyPaymentSignature(array(
'razorpay_order_id' => $razorpayOrderId,
'razorpay_payment_id' => $razorpayPaymentId,
'razorpay_signature' => $razorpaySignature
));
}
Steps to reproduce the behavior
Expected behavior
The verifyPaymentSignature and verifyWebhookSignature methods should return the verification result (true or false) to indicate if the signature is valid.
Actual behavior
The verifyPaymentSignature and verifyWebhookSignature methods do not return any value, causing the verification result to be inaccessible.
Code snippets
Php version
PHP v8.2
Library version
razorpay-php v2.9.0
Additional Information
The methods verifyPaymentSignature and verifyWebhookSignature do not return the result of verifySignature which causes the caller to not know if the signature verification was successful. Adding return statements in these methods will resolve this issue.
Here is a possible fix for the methods: