With $Country explicity to CA, fix identification of JCB 3529-3589 as Discover
[Business-CreditCard.git] / CreditCard.pm
index efc80c6..4fe901e 100644 (file)
@@ -5,7 +5,7 @@ use vars qw( @ISA $VERSION $Country );
 
 @ISA = qw( Exporter );
 
-$VERSION = "0.32";
+$VERSION = "0.33_01";
 
 $Country = 'US';
 
@@ -207,7 +207,7 @@ sub cardtype {
       ||   $number =~ /^64[4-9][\dx]{13}$/o
       ||   $number =~ /^65[\dx]{14}$/o
       || ( $number =~ /^62[24-68][\dx]{13}$/o && uc($Country) ne 'CN' ) #CUP
-      || ( $number =~ /^35(2[89]|[3-8][\dx])[\dx]{12}$/o && uc($Country) eq 'US' );
+      || ( $number =~ /^35(2[89]|[3-8][\dx])[\dx]{12}$/o && $Country =~ /^(US|CA)$/oi ); #JCB cards in the 3528-3589 range are identified as Discover inside the US and Canada
 
     return "Switch"
       if $number =~ /^49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o