Sha256: 1d272ffe36a8d6672d4d6481074b770f4b9379616db46dfdd188b02e41561132
Contents?: true
Size: 1.13 KB
Versions: 17
Compression:
Stored size: 1.13 KB
Contents
stripeCheckoutHandler = (key, form) -> StripeCheckout.configure key: key token: (token, args) -> if token.error form.find("input[type='submit']").removeAttr('disabled') alert("An error ocurred when contacting Stripe. Your card has not been charged. Please refresh the page and try again. #{token.error.message}") else form.find("input[type='submit']").prop('disabled', true) form.find('input#effective_stripe_subscription_token').val('' + token['id']) form.submit() $(document).on 'click', "#effective-orders-new-subscription-form form input[type='submit']", (event) -> event.preventDefault() obj = $('#effective-orders-new-subscription-form') form = obj.find('form').first() plan = form.find('option:selected') if plan.length > 0 form.find("input[type='submit']").prop('disabled', true) stripeCheckoutHandler(obj.data('stripe-publishable-key'), form).open name: obj.data('site-title') email: obj.data('user-email') description: plan.text() panelLabel: 'Start Subscription' closed: -> form.find("input[type='submit']").removeAttr('disabled')
Version data entries
17 entries across 17 versions & 1 rubygems