You are here

protected function PaymentMethodAddForm::buildCreditCardForm in Commerce Core 8.2

Same name in this branch
  1. 8.2 modules/payment/src/PluginForm/PaymentMethodAddForm.php \Drupal\commerce_payment\PluginForm\PaymentMethodAddForm::buildCreditCardForm()
  2. 8.2 modules/payment_example/src/PluginForm/Onsite/PaymentMethodAddForm.php \Drupal\commerce_payment_example\PluginForm\Onsite\PaymentMethodAddForm::buildCreditCardForm()

Builds the credit card form.

Parameters

array $element: The target element.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.

Return value

array The built credit card form.

Overrides PaymentMethodAddForm::buildCreditCardForm

File

modules/payment_example/src/PluginForm/Onsite/PaymentMethodAddForm.php, line 13

Class

PaymentMethodAddForm

Namespace

Drupal\commerce_payment_example\PluginForm\Onsite

Code

protected function buildCreditCardForm(array $element, FormStateInterface $form_state) {
  $element = parent::buildCreditCardForm($element, $form_state);

  // Default to a known valid test credit card number.
  $element['number']['#default_value'] = '4111111111111111';
  return $element;
}