From 783257706ca6c20776efe59ea84852a04281adbc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 2 Jul 2021 10:53:51 +0200 Subject: [PATCH] fix: payment ok should trigger PAYMENTONLINE_PAYMENT_OK even on custom object --- htdocs/public/payment/paymentok.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 60d763593fe..fb23e57d1ed 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -746,6 +746,12 @@ if ($ispaymentok) $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); if ($result < 0) $error++; // End call triggers + } elseif (get_class($object)=='stdClass') { + //In some case $object is not instanciate (for paiement on custom object) We need to deal with payment + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $result = $paiement->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); + if ($result < 0) $error++; } print $langs->trans("YourPaymentHasBeenRecorded")."
\n";