You are here

public function PaymentGateway::getConditions in Commerce Core 8.2

Gets the payment gateway conditions.

Return value

\Drupal\commerce\Plugin\Commerce\Condition\ConditionInterface[] The payment gateway conditions.

Overrides PaymentGatewayInterface::getConditions

1 call to PaymentGateway::getConditions()
PaymentGateway::applies in modules/payment/src/Entity/PaymentGateway.php
Checks whether the payment gateway applies to the given order.

File

modules/payment/src/Entity/PaymentGateway.php, line 193

Class

PaymentGateway
Defines the payment gateway entity class.

Namespace

Drupal\commerce_payment\Entity

Code

public function getConditions() {
  $plugin_manager = \Drupal::service('plugin.manager.commerce_condition');
  $conditions = [];
  foreach ($this->conditions as $condition) {
    $condition = $plugin_manager
      ->createInstance($condition['plugin'], $condition['configuration']);
    if ($condition instanceof ParentEntityAwareInterface) {
      $condition
        ->setParentEntity($this);
    }
    $conditions[] = $condition;
  }
  return $conditions;
}