You are here

interface SupportsVoidsInterface in Commerce Core 8.2

Defines the interface for gateways which support voiding payments.

Payments can usually only be voided before they are captured/received.

Hierarchy

Expanded class hierarchy of SupportsVoidsInterface

All classes that implement SupportsVoidsInterface

File

modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsVoidsInterface.php, line 12

Namespace

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

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

  /**
   * Voids the given payment.
   *
   * @param \Drupal\commerce_payment\Entity\PaymentInterface $payment
   *   The payment to void.
   *
   * @throws \Drupal\commerce_payment\Exception\PaymentGatewayException
   *   Thrown when the transaction fails for any reason.
   */
  public function voidPayment(PaymentInterface $payment);

}

Members

Namesort descending Modifiers Type Description Overrides
SupportsVoidsInterface::canVoidPayment public function Checks whether the given payment can be voided.
SupportsVoidsInterface::voidPayment public function Voids the given payment. 2