You are here

interface SupportsAuthorizationsInterface in Commerce Core 8.2

Defines the interface for gateways which support authorizing payments.

Hierarchy

Expanded class hierarchy of SupportsAuthorizationsInterface

All classes that implement SupportsAuthorizationsInterface

2 files declare their use of SupportsAuthorizationsInterface
OnsiteInterface.php in modules/payment_example/src/Plugin/Commerce/PaymentGateway/OnsiteInterface.php
OnsitePaymentAddForm.php in modules/payment/src/PluginForm/OnsitePaymentAddForm.php

File

modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsAuthorizationsInterface.php, line 11

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway
View source
interface SupportsAuthorizationsInterface extends SupportsVoidsInterface {

  /**
   * Checks whether the given payment can be captured.
   *
   * @param \Drupal\commerce_payment\Entity\PaymentInterface $payment
   *   The payment to capture.
   *
   * @return bool
   *   TRUE if the payment can be captured, FALSE otherwise.
   */
  public function canCapturePayment(PaymentInterface $payment);

  /**
   * Captures the given authorized payment.
   *
   * Only payments in the 'authorization' state can be captured.
   *
   * @param \Drupal\commerce_payment\Entity\PaymentInterface $payment
   *   The payment to capture.
   * @param \Drupal\commerce_price\Price $amount
   *   The amount to capture. If NULL, defaults to the entire payment amount.
   *
   * @throws \Drupal\commerce_payment\Exception\PaymentGatewayException
   *   Thrown when the transaction fails for any reason.
   */
  public function capturePayment(PaymentInterface $payment, Price $amount = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
SupportsAuthorizationsInterface::canCapturePayment public function Checks whether the given payment can be captured.
SupportsAuthorizationsInterface::capturePayment public function Captures the given authorized payment. 1
SupportsVoidsInterface::canVoidPayment public function Checks whether the given payment can be voided.
SupportsVoidsInterface::voidPayment public function Voids the given payment. 2