#nickdnk-billing-lifecycle
1 messages · Page 1 of 1 (latest)
Normally I would ignore the manual attempts by filtering out the request ID, but the second request has no request ID since it was automatic, so our system incorrectly assumed that the sub was active and a renewal failed
I realize I can filter out by fetching the subscription and checking its status instead, but it does not explain the double event
Not immediately sure. Thanks for the IDs, looking in to it
The second failure was from 3DS auth failing. It was from your request to handle 3DS auth when your app heard back that the PaymentIntent required action but because of how that is handled in our system it comes back to you in the webhook event without a request ID
Aha
Okay
I'll have to guard both against requests with no id and subscription status === incomplete then
The former can happen if users manually attempt to pay an invoice again, the latter in this case
I may not quite be reading that right but the second event - the one without the request ID - was the one from 3DS auth
But yes those do sound like the checks to do
Ah, that is what you meant
I mean I'll have to retain the request ID check
because subsequent attempts at paying invoices that are not status incomplete, on-session retries
will have an ID and should not trigger "we tried to charge you" emails
Distinguishing between on- and off-session events in cases like this has been really difficult
But this kind of leads me back to this situation:
User create sub, all good, payment goes through
Payment fails a month later, not because of 3ds, but let's say insufficient funds
We send an email, bring the user back on session to pay the invoice
The payment now requires 3ds, so the first attempt fails, but has a request ID; we ignore that
3ds completes but the payment fails due to insufficient funds; this is now an automatic event for a subscription that is not status incomplete, which will trigger an email even though the user is actually on-session
Suggestions for avoiding this?
I can't think of a reliable solution right now unfortunately.
I think I'd track when I last sent them an email about a failure and use that to decide whether to send a new one or not
Okay. This is kind of and edge case at the moment, I was just thinking about possible problems. I'll leave it for now I think