This commit is contained in:
Nathan Coad
2016-07-23 09:48:27 +10:00
parent f4456a86f0
commit dd70dfd5a3
3 changed files with 4 additions and 7 deletions

View File

@@ -244,7 +244,7 @@ function booking_admin() {
'#default_value' => variable_get('booking_stripe_transaction_fee_percentage_intl', '2.9'), '#default_value' => variable_get('booking_stripe_transaction_fee_percentage_intl', '2.9'),
'#field_prefix' => '%', '#field_prefix' => '%',
'#size' => 5, '#size' => 5,
'#description' => 'Percentage of transaction charged as stripe fee for transactions that include currency conversion, currently 2.9% in Australia', '#description' => 'Percentage of transaction charged as stripe fee for transactions that include currency conversion, currently 2.9% in Australia. This fee also applies to American Express cards.',
); );
$form['stripe']['booking_stripe_logo'] = array ( $form['stripe']['booking_stripe_logo'] = array (
'#type' => 'textfield', '#type' => 'textfield',

View File

@@ -46,14 +46,13 @@ function booking_stripe_form($node, &$form_state, $person, $invoiceid, $net_amou
//set some values for our internal stripe library to help process the form //set some values for our internal stripe library to help process the form
//these will be used by the attached js from booking-strip library to identify which parts of the form to process //these will be used by the attached js from booking-strip library to identify which parts of the form to process
// @todo set name and image in the admin page
$setting['booking_stripe'] = array( $setting['booking_stripe'] = array(
'pubkey' => _booking_get_stripe_public_key(), 'pubkey' => _booking_get_stripe_public_key(),
'form_selector' => str_replace('_', '-', __FUNCTION__), 'form_selector' => str_replace('_', '-', __FUNCTION__),
'name' => $event->booking_eventname, 'name' => $event->booking_eventname,
'image' => variable_get('booking_stripe_logo', ''), 'image' => variable_get('booking_stripe_logo', ''),
); );
//attach settings and javascript to the form //attach settings and javascript to the form
$form['#attached'] = array( $form['#attached'] = array(
'js' => array( 'js' => array(

View File

@@ -24,11 +24,9 @@ jQuery(document).ready(function($) {
}); });
$('.form-submit').click(function (e) { $('.form-submit').click(function (e) {
//currentForm = $(this).closest('form');
//if (currentForm === undefined)
// return;
var $settings = Drupal.settings.booking_stripe; var $settings = Drupal.settings.booking_stripe;
var $stripeForm = $("#" + $settings.form_selector); var $stripeForm = $("#" + $settings.form_selector);
var $amount = $(':input[name="gross_amount"]', $stripeForm).val() * 100;
handler.open({ handler.open({
name: $settings.name, name: $settings.name,