You are here

public function DefaultExchangerCalculator::getExchangerId in Commerce Exchanger 8

Return configuration file of active provider or NULL.

Return value

string|null Return provider.

Overrides ExchangerCalculatorInterface::getExchangerId

File

src/DefaultExchangerCalculator.php, line 10

Class

DefaultExchangerCalculator

Namespace

Drupal\commerce_exchanger

Code

public function getExchangerId() {

  // Return the first one.
  foreach ($this->providers as $provider) {
    if ($provider
      ->status()) {
      return $provider
        ->getExchangerConfigName();
    }
  }
  return NULL;
}