You are here

function _commerce_braintree_commerce_payment_checkout_custom_validation in Commerce Braintree 7

Same name and namespace in other branches
  1. 7.3 commerce_braintree.module \_commerce_braintree_commerce_payment_checkout_custom_validation()
  2. 7.2 commerce_braintree.module \_commerce_braintree_commerce_payment_checkout_custom_validation()

Callback. Custom checkout payement validation.

_state

Parameters

$form:

$checkout_pane:

$order:

Return value

bool

1 string reference to '_commerce_braintree_commerce_payment_checkout_custom_validation'
commerce_braintree_commerce_checkout_pane_info_alter in ./commerce_braintree.module
Implements hook_commerce_checkout_pane_info_alter().

File

./commerce_braintree.module, line 235
Implementations of the Braintree payment gateway (http://braintreepayments.com) for drupal commerce.

Code

function _commerce_braintree_commerce_payment_checkout_custom_validation($form, &$form_state, $checkout_pane, $order) {
  if (isset($form_state['values']['commerce_payment']['payment_details']['cardonfile'])) {
    commerce_braintree_payment_session_save($order->order_id, $form_state['values']['commerce_payment']['payment_details']['cardonfile']);
    return TRUE;
  }

  // Do nothing, but still return TRUE.
  return TRUE;
}