You are here

protected function PaymentMethodAddForm::submitBillingProfileForm in Commerce Purchase Order 8

Handles the submission of the billing profile form.

Parameters

array $element: The billing profile form element.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.

File

src/PluginForm/PurchaseOrder/PaymentMethodAddForm.php, line 95

Class

PaymentMethodAddForm
PaymentMethodAddForm for Purchase Order.

Namespace

Drupal\commerce_purchase_order\PluginForm\PurchaseOrder

Code

protected function submitBillingProfileForm(array $element, FormStateInterface $form_state) {
  $billing_profile = $element['#entity'];
  $form_display = EntityFormDisplay::collectRenderDisplay($billing_profile, 'default');
  $form_display
    ->extractFormValues($billing_profile, $element, $form_state);

  /** @var \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method */
  $payment_method = $this->entity;
  $payment_method
    ->setBillingProfile($billing_profile);
}