All threads / How do I pause the submission of a form until successful stripe payment?
Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I pause the submission of a form until successful stripe payment?

Jack asked in Rails

Hey guys. I'm losing my mind trying to figure this out.

I have an app where I charge people to submit a screenplay. The code is very simple thus far.

  1. The user clicks submit on the form
  2. Take them to stripe checkout where they can pay

However, I don't want the form to be submitted until the user actually pays. I'm guessing I would implement this with webhooks. The issue is I have no idea how to go about pausing the form until the successful payment, and then submitting the form with the webhooks once the payment is made.

I hope I explained this well enough. If anyone could point me in the right direction (either with vanilla stripe or the pay gem) it would be greatly appreciated. Thank you!

How you add stripe payment functionality

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 64,614+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.