A little secret to rock your YouTube subscribers
Get Free YouTube Subscribers, Views and Likes

Usage based metered billing with Ruby on Rails and Stripe

Follow
CJ Avilla

In this video, you'll learn how to use Stripe Checkout to start a Subscription that includes a flat monthly rate plus a small fee based on usage. We'll also look at how to create UsageRecords with the Stripe API to report usage over time.


00:00:00 Introduction
00:02:16 Create the pricing page with Tailwind UI
00:06:50 Create the Checkout Session and redirect
00:11:55 Install the Stripe gem
00:13:07 Redirect back after authenticating with devise
00:16:55 Create and store a Stripe Customer on the current user
00:21:46 Store Subscription data in the db
00:24:20 Handle Stripe webhook events
00:34:53 Handle customer.subscription.created event
00:51:13 Report UsageRecords for the metered Subscription
01:01:51 Create a metered Stripe price with divide by transform
01:11:52 Conclusion

#rails #rubyonrails #webhook

posted by agralhardt