You are here

class FilterPaymentGatewaysEvent in Commerce Core 8.2

Defines the event for filtering the available payment gateways.

Hierarchy

Expanded class hierarchy of FilterPaymentGatewaysEvent

See also

\Drupal\commerce_payment\Event\PaymentEvents

2 files declare their use of FilterPaymentGatewaysEvent
FilterPaymentGatewaysSubscriber.php in modules/payment/tests/modules/commerce_payment_test/src/EventSubscriber/FilterPaymentGatewaysSubscriber.php
PaymentGatewayStorage.php in modules/payment/src/PaymentGatewayStorage.php

File

modules/payment/src/Event/FilterPaymentGatewaysEvent.php, line 13

Namespace

Drupal\commerce_payment\Event
View source
class FilterPaymentGatewaysEvent extends EventBase {

  /**
   * The payment gateways.
   *
   * @var \Drupal\commerce_payment\Entity\PaymentGatewayInterface[]
   */
  protected $paymentGateways;

  /**
   * The order.
   *
   * @var \Drupal\commerce_order\Entity\OrderInterface
   */
  protected $order;

  /**
   * Constructs a new FilterPaymentGatewaysEvent object.
   *
   * @param \Drupal\commerce_payment\Entity\PaymentGatewayInterface[] $payment_gateways
   *   The payment gateways.
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   */
  public function __construct(array $payment_gateways, OrderInterface $order) {
    $this->paymentGateways = $payment_gateways;
    $this->order = $order;
  }

  /**
   * Gets the payment gateways.
   *
   * @return \Drupal\commerce_payment\Entity\PaymentGatewayInterface[]
   *   The payment gateways.
   */
  public function getPaymentGateways() {
    return $this->paymentGateways;
  }

  /**
   * Sets the payment gateways.
   *
   * @param \Drupal\commerce_payment\Entity\PaymentGatewayInterface[] $payment_gateways
   *   The payment gateways.
   *
   * @return $this
   */
  public function setPaymentGateways(array $payment_gateways) {
    $this->paymentGateways = $payment_gateways;
    return $this;
  }

  /**
   * Gets the order.
   *
   * @return \Drupal\commerce_order\Entity\OrderInterface
   *   The order.
   */
  public function getOrder() {
    return $this->order;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FilterPaymentGatewaysEvent::$order protected property The order.
FilterPaymentGatewaysEvent::$paymentGateways protected property The payment gateways.
FilterPaymentGatewaysEvent::getOrder public function Gets the order.
FilterPaymentGatewaysEvent::getPaymentGateways public function Gets the payment gateways.
FilterPaymentGatewaysEvent::setPaymentGateways public function Sets the payment gateways.
FilterPaymentGatewaysEvent::__construct public function Constructs a new FilterPaymentGatewaysEvent object.