You are here

public function PaymentMethodBase::refundPaymentAccess in Payment 8.2

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.

Parameters

\Drupal\Core\Session\AccountInterface $account:

Return value

\Drupal\Core\Access\AccessResultInterface

Overrides PaymentMethodRefundPaymentInterface::refundPaymentAccess

See also

self::refundPayment

File

src/Plugin/Payment/Method/PaymentMethodBase.php, line 308

Class

PaymentMethodBase
A base payment method plugin.

Namespace

Drupal\payment\Plugin\Payment\Method

Code

public function refundPaymentAccess(AccountInterface $account) {
  if (!$this
    ->getPayment()) {
    throw new \LogicException('Trying to check access for a non-existing payment. A payment must be set trough self::setPayment() first.');
  }
  return $this
    ->doRefundPaymentAccess($account);
}