You are here

public function PaymentOptionsBuilderInterface::buildOptions in Commerce Core 8.2

Builds the payment options for the given order's payment gateways.

The payment options will be derived from the given payment gateways in the following order: 1) The customer's stored payment methods. 2) The order's payment method (if not added in the previous step). 3) Options to create new payment methods of valid types. 4) Options for the remaining gateways (off-site, manual, etc).

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The order.

\Drupal\commerce_payment\Entity\PaymentGatewayInterface[] $payment_gateways: The payment gateways. When empty, defaults to all available gateways.

Return value

\Drupal\commerce_payment\PaymentOption[] The payment options, keyed by option ID.

1 method overrides PaymentOptionsBuilderInterface::buildOptions()
PaymentOptionsBuilder::buildOptions in modules/payment/src/PaymentOptionsBuilder.php
Builds the payment options for the given order's payment gateways.

File

modules/payment/src/PaymentOptionsBuilderInterface.php, line 30

Class

PaymentOptionsBuilderInterface
Builds payment options for an order.

Namespace

Drupal\commerce_payment

Code

public function buildOptions(OrderInterface $order, array $payment_gateways = []);