diff --git a/Controller/Payment/Webhook.php b/Controller/Payment/Webhook.php index 749d8d5f..72cce1fc 100644 --- a/Controller/Payment/Webhook.php +++ b/Controller/Payment/Webhook.php @@ -10,7 +10,7 @@ use Magento\Framework\App\Request\InvalidRequestException; use Magento\Framework\App\RequestInterface; -class Webhook extends \Razorpay\Magento\Controller\BaseController implements CsrfAwareActionInterface +class Webhook extends \Razorpay\Magento\Controller\BaseController { /** * @var \Magento\Checkout\Model\Session @@ -89,23 +89,6 @@ public function __construct( $this->customerRepository = $customerRepository; } - /** - * @inheritDoc - */ - public function createCsrfValidationException( - RequestInterface $request - ): ?InvalidRequestException { - return true; - } - - /** - * @inheritDoc - */ - public function validateForCsrf(RequestInterface $request): ?bool - { - return true; - } - /** * Processes the incoming webhook */ diff --git a/Plugin/CsrfValidatorSkip.php b/Plugin/CsrfValidatorSkip.php new file mode 100644 index 00000000..80a69f49 --- /dev/null +++ b/Plugin/CsrfValidatorSkip.php @@ -0,0 +1,22 @@ +getModuleName() == 'razorpay') { + //return; // Skip CSRF check + } + $proceed($request, $action); // Proceed Magento 2 core functionalities + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index ce375af9..00299290 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "razorpay/magento", "description": "Razorpay Magento 2.0 plugin for accepting payments.", - "version": "2.9.0", + "version": "2.9.1", "require": { "php": "~5.5.0|~5.6.0|^7.0", "razorpay/razorpay": "2.*" diff --git a/etc/di.xml b/etc/di.xml new file mode 100644 index 00000000..292bc53b --- /dev/null +++ b/etc/di.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/etc/module.xml b/etc/module.xml index 0e161517..600dab72 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +