You are here

public function CreditMessagingForm::submitForm in Commerce PayPal 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ConfigFormBase::submitForm

File

src/Form/CreditMessagingForm.php, line 55

Class

CreditMessagingForm
Provides a configuration form for PayPal credit messaging.

Namespace

Drupal\commerce_paypal\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('commerce_paypal.credit_messaging_settings')
    ->set('client_id', $form_state
    ->getValue('client_id'))
    ->set('add_to_cart', $form_state
    ->getValue('add_to_cart'))
    ->save();
}