-
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
25cf56a
a1bf701
1f3179d
eb08085
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
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. Ok, I think I need a little bit more context as I am confused now 😅
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. https://docs.processout.com/docs/tokenizing-a-card-in-the-browser#event-structure-detail This somewhat explains the other angle I think it's still good to support 8 digit BIN via this call, but we have another angle which most merchants rely on for "Quicker" information on the BIN determined from offline data (if it starts with 4 = Visa etc) In that flow we also return the IIN in real time to the merchant, so they can use/do look ups manually if they want - in this case that might be a good place for merchants to obtain the 8 digit bin as well |
||
| const apiEndpoint = `iins/${iin}` | ||
|
|
||
| this.apiRequest( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.