fix price force refresh
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Services;
|
||||
|
||||
use App\Models\Cnt;
|
||||
use App\Models\Order;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -44,10 +45,18 @@ class MontzarService
|
||||
$token = $response['access_token'] ?? $response['token'] ?? null;
|
||||
|
||||
if (!$token) {
|
||||
Log::error('Montzar login failed', [
|
||||
'base_url' => $this->baseUrl(),
|
||||
'mobile' => $this->config()->Config('montzar_mobile'),
|
||||
'response' => $response,
|
||||
]);
|
||||
throw new \Exception('Montzar login failed: ' . json_encode($response, JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
$this->config()->UpdateConfig('montzar_token', $token);
|
||||
Setting::updateOrCreate(
|
||||
['key' => 'montzar_token'],
|
||||
['value' => $token, 'is_active' => 1]
|
||||
);
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user