use foreign transaction rate for amex cards

This commit is contained in:
Nathan Coad
2016-07-22 15:15:19 +10:00
parent 5f8f17e798
commit b102d4c496
3 changed files with 35 additions and 33 deletions

View File

@@ -1,16 +1,19 @@
jQuery(document).ready(function($) {
var settings = Drupal.settings.booking_stripe;
var $stripeForm = $("#" + settings.form_selector);
var $settings = Drupal.settings.booking_stripe;
var $stripeForm = $("#" + $settings.form_selector);
var handler = StripeCheckout.configure({
key: settings.pubkey,
image: settings.image,
locale: 'auto',
token: function(token) {
try {
// Use the token to create the charge with a server-side script.
// You can access the token ID with `token.id`
//store the returned token into hidden form elements
$(':input[name="token_id"]', $stripeForm).val(token.id);
$(':input[name="token_email"]', $stripeForm).val(token.email);
$(':input[name="token_client_ip"]', $stripeForm).val(token.client_ip);
$(':input[name="card_brand"]', $stripeForm).val(token.card.brand);
$(':input[name="card_cvc_check"]', $stripeForm).val(token.card.cvc_check);
$(':input[name="card_address_zip_check"]', $stripeForm).val(token.card.address_zip_check);
$stripeForm.get(0).submit();
}
catch(err) {
@@ -24,8 +27,8 @@ jQuery(document).ready(function($) {
//currentForm = $(this).closest('form');
//if (currentForm === undefined)
// return;
var settings = Drupal.settings.booking_stripe;
var $stripeForm = $("#" + settings.form_selector);
var $settings = Drupal.settings.booking_stripe;
var $stripeForm = $("#" + $settings.form_selector);
//$description = $(':input[name="description"]', $stripeForm).val();
//console.log([$description]);
//description: currentForm.find('input[name="description"]').val(),