@jeremysmithco In your latest podcast you mentioned almost but not quite using the nocheckout gem. I hadn't seen that before, and I love the approach.
Are you able to say more about why you didn't use it?
Hey @adamlogic, for sure! I didn't need the webhooks piece for launch, and there was enough indirection in the CheckoutSessionsController
that I had trouble following the flow and figuring out how best to extend it with subclassing. So I ended up just copying that controller into Liminal and refactored/rewrote it into a style that is probably more procedural, but made more sense to my brain.
This is roughly the result:
https://gist.github.com/jeremysmithco/ff58f4324b975fa2b62afc510fa108bd
I added barebones StripeCustomer
and StripeSubscription
AR models to the app to hold the references to user's stripe customer and connected subscriptions. And after checkout, I assign the subscription to the space they create.
I'm not quite covering all edge cases here, so there may be some exceptions raised, but this got me going in an afternoon and has covered a couple sales so far!
Log in to reply to this topic.
Log in