You are here

class SupportedCurrency in Payment 8.2

Provides a currency that is supported by a payment method.

Hierarchy

Expanded class hierarchy of SupportedCurrency

2 files declare their use of SupportedCurrency
PaymentMethodBaseTest.php in tests/src/Unit/Plugin/Payment/Method/PaymentMethodBaseTest.php
SupportedCurrencyTest.php in tests/src/Unit/Plugin/Payment/Method/SupportedCurrencyTest.php

File

src/Plugin/Payment/Method/SupportedCurrency.php, line 8

Namespace

Drupal\payment\Plugin\Payment\Method
View source
class SupportedCurrency implements SupportedCurrencyInterface {

  /**
   * The currency code.
   *
   * @var string
   */
  protected $currencyCode;

  /**
   * The lowest supported amount.
   *
   * @var int|float
   */
  protected $minimumAmount;

  /**
   * The highest supported amount.
   *
   * @var int|float
   */
  protected $maximumAmount;

  /**
   * Constructs a new instance.
   *
   * @param string $currency_code
   *   The currency code.
   * @param int|float|null $minimum_amount
   *   The minimum amount or NULL if there is no minimum amount.
   * @param int|float|null @$maximum_amount
   *   The maximum amount or NULL if there is no maximum amount.
   */
  public function __construct($currency_code, $minimum_amount = NULL, $maximum_amount = NULL) {
    $this->currencyCode = $currency_code;
    $this->minimumAmount = $minimum_amount;
    $this->maximumAmount = $maximum_amount;
  }

  /**
   * {@inheritdoc}
   */
  public function getCurrencyCode() {
    return $this->currencyCode;
  }

  /**
   * {@inheritdoc}
   */
  public function getMinimumAmount() {
    return $this->minimumAmount;
  }

  /**
   * {@inheritdoc}
   */
  public function getMaximumAmount() {
    return $this->maximumAmount;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SupportedCurrency::$currencyCode protected property The currency code.
SupportedCurrency::$maximumAmount protected property The highest supported amount.
SupportedCurrency::$minimumAmount protected property The lowest supported amount.
SupportedCurrency::getCurrencyCode public function Gets the currency code. Overrides SupportedCurrencyInterface::getCurrencyCode
SupportedCurrency::getMaximumAmount public function Gets the highest supported amount. Overrides SupportedCurrencyInterface::getMaximumAmount
SupportedCurrency::getMinimumAmount public function Gets the lowest supported amount. Overrides SupportedCurrencyInterface::getMinimumAmount
SupportedCurrency::__construct public function Constructs a new instance.