diff --git a/controllers/front/return.php b/controllers/front/return.php index dfa6a7979..7ea86c42c 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -204,7 +204,9 @@ protected function processGetStatus() $transactionId = $dbPayment['transaction_id'] ?: Tools::getValue('transaction_id'); - if (!isset($dbPayment) || !\Validate::isLoadedObject($cart = new Cart((int) Tools::getValue('cart_id')))) { + $cart = new Cart((int) $dbPayment['cart_id']); + + if (!isset($dbPayment) || !Validate::isLoadedObject($cart)) { exit(json_encode([ 'success' => false, ])); @@ -212,8 +214,9 @@ protected function processGetStatus() /* @phpstan-ignore-next-line */ $orderId = (int) Order::getOrderByCartId((int) $cart->id); + /** @phpstan-ignore-line */ - $order = new Order((int) $orderId); + $order = new Order($orderId); if ((int) $cart->id_customer !== (int) $this->context->customer->id) { exit(json_encode([