File tree Expand file tree Collapse file tree
dynamic-checkout/payment-methods Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -918,7 +918,12 @@ module ProcessOut {
918918 return
919919 }
920920
921- const isAllowedIin = restrictToIins . indexOf ( iin ) !== - 1
921+ // card_iin may carry more digits than the configured entries (IINs can
922+ // be 6 or 8 digits), so match on prefix: an allowed entry matches when
923+ // the detected IIN starts with it.
924+ const isAllowedIin = restrictToIins . some ( function ( allowedIin ) {
925+ return allowedIin . length > 0 && iin . substring ( 0 , allowedIin . length ) === allowedIin
926+ } )
922927
923928 this . setCardRestrictionState ( ! isAllowedIin )
924929 }
Original file line number Diff line number Diff line change @@ -456,8 +456,8 @@ module ProcessOut {
456456 number = Card . parseNumber ( number ) ; // Remove potential spaces
457457
458458 var l = number . length ;
459- if ( l > 6 )
460- l = 6 ;
459+ if ( l > 8 )
460+ l = 8 ;
461461 return number . substring ( 0 , l ) ;
462462 }
463463
Original file line number Diff line number Diff line change @@ -1676,7 +1676,10 @@ module ProcessOut {
16761676 return
16771677 }
16781678
1679- const iin = cardNumber . substring ( 0 , 6 )
1679+ // Support up to 8-digit IINs (some networks issue 8-digit IINs, which
1680+ // yield more accurate issuer information); fall back to whatever is
1681+ // available when fewer digits were provided.
1682+ const iin = cardNumber . substring ( 0 , 8 )
16801683 const apiEndpoint = `iins/${ iin } `
16811684
16821685 this . apiRequest (
You can’t perform that action at this time.
0 commit comments