Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #145 from heidelpay/MAGE2-323/magento_2.4_compatib…
Browse files Browse the repository at this point in the history
…ility

Mage2 323/magento 2.4 compatibility
  • Loading branch information
Ryouzanpaku authored Sep 4, 2020
2 parents e0a0715 + 281622f commit ef5912e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 24 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 23 additions & 7 deletions Controller/HgwAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 Netresearch\Compatibility\Controller\CsrfAware\Action as CsrfAwareAction;
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\Request\InvalidRequestException;

/**
* Abstract controller class
Expand All @@ -21,7 +22,7 @@
* @subpackage Magento2
* @category Magento2
*/
abstract class HgwAbstract extends CsrfAwareAction
abstract class HgwAbstract extends Action implements CsrfAwareActionInterface
{
protected $resultPageFactory;
protected $logger;
Expand Down Expand Up @@ -144,14 +145,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;
}


}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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

Expand All @@ -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


Expand Down
25 changes: 12 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"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",
"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": "^101.0.0",
"magento/module-customer": "^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",
"heidelpay/php-payment-api": "~1.7",
"heidelpay/php-payment-api": "~2.0",
"ext-json": "*",
"netresearch/module-compatibility-m2": "*",
"ext-bcmath": "*"
},
"require-dev": {
Expand All @@ -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"
"magento/module-checkout-agreements": "^100.0.0"
},
"repositories": [
{
Expand Down

0 comments on commit ef5912e

Please sign in to comment.