add code to handle stripe fees

This commit is contained in:
Nathan Coad
2016-07-22 11:21:27 +10:00
parent 75e7f08111
commit b132ed9682
4 changed files with 121 additions and 98 deletions

View File

@@ -7,32 +7,23 @@ jQuery(document).ready(function($) {
locale: 'auto',
token: function(token) {
try {
//var $token_id = $(':input[name="token_id"]', $stripeForm);
//var $token_email = $(':input[name="token_email"]', $stripeForm);
// Use the token to create the charge with a server-side script.
// You can access the token ID with `token.id`
$(':input[name="token_id"]', $stripeForm).val(token.id);
$(':input[name="token_email"]', $stripeForm).val(token.email);
$stripeForm.get(0).submit();
}
catch(err) {
console.log([err]);
alert(err.message);
console.log([err]);
alert(err.message);
}
// Use the token to create the charge with a server-side script.
// You can access the token ID with `token.id`
//if (currentForm === undefined)
// return;
//currentForm.find('input[name="token_id"]').val(token.id);
//currentForm.find('input[name="token_email"]').val(token.email);
//currentForm.submit();
}
});
//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 settings = Drupal.settings.booking_stripe;
var $stripeForm = $("#" + settings.form_selector);
//$description = $(':input[name="description"]', $stripeForm).val();