add stripe config options to admin page

This commit is contained in:
Nathan Coad
2016-07-21 08:23:28 +10:00
parent f76d8be329
commit 48abf172a8

View File

@@ -123,6 +123,8 @@ function booking_admin() {
$form['paypal'] = array(
'#type' => 'fieldset',
'#title' => 'Paypal Settings'
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['paypal']['booking_use_paypal'] = array(
'#type' => 'radios',
@@ -175,10 +177,81 @@ function booking_admin() {
'#description' => 'Percentage of transaction charged as paypal fee for transactions that include currency conversion, currently 3.6% in Australia'
);
//Stripe Settings
$form['stripe'] = array (
'#type' => 'fieldset',
'#title' => 'Stripe Settings',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['stripe']['booking_stripe_test_secret_key'] = array (
'#type' => 'textfield',
'#title' => t('Specify Stripe Test Secret Key'),
'#default_value' => variable_get('booking_stripe_test_secret_key', ''),
'#description' => '(Secret API key)',
);
$form['stripe']['booking_stripe_test_public_key'] = array (
'#type' => 'textfield',
'#title' => t('Specify Stripe Test Public Key'),
'#default_value' => variable_get('booking_stripe_test_public_key', ''),
'#description' => '(Public API key)',
);
$form['stripe']['booking_stripe_live_secret_key'] = array (
'#type' => 'textfield',
'#title' => t('Specify Stripe Live Secret Key'),
'#default_value' => variable_get('booking_stripe_live_secret_key', ''),
'#description' => '(Secret API key)',
);
$form['stripe']['booking_stripe_live_public_key'] = array (
'#type' => 'textfield',
'#title' => t('Specify Stripe Live Public Key'),
'#default_value' => variable_get('booking_stripe_live_public_key', ''),
'#description' => '(Public API key)',
);
$form['stripe']['booking_stripe_testmode'] = array (
'#type' => 'radios',
'#title' => t('Stripe Test mode'),
'#description' => t('When in test mode, payments will use test api keys which will not make any charges to cards. Leave this as off unless doing testing.'),
'#options' => array (0 => t('Off'), t('On')),
'#default_value' => variable_get('booking_stripe_testmode', 0),
);
$form['stripe']['booking_stripe_transaction_fee_fixedcost'] = array (
'#type' => 'textfield',
'#title' => t('Stripe fixed cost transaction fee'),
'#default_value' => variable_get('booking_stripe_transaction_fee_fixedcost', '0.3'),
'#field_prefix' => '$',
'#size' => 5,
'#description' => 'Transaction fee is currently $0.3 AUD and is added before the percentage fee is applied.',
);
$form['stripe']['booking_stripe_transaction_fee_percentage'] = array (
'#type' => 'textfield',
'#title' => t('Stripe Percentage Transaction Fee'),
'#default_value' => variable_get('booking_stripe_transaction_fee_percentage', '1.75'),
'#field_prefix' => '%',
'#size' => 5,
'#description' => 'Percentage of transaction charged as stripe fee, currently 1.75% in Australia',
);
$form['stripe']['booking_stripe_transaction_fee_percentage_intl'] = array (
'#type' => 'textfield',
'#title' => t('Stripe Percentage Transaction Fee (International)'),
'#default_value' => variable_get('booking_stripe_transaction_fee_percentage_intl', '2.9'),
'#field_prefix' => '%',
'#size' => 5,
'#description' => 'Percentage of transaction charged as stripe fee for transactions that include currency conversion, currently 2.9% in Australia',
);
$form['features'] = array(
'#type' => 'fieldset',
'#title' => 'Enable/Disable Features'
);
$form['features']['booking_payment_processor'] = array (
'#type' => 'radios',
'#title' => t('Select Payment Processor to use'),
'#description' => t('Select between Paypal and Stripe to use for integrated payment methods. Has no impact if manual payments are being used.'),
'#options' => array (0 => t('Paypal'), t('Stripe')),
'#default_value' => variable_get('booking_payment_processor', 0),
);
$form['features']['booking_enable_roomallocations'] = array(
'#type' => 'radios',
'#title' => t('Enable room allocations?'),