NASER add jibit instead of identify verification

This commit is contained in:
gholak tala
2026-04-13 17:50:13 +00:00
parent 82543b5d43
commit 8bdf85aefd
@@ -146,16 +146,31 @@ class CustomerController extends Controller
// $tah = new TahesabController(); // $tah = new TahesabController();
// $tah->store(["customer_id" => $customer->id]); // $tah->store(["customer_id" => $customer->id]);
if (!$customer->is_legal) { if (!$customer->is_legal) {
$nationalCode = $customer->n_code;
$response = Http::withHeaders([ $mobileNumber = $customer->mobile;
'Authorization' => 'Bearer mob83EBzqU7GWBmnc-6gXIp6r2G57P_94', // Storage::put('accessTokenGibit', ['accessToken']);
'Content-Type' => 'application/json', // Storage::put('refreshTokenGibit', ['refreshToken']);
])->post('http://185.97.116.24:20205/check_user', [ $response = Http::withoutVerifying()->withToken(Storage::get('accessTokenGibit'))
'number' => $customer->mobile, ->get("https://napi.jibit.ir/ide/v1/services/matching?nationalCode=".$nationalCode."&mobileNumber=".$mobileNumber)->json();
'national' => $customer->n_code, if (isset($response['code']) && $response['code']== "forbidden"){
'host' => $_SERVER['HTTP_HOST'], $response = Http::withoutVerifying()->withToken(Storage::get('refreshTokenGibit'))
]); ->post("https://napi.jibit.ir/ide/v1/tokens/generate",[
'apiKey' => "J5WxrPxPOg",
'secretKey' => "7dgeE70xQXsQL7r36j3wif6X9",
])->json();
Storage::put('accessTokenGibit', $response['accessToken']);
Storage::put('refreshTokenGibit', $response['refreshToken']);
$response = Http::withoutVerifying()->withToken(Storage::get('accessTokenGibit'))
->get("https://napi.jibit.ir/ide/v1/services/matching?nationalCode=".$nationalCode."&mobileNumber=".$mobileNumber)->json();
}
// $response = Http::withHeaders([
// 'Authorization' => 'Bearer mob83EBzqU7GWBmnc-6gXIp6r2G57P_94',
// 'Content-Type' => 'application/json',
// ])->post('http://185.97.116.24:20205/check_user', [
// 'number' => $customer->mobile,
// 'national' => $customer->n_code,
// 'host' => $_SERVER['HTTP_HOST'],
// ]);
if (isset($response['matched']) and $response['matched'] == true) { if (isset($response['matched']) and $response['matched'] == true) {
$customer->is_legal = 1; $customer->is_legal = 1;