From dd70dfd5a3363e3dd313d1cd4c9c5848b04d6e5d Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sat, 23 Jul 2016 09:48:27 +1000 Subject: [PATCH] bugfix --- booking.admin.inc | 2 +- booking.stripe.inc | 3 +-- booking.stripe.js | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/booking.admin.inc b/booking.admin.inc index daaa7d1..08263f2 100644 --- a/booking.admin.inc +++ b/booking.admin.inc @@ -244,7 +244,7 @@ function booking_admin() { '#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', + '#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 ( '#type' => 'textfield', diff --git a/booking.stripe.inc b/booking.stripe.inc index 6dea0a8..6437392 100644 --- a/booking.stripe.inc +++ b/booking.stripe.inc @@ -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 //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( 'pubkey' => _booking_get_stripe_public_key(), 'form_selector' => str_replace('_', '-', __FUNCTION__), 'name' => $event->booking_eventname, 'image' => variable_get('booking_stripe_logo', ''), ); + //attach settings and javascript to the form $form['#attached'] = array( 'js' => array( diff --git a/booking.stripe.js b/booking.stripe.js index dfd32e1..f13785a 100644 --- a/booking.stripe.js +++ b/booking.stripe.js @@ -24,12 +24,10 @@ jQuery(document).ready(function($) { }); $('.form-submit').click(function (e) { - //currentForm = $(this).closest('form'); - //if (currentForm === undefined) - // return; var $settings = Drupal.settings.booking_stripe; var $stripeForm = $("#" + $settings.form_selector); - + var $amount = $(':input[name="gross_amount"]', $stripeForm).val() * 100; + handler.open({ name: $settings.name, currency: "aud",