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.
This commit is contained in:
Jean Traullé 2020-03-06 17:46:45 +01:00 committed by GitHub
parent d4b67a6cef
commit f7dda657b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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