Skip to content

Commit

Permalink
PW-818: Fix for Magento 2.3 compatibility (#357)
Browse files Browse the repository at this point in the history
* PW-818: Fix for Magento 2.3 compatibility

* Set only the isAjax param instead of setting everything again
  • Loading branch information
Aleffio committed Dec 11, 2018
1 parent 305271e commit 9589d4a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Controller/Process/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
namespace Adyen\Payment\Controller\Process;

use Symfony\Component\Config\Definition\Exception\Exception;
use Magento\Framework\App\Request\Http as HttpRequest;

/**
* Class Json
Expand Down Expand Up @@ -69,6 +70,14 @@ public function __construct(
$this->_resultFactory = $context->getResultFactory();
$this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;

// Fix for Magento2.3 adding isAjax to the request params
if(interface_exists("\Magento\Framework\App\CsrfAwareActionInterface")) {
$request = $this->getRequest();
if ($request instanceof HttpRequest && $request->isPost()) {
$request->setParam('isAjax', true);
}
}
}

/**
Expand Down

0 comments on commit 9589d4a

Please sign in to comment.