{:uriI"Âfile:///Users/craigphares/Code/tang/app/assets/javascripts/tang/subscriptions.coffee?type=application/javascript&pipeline=self&id=9168b4542b732353981f42c47b7b13649eff5d3811a9bc374bf703be889ed04d:ET:load_pathI"8/Users/craigphares/Code/tang/app/assets/javascripts;T: filenameI"R/Users/craigphares/Code/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; $form = $('#payment-form'); $form.submit(function(event) { var cardType, cvc, exp, name, number, valid; 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; } $form.find('.submit').prop('disabled', true); if (window.testStripeToken != null) { stripeResponseHandler({}, {}); } else { Stripe.card.createToken($form, stripeResponseHandler); } return false; }); $('input[data-stripe="number"]').payment('formatCardNumber'); $('input[data-stripe="exp"]').payment('formatCardExpiry'); return $('input[data-stripe="cvc"]').payment('formatCardCVC'); }); stripeResponseHandler = function(status, response) { var $form, token; $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"`file-digest:///Users/craigphares/Code/tang/app/assets/javascripts/tang/subscriptions.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%&q4˜ v ¼ÊJ1àš»ý7ŠíO©HûbYð  ìž(: lengthi:dependencies_digest"%‡§$Ñ-0ý3Wq"D¶pK_§Óx"í² Í¸aß\:idI"E9168b4542b732353981f42c47b7b13649eff5d3811a9bc374bf703be889ed04d;F: mtimel+Pî\