PaymentMethodAddForm.php in Commerce Core 8.2
File
modules/payment_example/src/PluginForm/Onsite/PaymentMethodAddForm.php
View source
<?php
namespace Drupal\commerce_payment_example\PluginForm\Onsite;
use Drupal\commerce_payment\PluginForm\PaymentMethodAddForm as BasePaymentMethodAddForm;
use Drupal\Core\Form\FormStateInterface;
class PaymentMethodAddForm extends BasePaymentMethodAddForm {
protected function buildCreditCardForm(array $element, FormStateInterface $form_state) {
$element = parent::buildCreditCardForm($element, $form_state);
$element['number']['#default_value'] = '4111111111111111';
return $element;
}
}