function commerce_braintree_default_settings_form in Commerce Braintree 7
Returns the default settings for the Braintree payment method.
2 calls to commerce_braintree_default_settings_form()
- commerce_braintree_cof_settings_form in ./
commerce_braintree.commerce_braintree_cof.inc - Payment method callback: settings form.
- commerce_braintree_settings_form in ./
commerce_braintree.commerce_braintree.inc - Payment method callback: settings form.
File
- ./
commerce_braintree.module, line 110 - Implementations of the Braintree payment gateway (http://braintreepayments.com) for drupal commerce.
Code
function commerce_braintree_default_settings_form($settings = NULL) {
$default_currency = commerce_default_currency();
// Merge default settings into the stored settings array.
// Demonstration or production ?
$form['commerce_braintree_mode'] = array(
'#type' => 'select',
'#title' => t('Mode'),
'#options' => array(
'sandbox' => t('Sandbox'),
'production' => t('Production'),
),
'#default_value' => isset($settings['commerce_braintree_mode']) ? $settings['commerce_braintree_mode'] : NULL,
);
$form['commerce_braintree_merchant_id'] = array(
'#type' => 'textfield',
'#title' => t('Merchant ID'),
'#description' => t("The merchantID."),
'#size' => 30,
'#maxlength' => 128,
'#default_value' => isset($settings['commerce_braintree_merchant_id']) ? $settings['commerce_braintree_merchant_id'] : NULL,
'#required' => TRUE,
);
$form['commerce_braintree_public_key'] = array(
'#type' => 'textfield',
'#title' => t('Public Key'),
'#description' => t("The publicKey."),
'#size' => 30,
'#maxlength' => 128,
'#default_value' => isset($settings['commerce_braintree_public_key']) ? $settings['commerce_braintree_public_key'] : NULL,
'#required' => TRUE,
);
$form['commerce_braintree_private_key'] = array(
'#type' => 'textfield',
'#title' => t('Private Key'),
'#description' => t("The privateKey."),
'#size' => 40,
'#maxlength' => 128,
'#default_value' => isset($settings['commerce_braintree_private_key']) ? $settings['commerce_braintree_private_key'] : NULL,
'#required' => TRUE,
);
return $form;
}