Set Currency

@since 1.0.0
@param string $currency
@return \Icepay_Pbm_Object
@throws Exception
554356
public function setCurrency($currency)
    {
        if (!Icepay_Parameter_Validation::currency($currency))
            throw new Exception('Please enter a valid currency format (ISO 4217)', 1004);

        $this->currency = $currency;
        return $this;
    }
1185946
public static function zero(Currency $currency = null)
    {
        if (null === $currency) {
            $currency = Currency::valueOf(Currency::NONE);
        }

        return self::valueOf('0', $currency);
    }
888410
public static function currencies(string $currency = null) : Collection
    {
        $currency = strtoupper($currency);

        $file = __DIR__ . "/../Assets/Currencies.json";
        $json = json_decode(file_get_contents($file), true);

        if ($currency) {
            return Collection::make($json[$currency]);
        }

        return Collection::make($json);
    }
141838
public function setCurrency($currency) {

        $this->checkInArray($currency, GDAXConstants::$currencyValues);
        $this->currency = $currency;
        return $this;

    }
921614
public function setPrice(Money $price): self
    {
        $this->updateCurrency($price);
        $this->price = (int) $price->getAmount();
        $this->updateTotalPrice();

        return $this;
    }
100020
public function setCurrency($value)
    {
        $this->amount->setCurrency($value);
        foreach ($this->receipt->getItems() as $item) {
            $item->getPrice()->setCurrency($value);
        }

        return $this;
    }
112102
public function filterByCurrency($currency) {
        foreach ($this->_paymentMethod as $name => $class) {
            if (!in_array($currency, $class->getSupportedCurrency()) && !in_array('00', $class->getSupportedCurrency()))
                unset($this->paymentMethods[$name]);
        }
        return $this;
    }
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'];
    }
70983
@Override
    public MonetaryAmountFactory<T> setCurrency(String currencyCode) {
        this.currency = Monetary.getCurrency(currencyCode);
        return this;
    }
1143210
public function getPrice($currency = self::DEFAULT_CURRENCY)
    {
        $priceKey = 'price_'.strtolower($currency);
        $response = $this->request(sprintf('ticker/%s/?convert=%s', static::DECRED_TICKER, $currency));

        if (!isset($response[$priceKey])) {
            throw new \RuntimeException(sprintf('Missing currency rate %s!', $currency));
        }

        return $response[$priceKey];
    }
978281
public function setPricesCurrency($pricesCurrency = 'RON')
    {
        $pricesCurrency = strtoupper(trim($pricesCurrency));
        switch ($pricesCurrency) {
            case 'ROL':
                $this->pricesCurrency = 'ROL';
                break;

            case 'EUR':
                $this->pricesCurrency = 'EUR';
                break;

            case 'USD':
                $this->pricesCurrency = 'USD';
                break;

            case 'GBP':
                $this->pricesCurrency = 'GBP';
                break;

            case 'BGN':
                $this->pricesCurrency = 'BGN';
                break;

            case 'RON':
            default:
                $this->pricesCurrency = 'RON';
        }

        return true;
    }
205664
public static function fromInt(int $value, string $currency) : Price
    {
        return new self($value * self::DEFAULT_PRECISION, $currency);
    }
934800
private function getCurrencyCode($currency)
    {
        $list = self::getCurrencyList();

        if (isset($list[$currency])) {
            return $list[$currency]['code'];
        }

        throw new \RuntimeException('Invalid exception provided');
    }
577964
public static function of($amount, $currency) : RationalMoney
    {
        $amount = BigRational::of($amount);

        if (! $currency instanceof Currency) {
            $currency = Currency::of($currency);
        }

        return new RationalMoney($amount, $currency);
    }
877840
public function convertAndFormat($money, $language = null, $currency = null)
    {
        if (!$currency) {
            $currency = $this->currencyCode;
        }

        $convertedMoney = $money->convertToCurrency($currency);

        return $this->intlFormatter($language)->format($convertedMoney);
    }
654548
def set_money_currency(self, money_currency):
        
        if money_currency not in self.money_formats:
            raise CurrencyDoesNotExist

        self.money_currency = money_currency
679836
public function init($gateway, $amount, $currency)
    {
        $this->setGateway($gateway);
        $this->setAmount($amount);
        $this->setCurrency($currency);
        return $this;
    }