NASER fix jibit checker issues and make new settings editable

This commit is contained in:
gholak tala
2026-04-28 16:37:12 +00:00
parent 79a5d98dce
commit c68f8ec53d
3 changed files with 12 additions and 11 deletions
@@ -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('ارتباط با سامانه قطع میباشد.');