#thehollytoats_code

1 messages ¡ Page 1 of 1 (latest)

tribal sedgeBOT
#

👋 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/1407393360658042972

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

fast quiver
#

For example: pi_3RxroNLyyVuDV3Wz0RjnHm45

magic kiln
#

Hi there. Firstly, Charges & Refunds are different classes of objects, but let me test this - I wonder if we don't include uncaptured funds refunds in the refunds field on the Charge

#

No, we do. This works fine for me. Can you remove Charges from the expand array and try again? You can't call the "list Charges" endpoint and try to expand Charges

#

you should expand data.refunds rather than refunds

fast quiver
#

I tried this: $charges = \Stripe\Charge::all(["payment_intent" => $pi], ['expand' => ['data.refunds']]);

#

it gave me the same result. I didn't see the refund

#

"id": "ch_3Rxs7eLyyVuDV3Wz1L64hmxI",
"object": "charge",
"amount": 400,
"amount_captured": 300,
"amount_refunded": 100,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_3Rxs7eLyyVuDV3Wz1hxkRR2v",

magic kiln
#

That's not the full output of your request, though, right?

fast quiver
#

Yes, that's not the full output

#

So I can get the ammount or refund, but I need the related fee for the refund.

#

in the dashboard, I can see 2 group of charges
18cents + 2 cents (tax) = 20cents total
3cents: stripe processing fee refund

#

I don't know how to get the 3cents

magic kiln
#

Then you'll need to look at the balance_transaction property on the refund and then retrieve that and look at the fee_details on the Balance Transaction

fast quiver
#

testing now

#

It works!