-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PayoutItem amount is a string not an integer #47
Comments
We store amounts as decimals, rather than floats (to prevent floating point errors and other rounding issues), but it seems like the reason for this is more to allow for the fact that decimals aren't always represented consistently across different systems (e.g. some require a precision to be specified). The string value allows for having the decimal value represented as we store it without having to specify precision or have any other issues with the representation. Could you please link to the documentation example where the type is not referred to correctly? We should have consistent types for all our amounts, but if there's anything missing, we'll make sure to get it updated. |
Sorry for the slow response! None of the I assumed they were all of the same type but evidently not. In fact the API docs don't mention any types anywhere. It would be great to have the type included in the docs. |
Thank you for getting back to us!
Payout items are the exception because we return those amounts in fractional currency to one decimal place. (E.g. if the amount of the payout item is £12.345, we'll serialize it as We'll make that clearer in the docs.
Agreed, this would be nice to have. Currently, types can be inferred from the examples but this is suboptimal. Including types in the API docs is not something we're actively looking into but if this becomes a common request, we will reevaluate. |
I was surprised to find that a
PayoutItem
instance'samount
is a string. I expected it to be an integer, or possibly a float, like aPayment
instance'samount
or aPayout
instance'samount
.There's no difference in the API documentation for the various resources' amounts to indicate that the type can differ.
Is this intentional?
The text was updated successfully, but these errors were encountered: