Context:
I use Stripe checkout to accept a one-time payment in rails. I have a charge controller as shown below. At first I used striped webhook to listen to charge.succeeded, but ran into some problems due to the asynchronous nature of webhooks. I moved the business logic to the controller. If the customer order is successful, I save the customer and some other details in db.
My question is:
Is this verification sufficient to ensure a successful payment?
if charge["paid"] == true
Stripe documentation for Stripe :: Charge.create states, "Returns a charged object if the charge succeeds. Causes an error if something goes wrong. A common source of error is an invalid or expired card or a valid card with insufficient balance available.
My ChargesController:
class ChargesController < ApplicationController def new end def create
ruby ruby-on-rails stripe-payments webhooks payment-processing
newbie
source share