Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Controller/Standard/AbstractStandard.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ protected function _retrieveQuote()
if (!$sessionQuote) {
$this->_logger->error(__("Session Quote does not exist."));
$use_checkout_api_quote = true;
} elseif ($checkout_id != $zipMoneyCheckoutId && $checkout_id != 'au-'.$zipMoneyCheckoutId) {
} elseif ($checkout_id != $zipMoneyCheckoutId && $checkout_id != 'au-' . $zipMoneyCheckoutId) {
$this->_logger->error(__("Checkout Id does not match with the session quote."));
$this->_logger->debug(__("Sesion Checkout Id: %s and Zip callback Checkout Id: %s.", $checkout_id, $zipMoneyCheckoutId));
$use_checkout_api_quote = true;
} else {
return $sessionQuote;
Expand Down Expand Up @@ -292,6 +293,13 @@ protected function _getQuoteByUsingCheckoutApi($zip_checkout_id)
->create()
->addFieldToFilter("entity_id", $quoteId)
->getFirstItem();
// update checkout id by latest checckout id in payment additional data.
if ($this->_quote) {
$additionalPaymentInfo = $this->_quote->getPayment()->getAdditionalInformation();
$additionalPaymentInfo['zip_checkout_id'] = $zip_checkout_id;
$this->_quote->getPayment()->setAdditionalInformation($additionalPaymentInfo);
$this->_quoteRepository->save($this->_quote);
}
return $this->_quote;
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->_logger->error($e->getMessage());
Expand Down Expand Up @@ -535,8 +543,10 @@ protected function _sendResponse($data, $responseCode = \Magento\Framework\Webap
*/
protected function _isResultValid()
{
if (!$this->getRequest()->getParam('result') ||
!in_array($this->getRequest()->getParam('result'), $this->_validResults)) {
if (
!$this->getRequest()->getParam('result') ||
!in_array($this->getRequest()->getParam('result'), $this->_validResults)
) {
$this->_logger->error(__("Invalid Result"));
return false;
}
Expand Down