Skip to content

Commit

Permalink
fixed webhook signature mismatch in case json_encode/decode issue (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramth05 authored Jun 3, 2021
1 parent 9da0934 commit f117540
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Controller/Payment/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ public function execute()

try
{
$this->rzp->utility->verifyWebhookSignature(json_encode($post), $_SERVER['HTTP_X_RAZORPAY_SIGNATURE'], $webhookSecret);
$postData = file_get_contents('php://input');

$this->rzp->utility->verifyWebhookSignature($postData, $_SERVER['HTTP_X_RAZORPAY_SIGNATURE'], $webhookSecret);
}
catch (Errors\SignatureVerificationError $e)
{
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "razorpay/magento",
"description": "Razorpay Magento 2.0 plugin for accepting payments.",
"version": "3.5.2",
"version": "3.5.3",
"require": {
"php": "~5.5.0|~5.6.0|^7.0",
"razorpay/razorpay": "2.*"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Razorpay_Magento" setup_version="3.5.2">
<module name="Razorpay_Magento" setup_version="3.5.3">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down

0 comments on commit f117540

Please sign in to comment.