From a8d298ec8047f312a2650fc215edcd68875cb92a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 13 Mar 2013 18:09:15 -0700 Subject: [PATCH] With $Country explicity to CA, fix identification of JCB 3529-3589 as Discover --- Changes | 4 ++++ CreditCard.pm | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index a63119e..d3c2183 100644 --- 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, diff --git a/CreditCard.pm b/CreditCard.pm index efc80c6..4fe901e 100644 --- a/CreditCard.pm +++ b/CreditCard.pm @@ -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 -- 2.11.0