#shimmmaz_api

1 messages · Page 1 of 1 (latest)

solemn boughBOT
#

👋 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.

deft hawk
#

Hi there

#

Can you clarify what you mean by "the invoice meanwhile fails"?

golden dove
#

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!

deft hawk
#

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

golden dove
#

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

deft hawk
#

Let me see if there's a way to test when mandates become inactive (since that's what happened here)

golden dove
#

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

deft hawk
golden dove
#

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

deft hawk
#

On the mandate piece, I don't see a way to manually trigger transitioning a mandate to inactive

golden dove
#

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

deft hawk
#

That said, for ACH, you can still listen for mandate.updated events to know when a mandate for a particular PaymentMethod has been updated

golden dove
#

let's organize my questions:

  1. what is the "non-retryable return code" on the invoice.payment_failed?
  2. What would invoice.payment_failed payload look like in a mandate failed scenario?
  3. would mandate.updated tell me that it failed?
deft hawk
#
  1. 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_failed event 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
#
  1. invoice.payment_failed events 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.
#
  1. The mandate.updated event 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 the status of the Mandate is, what the type of the Mandate is, and what previous_attributes are 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

golden dove
#

I understand, super helpful, thanks!