You are here

public function DryIcePlugin::submitConfigurationForm in Commerce FedEx 8

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

File

modules/dry_ice/src/Plugin/Commerce/FedEx/DryIcePlugin.php, line 146

Class

DryIcePlugin
Provides the Fedex Dry Ice Service.

Namespace

Drupal\commerce_fedex_dry_ice\Plugin\Commerce\FedEx

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  if (!$form_state
    ->getErrors()) {
    $values = $form_state
      ->getValues();
    $this->configuration['domestic']['package_type'] = $values['domestic']['package_type'];
    $this->configuration['domestic']['weight'] = $values['domestic']['weight'];
    $this->configuration['intl']['package_type'] = $values['intl']['package_type'];
    $this->configuration['intl']['weight'] = $values['intl']['weight'];
  }
}