FIX bad message oncallback of online payment

This commit is contained in:
Laurent Destailleur 2023-04-20 13:14:50 +02:00
parent a39ceee426
commit 692eee1e25

View File

@ -351,11 +351,14 @@ $parameters = [
]; ];
$reshook = $hookmanager->executeHooks('isPaymentOK', $parameters, $object, $action); $reshook = $hookmanager->executeHooks('isPaymentOK', $parameters, $object, $action);
if ($reshook >= 0) { if ($reshook >= 0) {
if (isset($hookmanager->resArray['ispaymentok'])) {
dol_syslog('ispaymentok overwrite by hook return with value='.$hookmanager->resArray['ispaymentok'], LOG_DEBUG, 0, '_payment');
$ispaymentok = $hookmanager->resArray['ispaymentok']; $ispaymentok = $hookmanager->resArray['ispaymentok'];
} }
}
// If data not provided from back url, search them into the session env // If data not provided into callback url, search them into the session env
if (empty($ipaddress)) { if (empty($ipaddress)) {
$ipaddress = $_SESSION['ipaddress']; $ipaddress = $_SESSION['ipaddress'];
} }
@ -815,13 +818,13 @@ if ($ispaymentok) {
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
$paymentTypeId = 0; $paymentTypeId = 0;
if ($paymentmethod == 'paybox') { if ($paymentmethod === 'paybox') {
$paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS;
} }
if ($paymentmethod == 'paypal') { if ($paymentmethod === 'paypal') {
$paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS;
} }
if ($paymentmethod == 'stripe') { if ($paymentmethod === 'stripe') {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {