#shimmmaz_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1360015900753002626
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Look at this payment intent: pi_3QGD3fCFsGKEw9he1sRHf4u7
And this invoice: in_1QGC4gCFsGKEw9hetglZIkh3
the payment intent says "incomplete" The customer hasn’t attempted to pay this invoice yet.
the invoice has failed after Automatic collection for this invoice was turned off
Also - thanks for the help!
Taking a step back, the "incomplete" label you see in the Dashboard is a Dashboard-only concept. Payment for this PaymentIntent was attempted a few times but each attempt failed due to missing mandate details
yes that's clear, I know it is a dashboard concept. The invoice is actually "open"
I am trying to recreate this in test mode
because I quite often get this in production
Let me see if there's a way to test when mandates become inactive (since that's what happened here)
We relied on payment_intent.payment_failed and now I want to move to only getting invoice.payment_failed, and just want to make sure that it captures all the edge cases
Yep, you should listen for invoice.payment_failed events in general, and that's the event type that was emitted after the automatic retries on this Invoice: https://docs.stripe.com/billing/revenue-recovery/smart-retries#invoice-payment-failed-webhook
I see. that's why I am transitioning to the invoice.payment_failed
thank you
question -
what is "non-retryable return code"
that is mentioned in the page
On the mandate piece, I don't see a way to manually trigger transitioning a mandate to inactive
the main reason why I want to recreate it so that I know how the invoice.payment_failed payload would look like in that scenario
That said, for ACH, you can still listen for mandate.updated events to know when a mandate for a particular PaymentMethod has been updated
let's organize my questions:
- what is the "non-retryable return code" on the invoice.payment_failed?
- What would invoice.payment_failed payload look like in a mandate failed scenario?
- would mandate.updated tell me that it failed?
- I believe this is referring to an error code that would be present in the nested charge for a given invoice payment failure, so it wouldn't be present on the
invoice.payment_failedevent directly. You'd have to retrieve the relevant PI and expand the Charge object to see this. Some examples of non-retryable card codes are in the section here: https://docs.stripe.com/billing/revenue-recovery/smart-retries#non-retryable-decline-codes. If you're interested in ACH codes, you'll need to reach out to our support team
invoice.payment_failedevents will contain just an Invoice object. Instances where an Invoice payment failed due to a missing Mandate will not look different from other Invoice payment failures.
- The
mandate.updatedevent will contain a Mandate object. The object will note that the Mandate for a specific PM has been updated. You can parse the payload to understand which PM it's tied to, what thestatusof the Mandate is, what thetypeof the Mandate is, and whatprevious_attributesare on the event (this will help you understand what changed).
So for this particular example, the status for the Mandate for this PM changed to inactive on 2024-10-02. This could have been used as a cue to understand whether the PM was being actively used for any Subscriptions and, if it was, to prompt the customer to come back on session to provide updated payment details
I understand, super helpful, thanks!