From ef554d0ad0d8a973d1eccc9788a10fd4f9a4cacb Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Mon, 3 Jul 2023 08:30:21 +0100 Subject: [PATCH] feature(ilink transaction): add payout payment in Agent - Envoi cash vers aure wallet --- .../Controllers/iLinkTransactionController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Http/Controllers/iLinkTransactionController.php b/app/Http/Controllers/iLinkTransactionController.php index a1b7b43..e195ab1 100755 --- a/app/Http/Controllers/iLinkTransactionController.php +++ b/app/Http/Controllers/iLinkTransactionController.php @@ -1068,6 +1068,22 @@ class iLinkTransactionController extends Controller // $walletUser->balance += $transaction->montant_net_final_country; // $transaction->id_destinataire = r + $countryCurrency = CountriesCurrency::findOrFail($request->final_country); + // PayOut through payment service + $this->handlePayOut($transaction, [ + 'network_name' => $reseauPayeur->network->name, + 'payment_method' => 'WALLET', + 'amount' => $transaction->montant_net_final_country, + 'currency' => $countryCurrency->currency_code, + 'customer_id' => $agent->id, + 'customer_email' => $request->input('email_emetteur'), + 'customer_name' => $request->input('prenom_destinataire'), + 'customer_surname' => $request->input('nom_destinataire'), + 'customer_phone_number' => $transaction->id_destinataire, + 'customer_country' => $countryCurrency->code_country, + 'reason' => "Agent - Envoi de cash vers autre wallet" + ]); + $final_country = $request->final_country; $plr_agent_cash_wallet_or_cash_national = $this->getPaliers($paliers_commission_wallets, 'agent_cash_wallet_or_cash_national'); $plr_agent_cash_wallet_or_cash_international = $this->getPaliers($paliers_commission_wallets, 'agent_cash_wallet_or_cash_international');