+ Optimization of requests to the bank ( Validation of IBAN code)
This commit is contained in:
parent
29374c8cc4
commit
a587c69c51
|
@ -350,7 +350,7 @@ class WalletController extends Controller
|
|||
|
||||
public function getWalletBanks($id_wallet_network)
|
||||
{
|
||||
$banks = DB::select("SELECT b.id as id_bank, b.nom as bank_name , bc.adresse as bank_address, c.name as country FROM networks_banks nb INNER JOIN banks_countries bc on bc.id = nb.id_bank_country INNER JOIN banks b ON b.id = bc.id_bank
|
||||
$banks = DB::select("SELECT bc.id as id_bank, b.nom as bank_name , bc.adresse as bank_address, c.name as country FROM networks_banks nb INNER JOIN banks_countries bc on bc.id = nb.id_bank_country INNER JOIN banks b ON b.id = bc.id_bank
|
||||
INNER JOIN countries c ON bc.id_country = c.id WHERE nb.id_network = :id_network ;", ['id_network' => $id_wallet_network]);
|
||||
|
||||
return $this->successResponse($banks);
|
||||
|
|
|
@ -8,6 +8,7 @@ use App\Models\ConfigWallet;
|
|||
use App\Models\Country;
|
||||
use App\Models\Identification;
|
||||
use App\Models\NetworksAgent;
|
||||
use App\Models\NetworksBank;
|
||||
use App\Models\PayingNetwork;
|
||||
use App\Models\Regulation;
|
||||
use App\Models\TypeIlinkTransaction;
|
||||
|
@ -396,11 +397,22 @@ class iLinkTransactionController extends Controller
|
|||
// return $rep;
|
||||
|
||||
//Verifier si la banque est associée au reseau
|
||||
$result = DB::select("SELECT * FROM networks_banks nb INNER JOIN banks_countries bc ON bc.id = nb.id_bank_country
|
||||
WHERE nb.id_network = :id_network AND bc.id_bank = :id_bank;", ["id_network" => $request->id_wallet_network, 'id_bank' => $request->id_bank]);
|
||||
if (sizeof($result) == 0)
|
||||
$network_bank = NetworksBank::where('id_network', $request->id_wallet_network)->where('id_bank_country', $request->id_bank)->first();
|
||||
if (!$network_bank)
|
||||
return $this->errorResponse(trans('errors.bank_not_associated_with_network'));
|
||||
|
||||
//Verifier le code IBAN
|
||||
$country_code = $network_bank->network->country->code_country;
|
||||
$bank_code = $network_bank->banks_country->code_banque;
|
||||
switch ($this->checkIBAN($request->iban, $country_code, $bank_code)) {
|
||||
case 0:
|
||||
return $this->errorResponse(trans('errors.invalid_iban'));
|
||||
case 1:
|
||||
return $this->errorResponse(trans('errors.country_not_match_iban'));
|
||||
case 2:
|
||||
return $this->errorResponse(trans('errors.bank_not_match_iban'));
|
||||
}
|
||||
|
||||
$transaction->frais = $frais = 0;
|
||||
$transaction->taxe = $taxe = 0;
|
||||
// $walletUser->balance -= $transaction->montant;
|
||||
|
@ -412,6 +424,8 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
||||
$transaction->frais = $frais;
|
||||
$transaction->date = new \DateTime();
|
||||
$transaction->bank = $network_bank->banks_country->bank->nom;
|
||||
$transaction->country = $network_bank->network->country->name;
|
||||
$transaction->id_bank = $request->id_bank;
|
||||
$transaction->iban = $request->iban;
|
||||
// $walletUser->save();
|
||||
|
@ -426,7 +440,7 @@ class iLinkTransactionController extends Controller
|
|||
['id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country),
|
||||
'net' => $this->toMoney($transaction->montant, $init_country), 'iban' => $request->iban, 'fees' => $this->toMoney($frais, $init_country),
|
||||
'sender_code' => $user->user_code]);
|
||||
// $this->sendMail($user->email, trans('messages.successful_transaction'), $message);
|
||||
$this->sendMail($user->email, trans('messages.successful_transaction'), $message);
|
||||
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
||||
|
||||
break;
|
||||
|
@ -1076,11 +1090,22 @@ class iLinkTransactionController extends Controller
|
|||
return $this->errorResponse(trans('errors.insufficient_balance'));
|
||||
|
||||
//Verifier si la banque est associée au reseau
|
||||
$result = DB::select("SELECT * FROM networks_banks nb INNER JOIN banks_countries bc ON bc.id = nb.id_bank_country
|
||||
WHERE nb.id_network = :id_network AND bc.id_bank = :id_bank;", ["id_network" => $request->id_wallet_network, 'id_bank' => $request->id_bank]);
|
||||
if (sizeof($result) == 0)
|
||||
$network_bank = NetworksBank::where('id_network', $request->id_wallet_network)->where('id_bank_country', $request->id_bank)->first();
|
||||
if (!$network_bank)
|
||||
return $this->errorResponse(trans('errors.bank_not_associated_with_network'));
|
||||
|
||||
//Verifier le code IBAN
|
||||
$country_code = $network_bank->network->country->code_country;
|
||||
$bank_code = $network_bank->banks_country->code_banque;
|
||||
switch ($this->checkIBAN($request->iban, $country_code, $bank_code)) {
|
||||
case 0:
|
||||
return $this->errorResponse(trans('errors.invalid_iban'));
|
||||
case 1:
|
||||
return $this->errorResponse(trans('errors.country_not_match_iban'));
|
||||
case 2:
|
||||
return $this->errorResponse(trans('errors.bank_not_match_iban'));
|
||||
}
|
||||
|
||||
$transaction->frais = $frais = 0;
|
||||
$transaction->taxe = $taxe = 0;
|
||||
// $walletUser->balance -= $transaction->montant;
|
||||
|
@ -1094,6 +1119,8 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->id_wallet_sup = $walletSuperviseur->id;
|
||||
$transaction->frais = $frais;
|
||||
$transaction->date = new \DateTime();
|
||||
$transaction->bank = $network_bank->banks_country->bank->nom;
|
||||
$transaction->country = $network_bank->network->country->name;
|
||||
$transaction->id_bank = $request->id_bank;
|
||||
$transaction->iban = $request->iban;
|
||||
// $walletUser->save();
|
||||
|
@ -1108,15 +1135,13 @@ class iLinkTransactionController extends Controller
|
|||
['id_transaction' => $transaction->id_transaction, 'amount' => $this->toMoney($transaction->montant, $init_country),
|
||||
'net' => $this->toMoney($transaction->montant, $init_country), 'iban' => $request->iban, 'fees' => $this->toMoney($frais, $init_country),
|
||||
'sender_code' => $codeGenerer->code_membre]);
|
||||
// $this->sendMail($user->email, trans('messages.successful_transaction'), $message);
|
||||
|
||||
$this->sendMail($agent->email, trans('messages.successful_transaction'), $message);
|
||||
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public
|
||||
function lastUserTransactions($id_user)
|
||||
public function lastUserTransactions($id_user)
|
||||
{
|
||||
$user = User::findOrFail($id_user);
|
||||
$wallet_user = WalletsUser::where('idUser', $user->id)->firstOrFail();
|
||||
|
@ -1157,8 +1182,7 @@ class iLinkTransactionController extends Controller
|
|||
return $this->successResponse($transactions);
|
||||
}
|
||||
|
||||
public
|
||||
function lastAgentTransactions($id_wallet_agent)
|
||||
public function lastAgentTransactions($id_wallet_agent)
|
||||
{
|
||||
$transactions = DB::select('SELECT wit.id_transaction, tit.nom as operation_fr , tit.name as operation_en, wit.montant ,wit.nom_emetteur, wit.prenom_emetteur, wit.id_wallet_user,wit.frais,wit.taxe,wit.id_destinataire,
|
||||
wit.nom_destinataire, wit.prenom_destinataire, wit.type , wit.id_wallet_user, wit.init_country, wit.final_country , wit.network_destinataire , wit.montant_net_final_country ,
|
||||
|
@ -1193,8 +1217,7 @@ class iLinkTransactionController extends Controller
|
|||
return $this->successResponse($transactions);
|
||||
}
|
||||
|
||||
public
|
||||
function calculateCommission(Request $request)
|
||||
public function calculateCommission(Request $request)
|
||||
{
|
||||
$rules = [
|
||||
'type' => 'required|integer|min:0|not_in:0',
|
||||
|
@ -1248,13 +1271,19 @@ class iLinkTransactionController extends Controller
|
|||
case 1: //User - Envoi wallet à wallet
|
||||
$this->validate($request, [
|
||||
'final_country' => 'required|integer|min:0|not_in:0',
|
||||
'id_destinataire' => 'required_without:phone_destinataire'
|
||||
'id_destinataire' => 'required_without:phone_destinataire',
|
||||
'network_destinataire' => 'required|integer|min:0|not_in:0',
|
||||
]);
|
||||
$configNetworkDestinataire = ConfigWallet::where('id_network', $request->network_destinataire)->firstOrFail();
|
||||
$frais = ($init_country != $request->final_country) ? $this->calculateFees($plr_user_wallet_wallet, $request->montant) : $this->calculateFees($plr_user_wallet_wallet_national, $request->montant);
|
||||
$taxe = ($init_country != $request->final_country) ? $this->calculateTax($taxesInternationales, $frais) : $this->calculateTax($taxesNationales, $frais);
|
||||
$destinataire = User::where('user_code', $request->id_destinataire)->first();
|
||||
//Verifier si c'est pas un reseau ilink
|
||||
if ($configNetworkDestinataire->type != 'ilink') {
|
||||
$data['destinataire'] = $request->id_destinataire;
|
||||
} else {
|
||||
$destinataire = User::where('user_code', $request->id_destinataire)->first();
|
||||
$data['destinataire'] = $destinataire ? $destinataire->lastname . ' ' . $destinataire->firstname : $request->id_destinataire;
|
||||
}
|
||||
$data['frais'] = round($frais + $taxe, 2);
|
||||
$data['montant_net_init'] = round($request->montant - $data['frais'], 2);
|
||||
$data['montant_net_final'] = $this->toMoneyWithCurrency($data['montant_net_init'], $init_country, $request->final_country);
|
||||
|
@ -1342,8 +1371,7 @@ class iLinkTransactionController extends Controller
|
|||
return $this->successResponse($data);
|
||||
}
|
||||
|
||||
public
|
||||
function getTransactionRetrait(Request $request)
|
||||
public function getTransactionRetrait(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'id_transaction' => 'required',
|
||||
|
@ -1399,8 +1427,7 @@ class iLinkTransactionController extends Controller
|
|||
}
|
||||
|
||||
|
||||
private
|
||||
function getPaliers(array $paliers, $type)
|
||||
private function getPaliers(array $paliers, $type)
|
||||
{
|
||||
return array_values(array_filter($paliers, function ($palier) use ($type) {
|
||||
return $palier->type == $type;
|
||||
|
@ -1408,8 +1435,7 @@ class iLinkTransactionController extends Controller
|
|||
}
|
||||
|
||||
//Calcul des frais internationaux
|
||||
private
|
||||
function calculateFees(array $paliers, $montant)
|
||||
private function calculateFees(array $paliers, $montant)
|
||||
{
|
||||
$size = sizeof($paliers);
|
||||
if ($size > 0) {
|
||||
|
@ -1436,8 +1462,7 @@ class iLinkTransactionController extends Controller
|
|||
}
|
||||
|
||||
|
||||
private
|
||||
function random_string()
|
||||
private function random_string()
|
||||
{
|
||||
$character_set_array = array();
|
||||
$character_set_array[] = array('count' => 12, 'characters' => 'ABCDEFGHJKMNPQRSTUVWXYZ');
|
||||
|
@ -1452,8 +1477,7 @@ class iLinkTransactionController extends Controller
|
|||
return implode('', $temp_array);
|
||||
}
|
||||
|
||||
private
|
||||
function getTransactionID()
|
||||
private function getTransactionID()
|
||||
{
|
||||
do {
|
||||
$code = $this->generateTransactionCode();
|
||||
|
@ -1464,8 +1488,7 @@ class iLinkTransactionController extends Controller
|
|||
}
|
||||
|
||||
|
||||
private
|
||||
function checkUserIdentification($id_user)
|
||||
private function checkUserIdentification($id_user)
|
||||
{
|
||||
$identification = Identification::where('id_user', $id_user)->first();
|
||||
if (isset($identification)) {
|
||||
|
@ -1491,8 +1514,7 @@ class iLinkTransactionController extends Controller
|
|||
//
|
||||
// }
|
||||
|
||||
public
|
||||
function cancel($id_transaction)
|
||||
public function cancel($id_transaction)
|
||||
{
|
||||
$transaction = WalletIlinkTransaction::where('id_transaction', $id_transaction)->firstOrFail();
|
||||
$transactionInverse = $transaction->replicate();
|
||||
|
@ -1536,8 +1558,7 @@ class iLinkTransactionController extends Controller
|
|||
}
|
||||
|
||||
//Verfier les limites reglementaires
|
||||
public
|
||||
function checkReguationsLimits($identifiant, $init_country, $final_country, $montant_transaction, $is_id_document_emetteur = false)
|
||||
public function checkReguationsLimits($identifiant, $init_country, $final_country, $montant_transaction, $is_id_document_emetteur = false)
|
||||
{
|
||||
|
||||
$regulation = Regulation::where('id_country', $init_country)->first();
|
||||
|
@ -1582,8 +1603,7 @@ class iLinkTransactionController extends Controller
|
|||
}
|
||||
|
||||
// Recevoir le traitement d'une transaction venant d'un reseau payeur
|
||||
public
|
||||
function receiveRequestProcessingResult(Request $request)
|
||||
public function receiveRequestProcessingResult(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'id_transaction' => 'required',
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Bank
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $nom
|
||||
*
|
||||
* @property Collection|BanksCountry[] $banks_countries
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Bank extends Model
|
||||
{
|
||||
protected $table = 'banks';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'nom'
|
||||
];
|
||||
|
||||
public function banks_countries()
|
||||
{
|
||||
return $this->hasMany(BanksCountry::class, 'id_bank');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BanksCountry
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $id_bank
|
||||
* @property int $id_country
|
||||
* @property string|null $adresse
|
||||
* @property string|null $code_banque
|
||||
* @property bool $status
|
||||
*
|
||||
* @property Bank $bank
|
||||
* @property Country $country
|
||||
* @property Collection|NetworksBank[] $networks_banks
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class BanksCountry extends Model
|
||||
{
|
||||
protected $table = 'banks_countries';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'id_bank' => 'int',
|
||||
'id_country' => 'int',
|
||||
'status' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'id_bank',
|
||||
'id_country',
|
||||
'adresse',
|
||||
'code_banque',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function bank()
|
||||
{
|
||||
return $this->belongsTo(Bank::class, 'id_bank');
|
||||
}
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(Country::class, 'id_country');
|
||||
}
|
||||
|
||||
public function networks_banks()
|
||||
{
|
||||
return $this->hasMany(NetworksBank::class, 'id_bank_country');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class NetworksBank
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $id_bank_country
|
||||
* @property int $id_network
|
||||
*
|
||||
* @property BanksCountry $banks_country
|
||||
* @property Network $network
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class NetworksBank extends Model
|
||||
{
|
||||
protected $table = 'networks_banks';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $casts = [
|
||||
'id_bank_country' => 'int',
|
||||
'id_network' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'id_bank_country',
|
||||
'id_network'
|
||||
];
|
||||
|
||||
public function banks_country()
|
||||
{
|
||||
return $this->belongsTo(BanksCountry::class, 'id_bank_country');
|
||||
}
|
||||
|
||||
public function network()
|
||||
{
|
||||
return $this->belongsTo(Network::class, 'id_network');
|
||||
}
|
||||
}
|
|
@ -436,4 +436,46 @@ trait Helper
|
|||
|
||||
// return $response->getBody()->getContents();
|
||||
}
|
||||
|
||||
// Verification du code IBAN
|
||||
// 0 si code invalide
|
||||
// 1 si le pays ne correspond pas
|
||||
// 2 si le code la banque est incorrect
|
||||
// 3 si tout est ok
|
||||
public function checkIBAN($iban, $country_code, $bank_code = null)
|
||||
{
|
||||
// Normalize input (remove spaces and make upcase)
|
||||
$iban = strtoupper(str_replace(' ', '', $iban));
|
||||
|
||||
if (preg_match('/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/', $iban)) {
|
||||
$country = substr($iban, 0, 2);
|
||||
if ($country != $country_code)
|
||||
return 1;
|
||||
// $check = intval(substr($iban, 2, 2));
|
||||
$code_bank = substr($iban, 4, 4);
|
||||
if ($code_bank != $bank_code)
|
||||
return 2;
|
||||
// $account = substr($iban, 4);
|
||||
|
||||
// // To numeric representation
|
||||
// $search = range('A', 'Z');
|
||||
// foreach (range(10, 35) as $tmp)
|
||||
// $replace[] = strval($tmp);
|
||||
// $numstr = str_replace($search, $replace, $account . $country . '00');
|
||||
//
|
||||
// // Calculate checksum
|
||||
// $checksum = intval(substr($numstr, 0, 1));
|
||||
// for ($pos = 1; $pos < strlen($numstr); $pos++) {
|
||||
// $checksum *= 10;
|
||||
// $checksum += intval(substr($numstr, $pos, 1));
|
||||
// $checksum %= 97;
|
||||
// }
|
||||
// return ((98 - $checksum) == $check) ? 3 : 0;
|
||||
|
||||
return 3;
|
||||
} else
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,12 +81,13 @@ $app->register(\SwaggerLume\ServiceProvider::class);
|
|||
|
||||
$app->middleware([
|
||||
App\Http\Middleware\Localization::class,
|
||||
App\Http\Middleware\AuthenticateAccess::class
|
||||
]);
|
||||
|
||||
$app->routeMiddleware([
|
||||
// 'auth' => App\Http\Middleware\Authenticate::class,
|
||||
'docs' => App\Http\Middleware\SecureApiDocs::class,
|
||||
'auth' => App\Http\Middleware\AuthenticateAccess::class
|
||||
|
||||
]);
|
||||
|
||||
/*
|
||||
|
|
|
@ -75,4 +75,7 @@ Paying network : :network :country',
|
|||
"transmitter_network_not_configured" => "This transmitter network is not configured in our system",
|
||||
"transmitter_network_not_authorized" => "This sender network is not authorized to receive transactions in our system",
|
||||
"transmitter_network_not_recognized" => 'This network is not recognized as being a sender network of the recipient network',
|
||||
"invalid_iban" => "The IBAN code is invalid",
|
||||
"country_not_match_iban" => "The IBAN code does not correspond to the country of this bank",
|
||||
"bank_not_match_iban" => "The IBAN code does not correspond to this bank",
|
||||
];
|
||||
|
|
|
@ -75,4 +75,7 @@ Réseau payeur : :network :country',
|
|||
"transmitter_network_not_configured" => "Ce reseau emetteur n'est pas configuré dans notre systeme",
|
||||
"transmitter_network_not_authorized" => "Ce reseau emetteur n'est pas autorisé à recevoir des transactions dans notre systeme",
|
||||
"transmitter_network_not_recognized" => "Ce réseau n'est pas reconnu comme etant un réseau emetteur du reseau destinataire",
|
||||
"invalid_iban" => "Le code IBAN est invalide",
|
||||
"country_not_match_iban" => "Le code IBAN ne correspond pas au pays cette banque",
|
||||
"bank_not_match_iban" => "Le code IBAN ne correspond à cette banque",
|
||||
];
|
||||
|
|
|
@ -14,45 +14,47 @@
|
|||
//$router->get('/', function () use ($router) {
|
||||
// return $router->app->version();
|
||||
//});
|
||||
|
||||
$router->group(['prefix' => '', 'middleware' => 'auth'], function () use ($router) {
|
||||
// Helper routes
|
||||
$router->post('receivePayment', 'TransmittingNetworksController@receivePayment');
|
||||
$router->post('update_password', 'UserController@updatePassword');
|
||||
$router->get('agent_codes/{agent_code}', 'HelperController@agentCodes');
|
||||
$router->get('countries', 'HelperController@countries');
|
||||
$router->get('countries/{dial_code}','HelperController@country');
|
||||
$router->post('paying_networks','HelperController@paying_networks');
|
||||
$router->post('other_paying_networks','HelperController@other_paying_networks');
|
||||
$router->get('init','HelperController@init');
|
||||
$router->post('receivePayment', 'TransmittingNetworksController@receivePayment');
|
||||
$router->post('update_password', 'UserController@updatePassword');
|
||||
$router->get('agent_codes/{agent_code}', 'HelperController@agentCodes');
|
||||
$router->get('countries', 'HelperController@countries');
|
||||
$router->get('countries/{dial_code}', 'HelperController@country');
|
||||
$router->post('paying_networks', 'HelperController@paying_networks');
|
||||
$router->post('other_paying_networks', 'HelperController@other_paying_networks');
|
||||
$router->get('init', 'HelperController@init');
|
||||
|
||||
// Transactions routes
|
||||
$router->group(['prefix' => '/transactions'] , function () use ($router){
|
||||
$router->post('','TransactionController@add');
|
||||
$router->get('{id_wallet}','TransactionController@lastTransactions');
|
||||
$router->post('commission','TransactionController@calculateCommission');
|
||||
$router->delete('{id_transaction}','TransactionController@cancel');
|
||||
$router->group(['prefix' => '/transactions'], function () use ($router) {
|
||||
$router->post('', 'TransactionController@add');
|
||||
$router->get('{id_wallet}', 'TransactionController@lastTransactions');
|
||||
$router->post('commission', 'TransactionController@calculateCommission');
|
||||
$router->delete('{id_transaction}', 'TransactionController@cancel');
|
||||
|
||||
// Transactions wallet ilink
|
||||
$router->group(['prefix' => '/ilink'] , function () use ($router){
|
||||
$router->post('','iLinkTransactionController@add');
|
||||
$router->post('commission','iLinkTransactionController@calculateCommission');
|
||||
$router->get('user/{id_wallet_user}','iLinkTransactionController@lastUserTransactions');
|
||||
$router->get('agent/{id_wallet_agent}','iLinkTransactionController@lastAgentTransactions');
|
||||
$router->post('check_retraits','iLinkTransactionController@getTransactionRetrait');
|
||||
$router->group(['prefix' => '/ilink'], function () use ($router) {
|
||||
$router->post('', 'iLinkTransactionController@add');
|
||||
$router->post('commission', 'iLinkTransactionController@calculateCommission');
|
||||
$router->get('user/{id_wallet_user}', 'iLinkTransactionController@lastUserTransactions');
|
||||
$router->get('agent/{id_wallet_agent}', 'iLinkTransactionController@lastAgentTransactions');
|
||||
$router->post('check_retraits', 'iLinkTransactionController@getTransactionRetrait');
|
||||
$router->delete('{id_transaction}', 'iLinkTransactionController@cancel');
|
||||
$router->post('receive_request_processing_result', 'iLinkTransactionController@receiveRequestProcessingResult');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Credits routes
|
||||
$router->group(['prefix' => '/credits'] , function () use ($router){
|
||||
$router->group(['prefix' => '/credits'], function () use ($router) {
|
||||
$router->put('treatDemand/{id_demand}', 'CreditController@treatDemand');
|
||||
$router->put('cancelDemand/{id_demand}', 'CreditController@cancelDemand');
|
||||
});
|
||||
});
|
||||
|
||||
$router->put('/virement/{id_wallet}','CommissionController@virement');
|
||||
$router->put('/virement/{id_wallet}', 'CommissionController@virement');
|
||||
|
||||
// Wallets routes
|
||||
$router->group(['prefix' => '/wallets'] , function () use ($router){
|
||||
$router->group(['prefix' => '/wallets'], function () use ($router) {
|
||||
$router->get('{id_agent}/activated', 'WalletController@activated');
|
||||
$router->get('{id_wallet}', 'WalletController@show');
|
||||
$router->post('', 'WalletController@create');
|
||||
|
@ -70,20 +72,20 @@ $router->group(['prefix' => '/wallets'] , function () use ($router){
|
|||
//Liste des banques
|
||||
$router->get('banks/{id_wallet_network}', 'WalletController@getWalletBanks');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Idendification routes
|
||||
$router->group(['prefix' => '/identifications'], function () use ($router) {
|
||||
$router->group(['prefix' => '/identifications'], function () use ($router) {
|
||||
$router->post('', 'UserController@identification');
|
||||
$router->put('', 'UserController@updateIdentification');
|
||||
$router->post('{id_identification}', 'UserController@validateIdentification');
|
||||
$router->get('{user_phone}', 'UserController@fetchIdentification');
|
||||
$router->get('verify/{user_phone}', 'UserController@verifyIdentification');
|
||||
$router->post('rattach_card/{id_user}', 'UserController@rattachCard');
|
||||
});
|
||||
});
|
||||
|
||||
// Users groups routes
|
||||
$router->group(['prefix' => '/groups'], function () use ($router) {
|
||||
$router->group(['prefix' => '/groups'], function () use ($router) {
|
||||
$router->post('', 'UserGroupController@createGroup');
|
||||
$router->put('', 'UserGroupController@updateGroup');
|
||||
$router->post('join', 'UserGroupController@joinGroup');
|
||||
|
@ -120,4 +122,5 @@ $router->group(['prefix' => '/groups'], function () use ($router) {
|
|||
$router->get('demands_in_progress/{id_user}', 'NanoCreditController@getSavingsDemandsInProgress');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue