Skip to content

Commit

Permalink
Add a more complete message
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 5, 2024
1 parent 64093cc commit c27551c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions htdocs/public/payment/paymentok.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@
} else {
$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 currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')';
$ispostactionok = -1;
$error++; // Not yet supported
}
Expand Down Expand Up @@ -1011,7 +1011,7 @@
} else {
$paiement->multicurrency_amounts = array($invoice->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 currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')';
$ispostactionok = -1;
$error++;
}
Expand Down Expand Up @@ -1278,7 +1278,7 @@
} else {
$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 currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')';
$ispostactionok = -1;
$error++; // Not yet supported
}
Expand Down Expand Up @@ -1508,7 +1508,7 @@
} else {
$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 currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')';
$ispostactionok = -1;
$error++; // Not yet supported
}
Expand Down Expand Up @@ -1719,7 +1719,7 @@
} else {
$paiement->multicurrency_amounts = array($invoice->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 currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')';
$ispostactionok = -1;
$error++;
}
Expand Down
4 changes: 3 additions & 1 deletion htdocs/public/stripe/ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@
$payment_amount = $payment_amountInDolibarr;
// TODO Check payment_amount in Stripe (received) is same than the one in Dolibarr

$postactionmessages = array();

if ($paymentTypeId == "CB" && ($paymentTypeIdInDolibarr == 'card' || empty($paymentTypeIdInDolibarr))) {
// Case payment type in Stripe and into prelevement_demande are both CARD.
// For this case, payment should already have been recorded so we just update flag of payment request if not yet 1
Expand All @@ -422,7 +424,7 @@
} else {
$paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching

$postactionmessages[] = 'Payment was done in a different currency than currency expected of company';
$postactionmessages[] = 'Payment was done in a currency ('.$currencyCodeType.') other than the expected currency of company ('.$conf->currency.')';
$ispostactionok = -1;
// Not yet supported, so error
$error++;
Expand Down

0 comments on commit c27551c

Please sign in to comment.