fix: transaction amount while doing withdraw user to wallet
This commit is contained in:
parent
0f51769a75
commit
d0ba85c207
|
@ -250,6 +250,9 @@ class iLinkTransactionController extends Controller
|
|||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
$transaction->exchange_rate = $this->getExchangeRate($init_country, $final_country ?? $init_country);
|
||||
|
||||
|
||||
switch ($type->id) {
|
||||
case 1: //User - Envoi wallet à wallet
|
||||
$this->validate($request, $transaction->send_wallet_wallet_rules());
|
||||
|
@ -762,7 +765,6 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->frais = $frais;
|
||||
$transaction->montant_net = $transaction->montant + ($frais + $taxe); // Montant de retrait
|
||||
$transaction->montant_net_final_country = $this->toMoneyAmount($transaction->montant, $init_country, $final_country);
|
||||
$transaction->exchange_rate = $this->getExchangeRate($init_country, $final_country);
|
||||
|
||||
$identification = Identification::where('id_user', $user->id)->first();
|
||||
$countryCurrency = CountriesCurrency::findOrFail($init_country);
|
||||
|
@ -793,7 +795,7 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->commission_banque = $this->calculateFees($init_country != $final_country ? $plr_bank_user_cart_cash_international : $plr_bank_user_cart_cash_national, $request->montant, $frais);
|
||||
//Emettre une trame SSL pour recharger le compte de la banque partenaire du montant de sa commission
|
||||
|
||||
$walletUser->balance += $transaction->montant_net;
|
||||
$walletUser->balance += $transaction->montant_net_final_country;
|
||||
$transaction->commission_hyp = $this->calculateFees($init_country != $final_country ? $plr_hyp_user_cart_cash_international : $plr_hyp_user_cart_cash_national, $request->montant, $frais);
|
||||
$walletHyperviseur->balance_com += $transaction->commission_hyp;
|
||||
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
||||
|
@ -845,7 +847,6 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->frais = $frais;
|
||||
$transaction->montant_net = $transaction->montant + ($frais + $taxe); // Montant de retrait
|
||||
$transaction->montant_net_final_country = $this->toMoneyAmount($transaction->montant, $init_country, $final_country);
|
||||
$transaction->exchange_rate = $this->getExchangeRate($init_country, $final_country);
|
||||
|
||||
$countryCurrency = CountriesCurrency::findOrFail($init_country);
|
||||
$identification = Identification::where('id_user', $user->id)->first();
|
||||
|
|
Loading…
Reference in New Issue