- Update store customer + fix error arcadia

This commit is contained in:
Vincent BRIDIER 2021-05-12 18:39:53 +02:00
parent 18c6017fab
commit cb9bba67b5
2 changed files with 5 additions and 5 deletions

View file

@ -47,7 +47,7 @@ class ArcadiaController extends Controller
$xml = $this->makeXML($fields, $type, $customer, $customerInfos);
try {
Storage::disk('arcadia')->put(date ("Ymd_His") . ".xml", $xml);
Storage::disk('arcadia')->put(date ("Ymd_His") . microtime(true) . ".xml", $xml);
return new StatusResource(['status' => 'OK']);
}catch (\Exception $e){
Log::critical("ARCADIA XML CREATION FAILED : " . $e->getMessage());
@ -124,7 +124,7 @@ class ArcadiaController extends Controller
}
if (!empty($errors))
return ['status' => 'NOK', 'code' => 203, 'message' => $errors];
return ['status' => 'KO', 'code' => 203, 'message' => $errors];
return ['status' => 'OK'];
}

View file

@ -51,7 +51,7 @@ class CustomerController extends Controller
// Si le customer n'existe pas déjà
if (!$customer) {
$customer = new Customer();
$customer->email = $email;
$customer->email = strtolower($email);
$customer->save();
$singleOptin = SingleOptin::where([['email', $email], ['brand_id', $brandId]])->first();
if ($singleOptin)
@ -64,8 +64,8 @@ class CustomerController extends Controller
}
$customerInfos = new CustomerInfos();
$customerInfos->firstname = $firstname;
$customerInfos->lastname = $lastname;
$customerInfos->firstname = ucfirst(strtolower($firstname));
$customerInfos->lastname = ucfirst(strtolower($lastname));
$customerInfos->birth_date = !empty($request->birth_date) ? filter_var($request->birth_date, FILTER_SANITIZE_STRING) : null;
$customerInfos->address = !empty($request->address) ? filter_var($request->address, FILTER_SANITIZE_STRING) : null;
$customerInfos->address2 = !empty($request->address2) ? filter_var($request->address2, FILTER_SANITIZE_STRING) : null;