info('Refreshing exchange rates...'); $baseCurrency = $currencyService->getBaseCurrency(); $provider = config('commerce.currencies.exchange_rates.provider', 'ecb'); $this->line("Base currency: {$baseCurrency}"); $this->line("Provider: {$provider}"); // Check if rates need refresh if (! $this->option('force') && ! \Core\Mod\Commerce\Models\ExchangeRate::needsRefresh()) { $this->info('Rates are still fresh. Use --force to refresh anyway.'); return self::SUCCESS; } $rates = $currencyService->refreshExchangeRates(); if (empty($rates)) { $this->error('No rates were updated. Check logs for errors.'); return self::FAILURE; } $this->info('Updated '.count($rates).' exchange rates:'); $rows = []; foreach ($rates as $currency => $rate) { $rows[] = [$baseCurrency, $currency, number_format($rate, 6)]; } $this->table(['From', 'To', 'Rate'], $rows); return self::SUCCESS; } }