Operation deleteCurrencyByIdAsyncWithHttpInfo

Delete Currency

@param  string $currency_id ID of currency to delete. (required)

@throws \InvalidArgumentException
@return \GuzzleHttp\Promise\PromiseInterface
967653
protected static function deleteCurrencyByIdAsyncWithHttpInfo($currency_id) 
    {
        $returnType = '';  
        $request = self::deleteCurrencyByIdRequest($currency_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
169925
public static function checkCurrency($currency, $allowedCurrencies = null)
    {
        $currencies = self::$_defaultAllowedCurrencies;
        if (isset($allowedCurrencies) && is_array($allowedCurrencies)) {
            $currencies = $allowedCurrencies;
        }

        if ($currency == null || $currency == '') {
            throw new HpsInvalidRequestException(
                HpsExceptionCodes::MISSING_CURRENCY,
                'Currency cannot be none',
                'currency'
            );
        } else if (!in_array(strtolower($currency), $currencies)) {
            throw new HpsInvalidRequestException(
                HpsExceptionCodes::INVALID_CURRENCY,
                "'".strtolower($currency)."' is not a supported currency",
                'currency'
            );
        }
    }
1051621
public function convertTo(Currency $currency)
    {
        if ($this->currency->getCode() === $currency->getCode()) {
            return $this;
        }

        $baseAmount = $this->amount;

        if ($this->currency->getCode() !== static::baseCurrency()->getCode()) {
            $baseAmount = static::localAmountToDefault($this->amount, $this->currency);
        }

        return new static(
            static::baseAmountToLocal($baseAmount, $currency), $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);
    }
322325
public function update(CurrencyUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $currency = CurrencyQuery::create()->findPk($event->getCurrencyId())) {
            $currency
                ->setDispatcher($dispatcher)

                ->setLocale($event->getLocale())
                ->setName($event->getCurrencyName())
                ->setSymbol($event->getSymbol())
                ->setFormat($event->getFormat())
                ->setRate($event->getRate())
                ->setCode(strtoupper($event->getCode()))

                ->save();

            $event->setCurrency($currency);
        }
    }
1022974
public static function createFromCurrencies(Currency $baseCurrency, Currency $counterCurrency)
    {
        $message = sprintf(
            'Cannot resolve a currency pair for currencies: %s/%s',
            $baseCurrency->getCode(),
            $counterCurrency->getCode()
        );

        return new self($message);
    }
969548
public function setCurrencyCode($currencyCode): self
    {
        if ($currencyCode instanceof RowColumn) {
            $this->currency_column = $currencyCode->getColumnName();
        } elseif (!is_string($currencyCode) || trim($currencyCode) === '') {
            throw new Exception\InvalidArgumentException(__METHOD__ . ' Currency code must be an non empty string (or a RowColumn object)');
        }
        $this->params['currency_code'] = $currencyCode;

        return $this;
    }
803952
protected static function deleteTableRateRuleByIdAsyncWithHttpInfo($table_rate_rule_id) 
    {
        $returnType = '';  
        $request = self::deleteTableRateRuleByIdRequest($table_rate_rule_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
1061211
public static MozuUrl deleteCurrencyLocalizationUrl(String currencyCode)
	{
		UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}");
		formatter.formatUrl("currencyCode", currencyCode);
		return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
	}
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;
    }
178049
public static CurrencyUnit removeCurrencyUnit(Locale locale) {
        Objects.requireNonNull(locale);
        return ConfigurableCurrencyUnitProvider.CURRENCY_UNITS_BY_LOCALE.remove(locale);
    }
1352359
private function setCurrency(Currency $currency = null)
    {
        if($currency != null)
            $this->currency = $currency;
        else
        {
            $this->currency = new Currency();
        }
    }
98352
protected static function deleteAddressByIdAsyncWithHttpInfo($address_id) 
    {
        $returnType = '';  
        $request = self::deleteAddressByIdRequest($address_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
1071608
public static function useCurrency($currency, $symbol = null)
    {
        static::$currency = $currency;

        static::useCurrencySymbol($symbol ?: static::guessCurrencySymbol($currency));
    }
693767
@Indexable(type = IndexableType.DELETE)
	@Override
	public CommerceCurrency deleteCommerceCurrency(
		CommerceCurrency commerceCurrency) {
		return commerceCurrencyPersistence.remove(commerceCurrency);
	}
932326
public function actionCurrency($value, $currency = null, $options = [], $textOptions = [])
    {
        return Yii::$app->formatter->asCurrency($value, $currency, $options, $textOptions);
    }
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;
    }