Skip to content
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

JsonReaderException: JSON integer is too large or small for an Int32. Path 'account_balance' #1330

Closed
manaxname opened this issue Oct 10, 2018 · 2 comments · Fixed by #1293
Closed
Assignees

Comments

@manaxname
Copy link

We use \packages\Stripe.net.11.9.0\lib\net45\Stripe.net.dll, nuget, version=11.9.0.0, IIS, Windows.

Call stack:
Newtonsoft.Json.JsonTextReader in ParseNumber at line 553:0
Void ParseNumber(Newtonsoft.Json.ReadType)
Newtonsoft.Json.JsonTextReader in ReadNumberValue at line 522:0
Newtonsoft.Json.JsonTextReader in ReadAsInt32
Newtonsoft.Json.Serialization.JsonSerializerInternalReader in ReadForType at line 74:0
Newtonsoft.Json.Serialization.JsonSerializerInternalReader in PopulateObject at line 615:0
Newtonsoft.Json.Serialization.JsonSerializerInternalReader in CreateObject at line 353:0
Newtonsoft.Json.Serialization.JsonSerializerInternalReader in Deserialize at line 217:0
Newtonsoft.Json.JsonSerializer in DeserializeInternal at line 69:0
Newtonsoft.Json.JsonConvert in DeserializeObject at line 44:0
Newtonsoft.Json.JsonConvert in DeserializeObject
Stripe.Mapper`1 in MapFromJson at line 27:0
Stripe.StripeCustomerService in Get

account
We can change account balance and set value more than is used in
https://github.com/stripe/stripe-dotnet/blob/master/src/Stripe.net/Entities/StripeCustomer.cs
for AccountBalance property.
So, please, add validation or change int to other type.

Thanks.

@ob-stripe
Copy link
Contributor

Hi @manaxname, thanks for the report. Attributes that can hold amounts should be declared as long, but it looks like we forgot about StripeCustomer.AccountBalance and declared it as an int instead. We'll fix this in the next release.

@ob-stripe
Copy link
Contributor

Fixed in 20.0.0. All integer numeric types are now longs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants