diff --git a/app/Http/Controllers/WalletController.php b/app/Http/Controllers/WalletController.php index a7b3d3a..e306af4 100755 --- a/app/Http/Controllers/WalletController.php +++ b/app/Http/Controllers/WalletController.php @@ -26,7 +26,8 @@ class WalletController extends Controller public function activated($id_agent) { - $networks = DB::select('SELECT ne.name as network , countries.name AS country, w.id, w.balance_princ , w.balance_com, w.created_date, na.id AS id_networkAgent , cw.taux_com_client_depot , na.id AS id_networkAgent , cg.category FROM agents ag + $networks = DB::select('SELECT ne.name as network , countries.name AS country, w.id, w.balance_princ , w.balance_com, w.created_date, cw.type, + na.id AS id_networkAgent , cw.taux_com_client_depot , na.id AS id_networkAgent , cg.category FROM agents ag INNER JOIN networks_agents na ON ag.id=na.agent_id INNER JOIN codeGenerer cg ON cg.id=na.codeGenerer_id INNER JOIN networks ne ON ne.id=na.network_id INNER JOIN configWallet cw ON ne.id = cw.id_network INNER JOIN countries ON ne.country_id=countries.id LEFT JOIN wallets w ON na.id = w.id_networkAgent WHERE ag.id= :id AND network_id IN ( SELECT networks.id FROM networks LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1 AND id_network IS NOT NULL)', ['id' => $id_agent]); @@ -74,7 +75,7 @@ class WalletController extends Controller public function show($id_wallet) { // $wallet = Wallet::findOrFail($id_wallet); - $wallet = collect(DB::select('SELECT wa.wallet_id AS id, wa.balance_princ, wa.balance_com, wa.created_date, wa.network , cw.taux_com_client_depot, c.name AS country, + $wallet = collect(DB::select('SELECT wa.wallet_id AS id, wa.balance_princ, wa.balance_com, wa.created_date, wa.network , cw.taux_com_client_depot, c.name AS country, cw.type, c.currency_code FROM wallet_agent wa INNER JOIN configWallet cw ON wa.network_id = cw.id_network INNER JOIN networks n ON n.id = wa.network_id INNER JOIN countries_currencies c ON c.id = n.country_id WHERE wa.wallet_id = :id',['id' => $id_wallet]))->first(); diff --git a/app/Http/Controllers/iLinkTransactionController.php b/app/Http/Controllers/iLinkTransactionController.php index 1fbc9f8..844b9e4 100755 --- a/app/Http/Controllers/iLinkTransactionController.php +++ b/app/Http/Controllers/iLinkTransactionController.php @@ -441,7 +441,7 @@ class iLinkTransactionController extends Controller $transaction->final_country = $init_country; $frais = $request->montant * $config->taux_com_user_carte_cash / 100; - $transaction->montant_net = $montantRetrait = $transaction->montant - $frais; + $transaction->montant_net_final_country = $transaction->montant_net = $montantRetrait = $transaction->montant - $frais; $body['amount'] = $this->toUSDAmount($montantRetrait, $init_country); $body['card_number'] = $user->numero_carte; $body['cvv'] = $request->cvv; @@ -470,6 +470,7 @@ class iLinkTransactionController extends Controller $transaction->save(); $message = trans('messages.successful_user_remove_from_cart_to_cash', ['id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country), + 'final_country' => $this->getCountryName($init_country),'init_country' => $this->getCountryName($init_country), 'net' => $this->toMoney($montantRetrait, $init_country), 'fees' => $this->toMoney($frais, $init_country), 'code' => wordwrap($code_retrait, 4, ' ', true), 'sender_code' => $user->user_code, 'cart_number' => wordwrap($transaction->numero_carte, 4, ' ', true)]); $this->sendMail($user->email, trans('messages.successful_transaction'), $message); @@ -537,8 +538,9 @@ class iLinkTransactionController extends Controller $transaction->save(); $transactionRetrait->save(); $message = trans('messages.successful_agent_remove_cash', - ['id_transaction' => $transactionRetrait->id_transaction, 'amount' => $this->toMoney($request->montant, $init_country), - 'code' => wordwrap($request->code_retrait, 4, ' ', true), 'id_transaction_retrait' => $transaction->id_transaction]); + ['id_transaction' => $transactionRetrait->id_transaction, 'amount' => $this->toMoney($request->montant, $init_country),'init_country' => $this->getCountryName($init_country), + 'code' => wordwrap($request->code_retrait, 4, ' ', true), 'final_country' => $this->getCountryName($transaction->final_country), + 'id_transaction_retrait' => $transaction->id_transaction]); $this->sendMail($emailEmetteur, trans('messages.successful_transaction'), $message); return $this->successResponse($message . trans('messages.sent_by_mail')); } else { @@ -1202,7 +1204,7 @@ class iLinkTransactionController extends Controller } private function generateTransactionCode($length = 12) { - $characters = '23456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ'; + $characters = '23456789ABCDEFGHJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { diff --git a/resources/lang/en/messages.php b/resources/lang/en/messages.php index b5c15e6..12639e1 100755 --- a/resources/lang/en/messages.php +++ b/resources/lang/en/messages.php @@ -120,8 +120,18 @@ Transaction information : - Number: :id_transaction - Amount of the transaction: :amount - Fees: :fees + - Country of departure: :init_country - Net withdrawal amount: :net + - Country of destination: :init_country - User code : :sender_code - Card number : :cart_number - Withdrawal code : :code', + 'successful_agent_remove_cash'=>'Withdrawal of money from a geolocated agent +Transaction information : + - Number : :id_transaction + - Withdrawal amount : :amount + - Withdrawal transaction number : :id_transaction_retrait + - Withdrawal code : :code + - Country of departure : :init_country + - Country of destination : :final_country', ]; diff --git a/resources/lang/fr/messages.php b/resources/lang/fr/messages.php index cbdbbc7..4099a14 100755 --- a/resources/lang/fr/messages.php +++ b/resources/lang/fr/messages.php @@ -120,7 +120,9 @@ Informations de la transaction : - Numéro : :id_transaction - Montant de la transaction : :amount - Frais : :fees + - Pays de départ : :init_country - Montant net de retrait: :net + - Pays de destination : :final_country - Code utilisateur : :sender_code - Numero de la carte : :cart_number - Code de retrait : :code', @@ -129,5 +131,7 @@ Informations de la transaction : - Numéro : :id_transaction - Montant de retrait : :amount - Numero de transaction de retrait : :id_transaction_retrait - - Code de retrait : :code' + - Code de retrait : :code + - Pays de départ : :init_country + - Pays de destination : :final_country' ];