#modev1233214_unexpected
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/1443584000517079232
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
can you share the evt_xxx ID please
to be clear you want to know why the payment failed?
yes
got it. in that case you don't want last_finalization_error โ the invoice is already finalized, and payment attempt, hence why it's null
I see, that makes sense. Is there another property I can rely on to find out why the failure occurred? ๐ค
instead you'll need to look on the associated payment_intent property/object, specifically this: https://docs.stripe.com/api/payment_intents/object#payment_intent_object-last_payment_error
that means another API request to retrieve those details
ok, so I queried the payment intent included in the event. However, the last_payment_error there in is also null ๐
pi_3SWeVWADFEJCk2PP1d1waCaY if you wanna check
yeah I see. weirdly we don't constitute this as a payment failure โ the issue is there's no attached payment method to actually pay the invoice with
I see, so potentially if there is no last_payment_error we should make a call to check if that customer as a payment method...
as that would effectively be the "error" causing the invoice failure
or is there another way?
easier way would be to just check the payment_method property on the Payment Intent and/or status (requires_payment_method)