From d3b9fe0e4198e83cab3b7a80f5858ea614aca6ea Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Thu, 10 Aug 2023 11:18:49 +0100 Subject: [PATCH] fix: move check balance verification only when wallet type is not ilink --- .../iLinkTransactionController.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/iLinkTransactionController.php b/app/Http/Controllers/iLinkTransactionController.php index 72983bb..86af391 100755 --- a/app/Http/Controllers/iLinkTransactionController.php +++ b/app/Http/Controllers/iLinkTransactionController.php @@ -1820,18 +1820,21 @@ class iLinkTransactionController extends Controller //Verification des limites reglementaires $this->checkReguationsLimits($walletUser->id, $init_country, $request->final_country, $transaction->montant); - $balance = $this->checkBalance([ - 'country_id' => $request->final_country, - 'amount' => $request->montant - ]); - - if (!is_string($balance)) { - return $balance; - } - $configPayeur = ConfigWallet::where('id_network', $request->network_destinataire)->firstOrFail(); $reseauPayeur = PayingNetwork::where('id_network', $request->network_destinataire)->where('id_configWallet', $config->id)->first(); + if ($configPayeur->type != 'ilink') { + $balance = $this->checkBalance([ + 'country_id' => $request->final_country, + 'amount' => $request->montant + ]); + + if (!is_string($balance)) { + return $balance; + } + } + + $frais = $this->calculateFees($init_country != $request->final_country ? $plr_user_cart_autre_wallet_international : $plr_user_cart_autre_wallet_national, $request->montant); $fees = $this->getBasicTransactionFees([ 'amount' => $request->montant,