You are here

public function PayPalWebsitePaymentsPro::submitConfigurationForm in Ubercart 8.4

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 CreditCardPaymentMethodBase::submitConfigurationForm

File

payment/uc_paypal/src/Plugin/Ubercart/PaymentMethod/PayPalWebsitePaymentsPro.php, line 88

Class

PayPalWebsitePaymentsPro
Defines the PayPal Website Payments Pro payment method.

Namespace

Drupal\uc_paypal\Plugin\Ubercart\PaymentMethod

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  $this->configuration['wps_email'] = trim($form_state
    ->getValue('wps_email'));
  $this->configuration['wpp_server'] = $form_state
    ->getValue('wpp_server');
  $this->configuration['api']['api_username'] = $form_state
    ->getValue([
    'settings',
    'api',
    'api_username',
  ]);
  $this->configuration['api']['api_password'] = $form_state
    ->getValue([
    'settings',
    'api',
    'api_password',
  ]);
  $this->configuration['api']['api_signature'] = $form_state
    ->getValue([
    'settings',
    'api',
    'api_signature',
  ]);
}