#jj_1325

1 messages · Page 1 of 1 (latest)

lost jayBOT
ornate cobalt
#

hard to say, do you have specific details?

frigid wing
#

That scenario happened in every subscription payment

#

I use 4242 4242 4242 card for testing purpose

ornate cobalt
#

any example payment ID I can look at like an invoice ID in_xxx or sub_xxx Subscription ID or anything?

frigid wing
#

sub_1NsPtkSJ4AERD69liH3xqw7x

ornate cobalt
#

that's normal, because 3D Secure was required

#

so we send an invoice.payment_failed when 3D Secure is needed, and then later invoice.payment_succeeded when 3DS is done and the payment completed

frigid wing
#

Any way to check 3ds is successfully done in invoice.payment_failed event

ornate cobalt
#

well no, because that event is not related to 3DS being successfully done.

frigid wing
#

My scenario is if customer make payment after using webhook we store that subscription details like id,status and date to our database.

So my problem is
I write code in both event invoice.payment_failed and invoice.payment_succeded

First check fetch subscription from db if present than update it otherwise save as a new entry.

So sometimes both event run individually and First check sub present in db if not add entry So add duplicate entry in my db.

So how to solve this scenario

#

?,

ornate cobalt
#

sorry, I don't understand you

#

in any case you need to be able to handle events that arrive in any order, since the order of webhooks is not guranteed.