You are here

public function SupportsStoredPaymentMethodsInterface::createPayment in Commerce Core 8.2

Creates a payment.

Parameters

\Drupal\commerce_payment\Entity\PaymentInterface $payment: The payment.

bool $capture: Whether the created payment should be captured (VS authorized only). Allowed to be FALSE only if the plugin supports authorizations.

Throws

\InvalidArgumentException If $capture is FALSE but the plugin does not support authorizations.

\Drupal\commerce_payment\Exception\PaymentGatewayException Thrown when the transaction fails for any reason.

2 methods override SupportsStoredPaymentMethodsInterface::createPayment()
Onsite::createPayment in modules/payment_example/src/Plugin/Commerce/PaymentGateway/Onsite.php
Creates a payment.
StoredOffsiteRedirect::createPayment in modules/payment_example/src/Plugin/Commerce/PaymentGateway/StoredOffsiteRedirect.php
Creates a payment.

File

modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsStoredPaymentMethodsInterface.php, line 27

Class

SupportsStoredPaymentMethodsInterface
Defines the interface for gateways which support storing payment methods.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function createPayment(PaymentInterface $payment, $capture = TRUE);