You are here

interface PaymentMethodRefundPaymentInterface in Payment 8.2

Defines a payment method that can Refund authorized payments.

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

Hierarchy

Expanded class hierarchy of PaymentMethodRefundPaymentInterface

All classes that implement PaymentMethodRefundPaymentInterface

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

File

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

Namespace

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

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

  /**
   * Refunds the payment.
   *
   * Implementations must dispatch the
   * \Drupal\payment\Event\PaymentEvents::PAYMENT_PRE_REFUND Symfony event
   * before refunding the payment.
   *
   * @return \Drupal\payment\OperationResultInterface
   *
   * @see self::refundPaymentAccess
   */
  public function refundPayment();

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

}

Members

Namesort descending Modifiers Type Description Overrides
PaymentMethodRefundPaymentInterface::getPaymentRefundResult public function Gets the payment refund status. 1
PaymentMethodRefundPaymentInterface::refundPayment public function Refunds the payment. 1
PaymentMethodRefundPaymentInterface::refundPaymentAccess public function Checks if the payment can be refunded. 1