Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type cast Version (and other 64-bit values in result.card object) to …
…prevent auto-retries of storeCard (#241) **Please explain the changes you made here:** We've noticed that the store-card-on-file example has been visibly reporting failures. After some investigation, I realized that these failures were not caused by malformed requests, but by server.js auto-retrying (non-failing) requests. These delinquent retries (correctly) failed with `source_used` errors. The retries were actually caused by an exception in this call to [send within storecCard](https://github.com/square/web-payments-quickstart/blob/042c73641a18f2b80a8d09d3cd09f5ad61871082/server.js#L121). One of the values in result.card (specifically _result.card.version_) is a 64-bit integer value, and "send" fails to encode this type. By casting this value (and other 64bit int values) to strings before we call "send", we can prevent the auto retries and no longer report failures. _Does this close any currently open issues?_ - [ ] [Individual Contributor License Agreement (CLA)](https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1) signed
- Loading branch information