You are here

public function SymfonyEventDispatcher::executePaymentAccess in Payment 8.2

Checks access for before executing a payment.

Parameters

\Drupal\payment\Entity\PaymentInterface $payment: The payment that will be executed.

\Drupal\payment\Plugin\Payment\Method\PaymentMethodInterface $payment_method: The payment method that will execute the payment.

\Drupal\Core\Session\AccountInterface $account: The account for which to check access.

Return value

\Drupal\Core\Access\AccessResultInterface

Overrides EventDispatcherInterface::executePaymentAccess

File

src/SymfonyEventDispatcher.php, line 71

Class

SymfonyEventDispatcher
Dispatches Payment events through Symfony's event dispatcher.

Namespace

Drupal\payment

Code

public function executePaymentAccess(PaymentInterface $payment, PaymentMethodInterface $payment_method, AccountInterface $account) {
  $event = new PaymentExecuteAccess($payment, $payment_method, $account);
  $this->symfonyEventDispatcher
    ->dispatch(PaymentEvents::PAYMENT_EXECUTE_ACCESS, $event);
  return $event
    ->getAccessResult();
}