You are here

protected function ExchangerProviderRemoteBase::importEnterprise in Commerce Exchanger 8

Fetch remote provider by each currency and create dataset.

Return value

array Return array of exchange rates.

1 call to ExchangerProviderRemoteBase::importEnterprise()
ExchangerProviderRemoteBase::buildExchangeRates in src/Plugin/Commerce/ExchangerProvider/ExchangerProviderRemoteBase.php
Process all currencies for rates for other currencies.

File

src/Plugin/Commerce/ExchangerProvider/ExchangerProviderRemoteBase.php, line 119

Class

ExchangerProviderRemoteBase
Base class for Commerce exchanger provider plugins.

Namespace

Drupal\commerce_exchanger\Plugin\Commerce\ExchangerProvider

Code

protected function importEnterprise() {
  $exchange_rates = [];
  foreach ($this->currencies as $code => $currency) {
    $exchange_rates_data = $this
      ->processRemoteData($code);
    $exchange_rates += $this
      ->mapExchangeRates($exchange_rates_data);
  }
  return $exchange_rates;
}