fix #23716 : handle hookmanagers returns
This commit is contained in:
parent
a06a5d0f65
commit
d3b1ee367a
@ -212,6 +212,11 @@ $parameters = [
|
|||||||
'validpaymentmethod' => &$validpaymentmethod
|
'validpaymentmethod' => &$validpaymentmethod
|
||||||
];
|
];
|
||||||
$reshook = $hookmanager->executeHooks('doValidatePayment', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('doValidatePayment', $parameters, $object, $action);
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
} elseif ($reshook > 0) {
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
// Check security token
|
// Check security token
|
||||||
$valid = true;
|
$valid = true;
|
||||||
@ -1674,6 +1679,12 @@ if ($action != 'dopayment')
|
|||||||
'object' => $object
|
'object' => $object
|
||||||
];
|
];
|
||||||
$reshook = $hookmanager->executeHooks('doCheckStatus', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('doCheckStatus', $parameters, $object, $action);
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
} elseif ($reshook > 0) {
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
if ($source == 'order' && $object->billed)
|
if ($source == 'order' && $object->billed)
|
||||||
{
|
{
|
||||||
print '<br><br><span class="amountpaymentcomplete size15x">'.$langs->trans("OrderBilled").'</span>';
|
print '<br><br><span class="amountpaymentcomplete size15x">'.$langs->trans("OrderBilled").'</span>';
|
||||||
@ -1699,6 +1710,12 @@ if ($action != 'dopayment')
|
|||||||
'paymentmethod' => $paymentmethod
|
'paymentmethod' => $paymentmethod
|
||||||
];
|
];
|
||||||
$reshook = $hookmanager->executeHooks('doAddButton', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('doAddButton', $parameters, $object, $action);
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
} elseif ($reshook > 0) {
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled))
|
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled))
|
||||||
{
|
{
|
||||||
print '<div class="button buttonpayment" id="div_dopayment_paybox"><span class="fa fa-credit-card"></span> <input class="" type="submit" id="dopayment_paybox" name="dopayment_paybox" value="'.$langs->trans("PayBoxDoPayment").'">';
|
print '<div class="button buttonpayment" id="div_dopayment_paybox"><span class="fa fa-credit-card"></span> <input class="" type="submit" id="dopayment_paybox" name="dopayment_paybox" value="'.$langs->trans("PayBoxDoPayment").'">';
|
||||||
@ -2299,9 +2316,13 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
|||||||
'dopayment' => GETPOST('dopayment', 'alpha')
|
'dopayment' => GETPOST('dopayment', 'alpha')
|
||||||
];
|
];
|
||||||
$reshook = $hookmanager->executeHooks('doPayment', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('doPayment', $parameters, $object, $action);
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
} elseif ($reshook > 0) {
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);
|
htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object);
|
||||||
|
|
||||||
llxFooter('', 'public');
|
llxFooter('', 'public');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user