#jj_1325

1 messages · Page 1 of 1 (latest)

analog etherBOT
real sentinel
delicate linden
#

I save some data in my database like subscription is active or not

#

I handle invoice.payment_failed and invoice.payment_succeded event in my spring code.

#

I retrieve subscription from stripe and check that status and save my database if not exist.

If that subscription exist in my db that update that subscription with stripe subscription status.

real sentinel
#

If you don't respond to invoice.created it will delay automatic payment collection by 72 hours. We mention this in our doc

delicate linden
#

But problem is stripe send webhook to my spring microserice. Than stripe after send other failed request so some time both request executed parallel and save duplicate entry in my db

real sentinel
#

Stripe will resend a webhook event if it does not receive a 200 status response

delicate linden
#

I write logic
In failed event
If subscription == present than update with stripe subscription status
Else
Save that subscription.

Save logic write in invoice succeed scenario

#

But some time both succeed and failed request parallel and add duplicate entry in my db.

#

Is it best practices to save some details in my db using webhook???

delicate linden
#

Because stripe send many webhook after subscription and hit that request on my db server.

real sentinel
#

Sorry it's not clear at all what your logic is doing. When you say "failed event" what event are you talking about specifically?

Which of these event types do you mean: https://stripe.com/docs/api/events/types

delicate linden
#

When I create a subscription and make a payment.
Payment is successfully done.

After stripe send invoice.payment_failed event and invoice.payment_succeded event both

#

I use 3ds

real sentinel
#

Do you have examples of these events with their event IDs?

delicate linden
#

It happen in every subscription payment

#

??

swift olive
#

👋 hopping in here since snufkin has to head out

#

Can you please send us an example invoice or event ID? The behavior you're describing is not one that we'd expect, so we want to take a closer look to see what's happenign on your account

delicate linden
#

My transaction in rupees

swift olive
#

Again, can you pleases give us a specific example?

delicate linden
#

In every subscription payment.

swift olive
#

I understand this is happening for every one of your payments, so can you give us an example of any of those payments so we can double check what's happening?

delicate linden
swift olive
#

And I'm asking if you can give us the specific invovice or event ID - not just a screenshot