#jj_1325

1 messages · Page 1 of 1 (latest)

quaint dustBOT
dusk radish
#

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

barren vault
#

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?

dusk radish
#

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.

barren vault
#

Those docs talk about signature verification, how to get this set up, etc

dusk radish
#

I know how to setup webhook

#

I already done

#

But I just want to know 😕 what is best approach.

#

Asynchronous or sync

barren vault
#

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

dusk radish
#

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.

barren vault
#

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

dusk radish
#

"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
#

Stripe doesn't always send webhooks in order

dusk radish
#

@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

barren vault
#

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