You are here

function commerce_braintree_commerce_braintree_hostedfields_js_alter in Commerce Braintree 7.2

Same name and namespace in other branches
  1. 7.3 modules/commerce_braintree_hostedfields/commerce_braintree_hostedfields.api.php \commerce_braintree_commerce_braintree_hostedfields_js_alter()

Implements hook_commerce_braintree_hostedfields_js_alter().

Parameters

$js_settings: An array of settings by reference that will be passed to the javascript API for Braintree.

$payment_method: The Drupal commerce payment method settings for context.

File

modules/commerce_braintree_hostedfields/commerce_braintree_hostedfields.api.php, line 32
Provides API methods exposed by this module.

Code

function commerce_braintree_commerce_braintree_hostedfields_js_alter(&$js_settings, $payment_method) {

  // Change the color of the input text to pink.
  // See https://developers.braintreepayments.com/reference/client-reference/javascript/v2/hosted-fields#options
  $js_settings['hostedFields']['styles'] = array(
    'input' => array(
      'color' => 'blue',
    ),
  );
}