Add a more complete message

This commit is contained in:
Laurent Destailleur 2024-03-05 23:29:41 +01:00
parent 64093cc378
commit c27551cbb7
2 changed files with 8 additions and 6 deletions

View file

@ -882,7 +882,7 @@ if ($ispaymentok) {
} 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
}
@ -1011,7 +1011,7 @@ if ($ispaymentok) {
} 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++;
}
@ -1278,7 +1278,7 @@ if ($ispaymentok) {
} 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
}
@ -1508,7 +1508,7 @@ if ($ispaymentok) {
} 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
}
@ -1719,7 +1719,7 @@ if ($ispaymentok) {
} 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++;
}

View file

@ -404,6 +404,8 @@ if ($event->type == 'payout.created') {
$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
@ -422,7 +424,7 @@ if ($event->type == 'payout.created') {
} 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++;