function commerce_braintree_dropin_submit_form in Commerce Braintree 7.2
Same name and namespace in other branches
- 7.3 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 130 - 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);
return $form;
}