From d1a73a3ecdca7c0e619c6df9e7b954d7b914b13f Mon Sep 17 00:00:00 2001 From: Matt75 <5262628+Matt75@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:01:28 +0200 Subject: [PATCH] Fix fatal type error on cancel --- controllers/front/cancel.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/front/cancel.php b/controllers/front/cancel.php index d0ced054e..6581a3a0b 100644 --- a/controllers/front/cancel.php +++ b/controllers/front/cancel.php @@ -70,7 +70,9 @@ public function postProcess() $isExpressCheckout = isset($bodyValues['isExpressCheckout']) && $bodyValues['isExpressCheckout']; $isHostedFields = isset($bodyValues['isHostedFields']) && $bodyValues['isHostedFields']; $reason = isset($bodyValues['reason']) ? Tools::safeOutput($bodyValues['reason']) : null; - $error = isset($bodyValues['error']) ? Tools::safeOutput($bodyValues['error']) : null; + $error = isset($bodyValues['error']) + ? Tools::safeOutput(is_string($bodyValues['error']) ? $bodyValues['error'] : json_encode($bodyValues['error'])) + : null; if ($orderId) { /** @var CommandBusInterface $commandBus */