#jj_1325
1 messages · Page 1 of 1 (latest)
hard to say, do you have specific details?
That scenario happened in every subscription payment
I use 4242 4242 4242 card for testing purpose
any example payment ID I can look at like an invoice ID in_xxx or sub_xxx Subscription ID or anything?
sub_1NsPtkSJ4AERD69liH3xqw7x
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
Any way to check 3ds is successfully done in invoice.payment_failed event
well no, because that event is not related to 3DS being successfully done.
my advice would be to look at billing_reason in the event and ignore the event if it's subscription_create
https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
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
?,