#vilesa - full refund

1 messages · Page 1 of 1 (latest)

waxen loom
#

Because not specifying an amount will refund the entire charge.

pale steeple
#

yes I know, and that makes sense
i'm specifically specifying 0

waxen loom
#

Oh so you have you already tried that in the API?

pale steeple
#

yep confirmed

waxen loom
#

Good to know, thanks for confirming. Were you asking this to see if you needed a check to prevent refunds of 0 being created or something?

pale steeple
#

i'm asking this because:

i have some logic to decide how much to refund on a charge
and it happened that my logic returned 0, but i had no check i place to say "if 0 to refund, then don't refund"
instead i called the api, and my user was fully refunded

royal bridge
#

catching up here one sec

pale steeple
#

so probably a trap many of your customer can fall in

#

a bit dangerous

royal bridge
#

mind sharing the request ID for that? I think this is intended behavior that has ~always existed

pale steeple
#

i don't have a request id handy, you can easily reproduce

#

i'm using the python SDK

royal bridge
#

I can repro yes, just in >10 threads so will be a bit

royal bridge
#

sorry been in multiple threads, a colleague will be helping out in a sec

faint needle
#

Hhhmm, I tried to reproduce this, however, I'm unable to. I'm getting: Error: This value must be greater than or equal to 1 . This matches the API reference here https://stripe.com/docs/api/refunds/create#create_refund-amount stating that the amount is 'A positive integer in cents representing how much of this charge to refund.'

Can you share a request id, https://support.stripe.com/questions/finding-the-id-for-an-api-request with me since I was not able to reproduce this so I can further assist?

vocal flare
#

(NOT with Stripe) - it sounds like you're running into a typical "null check" issue - the Stripe code checks the value; if it's null-ish, then the whole amount is refunded. In Javascript, and many many other languages, "undefined", "null", "", and 0 ALL return "null-ish"

#

(as does "false")