January 25, 2021
Let's build for Ruby and Rails developers - Part 16
In part 16 I continue integrating Stripe by tackling the backend side of the equation.
This part covers adding Stripe's new Payment Intent API to the app. This API returns a response for secure charges. Some payments require authentication and this is a way to ensure more secure payment pricing thanks to new regulations across Europe and likely coming soon everywhere else.
It works by first declaring information about the charge and submitting an intent to Stripe. From there that intent returns a response which includes an intent client secret key. That key can then be passed through to your client side code to create a new charge and pass along any meta data you wish. More details of how this works is in the video.
In summary, it's a way to keep more secure things like pricing on the sever side of the equation so it can't be manipulated as easy.
After I integrate the checkout experience I continue to create a new job and return some JSON upon successful response. Each new job posting has a pending status by design. I'll use this as a means to review each new job listing transaction. I want the best quality jobs on this platform so I'm cool with this not being entirely automatic for now.
In the future I may explore subscription-based job listings but for now a one-time charge should suffice.
Follow the entire series here if you're just chiming in:
Let's Build for Ruby and Rails Developers
New to Ruby on Rails? I made a course for you.
Hello Rails is a modern course designed to help you start using and understanding Ruby on Rails fast.