+ Fix bug
This commit is contained in:
parent
29e6282bc1
commit
f208af131a
|
@ -370,9 +370,7 @@ class iLinkTransactionController extends Controller
|
|||
$this->validate($request, $transaction->user_card_rules());
|
||||
$user = $walletUser->user;
|
||||
if ($this->checkPassword($request->password, $user->encrypted_password, $user->salt)) {
|
||||
if ($request->montant > $walletUser->balance) {
|
||||
return $this->errorResponse(trans('errors.insufficient_balance'));
|
||||
} else {
|
||||
|
||||
if (!(isset($user->numero_carte) && isset($user->expiration_date)))
|
||||
return $this->errorResponse(trans('errors.no_bank_card_attached'));
|
||||
|
||||
|
@ -414,7 +412,7 @@ class iLinkTransactionController extends Controller
|
|||
} else {
|
||||
return $this->errorResponse(trans('errors.visa_api_failed'), Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return $this->errorResponse(trans('messages.incorrect_user_password'));
|
||||
}
|
||||
|
@ -423,9 +421,7 @@ class iLinkTransactionController extends Controller
|
|||
$this->validate($request, $transaction->user_card_rules());
|
||||
$user = $walletUser->user;
|
||||
if ($this->checkPassword($request->password, $user->encrypted_password, $user->salt)) {
|
||||
if ($request->montant > $walletUser->balance) {
|
||||
return $this->errorResponse(trans('errors.insufficient_balance'));
|
||||
} else {
|
||||
|
||||
if (!(isset($user->numero_carte) && isset($user->expiration_date)))
|
||||
return $this->errorResponse(trans('errors.no_bank_card_attached'));
|
||||
|
||||
|
@ -451,7 +447,6 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->encrypted_code_retrait = $hash['encrypted'];
|
||||
$transaction->code_retrait_salt = $hash['salt'];
|
||||
|
||||
$walletUser->balance -= $transaction->montant;
|
||||
$transaction->commission_hyp = $frais * $config->taux_com_hyp_retrait_carte_cash_ilink / 100;
|
||||
$walletHyperviseur->balance_com += $transaction->commission_hyp;
|
||||
$transaction->id_wallet_hyp = $walletHyperviseur->id;
|
||||
|
@ -459,7 +454,6 @@ class iLinkTransactionController extends Controller
|
|||
$transaction->date = new \DateTime();
|
||||
$transaction->status_retrait = 0;
|
||||
$walletHyperviseur->save();
|
||||
$walletUser->save();
|
||||
$transaction->id_transaction = $this->getTransactionID();
|
||||
$transaction->save();
|
||||
$message = trans('messages.successful_user_remove_from_cart_to_cash',
|
||||
|
@ -472,7 +466,7 @@ class iLinkTransactionController extends Controller
|
|||
} else {
|
||||
return $this->errorResponse(trans('errors.visa_api_failed'), Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return $this->errorResponse(trans('messages.incorrect_user_password'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue