further js mods

This commit is contained in:
Nathan Coad
2016-07-22 09:53:56 +10:00
parent b6bcfacead
commit ac9b330eb7

View File

@@ -14,7 +14,8 @@ jQuery(document).ready(function($) {
$stripeForm.get(0).submit(); $stripeForm.get(0).submit();
} }
catch(err) { catch(err) {
console.log([err]); //console.log([err]);
msg(err);
} }
// Use the token to create the charge with a server-side script. // Use the token to create the charge with a server-side script.
@@ -26,18 +27,22 @@ jQuery(document).ready(function($) {
//currentForm.submit(); //currentForm.submit();
} }
}); });
var currentForm = undefined; //var currentForm = undefined;
$('.form-submit').click(function (e) { $('.form-submit').click(function (e) {
currentForm = $(this).closest('form'); //currentForm = $(this).closest('form');
if (currentForm === undefined) //if (currentForm === undefined)
return; // return;
var $stripeForm = $("#" + settings.form_selector);
handler.open({ handler.open({
name: settings.name, name: settings.name,
description: currentForm.find('input[name="description"]').val(), //description: currentForm.find('input[name="description"]').val(),
email: currentForm.find('input[name="email"]').val(), description: $(':input[name="description"]', $stripeForm),
//email: currentForm.find('input[name="email"]').val(),
email: $(':input[name="email"]', $stripeForm),
currency: "aud", 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, zipCode: true,
closed: function() { closed: function() {
//document.getElementById("booking_stripe_form").submit(); //document.getElementById("booking_stripe_form").submit();