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
- interface \Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\SupportsStoredPaymentMethodsInterface
- interface \Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\SupportsCreatingPaymentMethodsInterface
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\PaymentGatewayView 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
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SupportsCreatingPaymentMethodsInterface:: |
public | function | Creates a payment method with the given payment details. | 1 |
SupportsStoredPaymentMethodsInterface:: |
public | function | Creates a payment. | 2 |
SupportsStoredPaymentMethodsInterface:: |
public | function | Deletes the given payment method. | 2 |