{:uriI"Éfile:///Users/craigphares/Development/tang/app/assets/javascripts/tang/subscriptions.coffee?type=application/javascript&pipeline=self&id=587c02c48c40127416f7ad388e12e475a8fd79aac5dc842328912679f893a28e:ET:load_pathI"?/Users/craigphares/Development/tang/app/assets/javascripts;T: filenameI"Y/Users/craigphares/Development/tang/app/assets/javascripts/tang/subscriptions.coffee;T: nameI"tang/subscriptions;T:logical_pathI"tang/subscriptions.self.js;T:content_typeI"application/javascript;T:sourceI" (function() { var stripeResponseHandler; $(function() { var $form; $('body').prepend('
JS LOADED
'); $form = $('#payment-form'); $form.submit(function(event) { var cardType, cvc, exp, name, number, valid, zip; name = $('input[data-stripe="name"]').val(); if (name.trim().length === 0) { alert('Please enter a valid cardholder name.'); return false; } number = $('input[data-stripe="number"]').val(); valid = $.payment.validateCardNumber(number); if (!valid) { alert('Please enter a valid credit card number.'); return false; } exp = $('input[data-stripe="exp"]').payment('cardExpiryVal'); valid = $.payment.validateCardExpiry(exp.month, exp.year); if (!valid) { alert('Please enter a valid expiration date.'); return false; } cvc = $('input[data-stripe="cvc"]').val(); cardType = $.payment.cardType(number); valid = $.payment.validateCardCVC(cvc, cardType); if (!valid) { alert('Please enter a valid CVC code.'); return false; } zip = $('input[data-stripe="address_zip"]').val(); if (zip.trim().length < 5) { alert('Please enter a valid zip code.'); return false; } $form.find('.submit').prop('disabled', true); Stripe.card.createToken($form, stripeResponseHandler); return false; }); $('input[data-stripe="number"]').payment('formatCardNumber'); $('input[data-stripe="exp"]').payment('formatCardExpiry'); $('input[data-stripe="cvc"]').payment('formatCardCVC'); return $('input[data-stripe="address_zip"]').payment('restrictNumeric'); }); stripeResponseHandler = function(status, response) { var $form, token; $('body').prepend('STRIPE RESPONSE
'); $form = $('#payment-form'); if (response.error) { $form.find('.payment-errors').text(response.error.message); return $form.find('.submit').prop('disabled', false); } else { if (window.testStripeToken != null) { token = window.testStripeToken; } else { token = response.id; } $form.append($('').val(token)); return $form.get(0).submit(); } }; }).call(this); ;T: metadata{:dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"gfile-digest:///Users/craigphares/Development/tang/app/assets/javascripts/tang/subscriptions.coffee;TTF: requiredo;;} F:stubbedo;;} F: linkso;;} F:charsetI" utf-8;F:digest"%;>ÁdY¦ÞŸó1TÉê˜Àÿ{$U…Ý7T÷$ü D:lengthi :dependencies_digest"%9;gÏL½ºc]B¾ÃAÈôÁ"ßCa3§r*<Ú6›:idI"E587c02c48c40127416f7ad388e12e475a8fd79aac5dc842328912679f893a28e;F: mtimel+ÿhòW