fix: calculation of commissions for "User - Envoi de wallet vers wallet"
This commit is contained in:
parent
d5764e8984
commit
80b62f9644
|
@ -2135,16 +2135,17 @@ class iLinkTransactionController extends Controller
|
||||||
//Verifier si c'est pas un reseau ilink
|
//Verifier si c'est pas un reseau ilink
|
||||||
if ($configNetworkDestinataire->type != 'ilink') {
|
if ($configNetworkDestinataire->type != 'ilink') {
|
||||||
$data['destinataire'] = $request->id_destinataire;
|
$data['destinataire'] = $request->id_destinataire;
|
||||||
} else {
|
|
||||||
$destinataire = User::where('user_code', $request->id_destinataire)->orWhere('phone', $request->id_destinataire)->first();
|
|
||||||
$data['destinataire'] = $destinataire ? $destinataire->lastname . ' ' . $destinataire->firstname : $request->id_destinataire;
|
|
||||||
$fees = $this->getBasicTransactionFees([
|
$fees = $this->getBasicTransactionFees([
|
||||||
'amount' => $request->montant,
|
'amount' => $request->montant,
|
||||||
'country_id' => $init_country,
|
'country_id' => $init_country,
|
||||||
'payment_type' => PaymentType::CASH_IN,
|
'payment_type' => PaymentType::CASH_IN,
|
||||||
'payment_method' => PaymentMethod::WALLET
|
'payment_method' => PaymentMethod::WALLET
|
||||||
]);
|
]);
|
||||||
$data['frais'] += $fees;
|
$data['fees'] = $fees;
|
||||||
|
$frais += $fees;
|
||||||
|
} else {
|
||||||
|
$destinataire = User::where('user_code', $request->id_destinataire)->orWhere('phone', $request->id_destinataire)->first();
|
||||||
|
$data['destinataire'] = $destinataire ? $destinataire->lastname . ' ' . $destinataire->firstname : $request->id_destinataire;
|
||||||
}
|
}
|
||||||
$data['frais'] = round($frais + $taxe, 2);
|
$data['frais'] = round($frais + $taxe, 2);
|
||||||
$data['montant_net_init'] = round($request->montant - $data['frais'], 2);
|
$data['montant_net_init'] = round($request->montant - $data['frais'], 2);
|
||||||
|
|
Loading…
Reference in New Issue