You are here

interface PaymentMethodUpdatePaymentStatusInterface in Payment 8.2

Defines a payment method that controls payment status updates.

Users can update payment statuses if they have the "payment.payment.update_status.any" and/or "payment.payment.update_status.own" permissions. By implementing this interface, payment methods can exercise additional control on top of these permissions.

Hierarchy

Expanded class hierarchy of PaymentMethodUpdatePaymentStatusInterface

All classes that implement PaymentMethodUpdatePaymentStatusInterface

4 files declare their use of PaymentMethodUpdatePaymentStatusInterface
PaymentAccessControlHandler.php in src/Entity/Payment/PaymentAccessControlHandler.php
PaymentAccessControlHandlerTest.php in tests/src/Unit/Entity/Payment/PaymentAccessControlHandlerTest.php
PaymentStatusForm.php in src/Entity/Payment/PaymentStatusForm.php
PaymentStatusFormTest.php in tests/src/Unit/Entity/Payment/PaymentStatusFormTest.php

File

src/Plugin/Payment/Method/PaymentMethodUpdatePaymentStatusInterface.php, line 21

Namespace

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

  /**
   * Checks if the payment status can be updated.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   */
  public function updatePaymentStatusAccess(AccountInterface $account);

  /**
   * Returns the statuses that can be set on a payment.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   * @param \Drupal\payment\Entity\PaymentInterface $payment
   *   The payment to set the status on.
   *
   * @return string[]
   *   The plugin IDs of the settable statuses.
   */
  public function getSettablePaymentStatuses(AccountInterface $account, PaymentInterface $payment);

}

Members

Namesort descending Modifiers Type Description Overrides
PaymentMethodUpdatePaymentStatusInterface::getSettablePaymentStatuses public function Returns the statuses that can be set on a payment. 1
PaymentMethodUpdatePaymentStatusInterface::updatePaymentStatusAccess public function Checks if the payment status can be updated. 1