You are here

interface ExchangerCalculatorInterface in Commerce Exchanger 8

Provides default price calculator with exchange rates.

@package Drupal\commerce_exchanger

Hierarchy

Expanded class hierarchy of ExchangerCalculatorInterface

All classes that implement ExchangerCalculatorInterface

File

src/ExchangerCalculatorInterface.php, line 12

Namespace

Drupal\commerce_exchanger
View source
interface ExchangerCalculatorInterface {

  /**
   * Preform currency conversion for prices.
   *
   * @param \Drupal\commerce_price\Price $price
   *   Price object.
   * @param string $target_currency
   *   Target currency.
   *
   * @return \Drupal\commerce_price\Price
   *   Return updated price object with new currency.
   */
  public function priceConversion(Price $price, string $target_currency);

  /**
   * Get all exchange rates.
   *
   * @return array
   *   Return exchange rates which are used for calculations.
   */
  public function getExchangeRates();

  /**
   * Return configuration file of active provider or NULL.
   *
   * @return string|null
   *   Return provider.
   */
  public function getExchangerId();

}

Members

Namesort descending Modifiers Type Description Overrides
ExchangerCalculatorInterface::getExchangeRates public function Get all exchange rates. 1
ExchangerCalculatorInterface::getExchangerId public function Return configuration file of active provider or NULL. 1
ExchangerCalculatorInterface::priceConversion public function Preform currency conversion for prices. 1