public function PaymentGatewayForm::validateInlineForm in Commerce Core 8.2
Validates the inline form.
Parameters
array $inline_form: The inline form, containing the following basic properties:
- #parents: Identifies the location of the field values in $form_state.
\Drupal\Core\Form\FormStateInterface $form_state: The form state of the complete form.
Overrides InlineFormBase::validateInlineForm
File
- modules/
payment/ src/ Plugin/ Commerce/ InlineForm/ PaymentGatewayForm.php, line 149
Class
- PaymentGatewayForm
- Provides a form element for embedding payment gateway forms.
Namespace
Drupal\commerce_payment\Plugin\Commerce\InlineFormCode
public function validateInlineForm(array &$inline_form, FormStateInterface $form_state) {
parent::validateInlineForm($inline_form, $form_state);
try {
$this->pluginForm
->validateConfigurationForm($inline_form, $form_state);
$this->entity = $this->pluginForm
->getEntity();
} catch (PaymentGatewayException $e) {
$error_element = $this->pluginForm
->getErrorElement($inline_form, $form_state);
$form_state
->setError($error_element, $e
->getMessage());
}
}