How to only save instance of a class once Checkout Fulfilled (One-time payment) #517
|
Hi all, Loving this gem! Just a quick question. Let's say I have a Job model. And I want to make sure the user has paid before the Job they have created is saved, does anyone know how I can do this with the pay gem? I've been trying to figure out how to tweak the code below (which is in the docs) to do this. The workaround I was thinking of was adding a paid column to the Jobs table, which would be a boolean, and then set it to true when checkout is complete. Then I could only show the Jobs where paid == true |
Answered by
cjavilla-stripe
Jan 7, 2022
Replies: 1 comment 4 replies
|
Since the webhook is asynchronous, the approach I would take is track the
|
4 replies
Answer selected by
SuDa2103
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since the webhook is asynchronous, the approach I would take is track the
statusof the Job instead of waiting to save it.status=:pendingpayment_statusof the Checkout Session is paid, update thestatus=:paid