You are here

function commerce_braintree_hostedfields_settings_form in Commerce Braintree 7.2

Same name and namespace in other branches
  1. 7.3 modules/commerce_braintree_hostedfields/commerce_braintree_hostedfields.module \commerce_braintree_hostedfields_settings_form()

Payment method callback: Braintree Web settings form.

See also

CALLBACK_commerce_payment_method_settings_form()

File

modules/commerce_braintree_hostedfields/commerce_braintree_hostedfields.module, line 84
Provides integration with Braintree Hosted Fields.

Code

function commerce_braintree_hostedfields_settings_form($settings = array()) {
  $settings = $settings + commerce_braintree_hostedfields_default_settings();

  // Reuse the transparent redirect settings form.
  $form = commerce_braintree_settings_form($settings);

  // Add option to enable the Braintree PayPal button.
  $form['paypal_button'] = array(
    '#type' => 'radios',
    '#title' => t('Include PayPal Button'),
    '#description' => t('Adds the ability to pay via PayPal. <strong>Must also be configured in the Braintree dashboard.</strong>'),
    '#options' => array(
      0 => t('No'),
      1 => t('Yes'),
    ),
    '#default_value' => $settings['paypal_button'],
  );
  $form['advanced_fraud_detect'] = array(
    '#type' => 'radios',
    '#title' => t('Enable Advanced Fraud Detection?'),
    '#description' => t('This requires additional configuration within your merchant account, please review !link', array(
      '!link' => l(t('the Braintree documentation for Advanced Fraud tools'), 'https://articles.braintreepayments.com/support/guides/fraud-tools/advanced/overview'),
    )),
    '#options' => array(
      0 => t('No'),
      1 => t('Yes'),
    ),
    '#default_value' => $settings['advanced_fraud_detect'],
  );
  $form['descriptor_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Unique Store Descriptor Name'),
    '#description' => t('This soft identifier is used to know which store this transaction came from in the case that you are running multiple stores with the same braintree account. Company name/DBA section must be either 3, 7 or 12 characters and the product descriptor can be up to 18, 14, or 9 characters respectively (with an * in between for a total descriptor name of 22 characters).'),
    '#default_value' => $settings['descriptor_name'],
  );
  return $form;
}