#gecko

1 messages · Page 1 of 1 (latest)

pearl shuttleBOT
austere wigeon
#

hi

idle vortex
#

hello! Stripe doesn't guarantee delivery of events in the order in which they are generated, so you should retrieve the object that you want the details of if a different event arrives first

#

you can list the checkout session(s) for that particular Subscription / PaymentIntent

austere wigeon
#

my point is...if I can get an invoice.paid event, before checkout.session.completed occurs, and I am managing the metadata inside the checkout.session.completed event....then I can't "fetch" it from the first-to-arrive invoice.paid event...I get there isn't an order guarantee.

#

I'm wondering what the solution is, to get access to it, in the out of order case, since I can't "fetch" a not-yet-completed event data

idle vortex
#

i'm not sure if i'm understanding your concern correctly - theoretically, it's only possible for you to retrieve invoice.paid when the Checkout Session is completed. The metadata should have been set upfront when you created the checkout session

#

can you elaborate more on why / how you're managing the metadata inside the checkout.session.completed event that you can't retrieve the checkout session when the invoice.paid event is received?

pearl shuttleBOT
austere wigeon
#

so in checkout, on the checkout.session.completed event, I will do a Stripe.subscriptions.update call with the metadata, to attach it.

#

my assumption is that checkout completion has to occur before invoice.paid, but it seems these events are arriving in reverse order some times.

#

I see it in my webhook history, and when this occurs, the metadata in the invoice.paid handler is empty. if the flow runs the revers (checkout completes before invoice paid event arrives) then the metadata is in place.

#

this seems to be a recent phenomenon...I assumed I had to handle this out of order sequence, but I'm not sure how to retrieve the data, when it hasn't been updated yet.

#

if I'm not handling the metadata correctly, please advise

wild bloom
#

👋 taking over here

#

And sorry it has been unclear. When did you set the metadata in the first place?

austere wigeon
#

I set metadata in the checkout.session.completed event as I said above

idle vortex
#

why do you set metadata upon receipt of checkout.session.completed event? And which object are you setting it on?

#

can you elaborate more on your flow?

austere wigeon
#

Here’s my understanding. I create a checkout session, and send the metadata as part of the checkout creation.

#

The checkout happens. I want to store the data in the customer’s subscription

#

So that subsequent invoices can recall the metadata

idle vortex
austere wigeon
#

Yes

idle vortex
#
Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created.
#

so you don't need to set it again

austere wigeon
#

Hmm

#

Ok I’ll go investigate more…please leave this open a bit longer and I’ll write back I’m good to close, or a question why the flow was different and not working. Thanks.

idle vortex
#

sure