With $Country explicity to CA, fix identification of JCB 3529-3589 as Discover
authorIvan Kohler <ivan@freeside.biz>
Thu, 14 Mar 2013 01:09:15 +0000 (18:09 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 14 Mar 2013 01:09:15 +0000 (18:09 -0700)
Changes
CreditCard.pm

diff --git a/Changes b/Changes
index a63119e..d3c2183 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Perl extension Business::CreditCard.
 
+0.33  unreleased
+        - With $Country explicity to CA, fix identification of JCB 3529-3589
+          as Discover
+
 0.32  Thu Feb 21 16:02:42 PST 2013
         - Add Israeli Isracard (no checksum yet)
         - Add LICENSE=>perl to Makefile.PL; add license to META.yml,
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