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 6cfc68a0 authored by Alessio Zampatti's avatar Alessio Zampatti Committed by GitHub

PW-1059: add check for additionalData (#411)

* add check for additionalData

* Remove todo
parent e6c3ffd5
......@@ -148,7 +148,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action
$result = $this->_authorise3d($order->getPayment());
$responseCode = $result['resultCode'];
} catch (\Exception $e) {
$this->_adyenLogger->addAdyenResult("Process 3D secure payment was refused");
$this->_adyenLogger->addAdyenResult("Process 3D secure payment was refused with reason: " . $e->getMessage());
$responseCode = 'Refused';
}
......@@ -166,11 +166,10 @@ class Validate3d extends \Magento\Framework\App\Action\Action
$order->getPayment()->setAdditionalInformation('3dSuccess', true);
// TODO: add better checks if variables are available in the result
if (!$this->_adyenHelper->isCreditCardVaultEnabled()) {
if (!empty($result['additionalData']) && !$this->_adyenHelper->isCreditCardVaultEnabled()) {
$this->_adyenHelper->createAdyenBillingAgreement($order, $result['additionalData']);
} elseif (!empty($result['additionalData']) &&
!empty($additionalData['recurring.recurringDetailReference'])
!empty($result['additionalData']['recurring.recurringDetailReference'])
) {
try {
$additionalData = $result['additionalData'];
......
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