feat: automatic instant Jibit verification on customer profile update without admin manual approval
This commit is contained in:
@@ -208,7 +208,7 @@ class CustomerController extends Controller
|
||||
// $tah = new TahesabController();
|
||||
// $tah->store(["customer_id" => $customer->id]);
|
||||
$cfg = app(ConfigService::class);
|
||||
if (!$wasLegal && $cfg->isRegisterJibitVerifyEnabled()) {
|
||||
if (!$wasLegal && !empty($customer->n_code)) {
|
||||
$nCodeError = JibitIdentityService::nationalCodeError($customer->n_code);
|
||||
if ($nCodeError !== null) {
|
||||
return response()->json([
|
||||
@@ -226,7 +226,7 @@ class CustomerController extends Controller
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'ارتباط با سرویس احراز هویت جیبیت برقرار نشد. اطلاعات پروفایل ذخیره شد اما هویت تأیید نشد.',
|
||||
'message' => 'ارتباط با سرویس احراز هویت جیبیت برقرار نشد. لطفاً دقایقی دیگر مجدداً تلاش فرمایید.',
|
||||
'code' => 'jibit_unreachable',
|
||||
], 422);
|
||||
}
|
||||
@@ -257,12 +257,6 @@ class CustomerController extends Controller
|
||||
'code' => $jibit['code'],
|
||||
], 422);
|
||||
}
|
||||
} elseif (!$customer->is_legal && !$cfg->isRegisterJibitVerifyEnabled()) {
|
||||
return response()->json([
|
||||
'ok' => true,
|
||||
'pending_admin' => true,
|
||||
'message' => 'اطلاعات کاربری شما ثبت شد و پس از تایید ادمین فعال سازی خواهد شد',
|
||||
]);
|
||||
}
|
||||
return response()->json(true);
|
||||
} catch (QueryException $e) {
|
||||
|
||||
Reference in New Issue
Block a user