dsfdsf
This commit is contained in:
@@ -2360,9 +2360,40 @@ final class Router
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($catalog === []) {
|
||||||
|
$catalog = $this->fallbackCurrencyCatalog();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->currencyCatalogCache = $catalog;
|
return $this->currencyCatalogCache = $catalog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function fallbackCurrencyCatalog(): array
|
||||||
|
{
|
||||||
|
$entries = [
|
||||||
|
['code' => 'EUR', 'name' => 'Euro'],
|
||||||
|
['code' => 'USD', 'name' => 'US-Dollar'],
|
||||||
|
['code' => 'DOGE', 'name' => 'Dogecoin'],
|
||||||
|
['code' => 'BTC', 'name' => 'Bitcoin'],
|
||||||
|
['code' => 'ETH', 'name' => 'Ethereum'],
|
||||||
|
['code' => 'LTC', 'name' => 'Litecoin'],
|
||||||
|
['code' => 'USDT', 'name' => 'Tether'],
|
||||||
|
['code' => 'USDC', 'name' => 'USD Coin'],
|
||||||
|
];
|
||||||
|
|
||||||
|
return array_map(function (array $entry): array {
|
||||||
|
$code = (string) $entry['code'];
|
||||||
|
|
||||||
|
return [
|
||||||
|
'code' => $code,
|
||||||
|
'name' => (string) $entry['name'],
|
||||||
|
'symbol' => $code,
|
||||||
|
'is_active' => 1,
|
||||||
|
'is_crypto' => $this->isCryptoCurrencyCode($code) ? 1 : 0,
|
||||||
|
'sort_order' => 1000,
|
||||||
|
];
|
||||||
|
}, $entries);
|
||||||
|
}
|
||||||
|
|
||||||
private function currencyCatalogEntry(string $code): ?array
|
private function currencyCatalogEntry(string $code): ?array
|
||||||
{
|
{
|
||||||
$normalizedCode = strtoupper(trim($code));
|
$normalizedCode = strtoupper(trim($code));
|
||||||
|
|||||||
Reference in New Issue
Block a user