function commerce_braintree_express_checkout_submit_form in Commerce Braintree 7.3
Form callback for Braintree Express Checkout payment method.
See also
CALLBACK_commerce_payment_method_submit_form().
File
- modules/
commerce_braintree_express_checkout/ commerce_braintree_express_checkout.module, line 147 - Provides integration PayPal Express Checkout for Braintree.
Code
function commerce_braintree_express_checkout_submit_form($payment_method, $pane_values, $checkout_pane, $order) {
$nonce = FALSE;
if (!empty($order->data['commerce_braintree_express_checkout']['nonce'])) {
// Unset the nonce if it's no longer valid.
if (commerce_braintree_express_checkout_validate_nonce($order->data['commerce_braintree_express_checkout']['nonce'])) {
$nonce = $order->data['commerce_braintree_express_checkout']['nonce'];
$form['cancel'] = array(
'#type' => 'submit',
'#value' => t('Use another payment method'),
'#element_validate' => array(),
'#submit' => array(
'commerce_braintree_express_checkout_cancel',
),
);
}
}
$form['nonce'] = array(
'#type' => 'hidden',
'#default_value' => $nonce,
);
return $form;
}