Skip to content

Commit

Permalink
Fix RedirectToBoldCheckoutObserver compatibility. (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-bystritskyi authored Aug 19, 2024
1 parent a0b0003 commit 5aea22c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Observer/Checkout/RedirectToBoldCheckoutObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Bold\Checkout\Model\ConfigInterface;
use Bold\Checkout\Model\Order\InitOrderFromQuote;
use Bold\Checkout\Model\Order\ResumeOrder;
use Bold\Checkout\Model\Quote\QuoteExtensionDataFactory;
use Bold\Checkout\Model\RedirectToBoldCheckout\IsOrderInitializationAllowedInterface;
use Bold\Checkout\Model\RedirectToBoldCheckout\IsRedirectToBoldCheckoutAllowedInterface;
use Exception;
Expand Down Expand Up @@ -156,12 +155,16 @@ private function getPublicOrderIdForCart(int $cartId): string
->getPublicOrderId() ?? '';
}

private function resumeExistingCart(CartInterface $cart): array|null
/**
* @param CartInterface $cart
* @return array|null
*/
private function resumeExistingCart(CartInterface $cart): ?array
{
try {
$publicOrderId = $this->getPublicOrderIdForCart((int) $cart->getId());
return $this->resumeOrder->resume($cart, $publicOrderId);
} catch (NoSuchEntityException|LocalizedException) {
} catch (NoSuchEntityException|LocalizedException $exception) {
return null;
}
}
Expand Down

0 comments on commit 5aea22c

Please sign in to comment.