remove attempts to detect amex card in js
This commit is contained in:
@@ -23,32 +23,12 @@ jQuery(document).ready(function($) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//attempt to update amount for amex cards
|
|
||||||
$('#card_number').focusout(function() {
|
|
||||||
console.log(['Card field lost focus', $(this).attr('class')]);
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.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 $settings = Drupal.settings.booking_stripe;
|
var $settings = Drupal.settings.booking_stripe;
|
||||||
var $stripeForm = $("#" + $settings.form_selector);
|
var $stripeForm = $("#" + $settings.form_selector);
|
||||||
//$description = $(':input[name="description"]', $stripeForm).val();
|
|
||||||
//console.log([$description]);
|
|
||||||
//description: currentForm.find('input[name="description"]').val(),
|
|
||||||
//email: currentForm.find('input[name="email"]').val(),
|
|
||||||
//amount: currentForm.find('input[name="amount"]').val() * 100,
|
|
||||||
//alert($(':input[name="description"]', $stripeForm));
|
|
||||||
|
|
||||||
//set the amount dynamically based on the card brand from the token
|
|
||||||
//this doesn't actually work since card_brand isn't set yet
|
|
||||||
if ($(':input[name="card_brand"]', $stripeForm).val() == 'American Express') {
|
|
||||||
var $amount = $(':input[name="foreign_gross_amount"]', $stripeForm).val() * 100;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var $amount = $(':input[name="gross_amount"]', $stripeForm).val() * 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
handler.open({
|
handler.open({
|
||||||
name: $settings.name,
|
name: $settings.name,
|
||||||
@@ -63,8 +43,10 @@ jQuery(document).ready(function($) {
|
|||||||
});
|
});
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
// Close Checkout on page navigation
|
// Close Checkout on page navigation
|
||||||
$(window).on('popstate', function() {
|
$(window).on('popstate', function() {
|
||||||
handler.close();
|
handler.close();
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
});
|
});
|
Reference in New Issue
Block a user