public function PaymentGatewayBase::submitConfigurationForm in Commerce Core 8.2
Form submission handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Overrides PluginFormInterface::submitConfigurationForm
3 calls to PaymentGatewayBase::submitConfigurationForm()
- Manual::submitConfigurationForm in modules/
payment/ src/ Plugin/ Commerce/ PaymentGateway/ Manual.php - Form submission handler.
- OffsiteRedirect::submitConfigurationForm in modules/
payment_example/ src/ Plugin/ Commerce/ PaymentGateway/ OffsiteRedirect.php - Form submission handler.
- Onsite::submitConfigurationForm in modules/
payment_example/ src/ Plugin/ Commerce/ PaymentGateway/ Onsite.php - Form submission handler.
3 methods override PaymentGatewayBase::submitConfigurationForm()
- Manual::submitConfigurationForm in modules/
payment/ src/ Plugin/ Commerce/ PaymentGateway/ Manual.php - Form submission handler.
- OffsiteRedirect::submitConfigurationForm in modules/
payment_example/ src/ Plugin/ Commerce/ PaymentGateway/ OffsiteRedirect.php - Form submission handler.
- Onsite::submitConfigurationForm in modules/
payment_example/ src/ Plugin/ Commerce/ PaymentGateway/ Onsite.php - Form submission handler.
File
- modules/
payment/ src/ Plugin/ Commerce/ PaymentGateway/ PaymentGatewayBase.php, line 389
Class
- PaymentGatewayBase
- Provides the base class for payment gateways.
Namespace
Drupal\commerce_payment\Plugin\Commerce\PaymentGatewayCode
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
if (!$form_state
->getErrors()) {
$values = $form_state
->getValue($form['#parents']);
$values['payment_method_types'] = array_filter($values['payment_method_types']);
$this->configuration = [];
$this->configuration['display_label'] = $values['display_label'];
$this->configuration['mode'] = $values['mode'];
$this->configuration['payment_method_types'] = array_keys($values['payment_method_types']);
$this->configuration['collect_billing_information'] = $values['collect_billing_information'];
}
}