NASER fix jibit checker issues and make new settings editable
This commit is contained in:
@@ -266,22 +266,20 @@ class CustomerController extends SuperController
|
||||
if (empty($request->national_code)) {
|
||||
throw new UnprocessableEntityHttpException('لطفا شماره ملی وارد کنید.');
|
||||
}
|
||||
if(empty($request->birth_date)){
|
||||
throw new UnprocessableEntityHttpException('لطفا تاریخ تولد وارد کنید.');
|
||||
if(!empty($request->birth_date)){
|
||||
$birth_date = Verta::instance(Carbon::parse($request->birth_date))->format('Ymd');
|
||||
}
|
||||
$birth_date = Verta::instance(Carbon::parse($request->birth_date))->format('Ymd');
|
||||
$card_number = preg_replace('/\D/', '', $request->cart_number);
|
||||
|
||||
// dd("ok");
|
||||
|
||||
$response = $this->jibit("cartMatching", $card_number, $request->national_code, $birth_date);
|
||||
|
||||
$response = $this->jibit("cartMatching", $card_number, $request->national_code, $birth_date ?? null);
|
||||
if(isset($response['refresh'])){
|
||||
unset($response['refresh']);
|
||||
}
|
||||
if(!empty($response)){
|
||||
if (isset($response['cartData'])) {
|
||||
unset($response['refresh']);
|
||||
return response()->json($response);
|
||||
}elseif(!empty($response['message'])){
|
||||
if(!empty($response['message'])){
|
||||
throw new UnprocessableEntityHttpException($response['message']);
|
||||
}else{
|
||||
return response()->json($response);
|
||||
}
|
||||
}else{
|
||||
throw new UnprocessableEntityHttpException('ارتباط با سامانه قطع میباشد.');
|
||||
|
||||
Reference in New Issue
Block a user