You are here

interface PaymentMethodInterface in Payment 8.2

Defines a payment method.

PluginFormInterface is used to configure the plugin for a payment. The form is embedded in another form, so self::submitForm() must only save form values to $this and not redirect the page, for instance.

Plugins can additionally implement the following interfaces:

Hierarchy

Expanded class hierarchy of PaymentMethodInterface

All classes that implement PaymentMethodInterface

18 files declare their use of PaymentMethodInterface
CompletePaymentTest.php in tests/src/Unit/Controller/CompletePaymentTest.php
EventDispatcherCollection.php in src/EventDispatcherCollection.php
EventDispatcherCollectionTest.php in tests/src/Unit/EventDispatcherCollectionTest.php
EventDispatcherInterface.php in src/EventDispatcherInterface.php
Generate.php in src/Tests/Generate.php

... See full list

File

src/Plugin/Payment/Method/PaymentMethodInterface.php, line 32

Namespace

Drupal\payment\Plugin\Payment\Method
View source
interface PaymentMethodInterface extends PluginInspectionInterface, PaymentAwareInterface {

  /**
   * Checks if the payment can be executed.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *
   * @see self::executePayment
   */
  public function executePaymentAccess(AccountInterface $account);

  /**
   * Executes the payment.
   *
   * When executing a payment, it may be authorized, or authorized and captured.
   * After calling this method, more action may be required depending on the
   * return value of self::getPaymentExecutionResult().
   * This method MUST set the payment's status to "payment_pending" before it
   * performs any payment-method-specific logic.
   *
   * @return \Drupal\payment\OperationResultInterface
   *
   * @see self::executePaymentAccess
   */
  public function executePayment();

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

}

Members

Namesort descending Modifiers Type Description Overrides
PaymentAwareInterface::getPayment public function Gets the payment. 1
PaymentAwareInterface::setPayment public function Sets the payment. 1
PaymentMethodInterface::executePayment public function Executes the payment. 2
PaymentMethodInterface::executePaymentAccess public function Checks if the payment can be executed. 2
PaymentMethodInterface::getPaymentExecutionResult public function Gets the payment execution status. 2
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2