Is my Stripe code correct?
Hi, I want to offer my users a fixed-term subscription plan, where they get 30 days for free, and then they pay monthly for 12 months. Am I doing this the correct way?
(I am not using a webhook since it gives me errors and I have up)
Creating a session
Create subscription after the user went through the Stripe widget:
5 Replies
Webhook is the right way to do this. Otherwise you’ll need to manually poll the stripe server until you see that the users subscription has been enabled
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yea for now my process is that on the success page, I manually fetch Stripe. Its just that webhooks just really didnt work for me.
my line items:
Yeah, that does work right now because you're only concerned about the immediate action of 'enabling a subscription' when the user successfully submits payment.
Now let's wait a month later and the user fails to make a payment for the subscription for the next month. How will your server know to deactivate and prevent access to your site for this particular user?
This is why you need webhooks. Because this is how stripe can let you know in one month's time whether or not a user is still subscribed and is paying you money for said subscription.
What about webhooks didn't work for you? Perhaps we can help debug any issues you're having 🙂
yea, you are totally right. I've taken a lot of time away from this problem and came back to it, but still to no avail.
I've opened a new question if you want to give it a look 😦
https://discord.com/channels/966627436387266600/1097123974938366113