#enyo-checkout
1 messages · Page 1 of 1 (latest)
@wind bone you're supposed to only listen to the checkout.session.completed event, that is all you need
when you handle that event, there is a subscription and customer field on the CheckoutSession object and you can reconcile those/make API calls to get more detail on them
Mh, but what if changes to the subscription occur later on (because, I do them manually in the dashboard, or the subscription is renewed or canceled, etc...)
I'd like to use the customer.subscription.* events to make sure that the state I have in my system is always up to date with Stripe.
do you need the .created event though?
Mh... I'm thinking: what if the user creates a checkout session and aborts it
but either way, this is expected, the Subscription gets created before the Session completes. There actually isn't a great solution here to identify a subscription.created event that's generated form using Checkout versus one that's not. You could use metadata https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata
is there maybe a use case where they have a stripe customer id, and then I go in the dashboard and create an ID a subscription for them
Yes I already use the metadata but unfortunately that doesn't help me because it's not attached to the subscription events.