From c1baa7f74c3fc15e63eca082376b23eb728c77c5 Mon Sep 17 00:00:00 2001 From: hilrob Date: Thu, 23 May 2019 16:58:13 +0200 Subject: [PATCH] v1.3.0 Reimplemented M2.3 combatibility --- Controller/Webhooks/Index.php | 22 ++++++++++++++++- Controller/Webhooks/Twothree.php | 42 -------------------------------- Helper/Data.php | 14 ----------- RELEASE_NOTES.txt | 9 +++++++ composer.json | 6 ++--- marketplace.json | 6 ++--- 6 files changed, 36 insertions(+), 63 deletions(-) delete mode 100644 Controller/Webhooks/Twothree.php diff --git a/Controller/Webhooks/Index.php b/Controller/Webhooks/Index.php index 9994bb0..6f19938 100644 --- a/Controller/Webhooks/Index.php +++ b/Controller/Webhooks/Index.php @@ -14,12 +14,14 @@ namespace Iways\PayPalPlus\Controller\Webhooks; +use Magento\Framework\App\CsrfAwareActionInterface; +use Magento\Framework\App\Request\InvalidRequestException; use Magento\Framework\Exception\LocalizedException; /** * Unified IPN controller for all supported PayPal methods */ -class Index extends \Magento\Framework\App\Action\Action +class Index extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface { /** * @var \Psr\Log\LoggerInterface @@ -36,6 +38,24 @@ class Index extends \Magento\Framework\App\Action\Action */ protected $_apiFactory; + /** + * @param \Magento\Framework\App\RequestInterface $request + * @return bool|null + */ + public function validateForCsrf(\Magento\Framework\App\RequestInterface $request): ?bool + { + return true; + } + + /** + * @param \Magento\Framework\App\RequestInterface $request + * @return InvalidRequestException|null + */ + public function createCsrfValidationException(\Magento\Framework\App\RequestInterface $request): ?InvalidRequestException + { + return null; + } + /** * @param \Magento\Framework\App\Action\Context $context * @param \Iways\PayPalPlus\Model\Webhook\EventFactory $webhookEventFactory diff --git a/Controller/Webhooks/Twothree.php b/Controller/Webhooks/Twothree.php deleted file mode 100644 index b763784..0000000 --- a/Controller/Webhooks/Twothree.php +++ /dev/null @@ -1,42 +0,0 @@ -productMetaData->getVersion(); - if (version_compare($version, '2.3.0', '>=')) { - return str_replace( - 'http://', - 'https://', - $this->_getUrl( - 'paypalplus/webhooks/twothree/', - [ - '_forced_secure' => true, - '_nosid' => true, - ] - ) - ); - } return str_replace( 'http://', 'https://', diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 92eaab3..4d91650 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,12 @@ +==== 1.3.0 ==== +Reimplemented M2.3 combatibility +Removed M2.0 M2.1 M2.2 compatibility +Note: +M2.0 M2.1 M2.2 will be supported with v1.2.X upgrades. + +==== 1.2.4 ==== +Removed 2.3 compatibility due to problems with PHP 7.0 and M2.2.6 and the CsrfValidation in M2.3 + ==== 1.2.3 ==== Renamed PayPal-Plus to PayPal PLUS diff --git a/composer.json b/composer.json index 02832c4..debccef 100755 --- a/composer.json +++ b/composer.json @@ -6,9 +6,9 @@ {"type": "composer", "url": "https://repo.magento.com/"} ], "require": { - "php": "~7.0.0|~7.1.0|~7.2.0", + "php": "~7.1.0|~7.2.0", "paypal/rest-api-sdk-php": "^1.6", - "magento/module-paypal": "100.0.*|100.1.*|100.2.*|100.3.*" + "magento/module-paypal": "100.3.*" }, "authors": [ { @@ -19,7 +19,7 @@ } ], "type": "magento2-module", - "version": "1.2.3", + "version": "1.3.0", "license": [ "OSL-3.0" ], diff --git a/marketplace.json b/marketplace.json index e72c407..0d4bb0c 100755 --- a/marketplace.json +++ b/marketplace.json @@ -5,9 +5,9 @@ { "type": "composer", "url": "https://packagist.org" } ], "require": { - "php": "~7.0.0|~7.1.0|~7.2.0", + "php": "~7.1.0|~7.2.0", "paypal/rest-api-sdk-php": "^1.6", - "magento/module-paypal": "100.0.*|100.1.*|100.2.*|100.3.*" + "magento/module-paypal": "100.3.*" }, "authors": [ { @@ -18,7 +18,7 @@ } ], "type": "magento2-module", - "version": "1.2.3", + "version": "1.3.0", "license": [ "OSL-3.0" ],