We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit 3319303e authored by Rik ter Beek's avatar Rik ter Beek

#94 set 3dActive to empty so it will never try to do a new 3D secure payment...

#94 set 3dActive to empty so it will never try to do a new 3D secure payment for this order solving lots of issues
parent deba4ba7
...@@ -50,6 +50,11 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -50,6 +50,11 @@ class Validate3d extends \Magento\Framework\App\Action\Action
*/ */
protected $_paymentRequest; protected $_paymentRequest;
/**
* @var \Magento\Sales\Api\OrderRepositoryInterface
*/
protected $_orderRepository;
/** /**
* Validate3d constructor. * Validate3d constructor.
* *
...@@ -62,12 +67,14 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -62,12 +67,14 @@ class Validate3d extends \Magento\Framework\App\Action\Action
\Magento\Framework\App\Action\Context $context, \Magento\Framework\App\Action\Context $context,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger, \Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Model\Api\PaymentRequest $paymentRequest \Adyen\Payment\Model\Api\PaymentRequest $paymentRequest,
\Magento\Sales\Api\OrderRepositoryInterface $orderRepository
) { ) {
parent::__construct($context); parent::__construct($context);
$this->_adyenLogger = $adyenLogger; $this->_adyenLogger = $adyenLogger;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_paymentRequest = $paymentRequest; $this->_paymentRequest = $paymentRequest;
$this->_orderRepository = $orderRepository;
} }
/** /**
...@@ -86,6 +93,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -86,6 +93,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action
// check if 3D secure is active. If not just go to success page // check if 3D secure is active. If not just go to success page
if ($active) { if ($active) {
$this->_adyenLogger->addAdyenResult("3D secure is active"); $this->_adyenLogger->addAdyenResult("3D secure is active");
// check if it is already processed // check if it is already processed
...@@ -121,6 +129,10 @@ class Validate3d extends \Magento\Framework\App\Action\Action ...@@ -121,6 +129,10 @@ class Validate3d extends \Magento\Framework\App\Action\Action
// check if authorise3d was successful // check if authorise3d was successful
if ($result == 'Authorised') { if ($result == 'Authorised') {
$order->addStatusHistoryComment(__('3D-secure validation was successful'))->save(); $order->addStatusHistoryComment(__('3D-secure validation was successful'))->save();
// set back to false so when pressed back button on the success page it will reactivate 3D secure
$order->getPayment()->setAdditionalInformation('3dActive', '');
$this->_orderRepository->save($order);
$this->_redirect('checkout/onepage/success'); $this->_redirect('checkout/onepage/success');
} else { } else {
$order->addStatusHistoryComment(__('3D-secure validation was unsuccessful.'))->save(); $order->addStatusHistoryComment(__('3D-secure validation was unsuccessful.'))->save();
......
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