#dan-checkout-subscription
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- dan-checkout-subscription, 1 hour ago, 19 messages
- danboyle8637, 5 days ago, 5 messages
dan-checkout-subscription
@cedar tinsel There's zero guarantee of Event ordering delivery. Really as a developer you should rely on checkout.session.completed and ignore everything else in this case
ok... interesting. Here's why I'm doing this...
When a member upgrades or downgrades their subscription in the Stripe Customer Billing Portal... I need to know about that so I can update their database record.
This is why I'm listenting to customer.subscription.updated
Is there a better event to listen to?
No that's the right Event to listen to, that's not the point I was making though. You talked specifically about Checkout. With Checkout you should only care about checkout.session.completed and just ignore the other Events entirely and use checkout.session.completed to do fulfillment. It's totally possible for Checkout to generate many Events, including multiple failed payment Events, or multiple customer.subscription.updated Events
ok... so in my customer.subscription.updated I have a database query to update the user who changes their subscriptoin.
I guess I just have to be okay with this query failing for instances when a new user creates a subscription?
I do use checkout.session.completed as well for other purposes.
You could set custom metadata on the Subscription that Checkout creates and then you "unset" that metadata after you're done processing it on creation so that on future Events from the CustomerPortal you know they don't come from Checkout
ok... I was just mulling over how I can get the data in a metadata field so do this.
Thanks... I 'll have to think this through