#damol0_webhooks

1 messages ¡ Page 1 of 1 (latest)

lime inletBOT
#

👋 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/1215245088410705923

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

tight stagBOT
#

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.

upper mauve
#

hi! I don't think we publish such a thing no, haven't come across it.
Maybe you could build something based on the API spec? https://github.com/stripe/openapi But it would be complicated since Events(the body in the webhook) are very polymorphic since they can contain any resource in the API really.

junior marsh
#

ok that was the other question I was going to ask - just to confirm - these payload schemas are different by event type (eg payment_intent_succeeded is diff to setup_intent_suceeded) etc i.e I mean that the dict that the payload resolves to is a different structure. is that correct?

upper mauve
#

the webhook is an Event object and then the data.object field in an Event is a full copy of some other object like a PaymentIntent/SetupIntent

junior marsh
#

ok. so in general the stripe advice to "handle the webhook quickly and return status = 200" asap when processing a webhook. which makes sense.

But do you have any advice on how then to hook these disparate event types up to a queue (such as a kakfa message queue)? If I want to handle say 5 different event types (payment_intent_succeeded etc) I need 5 diff kaf message queues, with 5 diff avro schema definitions, rather than a single queue which handles all message types?

upper mauve
#

I don't know anything about avro unfortunately. Can't you just put the raw JSON into the queue, and then deal with parsing it and determing what event type it is and what you need to do in your application logic for each event later in the consumer?

#

another approach might be to just push the id of the Event into the queue, and then the consumer can call the Retrieve Event API with the ID and do all the actual work at that point instead of with the actual JSON from the incoming webhook.

junior marsh
#

It seems I must have a message def for the kafka queue - I cant just use raw json. HOwever from reading your link - it seems like if I push on the queue only the stripe event ID - then in my consumer I can do :
stripe.Event.retrieve("evt_1NG8Du2eZvKYlo2CUI79vXWy")
my question to you is - will that retrieved event be identical to the event I received in the (signature verified) payload to the webhook ?

upper mauve
#

yes

junior marsh
#

ok great. ill do something like htat i think. thank you

#

how long so stripe store these events for?

junior marsh
#

thanks