You are here

public function PaymentForm::validateForm in Payment 8.2

Button-level validation handlers are highly discouraged for entity forms, as they will prevent entity validation from running. If the entity is going to be saved during the form submission, this method should be manually invoked from the button-level validation handler, otherwise an exception will be thrown.

Overrides ContentEntityForm::validateForm

File

modules/payment_form/src/Entity/Payment/PaymentForm.php, line 114

Class

PaymentForm
Provides the payment form.

Namespace

Drupal\payment_form\Entity\Payment

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  $this
    ->getPluginSelector($form_state)
    ->validateSelectorForm($form['payment_method'], $form_state);
}