You are here

public function PaymentMethodListBuilder::validateAddPaymentMethod in Ubercart 8.4

Form validation handler for adding a new payment method.

File

payment/uc_payment/src/PaymentMethodListBuilder.php, line 163

Class

PaymentMethodListBuilder
Defines a class to build a listing of payment method configuration entities.

Namespace

Drupal\uc_payment

Code

public function validateAddPaymentMethod(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->isValueEmpty('payment_method_type')) {
    $form_state
      ->setErrorByName('payment_method_type', $this
      ->t('You must select the new payment method type.'));
  }
}