#cnguyen85

1 messages ยท Page 1 of 1 (latest)

mossy condorBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

grizzled shoal
#

Thank you. For now, for one subscription, I want to have all the payment associated with the amount and status of each one

fair frigate
#

When you list Invoices you can expand data.payment_intent to also get the PI in the response

grizzled shoal
#

ok so it's const invoices = await stripe.invoices.list({
subscription: subscriptionStripeId,
limit: 100,
expand: ['data.payment_intent']
});

fair frigate
#

Yup, that should work - try it out!

grizzled shoal
#

OK and what is the statut for the PI when it's refunded ?

#

I see only. requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded

fair frigate
#

The status of the PI wouldn't change at all - it would still be succeeded

#

You can try this all out in test mode yourself and see how it works

grizzled shoal
#

So how can I know when there is a refund associated to it ?

#

ok

fair frigate
#

๐Ÿ‘ (It'll all be on the Charge object associated with the PI, but still definitely test it out so you can see the full shape of all the associated objects)

mossy condorBOT
grizzled shoal
#

and I can expand the charge ?

#

I have to extend invoice => pi => charge so ?

sage gate
#

Hi ๐Ÿ‘‹

I'm stepping in as @fair frigate needs to go

#

Yes, you would go from expand: ['data.payment_intent'] to expand: ['data.payment_intent.latest_charge']

grizzled shoal
#

ok because for a subscription, we will always have for ONE INVOICE = ONE PI = ONE CHARGE ?

#

And we refund the PI. We will always have ONE charge but the status will be refunded

#

right ?

sage gate
#

ok because for a subscription, we will always have for ONE INVOICE = ONE PI = ONE CHARGE ?

No. But we expose the latest_invoice on the Subscription and the latest_charge on the Payment Intent so that you can access those specifically.

#

For a PI there will be one successful Charge