Skip Stripe checkout for user with certain conditions
Any ideas on how one would go about adding this to stripe checkout flow? I would like the referree to have a free post instead of going through the checkout if he has a referred user who has the referral_completed_at? as true.
Hey Anthony,
After the user signs up through the referral link, you can add the free post to their account. That might just be a column on the user model to keep track of it, up to you.
Then you can check if the user has a free post and let them post. If they don't, redirect them to the pricing page. You probably have a before_action in your PostsController to redirect if not subscribed, so you can modify that to allow them through if they have a free post. Once they complete the Post, then they you can remove that column on the user so they can't do it twice.