We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 4fac680e authored by Alessio Zampatti's avatar Alessio Zampatti

Set isajax to true in Validate3d controller to prevent Invalid form key...

Set isajax to true in Validate3d controller to prevent Invalid form key error(magento 2.3), fix for capture on shipment method
parent eb2dd086
......@@ -22,6 +22,7 @@
*/
namespace Adyen\Payment\Controller\Process;
use Magento\Framework\App\Request\Http as HttpRequest;
class Validate3d extends \Magento\Framework\App\Action\Action
{
......@@ -75,6 +76,13 @@ class Validate3d extends \Magento\Framework\App\Action\Action
$this->_adyenHelper = $adyenHelper;
$this->_paymentRequest = $paymentRequest;
$this->_orderRepository = $orderRepository;
// 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);
}
}
}
/**
......
......@@ -54,7 +54,7 @@ class BeforeShipmentObserver extends AbstractDataAssignObserver
{
$shipment = $observer->getEvent()->getShipment();
$order = $shipment->getOrder();
$captureOnShipment = $this->_adyenHelper->getConfigData('capture_on_shipment', 'adyen_abstract', $order->getStoreId());
$captureOnShipment = $this->adyenHelper->getConfigData('capture_on_shipment', 'adyen_abstract', $order->getStoreId());
if ($this->isPaymentMethodAdyen($order) && $captureOnShipment) {
$payment = $order->getPayment();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment