You are here

public function SupportsCreatingPaymentMethodsInterface::createPaymentMethod in Commerce Core 8.2

Creates a payment method with the given payment details.

Parameters

\Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method: The payment method.

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.

1 method overrides SupportsCreatingPaymentMethodsInterface::createPaymentMethod()
Onsite::createPaymentMethod in modules/payment_example/src/Plugin/Commerce/PaymentGateway/Onsite.php
Creates a payment method with the given payment details.

File

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

Class

SupportsCreatingPaymentMethodsInterface
An interface for gateways supporting direct creation of payment methods.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function createPaymentMethod(PaymentMethodInterface $payment_method, array $payment_details);