You are here

function commerce_braintree_dropin_submit_form in Commerce Braintree 7.3

Same name and namespace in other branches
  1. 7.2 modules/commerce_braintree_dropin/commerce_braintree_dropin.module \commerce_braintree_dropin_submit_form()

Form callback for Braintree Drop-in payment method.

See also

CALLBACK_commerce_payment_method_submit_form().

File

modules/commerce_braintree_dropin/commerce_braintree_dropin.module, line 185
Provides integration with Braintree Drop-in UI.

Code

function commerce_braintree_dropin_submit_form($payment_method, $pane_values, $checkout_pane, $order) {
  $form = array();
  $arguments = array();
  if (!empty($order->uid)) {
    $account = user_load($order->uid);
    if (!empty($account->data['braintree_vault']['id'])) {
      $arguments['customerId'] = $account->data['braintree_vault']['id'];
    }
  }

  // Append common the drop-in ui form elements to the form array.
  $form += (array) commerce_braintree_dropin_submit_form_elements($payment_method, $arguments, $order);
  return $form;
}