#enyo-checkout

1 messages · Page 1 of 1 (latest)

sonic osprey
#

@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

wind bone
#

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.

sonic osprey
#

do you need the .created event though?

wind bone
#

Mh... I'm thinking: what if the user creates a checkout session and aborts it

sonic osprey
wind bone
#

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.

sonic osprey
#

it would be if you use the field I mentioned

#

not the session.metadata, the session.subscription_data.metadata

wind bone
#

Oh!

#

That sounds perfect!

#

Thanks @sonic osprey ! I'll attack this right away 🙂