#mounirmtl

1 messages · Page 1 of 1 (latest)

flat surgeBOT
lost trail
hearty sparrow
#

That's what I thought indeed. But It's not clear how to use the charge data to have an accurate representation of the amount spent between refunds and everything

#

Should I just sum up the amount and substract refunds?

#

What about charges not captured yet?

#

Also how do I keep this number up to date?
I guess by subscribing to charge updates webhook. But how do I know if the charge can be added to the amount spent or if I should wait for a next update?

lost trail
#

Yes, you could do that. That is up to you. Reporting is not our expertise here. We're happy to help with any integration related questions. You might want to reach out to stripe support at https://support.stripe.com/contact on reporting questions. Otherwise, you can list all charges, and refunds to get the data needed. You, can also use Metadata on your end to track this as well.

hearty sparrow
#

Maybe you have an idea on what fields should I look at on the charge object?

lost trail
#

I'm unsure if I understand what you mean here

#

Can you clarify?

hearty sparrow
#

The charge object has a lot of fields and I'm not sure which ones to rely on.

For example there are the following fields amount, amount_captured, refunded, captured, paid.
refunded is false if the charge is partially refunded but how do I get the partial refund amount for this charge?

What's the difference between captured and paid?

If amount_captured < amount, does that mean that more amount will be captured later?

lost trail
#

Ah, I see. let me add some context (typing)

#

amount_captured - shows the amount that was captured for that charge. In cases where the amount and the amount_captured are not the same, the remaining amount is reversed back to the customer. Captured and paid are essentially the same to me.

hearty sparrow
#

in what scenario amount_captured and amount can be different? Is amount_captured = amount - refunds

lost trail
hearty sparrow
#

I see.

#

So basically I should take a look at all the charges that were paid?

lost trail
#

Yeap!

hearty sparrow
#

Thanks