From 7626de3ff15c0aeb36e4ddcb1842e3c00e3e1c8f Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Tue, 7 Oct 2025 20:47:55 +0200 Subject: [PATCH] enhance isPaymentOK hook (#35674) Co-authored-by: Laurent Destailleur --- htdocs/public/payment/paymentok.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 904a5314b84..7a00d683fe1 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -494,6 +494,8 @@ if (!in_array($paymentmethod, array('paypal', 'paybox', 'stripe'))) { dol_syslog('ispaymentok overwrite by hook return with value='.$hookmanager->resArray['ispaymentok'], LOG_DEBUG, 0, '_payment'); $ispaymentok = $hookmanager->resArray['ispaymentok']; } + } else { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } } @@ -2117,10 +2119,18 @@ if (empty($doactionsthenredirect)) { } } else { print $langs->trans('DoExpressCheckoutPaymentAPICallFailed')."
\n"; - print $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."
\n"; - print $langs->trans('ShortErrorMessage').": ".$ErrorShortMsg."
\n"; - print $langs->trans('ErrorCode').": ".$ErrorCode."
\n"; - print $langs->trans('ErrorSeverityCode').": ".$ErrorSeverityCode."
\n"; + if ($ErrorLongMsg) { + print $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."
\n"; + } + if ($ErrorShortMsg) { + print $langs->trans('ShortErrorMessage').": ".$ErrorShortMsg."
\n"; + } + if ($ErrorCode) { + print $langs->trans('ErrorCode').": ".$ErrorCode."
\n"; + } + if ($ErrorSeverityCode) { + print $langs->trans('ErrorSeverityCode').": ".$ErrorSeverityCode."
\n"; + } if ($mysoc->email) { print "\nPlease, send a screenshot of this page to ".$mysoc->email."
\n";