From f0d56ab8e695759ee3cad263ad294010b37a8503 Mon Sep 17 00:00:00 2001 From: Marcus Kreusch Date: Tue, 7 Nov 2023 21:27:22 +0100 Subject: [PATCH] improved error handling --- .../amazon_pay/includes/actions/checkout_shipping.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/new_dirs/includes/modules/payment/amazon_pay/includes/actions/checkout_shipping.php b/new_dirs/includes/modules/payment/amazon_pay/includes/actions/checkout_shipping.php index 295ff20..b601238 100644 --- a/new_dirs/includes/modules/payment/amazon_pay/includes/actions/checkout_shipping.php +++ b/new_dirs/includes/modules/payment/amazon_pay/includes/actions/checkout_shipping.php @@ -9,6 +9,12 @@ $checkoutSessionId = $_GET['amazonCheckoutSessionId']; $_SESSION['amazon_checkout_session'] = $checkoutSessionId; $checkoutSession = $checkoutHelper->getCheckoutSession($checkoutSessionId); + + if (!$checkoutSession || !$checkoutSession->getCheckoutSessionId()) { + \AlkimAmazonPay\GeneralHelper::log('warning', 'invalid amazon checkout session id on checkout_shipping', [$_SESSION['amazon_checkout_session'], $checkoutSession]); + xtc_redirect(xtc_href_link(FILENAME_SHOPPING_CART)); + } + $needsMainAddress = false; if (!$accountHelper->isLoggedIn()) { if(!$checkoutSession->getBuyer()){