You are here

interface ExchangerProviderRemoteInterface in Commerce Exchanger 8

Defines an interface for remote sources.

Hierarchy

Expanded class hierarchy of ExchangerProviderRemoteInterface

All classes that implement ExchangerProviderRemoteInterface

2 files declare their use of ExchangerProviderRemoteInterface
DefaultExchangerImporter.php in src/DefaultExchangerImporter.php
ExchangeRates.php in src/Entity/ExchangeRates.php

File

src/Plugin/Commerce/ExchangerProvider/ExchangerProviderRemoteInterface.php, line 8

Namespace

Drupal\commerce_exchanger\Plugin\Commerce\ExchangerProvider
View source
interface ExchangerProviderRemoteInterface {

  /**
   * URL from remote provider upon API call should be made.
   *
   * @return string
   *   Returns full url.
   */
  public function apiUrl();

  /**
   * Generic wrapper around Drupal http client.
   *
   * @param array $options
   *   Additional request options.
   *
   * @return mixed
   *   Return response, or error.
   */
  public function apiClient(array $options);

  /**
   * Method which supports remote provider.
   *
   * @return string
   *   Either GET or POST.
   */
  public function getMethod();

  /**
   * Determine if remote provider supports querying by different base currency.
   *
   * @return bool
   *   Return true or false.
   */
  public function isEnterprise();

  /**
   * Remote providers api key.
   *
   * @return string
   *   Return user entered api key or empty string.
   */
  public function getApiKey();

  /**
   * Remote authentication credentials.
   *
   * @return array
   *   Returns multiple parameters needed for authentication.
   */
  public function getAuthData();

  /**
   * Determine if rates provided by provider needs to be transformed
   * in a required rate ratio based on base currency.
   *
   * @return bool
   *   Return true if transfrom rates is ON.
   */
  public function transformRates();

  /**
   * Either remote provider defined base currency, or use entered.
   *
   * @return string
   *   Return currency three letter code - ISO 4217.
   */
  public function getBaseCurrency();

  /**
   * Either remote provider defined or use defined choice.
   *
   * @return bool
   *   Return true if all currencies values are derived from base.
   */
  public function useCrossSync();

  /**
   * Fetch external data.
   *
   * @param string|null $base_currency
   *   If we fetch data based on specific currency.
   */
  public function getRemoteData($base_currency = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
ExchangerProviderRemoteInterface::apiClient public function Generic wrapper around Drupal http client. 1
ExchangerProviderRemoteInterface::apiUrl public function URL from remote provider upon API call should be made. 6
ExchangerProviderRemoteInterface::getApiKey public function Remote providers api key. 1
ExchangerProviderRemoteInterface::getAuthData public function Remote authentication credentials. 1
ExchangerProviderRemoteInterface::getBaseCurrency public function Either remote provider defined base currency, or use entered. 1
ExchangerProviderRemoteInterface::getMethod public function Method which supports remote provider. 1
ExchangerProviderRemoteInterface::getRemoteData public function Fetch external data. 6
ExchangerProviderRemoteInterface::isEnterprise public function Determine if remote provider supports querying by different base currency. 1
ExchangerProviderRemoteInterface::transformRates public function Determine if rates provided by provider needs to be transformed in a required rate ratio based on base currency. 1
ExchangerProviderRemoteInterface::useCrossSync public function Either remote provider defined or use defined choice. 1