From ac9b330eb7f7b8e182d79cbca76a9d0af7d3a745 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Fri, 22 Jul 2016 09:53:56 +1000 Subject: [PATCH] further js mods --- booking.stripe.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/booking.stripe.js b/booking.stripe.js index 0fe2f4c..c187254 100644 --- a/booking.stripe.js +++ b/booking.stripe.js @@ -14,7 +14,8 @@ jQuery(document).ready(function($) { $stripeForm.get(0).submit(); } catch(err) { - console.log([err]); + //console.log([err]); + msg(err); } // Use the token to create the charge with a server-side script. @@ -26,18 +27,22 @@ jQuery(document).ready(function($) { //currentForm.submit(); } }); - var currentForm = undefined; + //var currentForm = undefined; $('.form-submit').click(function (e) { - currentForm = $(this).closest('form'); - if (currentForm === undefined) - return; + //currentForm = $(this).closest('form'); + //if (currentForm === undefined) + // return; + var $stripeForm = $("#" + settings.form_selector); handler.open({ name: settings.name, - description: currentForm.find('input[name="description"]').val(), - email: currentForm.find('input[name="email"]').val(), + //description: currentForm.find('input[name="description"]').val(), + description: $(':input[name="description"]', $stripeForm), + //email: currentForm.find('input[name="email"]').val(), + email: $(':input[name="email"]', $stripeForm), currency: "aud", - amount: currentForm.find('input[name="amount"]').val() * 100, + //amount: currentForm.find('input[name="amount"]').val() * 100, + amount: $(':input[name="amount"]', $stripeForm), zipCode: true, closed: function() { //document.getElementById("booking_stripe_form").submit();