You are here

public function PayPalBasic::submitConfigurationForm in PayPal for Payment 8

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

{}

Overrides Basic::submitConfigurationForm

2 calls to PayPalBasic::submitConfigurationForm()
PayPalExpress::submitConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalExpress.php
{}
PayPalStandard::submitConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalStandard.php
{}
2 methods override PayPalBasic::submitConfigurationForm()
PayPalExpress::submitConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalExpress.php
{}
PayPalStandard::submitConfigurationForm in src/Plugin/Payment/MethodConfiguration/PayPalStandard.php
{}

File

src/Plugin/Payment/MethodConfiguration/PayPalBasic.php, line 99

Class

PayPalBasic
Abstract class for PayPal payment method configurations.

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['production'] = !empty($values['paypal']['production']);
  $this->configuration['loglevel'] = $values['paypal']['logging']['loglevel'];
  $this->configuration['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_ADMIN] = !empty($values['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_ADMIN]);
  $this->configuration['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_CREATE] = !empty($values['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_CREATE]);
  $this->configuration['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_WEBHOOK] = !empty($values['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_WEBHOOK]);
  $this->configuration['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_REDIRECT] = !empty($values['paypal']['logging'][PayPalBasicMethod::PAYPAL_CONTEXT_TYPE_REDIRECT]);
}