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 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
*/
protected $_paymentRequest;
/**
* @var \Magento\Sales\Api\OrderRepositoryInterface
*/
protected $_orderRepository;
/**
* Validate3d constructor.
*
......@@ -62,12 +67,14 @@ class Validate3d extends \Magento\Framework\App\Action\Action
\Magento\Framework\App\Action\Context $context,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\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);
$this->_adyenLogger = $adyenLogger;
$this->_adyenHelper = $adyenHelper;
$this->_paymentRequest = $paymentRequest;
$this->_orderRepository = $orderRepository;
}
/**
......@@ -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
if ($active) {
$this->_adyenLogger->addAdyenResult("3D secure is active");
// check if it is already processed
......@@ -121,6 +129,10 @@ class Validate3d extends \Magento\Framework\App\Action\Action
// check if authorise3d was successful
if ($result == 'Authorised') {
$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');
} else {
$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