merge goldali with abshode_khanegi branch

This commit is contained in:
2026-06-04 12:18:53 +03:30
parent aea3cbbc6e
commit a9815fa717
28 changed files with 1359 additions and 379 deletions
+40
View File
@@ -303,6 +303,46 @@ class Controller extends BaseController
return $amount > 0 && $amount !== 1.0;
}
public function jibitNcode($nationalCode, $mobile)
{
$counter = Cnt::where('key', 'jibit_counter')->first();
if (empty($counter)) {
$counter = new Cnt();
$counter->key = 'jibit_counter';
$counter->value = 0;
$counter->save();
}
$apiData['refresh'] = Http::withoutVerifying()->withToken(Storage::get('refreshTokenGibit'))
->post('https://napi.jibit.ir/ide/v1/tokens/generate', [
'apiKey' => 'J5WxrPxPOg',
'secretKey' => '7dgeE70xQXsQL7r36j3wif6X9',
])->json();
Storage::put('accessTokenGibit', $apiData['refresh']['accessToken']);
$response = Http::withoutVerifying()->withToken(Storage::get('accessTokenGibit'))
->get("https://napi.jibit.ir/ide/v1/services/matching?mobileNumber=$mobile&nationalCode=$nationalCode")
->json();
if ((isset($response['code'])) && $response['code'] == 'forbidden') {
$refreshToken = Http::withoutVerifying()->withToken(Storage::get('refreshTokenGibit'))
->post('https://napi.jibit.ir/ide/v1/tokens/generate', [
'apiKey' => 'J5WxrPxPOg',
'secretKey' => '7dgeE70xQXsQL7r36j3wif6X9',
])->json();
Storage::put('accessTokenGibit', $refreshToken['accessToken']);
Storage::put('refreshTokenGibit', $refreshToken['refreshToken']);
$response = Http::withoutVerifying()->withToken(Storage::get('accessTokenGibit'))
->get("https://napi.jibit.ir/ide/v1/services/matching?mobileNumber=$mobile&nationalCode=$nationalCode")
->json();
}
$counter->value = (int) $counter->value + 1;
$counter->save();
return $response;
}
public static function jibit($method, $p1 = null, $p2 = null, $p3 = null)
{
$counter = Cnt::where('key', 'jibit_counter')->first();