diff --git a/app/Http/Controllers/iLinkTransactionController.php b/app/Http/Controllers/iLinkTransactionController.php index 3e60c07..de2ca1b 100755 --- a/app/Http/Controllers/iLinkTransactionController.php +++ b/app/Http/Controllers/iLinkTransactionController.php @@ -267,9 +267,6 @@ class iLinkTransactionController extends Controller $frais = ($init_country != $request->final_country) ? $this->calculateFees($plr_user_wallet_wallet, $request->montant) : $this->calculateFees($plr_user_wallet_wallet_national, $request->montant); $reseauPayeur = PayingNetwork::where('id_network', $request->network_destinataire)->where('id_configWallet', $config->id)->first(); - if(empty($reseauPayeur)){ - return $this->errorResponse(__('errors.service_unavailable_in_country')); - } $configPayeur = ConfigWallet::where('id_network', $request->network_destinataire)->firstOrFail(); $fees = 0; @@ -291,6 +288,12 @@ class iLinkTransactionController extends Controller $transaction->montant_net = $montantDepot = $transaction->montant - $frais - $taxe; $transaction->montant_net_final_country = $this->toMoneyAmount($montantDepot, $init_country, $request->final_country); + // Verifier si le reseau payeur existe si c'est pas un reseau ilink + if ($configPayeur->type != 'ilink' && empty($reseauPayeur)) { + return $this->errorResponse(__('errors.service_unavailable_in_country')); + } + + if (isset($reseauPayeur)) { $transaction->part_reseau_payeur = $frais * $reseauPayeur->taux_partage / 100; $transaction->part_reseau_payeur_final_country = $this->toMoneyAmount($transaction->part_reseau_payeur, $init_country, $request->final_country);