Sha256: df39ef1110a10c132fc39876164c9f09cdca343929f2d1d6fadb55c78e9c525e
Contents?: true
Size: 1.4 KB
Versions: 18
Compression:
Stored size: 1.4 KB
Contents
stripeCheckoutHandler = (key, form) -> StripeCheckout.configure key: key closed: -> form.find("input[type='submit']").removeAttr('disabled') $('input[data-disable-with]').each -> try $.rails.enableFormElement($(this)) token: (token, args) -> if token.error form.find("input[type='submit']").removeAttr('disabled') $('input[data-disable-with]').each -> try $.rails.enableFormElement($(this)) 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[name$='[stripe_token]']").val('' + token['id']) form.find("input[type='submit']").prop('disabled', true) $('input[data-disable-with]').each -> try $.rails.disableFormElement($(this)) form.submit() $(document).on 'click', "#effective-orders-new-charge-form form input[type='submit']", (event) -> event.preventDefault() obj = $('#effective-orders-new-charge-form') $form = obj.find('form').first() stripe = obj.data('stripe') # Disable the form $form.find("input[type='submit']").prop('disabled', true) $('input[data-disable-with]').each -> try $.rails.disableFormElement($(this)) stripeCheckoutHandler(stripe.key, $form).open image: stripe.image name: stripe.name description: stripe.description email: stripe.email amount: stripe.amount
Version data entries
18 entries across 18 versions & 1 rubygems