@param string $currencyCode

@return CurrencyInterface
339672
private function createCurrency($currencyCode)
    {
        /** @var CurrencyInterface $currency */
        $currency = $this->currencyFactory->createNew();
        $currency->setCode($currencyCode);

        return $currency;
    }
1179969
public function setCurrency($currency)
    {
        if ($currency) {
            $currency = strtoupper($currency);
            Currency::getNumericCode($currency); // ensure currency support
            $this->currency = $currency;
        } else {
            $this->currency = null;
        }

        return $this;
    }
360544
public static Currency getInstance(String currencyCode) {
        synchronized (codesToCurrencies) {
            Currency currency = codesToCurrencies.get(currencyCode);
            if (currency == null) {
                currency = new Currency(currencyCode);
                codesToCurrencies.put(currencyCode, currency);
            }
            return currency;
        }
    }
494725
public function getFraction($currencyCode)
    {
        if (array_key_exists($currencyCode, $this->fractions)) {
            return $this->fractions[$currencyCode];
        }

        return $this->fractions['DEFAULT'];
    }
1362189
protected function getCurrencyFromIsoCode($isoCode)
    {
        $this->prepareCurrencies();

        $isoCode = strtolower($isoCode);

        if (!array_key_exists($isoCode, self::$currencies)) {
            throw new UnknownCurrencyException('Currency with '.$isoCode.' iso code does not exist!');
        }

        return self::$currencies[$isoCode];
    }
1211824
public function getCurrencySymbol($currencyCode = null): string
    {
        if (!extension_loaded('intl')) {
            throw new InvalidConfigException('Locale component requires PHP intl extension to be installed.');
        }

        $locale = $this->locale;

        if ($currencyCode !== null) {
            $locale = $locale->withCurrency($currencyCode);
        }

        $formatter = new NumberFormatter((string)$locale, NumberFormatter::CURRENCY);
        return $formatter->getSymbol(NumberFormatter::CURRENCY_SYMBOL);
    }
21813
private CurrencyData getCurrencyData(String code) {
    CurrencyData data = currencies.get(code);
    if (data == null) {
      data = new CurrencyData();
      data.setCode(code);
      currencies.put(code, data);
    }
    return data;
  }
944450
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $services = $serviceLocator->getServiceLocator();
        $validator = new CurrencyCode();
        $validator->setCurrencyList($services->get(CurrencyListInterface::class));

        return $validator;
    }
1301994
public function getCurrency($currencyCode) : Currency
    {
        if (isset($this->currencies[$currencyCode])) {
            return $this->currencies[$currencyCode];
        }

        if (! isset($this->currencyData[$currencyCode])) {
            if ($this->numericToCurrency === null) {
                $this->numericToCurrency = require __DIR__ . '/../data/numeric-to-currency.php';
            }

            if (isset($this->numericToCurrency[$currencyCode])) {
                return $this->getCurrency($this->numericToCurrency[$currencyCode]);
            }

            throw UnknownCurrencyException::unknownCurrency($currencyCode);
        }

        $currency = new Currency(... $this->currencyData[$currencyCode]);

        return $this->currencies[$currencyCode] = $currency;
    }
923757
public static function getCurrencyCode()
	{
		if (!isset(self::$_currencyCode)) {
			$localeconv = localeconv();
			self::$_currencyCode = ($localeconv['currency_symbol'] != '')
				? $localeconv['currency_symbol'] : $localeconv['int_curr_symbol'];

			if (self::$_currencyCode == '') {
				// Default to $
				self::$_currencyCode = '$';
			}
		}
		return self::$_currencyCode;
	}
914578
public function numericCodeFor(Currency $currency)
    {
        if (!$this->contains($currency)) {
            throw new UnknownCurrencyException('Cannot find ISO currency '.$currency->getCode());
        }

        return $this->getCurrencies()[$currency->getCode()]['numericCode'];
    }
408775
public function setCurrency(\Sulu\Bundle\ProductBundle\Entity\Currency $currency = null)
    {
        $this->currency = $currency;

        return $this;
    }
488003
protected function updateCurrency($code)
    {
        if (!$this->isError() && !$this->currency->update($code, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
312220
public function getCurrencyIdByCode($code) {
        $this->sError = FALSE;

        if ($this->_currencyCode2Id === FALSE) {
            $this->_loadCurrencyCodes();
        }

        if (!isset($this->_currencyCode2Id[$code])) {
            $this->sError = 'Incorect currency code: ' . $code;
            return FALSE;
        }

        return $this->_currencyCode2Id[$code];
    }
1066363
public static function getPaymentFinalCurrencyCode($orderCurrencyCode) {
                
        // Get the object manager
        $manager = \Magento\Framework\App\ObjectManager::getInstance();

        // Load the gateway config and get the gateway payment currency
        $gatewayPaymentCurrency = $manager->create('CheckoutCom\Magento2\Gateway\Config\Config')->getPaymentCurrency();

        // Get the storoe id
        $storeId = $manager->create('Magento\Checkout\Model\Session')->getQuote()->getStoreId();

        // Get the user currency display
        $quote = $manager->create('Magento\Checkout\Model\Session')->getQuote();
        $order = $manager->create('Magento\Checkout\Model\Session')->getLastRealOrder();
        if ($quote) {
            $userCurrencyCode = $quote->getQuoteCurrencyCode();
        }
        else if ($order) {
            $userCurrencyCode = $quote->getOrderCurrencyCode();
        }
        else {
            $userCurrencyCode = $manager->create('Magento\Store\Model\StoreManagerInterface')->getStore($storeId)->getCurrentCurrencyCode();
        }

        // Load the store currency
        $storeBaseCurrencyCode = $manager->create('Magento\Store\Model\StoreManagerInterface')->getStore($storeId)->getBaseCurrency()->getCode(); 

        // Test the store and gateway config conditions
        if ($gatewayPaymentCurrency == self::BASE_CURRENCY) {

            // Use the store base currency code
            $finalCurrencyCode = $storeBaseCurrencyCode;
        }
        elseif ($gatewayPaymentCurrency == self::ORDER_CURRENCY) {

            // Use the order currency code
            $finalCurrencyCode = $userCurrencyCode;
        }
        else {

            // We have a specific currency code to use for the payment
            $finalCurrencyCode = $manager->create('CheckoutCom\Magento2\Gateway\Config\Config')->getCustomCurrency();
        }

        return $finalCurrencyCode;
    }
823482
public function getCurrencyCode($currency = null)
    {
        if ($currency === null) {
            $currency = $this->_currency;
        }

        $code = KlarnaCurrency::getCode($currency);
        return (string) $code;
    }
538240
private static function assertCurrency($code)
    {
        if (!isset(self::$data[$code])) {
            throw new NostoException(sprintf(
                'Currency (%s) must be one of the following ISO 4217 codes: "%s".',
                $code,
                implode('", "', array_keys(self::$data))
            ));
        }
    }