fix: move check balance verification only when wallet type is not ilink

This commit is contained in:
Djery-Tom 2023-08-10 11:18:49 +01:00
parent e3940a4ad4
commit d3b9fe0e41
1 changed files with 12 additions and 9 deletions

View File

@ -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,