In this episode, we focus on how to verify if Stripe payouts are enabled for a user. This is an important step—if payouts aren’t enabled, the user won’t be able to receive money from sales.
First, we hit the Stripe API to retrieve the current user's account information. We check the payouts_enabled
property on the account to see if everything is set up correctly—meaning Stripe has all the information it needs.
If payouts_enabled
is false, the user needs to go back through the onboarding process and fill in any missing details. If it’s true, we update the corresponding value in our own user model (usually called something like stripe_account_enabled
) to match.
After updating, we redirect the user appropriately: if payouts are enabled, they get sent to the dashboard and can start selling products. If not, they’re sent back through onboarding until everything is squared away. The episode is all about making sure our app is in sync with Stripe so users have the right access at the right time!