You are here

class PaymentPreCapture in Payment 8.2

Provides an event that is dispatched before a payment is captured.

Hierarchy

  • class \Drupal\payment\Event\PaymentPreCapture extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of PaymentPreCapture

See also

\Drupal\payment\Event\PaymentEvents::PAYMENT_PRE_CAPTURE

4 files declare their use of PaymentPreCapture
EventDispatcherCollectionTest.php in tests/src/Unit/EventDispatcherCollectionTest.php
PaymentPreCaptureTest.php in tests/src/Unit/Event/PaymentPreCaptureTest.php
SymfonyEventDispatcher.php in src/SymfonyEventDispatcher.php
SymfonyEventDispatcherTest.php in tests/src/Unit/SymfonyEventDispatcherTest.php

File

src/Event/PaymentPreCapture.php, line 13

Namespace

Drupal\payment\Event
View source
class PaymentPreCapture extends Event {

  /**
   * The payment.
   *
   * @var \Drupal\payment\Entity\PaymentInterface
   */
  protected $payment;

  /**-
   * Constructs a new instance.
   *
   * @param \Drupal\payment\Entity\PaymentInterface $payment
   *   The payment that will be captured.
   *
   * @param \Drupal\Core\Session\AccountInterface
   */
  public function __construct(PaymentInterface $payment) {
    $this->payment = $payment;
  }

  /**
   * Gets the payment that will be captured.
   *
   * @return \Drupal\payment\Entity\PaymentInterface
   */
  public function getPayment() {
    return $this->payment;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PaymentPreCapture::$payment protected property The payment.
PaymentPreCapture::getPayment public function Gets the payment that will be captured.
PaymentPreCapture::__construct public function