You are here

interface SupportsCreatingPaymentMethodsInterface in Commerce Core 8.2

An interface for gateways supporting direct creation of payment methods.

Payment gateways that implement this interface identify that they allow creating payment methods outside of the process of creating a payment. This will allow tokenization of payment methods during checkout before the order is placed, or from the user page.

Hierarchy

Expanded class hierarchy of SupportsCreatingPaymentMethodsInterface

All classes that implement SupportsCreatingPaymentMethodsInterface

2 files declare their use of SupportsCreatingPaymentMethodsInterface
PaymentInformation.php in modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php
PaymentMethodAddForm.php in modules/payment/src/Form/PaymentMethodAddForm.php

File

modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsCreatingPaymentMethodsInterface.php, line 15

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway
View source
interface SupportsCreatingPaymentMethodsInterface extends SupportsStoredPaymentMethodsInterface {

  /**
   * Creates a payment method with the given payment details.
   *
   * @param \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method
   *   The payment method.
   * @param array $payment_details
   *   The gateway-specific payment details provided by the payment method form
   *   for on-site gateways, or the incoming request for off-site gateways.
   *
   * @throws \Drupal\commerce_payment\Exception\PaymentGatewayException
   *   Thrown when the transaction fails for any reason.
   */
  public function createPaymentMethod(PaymentMethodInterface $payment_method, array $payment_details);

}

Members

Namesort descending Modifiers Type Description Overrides
SupportsCreatingPaymentMethodsInterface::createPaymentMethod public function Creates a payment method with the given payment details. 1
SupportsStoredPaymentMethodsInterface::createPayment public function Creates a payment. 2
SupportsStoredPaymentMethodsInterface::deletePaymentMethod public function Deletes the given payment method. 2