You are here

public function PayPalExpress::submitConfigurationForm in PayPal for Payment 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Payment/MethodConfiguration/PayPalExpress.php \Drupal\paypal_payment\Plugin\Payment\MethodConfiguration\PayPalExpress::submitConfigurationForm()

{}

Overrides PayPalBasic::submitConfigurationForm

File

src/Plugin/Payment/MethodConfiguration/PayPalExpress.php, line 80

Class

PayPalExpress
Provides the configuration for the PayPal Express payment method plugin.

Namespace

Drupal\paypal_payment\Plugin\Payment\MethodConfiguration

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  $parents = $form['plugin_form']['paypal']['#parents'];
  array_pop($parents);
  $values = $form_state
    ->getValues();
  $values = NestedArray::getValue($values, $parents);
  $this->configuration['clientId'] = $values['paypal']['clientId'];
  $this->configuration['clientSecret'] = $values['paypal']['clientSecret'];
  $this->configuration['webhookId'] = $this
    ->updateWebhook($this->configuration, $form_state
    ->getValue('id'));
}