#jon_subscription-customer
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1271142173303377952
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
@lapis gyro Hey! I'm happy to help but I unfortunately don't really grasp what you are asking.
I've been reading / watching tutorials on using stripe.net and what isn't clear to me is what the workflow would be in two scenarios.
1.) I have a new user, they download the application, and decide they want to pay for a subscription. What workflow should I follow? Do I create a new stripe customer, select the item they're purchasing (the subscription in this case), and redirect them to the stripe hosted site? From there, what can I use at a later date to verify the subscription (say, the following month) is still active?
2.) A returning user who decides to get a subscription again. Should I be tracking the "stripe customer" or do I make a new one? Etc.
#1 => You don't have to create a Customer if you are using Stripe Checkout. You send them to our hosted payment page, they subscribe and after that we send them back to you and you can handle fulfillment. See https://docs.stripe.com/checkout/fulfillment
#2 => Yes in that case you should know who they are and that they already have a Customer object cus_123 and re-use that one
jon_subscription-customer
So in this case, I can pull all the relevant information after the checkout when Stripe triggers the webhook, store that in my database keyed to their account?
I assume via Stripe API calls.
Do I have to periodically check that the subscription is active and still being paid, or does the webhook trigger when a subscription is cancelled?
Or if future payment fails (ie card expires)
So in this case, I can pull all the relevant information after the checkout when Stripe triggers the webhook, store that in my database keyed to their account?
yes
Do I have to periodically check that the subscription is active
you should use Webhooks for that yes see https://docs.stripe.com/webhooks and https://docs.stripe.com/billing/subscriptions/webhooks
so if I understand this correctly, with a new customer, I would just send them to the stripe hosted page with the "item" they're buying (the subscription) and my webhook location. Stripe will then send events to the webhook updating the status of that customer. For a returning customer, I would send them to the stripe hosted checkout page but include their customer id?
and my webhook location
not really no. You don't configure a "webhook location on the Checkout Session. That's a global setting on your account
For the rest then mostly yes. You call the Create Checkout Session API https://docs.stripe.com/api/checkout/sessions/create, you pass what they are buying in line_items and mode: 'subscription' if it's for a recurring payment and you also pass customer: 'cus_123' if you already have an existing Customer object
Excellent.
I also see this on the page:
Send events to your AWS account
We’re launching support for receiving Stripe events in Amazon EventBridge in private beta. Sign up to get early access.
Is there Azure support?
no Azure support for now. It's a brand new feature and we started with EventBridge
Okie dokie. Sounds good. Thanks for your help.
sure thing