Comments (11)
@daliwali, can you take a look at this?
from balanced-js.
@mjallday I was able to replicate this. The problem is that it's missing some type coercion on the input. I will submit a PR for this.
from balanced-js.
Thanks. Can you please submit pull-request for both the rev1 and master branches as well as test scenarios?
from balanced-js.
Is there ever a situation in which omitting leading zeros from a bank account/routing number will cause issues? Looking at a completely non-official list of routing numbers at http://www.gregthatcher.com/Bank/Routing/Numbers/Q , I see some that start with 0.
from balanced-js.
considering the number of edge cases around using a javascript integer and then transforming it into a string, I am -1 on allowing the number type. We should always take bank account, routing, card, cvv a string.
from balanced-js.
@matthewfl actually tokenizing a card with integer values works. Why would you want to break this now? Furthermore, we can prepend the leading zeros if the length of the string is too short. Do you mind explaining the issues that may arise?
from balanced-js.
maybe I am misunderstanding the issue, but there are issue with integers in general in javascript and I think we should avoid these in general.
[0 14:58:06 matthew]% node ~
> 9999999999999999
10000000000000000
> '9999999999999999'
'9999999999999999'
>
from balanced-js.
What @matthewfl said, plus prepending digits onto what was provided by the user is magical and unexpected. How do we know how many zeroes to prepend? Bank account numbers are not standardized, and may be of various lengths, and include letters as well as numbers. I think strings are the only safe thing to accept, in general.
from balanced-js.
plus if you have a leading 0, and all the rest of the digits are < 8, then the number will be interpreted as base 8.
basically this issue will degrade into all the problems with javascript integers when used like this. IMO we should not support taking number types. I am -1 on any changes to add this bug to the js
from balanced-js.
nb - the original issue is about an input with the attribute type="number"
. this is a good ux for users since on a mobile device it gives you a numeric keyboard. routing numbers are fixed to 9 digits so this is OK.
bank accounts are not supposed to be numeric so we shouldn't encourage or document them as so. it's entirely legal to have a bank account "number" of "abcasdwe"
from balanced-js.
@matthewfl the 16-digit rounding issue doesn't apply to routing numbers. However, the bug already affects the card tokenization, since it accepts the number type, but realistically, I don't think anyone has the card number 9999 9999 9999 9999
.
The parseInt('08') === 0
problem doesn't really affect anything discussed since there's no need to coerce a string into a number here.
Perhaps bank account number must be a String
, routing number can be Number
or String
. The error message for passing in a bank account number as a Number
should be much more explicit.
from balanced-js.
Related Issues (20)
- Better validation of input HOT 2
- Library should be built unminified and beautified. HOT 1
- Remove requirement to match card type before allowing it to be submitted. HOT 2
- Rename isSecurityCodeValid in 1.1 HOT 4
- Rename validateRoutingNumber in 1.1 HOT 1
- account_type Field 1.1
- Type Parameter is incorrect for tokenizing and creating bank accounts
- the goot HOT 1
- Coinbase example should display the tokenized result
- Make balanced.js installable with bower HOT 4
- Allow coinbase `send` scope to be complemented with `send_limit_amount`
- Put balanced.js in bower / component HOT 4
- Fails to tokenize when '#' is passed into the address line field HOT 4
- balanced.js is broken HOT 6
- Link in README is broken
- Balanced JS lib on Parse.com platform HOT 2
- Test Numbers always pass HOT 2
- Balanced js breaks in IE8 HOT 3
- Balanced server should be sending the "Vary: Accept-Encoding" header. HOT 1
- Add license header to the actual .js so it will be recognized as free software by LibreJS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from balanced-js.