*
Check if currency is available by informed iso code for PagSeguro transactions
@param string $currency_iso_code
@return boolean
487196
public static function checkCurrencyAvailabilityByIsoCode($currency_iso_code)
    {
        $available = false;
        if (array_search(strtoupper($currency_iso_code), self::$currencies)) {
            $available = true;
        }
        return $available;
    }
387542
public function equals(Money $money)
    {
        if (!$this->currency->equals($money->getCurrency())) {
            return false;
        }

        return (0 == $this->compare($money));
    }
319572
private static function isValidCurrency($price)
    {
        //====================================================================//
        // Check Contents Available
        if (!isset($price["tax"])) {
            return false;
        }
        if (!isset($price["symbol"])) {
            return false;
        }
        if (!isset($price["code"])) {
            return false;
        }
        if (!isset($price["name"])) {
            return false;
        }

        return true;
    }
245521
public function merchantByCurrency($config = array(), $currency = '')
    {
        if (!is_array($config)) {
            $this->errorMessage[] = 'config is not array!';
            return false;
        } elseif (count($config) == 0) {
            $this->errorMessage[] = 'Empty config array!';
            return false;
        }

        $config['CURRENCY'] = str_replace(' ', '', $currency);
        $variables = array('MERCHANT', 'SECRET_KEY');

        foreach ($variables as $var) {
            if (isset($config[$currency . '_' . $var])) {
                $config[$var] = str_replace(' ', '', $config[$currency . '_' . $var]);
            } elseif (!isset($config[$currency . '_' . $var])) {
                $config[$var] = 'MISSING_' . $var;
                $this->errorMessage[] = 'Missing ' . $var;
            }
        }

        if ($this->debug) {
            foreach ($config as $configKey => $configValue) {
                if (strpos($configKey, 'SECRET_KEY') !== true) {
                    $this->debugMessage[] = $configKey . '=' . $configValue;
                }
            }
        }
        return $config;
    }
518510
public function getIsSelectedCurrencyAvailable()
    {
        $oConfig = $this->getConfig();
        $blEnableMultiCurrency = (bool)$oConfig->getConfigParam('blBestitAmazonPay4OxidEnableMultiCurrency');

        if ($blEnableMultiCurrency === true) {
            return true;
        }

        if ($this->_isSelectedCurrencyAvailable === null) {
            $this->_isSelectedCurrencyAvailable = true;

            $aMap = array(
                'DE' => 'EUR',
                'UK' => 'GBP',
                'US' => 'USD'
            );
            $sLocale = (string)$oConfig->getConfigParam('sAmazonLocale');
            $sCurrency = (string)$this->getSession()->getBasket()->getBasketCurrency()->name;

            //If Locale is DE and currency is not EURO don't allow Amazon checkout process
            if (isset($aMap[$sLocale]) && $aMap[$sLocale] !== $sCurrency) {
                $this->_isSelectedCurrencyAvailable = false;
            }
        }

        return $this->_isSelectedCurrencyAvailable;
    }
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];
    }
232300
public static function checkCurrency($country, $currency)
    {
        switch($country) {
        case KlarnaCountry::AT:
        case KlarnaCountry::DE:
        case KlarnaCountry::NL:
        case KlarnaCountry::FI:
            return ($currency === KlarnaCurrency::EUR);
        case KlarnaCountry::DK:
            return ($currency === KlarnaCurrency::DKK);
        case KlarnaCountry::NO:
            return ($currency === KlarnaCurrency::NOK);
        case KlarnaCountry::SE:
            return ($currency === KlarnaCurrency::SEK);
        default:
            //Country not yet supported by Klarna.
            return false;
        }
    }
512488
public function equals(Money $money)
    {
        if (!$money instanceof MultiCurrencyMoney) {
            return false;
        }

        return $money->currency == $this->currency && $money->getAmount() == $this->getAmount();
    }
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;
    }
84528
public function filterByCurrency($currency)
    {
        $filteredArr = array();
        foreach ($this->_paymentMethodsArrayFiltered as $paymentMethod) {
            $continue = true;
            foreach ($paymentMethod["Issuers"] as $issuer) {
                foreach ($issuer["Countries"] as $country) {
                    if (in_array(strtoupper($currency), $country["Currencies"])) {
                        array_push($filteredArr, $paymentMethod); //return//return
                        $continue = false;
                    }
                    if (!$continue)
                        break;
                }
                if (!$continue)
                    break;
            }
        }
        $this->_paymentMethodsArrayFiltered = $filteredArr;
        return $this;
    }
1259583
protected function validateConvertionRateCurrency()
    {
        $field = 'conversion_rate';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            return null;
        }

        $label = $this->translation->text('Conversion rate');

        if (empty($value) || strlen($value) > 10) {
            $this->setErrorLengthRange($field, $label, 1, 10);
            return false;
        }

        if (preg_match('/^[0-9]\d*(\.\d+)?$/', $value) !== 1) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
799498
def check_update(from_currency, to_currency):
	
	if from_currency not in ccache: # if currency never get converted before
		ccache[from_currency] = {}
	if ccache[from_currency].get(to_currency) is None:
		ccache[from_currency][to_currency] = {'last_update': 0}
	last_update = float(ccache[from_currency][to_currency]['last_update'])
	if time.time() - last_update >= 30 * 60: # if last update is more than 30 min ago
		return True
	return False
938231
public function getPaylikeMultiplier( $currency_iso_code ) {
		$currency = $this->getCurrency( $currency_iso_code );
		if ( isset( $currency['exponent'] ) ) {
			return pow( 10, $currency['exponent'] );
		} else {
			return pow( 10, 2 );
		}
	}
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;
        }
    }
306984
public function getIso($code = null)
    {
        $data = (array) gplcart_config_get(GC_FILE_CONFIG_CURRENCY);

        if (isset($code)) {
            return isset($data[$code]) ? $data[$code] + array('code' => $code) : array();
        }

        return $data;
    }
751986
public function getCurrencyCode()
    {
        $currency = $this->paymentBridge->getCurrency();

        $constantName = sprintf('%s::%s', Currency::class, strtoupper($currency));

        if (!defined($constantName)) {
            throw new CurrencyNotSupportedException();
        }

        return constant($constantName);
    }
197608
public boolean isCurrentSpecial() {
	if (!isValidIndex()) return false;
	return lcText[pos] == '_' || lcText[pos] == '$' || lcText[pos] == SystemUtil.SYMBOL_EURO || lcText[pos] == SystemUtil.SYMBOL_POUND;
    }