From c7d59a530f99dcf553d6d9c82364bcded68ce4a5 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Mon, 31 Aug 2020 12:50:01 +0200 Subject: [PATCH 1/8] (MAGE2-323)[change] Enable PHP 7.4 in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 41351f65c71..1f95f171868 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "heidelpay/magento2", "description": "This extension for Magento 2 provides a direct integration of the Heidelpay payment methods to your Magento 2 shop.", "require": { - "php": "~7.0.0|~7.1.0 |~7.2.0|~7.3.0", + "php": "~7.0.0|~7.1.0 |~7.2.0|~7.3.0|~7.4.0", "magento/module-config": "^100.0.0 | ^101.0.0 | ^102.0.0", "magento/module-store": "^100.0.0 | ^101.0.0 | ^102.0.0", "magento/module-checkout": "^100.0.0 | ^101.0.0 | ^102.0.0", From 029a27f3821a17f5a79ae2c256a5924640956751 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Mon, 31 Aug 2020 13:07:26 +0200 Subject: [PATCH 2/8] (MAGE2-323)[change] update composer.json. --- composer.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 1f95f171868..d7a6ce5b925 100755 --- a/composer.json +++ b/composer.json @@ -3,15 +3,15 @@ "description": "This extension for Magento 2 provides a direct integration of the Heidelpay payment methods to your Magento 2 shop.", "require": { "php": "~7.0.0|~7.1.0 |~7.2.0|~7.3.0|~7.4.0", - "magento/module-config": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/module-store": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/module-checkout": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/module-sales": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/module-quote": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/module-customer": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/module-payment": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/module-backend": "^100.0.0 | ^101.0.0 | ^102.0.0", - "magento/framework": "^100.0.0 | ^101.0.0 | ^102.0.0", + "magento/module-config": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/module-store": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/module-checkout": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/module-sales": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/module-quote": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/module-customer": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/module-payment": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/module-backend": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "magento/framework": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", "heidelpay/php-message-code-mapper": "~1.0", "heidelpay/php-basket-api": "~1.0", "heidelpay/php-payment-api": "~1.7", @@ -26,7 +26,7 @@ "allure-framework/allure-phpunit": "~1.2.0" }, "suggest": { - "magento/module-checkout-agreements": "^100.0.0 | ^101.0.0 | ^102.0.0" + "magento/module-checkout-agreements": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0" }, "repositories": [ { From 66fd06bb823a98be5af6d70e6943731542ccce4b Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 1 Sep 2020 12:31:04 +0200 Subject: [PATCH 3/8] (MAGE2-323)[change] - remove PHP 7.0 support - remove support for magento versions smaller then 2.3. --- Controller/HgwAbstract.php | 27 +++++++++++++++++++++------ README.md | 2 +- composer.json | 23 +++++++++++------------ 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Controller/HgwAbstract.php b/Controller/HgwAbstract.php index 4aedadf81b4..157697cd8b4 100755 --- a/Controller/HgwAbstract.php +++ b/Controller/HgwAbstract.php @@ -9,7 +9,7 @@ use Magento\Sales\Model\Order\Email\Sender\OrderSender; use Magento\Sales\Model\Order\Email\Sender\OrderCommentSender; use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; -use Netresearch\Compatibility\Controller\CsrfAware\Action as CsrfAwareAction; +use Magento\Framework\App\CsrfAwareActionInterface; /** * Abstract controller class @@ -21,7 +21,7 @@ * @subpackage Magento2 * @category Magento2 */ -abstract class HgwAbstract extends CsrfAwareAction +abstract class HgwAbstract extends CsrfAwareActionInterface { protected $resultPageFactory; protected $logger; @@ -144,14 +144,29 @@ protected function getQuote() return $this->_quote; } - protected function getCsrfExceptionResponse(RequestInterface $request) + /** + * Create exception in case CSRF validation failed. + * Return null if default exception will suffice. + * + * @param RequestInterface $request + * + * @return InvalidRequestException|null + */ + public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException { + return null; } - protected function proxyValidateForCsrf(RequestInterface $request) + /** + * Perform custom request validation. + * Return null if default validation is needed. + * + * @param RequestInterface $request + * + * @return bool|null + */ + public function validateForCsrf(RequestInterface $request): ?bool { return true; } - - } diff --git a/README.md b/README.md index 1c8e5b9fb75..a3d02fa5b7e 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/heidelpay/magento2.svg?style=flat-square)](https://packagist.org/packages/heidelpay/magento2) [![Codacy Badge](https://api.codacy.com/project/badge/grade/fb5b516ad21f44a591a58761a8c3ef42)](https://www.codacy.com/app/heidelpay/magento2/dashboard) -[![PHP 7.0](https://img.shields.io/badge/php-7.0-blue.svg)](http://www.php.net) [![PHP 7.1](https://img.shields.io/badge/php-7.1-blue.svg)](http://www.php.net) [![PHP 7.2](https://img.shields.io/badge/php-7.2-blue.svg)](http://www.php.net) [![PHP 7.3](https://img.shields.io/badge/php-7.3-blue.svg)](http://www.php.net) +[![PHP 7.4](https://img.shields.io/badge/php-7.4-blue.svg)](http://www.php.net) ![Logo](http://dev.heidelpay.com/devHeidelpay_400_180.jpg) diff --git a/composer.json b/composer.json index d7a6ce5b925..ebacc10533e 100755 --- a/composer.json +++ b/composer.json @@ -2,21 +2,20 @@ "name": "heidelpay/magento2", "description": "This extension for Magento 2 provides a direct integration of the Heidelpay payment methods to your Magento 2 shop.", "require": { - "php": "~7.0.0|~7.1.0 |~7.2.0|~7.3.0|~7.4.0", - "magento/module-config": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/module-store": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/module-checkout": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/module-sales": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/module-quote": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/module-customer": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/module-payment": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/module-backend": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", - "magento/framework": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0", + "php": "~7.1.0 |~7.2.0|~7.3.0|~7.4.0", + "magento/module-config": "^102.0.0 | ^103.0.0", + "magento/module-store": "^102.0.0 | ^103.0.0", + "magento/module-checkout": "^102.0.0 | ^103.0.0", + "magento/module-sales": "^102.0.0 | ^103.0.0", + "magento/module-quote": "^102.0.0 | ^103.0.0", + "magento/module-customer": "^102.0.0 | ^103.0.0", + "magento/module-payment": "^102.0.0 | ^103.0.0", + "magento/module-backend": "^102.0.0 | ^103.0.0", + "magento/framework": "^102.0.0 | ^103.0.0", "heidelpay/php-message-code-mapper": "~1.0", "heidelpay/php-basket-api": "~1.0", "heidelpay/php-payment-api": "~1.7", "ext-json": "*", - "netresearch/module-compatibility-m2": "*", "ext-bcmath": "*" }, "require-dev": { @@ -26,7 +25,7 @@ "allure-framework/allure-phpunit": "~1.2.0" }, "suggest": { - "magento/module-checkout-agreements": "^100.0.0 | ^101.0.0 | ^102.0.0 | ^103.0.0" + "magento/module-checkout-agreements": "^102.0.0 | ^103.0.0" }, "repositories": [ { From 3d9f5a4c0f51f199212aeb87950c4c6cd4ead118 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 1 Sep 2020 17:50:22 +0200 Subject: [PATCH 4/8] (MAGE2-323)[change] Adjust composer constraints. --- composer.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ebacc10533e..5446d2dbb10 100755 --- a/composer.json +++ b/composer.json @@ -2,15 +2,15 @@ "name": "heidelpay/magento2", "description": "This extension for Magento 2 provides a direct integration of the Heidelpay payment methods to your Magento 2 shop.", "require": { - "php": "~7.1.0 |~7.2.0|~7.3.0|~7.4.0", - "magento/module-config": "^102.0.0 | ^103.0.0", - "magento/module-store": "^102.0.0 | ^103.0.0", - "magento/module-checkout": "^102.0.0 | ^103.0.0", + "php": "~7.1.0 |~7.2.0 | ~7.3.0 | ~7.4.0", + "magento/module-config": "^101.0.0", + "magento/module-store": "^101.0.0", + "magento/module-checkout": "^100.0.0", "magento/module-sales": "^102.0.0 | ^103.0.0", - "magento/module-quote": "^102.0.0 | ^103.0.0", + "magento/module-quote": "^101.0.0", "magento/module-customer": "^102.0.0 | ^103.0.0", - "magento/module-payment": "^102.0.0 | ^103.0.0", - "magento/module-backend": "^102.0.0 | ^103.0.0", + "magento/module-payment": "^100.0.0", + "magento/module-backend": "^101.0.0 | ^102.0.0", "magento/framework": "^102.0.0 | ^103.0.0", "heidelpay/php-message-code-mapper": "~1.0", "heidelpay/php-basket-api": "~1.0", @@ -25,7 +25,7 @@ "allure-framework/allure-phpunit": "~1.2.0" }, "suggest": { - "magento/module-checkout-agreements": "^102.0.0 | ^103.0.0" + "magento/module-checkout-agreements": "^100.0.0" }, "repositories": [ { From c965d760fbb20932266d33bf297f8fd2386b97f5 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Wed, 2 Sep 2020 16:44:52 +0200 Subject: [PATCH 5/8] (MAGE2-323)[change] Adjust composer constraints. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5446d2dbb10..a35771efd08 100755 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "magento/framework": "^102.0.0 | ^103.0.0", "heidelpay/php-message-code-mapper": "~1.0", "heidelpay/php-basket-api": "~1.0", - "heidelpay/php-payment-api": "~1.7", + "heidelpay/php-payment-api": "~2.0", "ext-json": "*", "ext-bcmath": "*" }, From e59740b2a475ccaf56a1ba97e7b22410200d8452 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 3 Sep 2020 13:25:51 +0200 Subject: [PATCH 6/8] (MAGE2-323)[change] Adjust class declaration of HgwAbstract. --- Controller/HgwAbstract.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Controller/HgwAbstract.php b/Controller/HgwAbstract.php index 157697cd8b4..bd7c467ffea 100755 --- a/Controller/HgwAbstract.php +++ b/Controller/HgwAbstract.php @@ -3,13 +3,14 @@ namespace Heidelpay\Gateway\Controller; use Heidelpay\Gateway\Helper\Payment as HeidelpayHelper; +use Magento\Framework\App\Action\Action; use Magento\Framework\App\RequestInterface; -use Magento\Framework\Controller\ResultInterface; use Magento\Quote\Model\QuoteManagement; use Magento\Sales\Model\Order\Email\Sender\OrderSender; use Magento\Sales\Model\Order\Email\Sender\OrderCommentSender; use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; use Magento\Framework\App\CsrfAwareActionInterface; +use Magento\Framework\App\Request\InvalidRequestException; /** * Abstract controller class @@ -21,7 +22,7 @@ * @subpackage Magento2 * @category Magento2 */ -abstract class HgwAbstract extends CsrfAwareActionInterface +abstract class HgwAbstract extends Action implements CsrfAwareActionInterface { protected $resultPageFactory; protected $logger; From 4ae15ed57eb65b30e729b2f34c4c543ebb97d6f2 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Fri, 4 Sep 2020 11:22:05 +0200 Subject: [PATCH 7/8] (MAGE2-323)[change] Update changelog. --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6048e21f7d..078d0853695 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ This project does not follow a versioning standard. Versions are crafted after the dates; for example, the version 17.7.25 was released on July, 25th in 2017 +## 20.x.xx +### Added +- Support for PHP 7.4 and Magento 2.4 + +### Removed +- Support for PHP 7.0 +- Support for Magento versions 2.2.x and smaller. + ## 20.5.13 ### Fixed - An issue during checkout if phone number is optional and not set by customer. That leads to a failing address comparison From 281622f85b77e55f3bd2145a42832c0c0b0146ca Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Fri, 4 Sep 2020 14:20:41 +0200 Subject: [PATCH 8/8] (MAGE2-323)[change] Update readme. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a3d02fa5b7e..5d10bd739bc 100755 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ For more information please visit -http://dev.heidelpay.com/magento2/ ## SYSTEM REQUIREMENTS -This extension requires PHP 7.0, PHP 7.1, PHP 7.2 or PHP 7.3. -It also depends on the Heidelpay php-payment-api library, which will be installed along with the plugin. +This extension requires PHP 7.1, PHP 7.2, PHP 7.3 or PHP 7.4. +It also depends on the Heidelpay php-payment-api library, which will be installed along with the plugin. ## LICENSE @@ -41,7 +41,6 @@ You can find a copy of this license in [LICENSE.txt](LICENSE.txt). All versions greater than 16.10.17 are based on the heidelpay php-api. (https://github.com/heidelpay/php-api). All versions greater than 18.3.1 are based on the heidelpay php-payment-api. (https://github.com/heidelpay/php-payment-api). Please visit https://dev.heidelpay.com/PhpPaymentApi/ for the developer documentation. - ## Installation