square / connect-api-specification

This repository contains the OpenAPI specification as well as templates for generating SDKs for Square's APIs
https://squareup.com/developers
Apache License 2.0
72 stars 35 forks source link

Maximum valid Money amount off by an order of magnitude (missing a `9` digit) #109

Closed sherbondy closed 5 years ago

sherbondy commented 6 years ago

Hi there,

I originally reported this issue with one of the downstream generated SDK libraries:

https://github.com/square/connect-python-sdk/issues/69

But after some digging into how Swagger API specs work, I found the corresponding underlying origin of the problem in the Connect API Specification for the Money model here:

Money Model missing a 9

I've run into "legitimate" responses from the Square Connect API V2 transactions listing tender cash_details field where the buyer_tendered_money amount was 999999999 (nine-nines) rather than 99999999 (eight-nines), resulting in the deserialization of the response from the connect API failing, causing a whole page of otherwise legitimate transactions results to be discarded.

Hopefully this is a quick patch fix (happy to submit a PR to resolve this).

mootrichard commented 6 years ago

So it looks like square/connect-python-sdk#69 has been resolved, you can try this out on the latest version of the Python SDK. I will be closing the issue for now, but if you still run into problems, please let us know so it can be reopened.

ssung88 commented 5 years ago

This is fixed.