Resolved '1005: failed to parse JSON' error for special characters #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a code change made from an Infusionsoft team to address a recent issue encountered when attempting the following calls (including, but not limited to these calls) with the Java SDK:
Creating an account with endpoint /account/create providing special characters in the name field.
Creating a credit card with endpoint credit/card/create providing special characters in the user_name field
We suspect the SDK was not properly encoding the JSON as UTF-8 on transmission, or it is somehow being overwritten when JSON is sent over.
We have been in communication with WePay support, and the following support tickets were made in order to track this particular issue:
829531
835128
We believe the code change provided is a 'possible' solution to the issue, where it encodes all parameters on the JSON object to UTF-8 before transmission. This has been tested on our end with various characters and determined to successfully make the API calls (mentioned above) with special characters, without problems. Please take a look. If you have found a more effective solution, please let us know.
Thank you.