function commerce_stripe_settings_form in Commerce Stripe 7.2
Same name and namespace in other branches
- 7.3 commerce_stripe.module \commerce_stripe_settings_form()
- 7 commerce_stripe.module \commerce_stripe_settings_form()
Payment method settings form.
Parameters
$settings: Default settings provided from rules
Return value
array Settings form array
File
- ./
commerce_stripe.module, line 69 - This module provides Stripe (http://stripe.com/) payment gateway integration to Commerce. Commerce Stripe offers a PCI-compliant way to process payments straight from you Commerce shop.
Code
function commerce_stripe_settings_form($settings) {
$form = array();
$form['stripe_currency'] = array(
'#type' => 'select',
'#title' => t('Currency'),
'#options' => array(
'CAD' => t('CAD'),
'EUR' => t('EUR'),
'GBP' => t('GBP'),
'USD' => t('USD'),
'AUD' => t('AUD'),
'CHF' => t('CHF'),
),
'#description' => t('Select the currency that you are using.'),
'#default_value' => !empty($settings['stripe_currency']) ? $settings['stripe_currency'] : 'USD',
);
$form['secret_key'] = array(
'#type' => 'textfield',
'#title' => t('Secret Key'),
'#description' => t('Secret API Key. Get your key from https://stripe.com/'),
'#default_value' => !empty($settings['secret_key']) ? $settings['secret_key'] : STRIPE_SECRET_KEY,
'#required' => TRUE,
);
$form['public_key'] = array(
'#type' => 'textfield',
'#title' => t('Publishable Key'),
'#description' => t('Publishable API Key. Get your key from https://stripe.com/'),
'#default_value' => !empty($settings['public_key']) ? $settings['public_key'] : STRIPE_PUBLIC_KEY,
'#required' => TRUE,
);
$form['display_title'] = array(
'#type' => 'textfield',
'#title' => t('Payment method display title'),
'#description' => t('Payment method display title'),
'#default_value' => !empty($settings['display_title']) ? $settings['display_title'] : t('Stripe'),
);
if (module_exists('commerce_cardonfile')) {
$form['cardonfile'] = array(
'#type' => 'checkbox',
'#title' => t('Enable Card on File functionality.'),
'#default_value' => isset($settings['cardonfile']) ? $settings['cardonfile'] : 0,
);
}
else {
$form['cardonfile'] = array(
'#type' => 'markup',
'#markup' => t('To enable Card on File funcitionality download and install the Card on File module.'),
);
}
return $form;
}