You are here

public function MolliePayment::submitConfigurationForm in Mollie Payment 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 PaymentMethodConfigurationBase::submitConfigurationForm

File

src/Plugin/Payment/MethodConfiguration/MolliePayment.php, line 329

Class

MolliePayment
Provides the configuration for the mollie_payment payment method plugin.

Namespace

Drupal\mollie_payment\Plugin\Payment\MethodConfiguration

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  $this
    ->getExecutePaymentStatusSelector($form_state)
    ->submitSelectorForm($form['plugin_form']['execute']['execute_status'], $form_state);
  $this
    ->getCapturePaymentStatusSelector($form_state)
    ->submitSelectorForm($form['plugin_form']['capture']['plugin_form']['capture_status'], $form_state);
  $this
    ->getRefundPaymentStatusSelector($form_state)
    ->submitSelectorForm($form['plugin_form']['refund']['plugin_form']['refund_status'], $form_state);
  $parents = $form['plugin_form']['brand_label']['#parents'];
  array_pop($parents);
  $values = $form_state
    ->getValues();
  $values = NestedArray::getValue($values, $parents);
  $this
    ->setExecuteStatusId($this
    ->getExecutePaymentStatusSelector($form_state)
    ->getSelectedPlugin()
    ->getPluginId());
  $this
    ->setCapture($values['capture']['capture']);
  $this
    ->setCaptureStatusId($this
    ->getCapturePaymentStatusSelector($form_state)
    ->getSelectedPlugin()
    ->getPluginId());
  $this
    ->setRefund($values['refund']['refund']);
  $this
    ->setRefundStatusId($this
    ->getRefundPaymentStatusSelector($form_state)
    ->getSelectedPlugin()
    ->getPluginId());
  $this
    ->setBrandLabel($values['brand_label']);
  $this
    ->setProfile($values['profile']);
}