+ Change structure of ID transaction
This commit is contained in:
parent
5cea0ca950
commit
6c0c4dbbce
|
@ -192,7 +192,7 @@ class iLinkTransactionController extends Controller
|
|||
'net_final' => $this->toMoneyWithCurrency($montantDepot, $init_country, $request->final_country), 'fees' => $this->toMoney($frais + $taxe, $init_country),
|
||||
'init_country' => $this->getCountryName($init_country), 'final_country' => $this->getCountryName($request->final_country),
|
||||
'sender_code' => $user->user_code, 'receiver_code' => $transaction->id_destinataire]);
|
||||
$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'));
|
||||
}
|
||||
} else {
|
||||
|
@ -1183,4 +1183,23 @@ class iLinkTransactionController extends Controller
|
|||
shuffle($temp_array);
|
||||
return implode('', $temp_array);
|
||||
}
|
||||
|
||||
private function getTransactionID(){
|
||||
do{
|
||||
$code=$this->generateTransactionCode();
|
||||
$result = collect(DB::select('SELECT * FROM wallet_ilink_transaction WHERE id_transaction = :code',['code'=>$code]));
|
||||
$codeCorrect=sizeof($result)<0;
|
||||
}while($codeCorrect);
|
||||
return $code;
|
||||
}
|
||||
|
||||
private function generateTransactionCode($length = 12) {
|
||||
$characters = '23456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ';
|
||||
$charactersLength = strlen($characters);
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
return $randomString;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,11 +131,11 @@ trait Helper
|
|||
}
|
||||
|
||||
|
||||
public function getTransactionID(){
|
||||
$d = new DateTime();
|
||||
$first = str_replace(['-',':'], '',$d->format("y-m-d H:i:s.u"));
|
||||
return str_replace(' ' ,'.',$first);
|
||||
}
|
||||
// public function getTransactionID(){
|
||||
// $d = new DateTime();
|
||||
// $first = str_replace(['-',':'], '',$d->format("y-m-d H:i:s.u"));
|
||||
// return str_replace(' ' ,'.',$first);
|
||||
// }
|
||||
|
||||
public function getCurrency($id_country){
|
||||
$cc = CountriesCurrency::findOrFail($id_country);
|
||||
|
|
Loading…
Reference in New Issue