Get information about a country, city or airport using its ID.

@param string $market
@param string $currency
@param string $locale
@param string $id

@return mixed
@throws \GuzzleHttp\Exception\GuzzleException
513732
public function getInformation($market, $currency, $locale, $id)
    {
        $url = implode('/', [$this->url, 'autosuggest', 'v1.0', $market, $currency, $locale]);
        $data = $this->request($url, compact('id'));
        return $data->Places ?? [];
    }
675829
public function retrieveTranslationByIdAndLocale($deliveryStatusId, $locale)
    {
        /** @var DeliveryStatusEntity $deliveryStatus */
        $deliveryStatus = $this->deliveryStatusRepository->find($deliveryStatusId);

        if (!$deliveryStatus || $deliveryStatus->getTranslations()->count() < 1) {
            return null;
        }

        $deliveryStatusTranslation = $deliveryStatus->getTranslations()->first();

        /** @var DeliveryStatusTranslation $translation */
        foreach ($deliveryStatus->getTranslations() as $translation) {
            if ($translation->getLocale() === $locale) {
                $deliveryStatusTranslation = $translation;
                break;
            }
        }

        return $deliveryStatusTranslation;
    }
812595
protected function getCart(ShopInterface $shop, ClientInterface $client = null, $sessionId, $currency)
    {
        $cart = $this->repository->findCart($client, $sessionId, $shop);

        if (null === $cart) {
            $cart = $this->createCart($shop, $client);
        } else {
            $this->updateCart($cart, $client, $currency);
        }

        return $cart;
    }
537103
public function formatByIntl($locale = null, Currencies $currencies = null, $style = NumberFormatter::CURRENCY)
    {
        $numberFormatter = new NumberFormatter($locale ?: static::getLocale(), $style);
        $formatter = new IntlMoneyFormatter($numberFormatter, $currencies ?: static::getCurrencies());

        return $this->formatByFormatter($formatter);
    }
360566
public static CurrencyUnit of(Locale locale) {
        MoneyUtils.checkNotNull(locale, "Locale must not be null");
        CurrencyUnit currency = currenciesByCountry.get(locale.getCountry());
        if (currency == null) {
            throw new IllegalCurrencyException("No currency found for locale '" + locale + '\'');
        }
        return currency;
    }
588352
public function get($name, $locale=null, $hook=true) {
		if(!$locale)
			$locale = $this->getLocale();

		if($hook && ($res = $this->getDefinition()->trigger('get', [$this, $name, $locale])) !== null)
			return $res;

		return $this->_get($name, $locale);
	}
1173807
public function getByIds($ids, $locale)
    {
        if (!is_array($ids) || 0 === count($ids)) {
            return [];
        }

        $accounts = $this->accountRepository->findByIds($ids);

        return array_map(
            function($account) use ($locale) {
                return $this->getApiObject($account, $locale);
            },
            $accounts
        );
    }
312218
public function findByIdAndLocale($id, $locale, $updateApiEntity = true)
    {
        $order = $this->orderRepository->findByIdAndLocale($id, $locale);

        if (!$order) {
            return null;
        }

        $order = $this->orderFactory->createApiEntity($order, $locale);

        if ($updateApiEntity) {
            $this->updateApiEntity($order, $locale);
        }

        return $order;
    }
345934
public function trans($id, array $parameters = [], $domain = 'messages', $locale = null)
    {
        $line = Arr::get($this->lines, $id);

        if (is_null($line)) {
            return $id;
        }

        return $this->makeReplacements($line, $parameters);
    }
1093312
static public function fetch( $id, $locale = false )
    {
        if ( is_string( $locale ) )
            $tags = self::fetchList( array( 'id' => $id ), null, null, false, $locale );
        else
            $tags = self::fetchList( array( 'id' => $id ) );

        if ( is_array( $tags ) && !empty( $tags ) )
            return $tags[0];

        return false;
    }
770335
private function retrievePriceByCurrency(array &$prices, $currencyId)
    {
        /** @var ProductPrice $price */
        foreach ($prices as $index => $price) {
            if ($currencyId === $price->getCurrency()->getId()) {
                unset($prices[$index]);

                return $price;
            }
        }

        return null;
    }
1042505
public static function get($short)
    {
        if( is_numeric($short) && in_array($short, self::$list) )
        {
            return $short;
        }
        elseif( $currency = (self::$list[strtoupper($short)] ?? NULL) )
        {
            return $currency;
        }

        throw new Exception\InvalidCurrencyInformationException(NULL, $short);
    }
462599
public function findPriceByCurrency($currency): ?PriceInterface
    {
        if ($currency instanceof \Money\Currency) {
            $currency = $currency->getCode();
        } elseif ($currency instanceof CurrencyInterface) {
            $currency = $currency->getIsoCodeAlpha();
        }

        if (!is_string($currency)) {
            throw new \InvalidArgumentException('$currency has to be a string');
        }

        foreach ($this->prices as $price) {
            if ($price->getCurrency()->getIsoCodeAlpha() === $currency) {
                return $price;
            }
        }

        return null;
    }
81833
public static function getValue($slug, $featureId, $locale = 'en_US')
    {
        return self::getValues([$slug], [$featureId], $locale)[$slug][$featureId];
    }
165315
private function retrieveExchangeRateFor(Currency $currency): void
    {
        $conversion = sprintf('%s_%s', $this->baseCurrency->getCode(), $currency->getCode());

        $response = $this->client->request('GET', self::EXCHANGE_RATE_API_URL . '/api/v6/convert', [
            'query' => ['q' => $conversion]
        ]);

        $data = json_decode($response->getBody(), true);

        if (! array_key_exists($conversion, $data['results'])) {
            throw CurrencyConverterApiException::currencyNotFound($currency->getCode());
        }

        $this->exchangeRates[$currency->getCode()] = (float) $data['results'][$conversion]['val'];
    }
725438
public function getExchangeRate(ExchangeRateQuery $exchangeQuery): ExchangeRateContract
    {
        $currencyPair = $exchangeQuery->getCurrencyPair();

        $response = $this->request(
            sprintf(
                self::LATEST_URL,
                strtolower($currencyPair->getBaseCurrency()),
                strtolower($currencyPair->getQuoteCurrency())
            )
        );

        $data = StringUtil::jsonToArray($response);

        if (!$data['success']) {
            $message = !empty($data['error']) ? $data['error'] : 'Unknown error';

            throw new Exception($message);
        }

        $date = (new \DateTime())->setTimestamp($data['timestamp']);

        return $this->createRate($currencyPair, (float) ($data['ticker']['price']), $date);
    }
102978
public static function getISO4217CurrencyCode($currency) {
    return (array_key_exists($currency, Connect2PayCurrencyHelper::$currencies)) ? Connect2PayCurrencyHelper::$currencies[$currency]["code"] : null;
  }