diff --git a/app/Http/Controllers/iLinkTransactionController.php b/app/Http/Controllers/iLinkTransactionController.php index 203938d..c3aadd7 100755 --- a/app/Http/Controllers/iLinkTransactionController.php +++ b/app/Http/Controllers/iLinkTransactionController.php @@ -649,7 +649,7 @@ class iLinkTransactionController extends Controller $data['destinataire'] = $destinataire ? $destinataire->lastname . ' ' . $destinataire->firstname : $request->id_destinataire; $data['frais'] = $frais + $taxe; $data['montant_net_init'] = $request->montant - $frais - $taxe; - $data['montant_net_final'] = $this->toMoneyWithCurrency($request->montant - $frais - $taxe, $init_country ,$request->final_country ); + $data['montant_net_final'] = $this->toMoneyWithCurrency($data['montant_net_init'], $init_country ,$request->final_country ); return $this->successResponse($data); break; case 2: //User - Envoi de wallet à carte diff --git a/app/Traits/Helper.php b/app/Traits/Helper.php index b6e7625..b4a2083 100644 --- a/app/Traits/Helper.php +++ b/app/Traits/Helper.php @@ -90,7 +90,7 @@ trait Helper $converter = new CurrencyConverter($provider); $init_country = Country::findOrFail($init_country); $final_country = Country::findOrFail($final_country); - $init_money = Money::of(round($amount, 2),$init_country->currency->code,new CustomContext(2)); + $init_money = Money::of(round(str_replace(',' , '',number_format($amount,2)), 2),$init_country->currency->code,new CustomContext(2)); return $converter->convert($init_money, $final_country->currency->code, RoundingMode::DOWN); }