Skip to content

Commit

Permalink
CGRE-280: Fix issue when reserved order id removed from quote
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr Klymenko committed Mar 22, 2021
1 parent b622e5c commit a9ae97b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Model/TransactionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,13 @@ private function placeOrder(QuoteInterface $vippsQuote, Transaction $transaction
$quote = $this->cartRepository->get($vippsQuote->getQuoteId());
if (!$quote) {
throw new \Exception( //@codingStandardsIgnoreLine
__('Could not place order. Could not find quote with such reserved order id.')
__('Could not place order. Could not find quote.')
);
}

if ($quote->getReservedOrderId() !== $vippsQuote->getReservedOrderId()) {
if ($vippsQuote->getReservedOrderId()
&& $quote->getReservedOrderId() !== $vippsQuote->getReservedOrderId()
) {
$quote->setReservedOrderId($vippsQuote->getReservedOrderId());
$this->cartRepository->save($quote);
}
Expand Down

0 comments on commit a9ae97b

Please sign in to comment.