-
Notifications
You must be signed in to change notification settings - Fork 2
chore(POCP-1226): support 8-digit IINs in card event #270
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -918,7 +918,12 @@ module ProcessOut { | |
| return | ||
| } | ||
|
|
||
| const isAllowedIin = restrictToIins.indexOf(iin) !== -1 | ||
| // card_iin may carry more digits than the configured entries (IINs can | ||
| // be 6 or 8 digits), so match on prefix: an allowed entry matches when | ||
| // the detected IIN starts with it. | ||
| const isAllowedIin = restrictToIins.some(function (allowedIin) { | ||
| return allowedIin.length > 0 && iin.substring(0, allowedIin.length) === allowedIin | ||
| }) | ||
|
Comment on lines
+921
to
+926
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In API we have a check per scheme if we can return 8 digits - we should port that to the JS side otherwise we risk over exposing (e.g. IIRC no Amex can expose 8 digit bins)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you are right. Good catch. Our |
||
|
|
||
| this.setCardRestrictionState(!isAllowedIin) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1676,7 +1676,10 @@ module ProcessOut { | |
| return | ||
| } | ||
|
|
||
| const iin = cardNumber.substring(0, 6) | ||
| // Support up to 8-digit IINs (some networks issue 8-digit IINs, which | ||
| // yield more accurate issuer information); fall back to whatever is | ||
| // available when fewer digits were provided. | ||
| const iin = cardNumber.substring(0, 8) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we return 8 digit bin in a new field? Unsure if this classes as a breaking change for merchants not expecting it
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah wait, I just saw where this comes from - our backend call I guess? There might be another angle to investigate here - in checkout-cdn where we host the card entry form fields, we have a "local" way of surfacing the bin to merchants while the card is being typed. Technically we should have all we need there
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But this bit you've updated is only ring fenced if the merchant wants to retrieve IIN data using our API endpoint no? The checkout-cdn card form is pure local based on the card number as it's typed |
||
| const apiEndpoint = `iins/${iin}` | ||
|
|
||
| this.apiRequest( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.