You are here

public function Basic::submitConfigurationForm in Payment 8.2

Same name in this branch
  1. 8.2 src/Plugin/Payment/MethodConfiguration/Basic.php \Drupal\payment\Plugin\Payment\MethodConfiguration\Basic::submitConfigurationForm()
  2. 8.2 src/Plugin/Payment/LineItem/Basic.php \Drupal\payment\Plugin\Payment\LineItem\Basic::submitConfigurationForm()

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

File

src/Plugin/Payment/LineItem/Basic.php, line 174

Class

Basic
A basic line item.

Namespace

Drupal\payment\Plugin\Payment\LineItem

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $values = NestedArray::getValue($values, $form['#parents']);
  $this
    ->setAmount($values['amount']['amount']);
  $this
    ->setCurrencyCode($values['amount']['currency_code']);
  $this
    ->setDescription($values['description']);
  $this
    ->setName($values['name']);
  $this
    ->setQuantity($values['quantity']);
}