4 ms·
Stripe uses integers [1] Adyen uses integers [2] Square uses integers [3] So not sure that the industry would agree with you [1] https://stripe.com/docs/api
by gytisgreitai 3y ago
Stripe uses integers [1]
Adyen uses integers [2]
Square uses integers [3]
So not sure that the industry would agree with you
[1] https://stripe.com/docs/api/prices/create#create_price-unit_amount https://stripe.com/docs/api/prices/create#create_price-unit_...
[2] https://docs.adyen.com/api-explorer/Checkout/70/post/payments#request-additionalAmount-value https://docs.adyen.com/api-explorer/Checkout/70/post/payment...
[3] https://developer.squareup.com/reference/square/objects/Money https://developer.squareup.com/reference/square/objects/Mone...
- SideburnsOfDoom 3y ago> Stripe uses integers [1] a) On web api, so this is by definition data interchange, not "in a language". b) with a currency code to cross check it. c) implicitly "in cents" which needs further documentation - does this mean "pence" when the currency is GBP? How does this work for for JPY? BHD? d) cannot represent fractions of a cent or penny. So: this int plus currency code plus docs is OK but not great, a lowest common denominator format for interchange, requires further documentation and cross-checking as "100 USD" does not mean 100 bucks and the conversion is currency-specific, and cannot represent all values. I wouldn't refuse to convert _to and from_ this format at the edges of my application, for data interchange, but the conversion to something clearer and richer IMHO should remain there. Payment APIs are far from the only use case in fintech, for interest calculations you do have to care about fractions of a cent or penny. In fact, if your case is "I call the stripe api" ... are you sure you're a fintech and not an online store? Get back to me when you have to interop with FiServ, MasterCard or SAP.
- gytisgreitai 3y agoyet with all those a) b) c) d) they still use that. Point is not "I call stripe api". Point is - those companies, that process wast amount of transactions, use integers. Probably for a reason. And its not in cents rather _minor units_ which you as working in fintech should ought to understand the difference
- SideburnsOfDoom 3y ago> Point is - those companies, that process vast amount of transactions, use integers. Point missed, they use that format _on their client apis_, which tells you nothing about what they do in the code that handles it. Now it could be the same internally, in which case the reason is "there's crap code everywhere"
- SideburnsOfDoom 3y ago> And its not in cents rather _minor units_ which you as working in fintech should ought to understand the difference Erm, did you see the quotation marks around "in cents" ? It's a _quote_ from the docs at the link. The link _that you gave_. The issue is not "do you or I understand the difference", it's "does stripe" and "do stripe users, after reading that?" It is simplistic, like the int, and is not making the point that this is great.