You are here

interface PaymentMethodCapturePaymentInterface in Payment 8.2

Defines a payment method that can capture authorized payments.

Users can refund payments if they have the "payment.payment.capture.any" permissions and self::capturePaymentAccess() returns TRUE.

Hierarchy

Expanded class hierarchy of PaymentMethodCapturePaymentInterface

All classes that implement PaymentMethodCapturePaymentInterface

3 files declare their use of PaymentMethodCapturePaymentInterface
PaymentAccessControlHandler.php in src/Entity/Payment/PaymentAccessControlHandler.php
PaymentAccessControlHandlerTest.php in tests/src/Unit/Entity/Payment/PaymentAccessControlHandlerTest.php
PaymentCaptureFormTest.php in tests/src/Unit/Entity/Payment/PaymentCaptureFormTest.php

File

src/Plugin/Payment/Method/PaymentMethodCapturePaymentInterface.php, line 17

Namespace

Drupal\payment\Plugin\Payment\Method
View source
interface PaymentMethodCapturePaymentInterface {

  /**
   * Checks if the payment can be captured.
   *
   * The payment method must have been configured and the payment must have been
   * authorized prior to capture.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *
   * @see self::capturePayment
   */
  public function capturePaymentAccess(AccountInterface $account);

  /**
   * Captures the payment.
   *
   * Implementations must dispatch the
   * \Drupal\payment\Event\PaymentEvents::PAYMENT_PRE_CAPTURE Symfony event
   * before capture.
   *
   * @return \Drupal\payment\OperationResultInterface
   *
   * @see self::capturePaymentAccess
   */
  public function capturePayment();

  /**
   * Gets the payment capture status.
   *
   * @return \Drupal\payment\OperationResultInterface
   */
  public function getPaymentCaptureResult();

}

Members

Namesort descending Modifiers Type Description Overrides
PaymentMethodCapturePaymentInterface::capturePayment public function Captures the payment. 1
PaymentMethodCapturePaymentInterface::capturePaymentAccess public function Checks if the payment can be captured. 1
PaymentMethodCapturePaymentInterface::getPaymentCaptureResult public function Gets the payment capture status. 1