From f7dda657b1c6eb5d5fb28afb113d4b7bfe6cc999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traull=C3=A9?= <613615+jtraulle@users.noreply.github.com> Date: Fri, 6 Mar 2020 17:46:45 +0100 Subject: [PATCH] Fix Call to a member function getMessage() on null Because we are not in the exception block, $e is necessarily undefined. Thus replacing $e->getMessage(); by value of $paymentintent->status. --- htdocs/public/payment/newpayment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9a9c3fff27d..9f9aab20665 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -665,9 +665,9 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) if ($paymentintent->status != 'succeeded') { $error++; - $errormessage = "StatusOfRetreivedIntent is not succeeded: ".$e->getMessage(); + $errormessage = "StatusOfRetreivedIntent is not succeeded: ".$paymentintent->status; dol_syslog($errormessage, LOG_WARNING, 0, '_stripe'); - setEventMessages($e->getMessage(), null, 'errors'); + setEventMessages($paymentintent->status, null, 'errors'); $action = ''; } else