You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
We ran into a funny issue where it looks like somebody specified the maximum possible "tendered" amount for a fake/test cash transaction of: 999,999,999 cents, corresponding to $9,999,999.99
This value came through in the buyer_tendered_money TenderCashDetails field.
if amount > 99999999:
raise ValueError("Invalid value for `amount`, must be a value less than or equal to `99999999`")
This value, 99,999,999, seems to be off by a digit from the actual maximum allowable value (999,999,999) inside the Square Point of Sale app, resulting in a "legitimate" tender value from the Connect API v2 endpoint yielding an exception during deserialization.
I'm guessing this issue is upstream in the underlying swagger spec that generates the Python SDK. So this problem may be present in all instances of the Connect SDK. Looks like somebody just mis-typed the constant here for the maximum valid Money model value in the spec?
Anyway, this was problematic for us because this single illegitimate amount raised an exception, yielding a deserialization failure for a whole page of otherwise legitimate transaction results.
Long live languages that support underscores in numeric literals! Added to Python in 3.6 FWIW, but again, guessing a deficit of Swagger / the underlying spec caused this problem.
The text was updated successfully, but these errors were encountered:
Hi there,
We ran into a funny issue where it looks like somebody specified the maximum possible "tendered" amount for a fake/test cash transaction of:
999,999,999
cents, corresponding to $9,999,999.99This value came through in the
buyer_tendered_money
TenderCashDetails field.The outcome was a ValueError thrown inside the SquareConnectAPI
money.py
model:https://github.com/square/connect-python-sdk/blob/master/squareconnect/models/money.py#L75
This value,
99,999,999
, seems to be off by a digit from the actual maximum allowable value (999,999,999
) inside the Square Point of Sale app, resulting in a "legitimate" tender value from the Connect API v2 endpoint yielding an exception during deserialization.I'm guessing this issue is upstream in the underlying swagger spec that generates the Python SDK. So this problem may be present in all instances of the Connect SDK. Looks like somebody just mis-typed the constant here for the maximum valid Money model value in the spec?
Anyway, this was problematic for us because this single illegitimate amount raised an exception, yielding a deserialization failure for a whole page of otherwise legitimate transaction results.
Long live languages that support underscores in numeric literals!
Added to Python in 3.6 FWIW, but again, guessing a deficit of Swagger / the underlying spec caused this problem.
The text was updated successfully, but these errors were encountered: