You are here

public function PaymentMethodBase::capturePaymentAccess in Payment 8.2

Checks if the payment can be captured.

The payment method must have been configured and the payment must have been authorized prior to capture.

Parameters

\Drupal\Core\Session\AccountInterface $account:

Return value

\Drupal\Core\Access\AccessResultInterface

Overrides PaymentMethodCapturePaymentInterface::capturePaymentAccess

See also

self::capturePayment

File

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

Class

PaymentMethodBase
A base payment method plugin.

Namespace

Drupal\payment\Plugin\Payment\Method

Code

public function capturePaymentAccess(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
    ->doCapturePaymentAccess($account);
}