#vilesa - full refund
1 messages · Page 1 of 1 (latest)
Are you specificaly specifying 0 or are you not specifying an amount when making this call? https://stripe.com/docs/api/refunds/create#create_refund-amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Because not specifying an amount will refund the entire charge.
yes I know, and that makes sense
i'm specifically specifying 0
Oh so you have you already tried that in the API?
yep confirmed
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?
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
catching up here one sec
mind sharing the request ID for that? I think this is intended behavior that has ~always existed
I can repro yes, just in >10 threads so will be a bit
sorry been in multiple threads, a colleague will be helping out in a sec
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?
(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")