You are here

public function Payment::ajaxCallback in Ubercart 8.4

AJAX callback to render the payment method pane.

File

payment/uc_payment/src/Plugin/Ubercart/OrderPane/Payment.php, line 145

Class

Payment
Specify and collect payment for an order.

Namespace

Drupal\uc_payment\Plugin\Ubercart\OrderPane

Code

public function ajaxCallback($form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response
    ->addCommand(new ReplaceCommand('#payment-details', trim(drupal_render($form['payment']['payment_details']))));
  $status_messages = [
    '#type' => 'status_messages',
  ];
  $response
    ->addCommand(new PrependCommand('#payment-details', drupal_render($status_messages)));
  return $response;
}