FIX page for confirmation of payments is empty

This commit is contained in:
Laurent Destailleur 2020-08-04 15:00:03 +02:00
parent e16fd45972
commit 5d20f47473
2 changed files with 23 additions and 17 deletions

View File

@ -129,10 +129,12 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice
$ipaddress = $_SESSION['ipaddress']; $ipaddress = $_SESSION['ipaddress'];
$errormessage = $_SESSION['errormessage']; $errormessage = $_SESSION['errormessage'];
// Call trigger if (is_object($object) && method_exists($object, 'call_trigger')) {
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user); // Call trigger
if ($result < 0) $error++; $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
// End call triggers if ($result < 0) $error++;
// End call triggers
}
// Send an email // Send an email
$sendemail = ''; $sendemail = '';

View File

@ -616,8 +616,8 @@ if ($ispaymentok)
{ {
// Record payment // Record payment
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$invoice = new Facture($db); $object = new Facture($db);
$result = $invoice->fetch($tmptag['INV']); $result = $object->fetch($tmptag['INV']);
if ($result) if ($result)
{ {
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
@ -646,11 +646,11 @@ if ($ispaymentok)
$paiement->datepaye = $now; $paiement->datepaye = $now;
if ($currencyCodeType == $conf->currency) if ($currencyCodeType == $conf->currency)
{ {
$paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id $paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id
} }
else else
{ {
$paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching
$postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; $postactionmessages[] = 'Payment was done in a different currency that currency expected of company';
$ispostactionok = -1; $ispostactionok = -1;
@ -689,7 +689,7 @@ if ($ispaymentok)
if ($bankaccountid > 0) if ($bankaccountid > 0)
{ {
$label = '(CustomerInvoicePayment)'; $label = '(CustomerInvoicePayment)';
if ($invoice->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note if ($object->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note
$result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', '');
if ($result < 0) if ($result < 0)
{ {
@ -748,10 +748,12 @@ if ($ispaymentok)
$currencyCodeType = $_SESSION['currencyCodeType']; $currencyCodeType = $_SESSION['currencyCodeType'];
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// Call trigger if (is_object($object) && method_exists($object, 'call_trigger')) {
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); // Call trigger
if ($result < 0) $error++; $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user);
// End call triggers if ($result < 0) $error++;
// End call triggers
}
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n"; print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
if ($TRANSACTIONID) print $langs->trans("ThisIsTransactionId", $TRANSACTIONID)."<br><br>\n"; if ($TRANSACTIONID) print $langs->trans("ThisIsTransactionId", $TRANSACTIONID)."<br><br>\n";
@ -882,10 +884,12 @@ else
$currencyCodeType = $_SESSION['currencyCodeType']; $currencyCodeType = $_SESSION['currencyCodeType'];
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// Call trigger if (is_object($object) && method_exists($object, 'call_trigger')) {
$result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user); // Call trigger
if ($result < 0) $error++; $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user);
// End call triggers if ($result < 0) $error++;
// End call triggers
}
print $langs->trans('DoExpressCheckoutPaymentAPICallFailed')."<br>\n"; print $langs->trans('DoExpressCheckoutPaymentAPICallFailed')."<br>\n";
print $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."<br>\n"; print $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."<br>\n";