Back to articles
Taking a Monthly Cut: Rails, Stripe Connect, and Recurring Billing

Taking a Monthly Cut: Rails, Stripe Connect, and Recurring Billing

via Dev.to WebdevZil Norvilis

In the previous article , we looked at how to use Stripe Connect to take a cut from a one-time payment. But what if you are building a platform like Patreon, Substack, or a SaaS marketplace? In these apps, a buyer subscribes to a seller. They pay $10 every month. You want to automatically take your 10% platform fee every month, and send the remaining $9 to the seller without lifting a finger. Handling recurring payments with Stripe Connect is slightly different than one-time charges. You can't just split the payment once; you have to tell Stripe to split the payment every time the billing cycle renews . Here is how to set up recurring Connect subscriptions in your Rails app. The Concept: Subscription Data When you do a one-time payment, you pass payment_intent_data to the Stripe Checkout session. For subscriptions, payment_intent_data does not work. Instead, we have to use subscription_data . Also, instead of passing a fixed application fee (like $1.00), it is usually much easier to pa

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
5 views

Related Articles