#aaparth-subscription-payment-failed
1 messages · Page 1 of 1 (latest)
Hello! There won't be any data relating to a failed payment on the Payment Intent object. You'll also need to expand the charges field on the PI object:
const invoice = await stripe.invoices.retrieve(data.invoice_id, {
expand: ['payment_intent.charges']
});
okay
I have expanded payment_intent.charges
what should I look for in the response
There'll be a list of Charge objects: https://stripe.com/docs/api/charges/object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
They have fields pertaining to failure reasons/codes
now lets say there were 3 retry so the charges will have 3 object correct ?
if yes then which one will be the latest, the top one or the last one ?
The first object in the array will be most recent
okay thanks a lot
Np!
please don't archive this thread, if all good then I will let you know to archive it
@glossy tendon
can you give me the syntax for php for the same please, can't seems to find it
Be something like:
$stripe-invoices->retrieve(
'in_xxx',
['expand' => ['payment_intent.charges']]
);