#dev-paymentintent-refund
1 messages · Page 1 of 1 (latest)
dev-paymentintent-refund
@hollow abyss there would be no Refund in that case if you canceled a Charge that wasn't captured, there's nothing to "refund" since you never captured the funds
Can you give me an example PaymentIntent id? I'm confused now
I thought you said refunds was null
Ah I think I get what you meant and I misunderstood
https://stripe.com/docs/upgrades#2022-11-15
We stopped returning refunds by default in this flow and you're likely just looking at the property and not realizing that
You need to use the Expand feature: https://stripe.com/docs/expand so that you get the refunds property when you retrieve the Charge. Or simply use the List Refunds API https://stripe.com/docs/api/refunds/list
Where would I do the expansion? On the paymentIntent?
I remember trying to expand it but it said refunds was not expandable
Step 1: read the Expand feature doc to understand it
Step 2: map that to what you're trying to do
PaymentIntent has no Refunds information, see https://stripe.com/docs/api/payment_intents
Charge does, see https://stripe.com/docs/api/charges/object
So if you look at the Charge, you can expand refunds. If you look at the PaymentIntent, you need to get to the Charge, which is latest_charge so you expand latest_charge.refunds
So the .addExpand should be "refunds" and that should be added as so: Charge.retrieve(paymentIntent.getLatestCharge(), expandPararms, requestOptions) ?
I think so yes
Okay, I will it give it a try. If it doesnt work then I think I might just use the List Refunds API. Thank you for your help ^^
if it doesn't work let me know and I can look
Okay, thanks. Appreciate it
of course!
It looks like the refunds expandable worked for charge. Thanks for the help
amazing! Sorry this isn't super intuitive at first
No problem, I appreciate the help.
Have a great day! 🙂