#jj_1325
1 messages · Page 1 of 1 (latest)
I listen stripe webhook using cli and store some data like transaction details and subscription is active or not in our database based on webhook event.
Now tell me what is best approach to listen webhook synchronous or asynchronous.
Write a code in java+spring boot
??
Hello
Hello! Do you need help on webhooks in genreal and getting that set up, or do you just want information on what events to listen for with subscriptions?
I need help to setup webhook hook for subscription payment.
I write webhook like if invoice.payment_succeded save transaction history amd subscription status in our database. And same code in invoice.payment_failed with subscription status inactive.
What is best approach for listen webhook asynchronous or synchronous.
Have you read through our docs on how to get webhook endpoints set up correctly? https://stripe.com/docs/webhooks
Those docs talk about signature verification, how to get this set up, etc
I know how to setup webhook
I already done
But I just want to know 😕 what is best approach.
Asynchronous or sync
I'm not really sure what you mean by that question - by definition webhooks are coming in asynchronously
The question of async vs sync isn't really relevant
Like stripe send webhook first store that event to Kafka and after that processor that msg on Kafka queue by queue.
Or directly listen webhook.
Ah I see - so really it's up to you to make the decision that works best for your integration
both approaches work
There isn't really a "best" approach here
"What are the best practices for handling Stripe webhook events in Java: synchronously or asynchronously?"
Stripe always send webhook in order as an example
First send subscription created then payment failed or succeed etc..
@barren vault what below point saying
(for example, you can fetch the invoice, charge, and subscription objects using the information from invoice.paid if you happen to receive this event first).
I read in stripe document
It's saying that if you want to be sure you're looking at the most recent state of the object you can re-retrieve it instead of relying on what's in the event