+ Update calcul de commission
This commit is contained in:
parent
b39dc7b365
commit
6da51dc29a
|
@ -172,11 +172,15 @@ class TransactionController extends Controller
|
||||||
$config = ConfigWallet::where('id_network',$network_agent->network_id)->firstOrFail();
|
$config = ConfigWallet::where('id_network',$network_agent->network_id)->firstOrFail();
|
||||||
$commission = null;
|
$commission = null;
|
||||||
if($request->type == 'credit') {
|
if($request->type == 'credit') {
|
||||||
|
//Depot
|
||||||
$commission = ( $request->montant * $config->taux_com_client_depot / 100 ) + $config->frais_min_banque_depot;
|
$commission = ( $request->montant * $config->taux_com_client_depot / 100 ) + $config->frais_min_banque_depot;
|
||||||
}elseif ($request->type == 'debit'){
|
|
||||||
$commission = $request->montant * $config->taux_com_client_retrait / 100 ;
|
|
||||||
}
|
|
||||||
$data['montant_calcule'] = $request->montant - $commission;
|
$data['montant_calcule'] = $request->montant - $commission;
|
||||||
|
}elseif ($request->type == 'debit'){
|
||||||
|
// Retrait
|
||||||
|
$commission = $request->montant * $config->taux_com_client_retrait / 100 ;
|
||||||
|
$data['montant_calcule'] = $request->montant + $commission;
|
||||||
|
}
|
||||||
|
|
||||||
$data['commission'] = $commission ;
|
$data['commission'] = $commission ;
|
||||||
return $this->successResponse($data);
|
return $this->successResponse($data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue