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 b541b3f8 authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Fix swish payment methods when running it with the swish app (#793)

* For some payment methods like swish with resultCode pending we store this into the property adyenPaymentData instead of paymentData. Check if adyenPaymentData exists if so add this as paymentData in request. This will solve issues for Swish payment method. We need to refactor a lot of code to make everywhere to use consistency in the naming this will be a separate story to be picked up.

* Update Controller/Process/Result.php

* Update Controller/Process/Result.php

* Update Controller/Process/Result.php
Co-authored-by: default avatarAlessio Zampatti <alessio.zampatti@adyen.com>
Co-authored-by: default avatarÁngel Campos <angel.campos@adyen.com>
Co-authored-by: default avatarAlessio Zampatti <alessio.zampatti@adyen.com>
parent cc3cd0d0
......@@ -390,11 +390,29 @@ class Result extends \Magento\Framework\App\Action\Action
$request = [];
if (!empty($this->_session->getLastRealOrder()) &&
!empty($this->_session->getLastRealOrder()->getPayment()) &&
!empty($this->_session->getLastRealOrder()->getPayment()->getAdditionalInformation("paymentData"))
!empty($this->_session->getLastRealOrder()->getPayment())
) {
$request['paymentData'] = $this->_session->getLastRealOrder()->getPayment()->
getAdditionalInformation("paymentData");
if (!empty($this->_session->getLastRealOrder()->getPayment()->getAdditionalInformation('paymentData'))) {
$request['paymentData'] = $this->_session->getLastRealOrder()->getPayment()->
getAdditionalInformation('paymentData');
// remove paymentData from db
$this->_session->getLastRealOrder()->getPayment()->unsAdditionalInformation('paymentData');
$this->_session->getLastRealOrder()->getPayment()->save();
}
// for pending payment that redirect we store this under adyenPaymentData
// TODO: refactor the code in the plugin that all paymentData is stored in paymentData and not in adyenPaymentData
if (!empty($this->_session->getLastRealOrder()->getPayment()->getAdditionalInformation('adyenPaymentData'))) {
$request['paymentData'] = $this->_session->getLastRealOrder()->getPayment()->
getAdditionalInformation("adyenPaymentData");
// remove paymentData from db
$this->_session->getLastRealOrder()->getPayment()->unsAdditionalInformation('adyenPaymentData');
$this->_session->getLastRealOrder()->getPayment()->save();
}
} else {
$this->_adyenLogger->addError("Can't load the order id from the session");
}
$request["details"] = $response;
......
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