#denjaland - Terminal
1 messages Β· Page 1 of 1 (latest)
sorry I made a mistake in the screenshot: this is the right data we get returned:
It's very strange data to see amount_refunded > amount_captured...
Hi π There is a lot of context here and it's super busy. Give me a minute to read up
take your time - you have other impatient customers π
to summarise my question: I'd like to be 100% sure that any uncaptured amount is always included in the refunded amount for a charge.
Okay...So to summarize, any amount not captured is returned to the customer.
yes that is what I understand
I'm just tryuing to understand how the attributes for a charge object work together
like I can have amount = 100, amount_captured = 50 and amount_refunded = 60
so is the 60 always the 50 uncaptured + 10 additional refund?
You might not have seen this if you are focused on Terminal but the basic flow is the same as described here:
https://stripe.com/docs/payments/place-a-hold-on-a-payment-method
yes- I understand the flow - I also understand what I do
but how should I interpret amount_refunded on a charge object
does it always include the uncaptured amount on the charge?
in other words
if I have a charge with amount_captured > 0
can I safely calculate the "amount paid" as being amount - amount_refunded?
it's a bit weird that I need to implement an IF in my logic, hence my question π
So...from what I have seen in my testing (going back to your initial question) here is how I see it:
- Create payment for 100 EUR (not yours, yet)
- Capture 50 EUR (now you have 50, customer gets 50 refunded)
- You refund 10 EUR - you can only refund from the 50 you captured. So this is added to the other 50 EUR refunded due to the capture.
Yes but you are not answering my question π
The question is: can we be 100% sure that the uncaptired amoung is ALWAYS included in the refunded amoung?
Partially capturing automatically releases the remaining amount.
From the doc I linked
Again: I jnderstand that but you donβt confirm my suestuin
Releasing a hold is not the same as refunding for me
You are putting it ibto the refunded amount ALWAYS?
Okay, what have you tested?
you have the test case above. What I need / want to know is whether or not an uncaptured amount is always considered "refunded" in your terminology
surely you can see the strange numbers now
so what I need from you is confirmation that
to know what the "net amount remaining and okay to be considered as paid for our busienss" I should apply this logic:
IF amount_captured = 0 THEN 0
ELSE amount - amount_refunded
And when you performed this test, what was the end result on your end?
Do you have the Payment Intent ID for this test?
it's literally what I sent you above...
amount = 100; amount_captured = 50 and amount_refunded = 60
I feel like you don't underatdn my question TBH
The question is: can we be 100% sure that the uncaptired amoung is ALWAYS included in the refunded amoung?
Yes
okay
so in order to know the "final amount of the charge"
I need to do
IF amount_captured = 0 then 0
else
Which is why I'm asking for the Payment Intent ID
amount - amount_refunded
Because I can examine a few more related objects to see if we can make this more explicit
it's just a generic question - it's not an issue with one particular pi
I know, but concrete examples are better to work with