Skip Menu |

This queue is for tickets about the Business-CreditCard CPAN distribution.

Report information
The Basics
Id: 110982
Status: resolved
Priority: 0/
Queue: Business-CreditCard

People
Owner: Nobody in particular
Requestors: jterry [...] bluehost.com
Cc: jacye [...] bluehost.com
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in:
  • 0.34
  • 0.35



CC: jacye [...] bluehost.com
Subject: New MasterCard bins coming Oct 2016
This URL gives a full update. Opens a Litle payment gateway page. http://tinyurl.com/h2gcey7 Basically MasterCard needs to have this ereg added. || $number =~ m/^2 ( 22[1-9] | 2[3-9][0-9] | [3-6][0-9]{2} | 7[0-1][0-9] | 720 ) [0-9]{12}$/xo
On Thu Jan 07 11:35:12 2016, OAXLIN wrote: Show quoted text
> This URL gives a full update. Opens a Litle payment gateway page. > http://tinyurl.com/h2gcey7 > > Basically MasterCard needs to have this ereg added. > > || $number =~ m/^2 ( 22[1-9] | 2[3-9][0-9] | [3-6][0-9]{2} | 7[0-1][0- > 9] | 720 ) [0-9]{12}$/xo
Thank you for the report and example. If you have a full patch in unified diff format, including with a new test case, that would certainly be appreciated.
Here you go. On Thu Jan 07 11:39:00 2016, IVAN wrote: Show quoted text
> On Thu Jan 07 11:35:12 2016, OAXLIN wrote:
> > This URL gives a full update. Opens a Litle payment gateway page. > > http://tinyurl.com/h2gcey7 > > > > Basically MasterCard needs to have this ereg added. > > > > || $number =~ m/^2 ( 22[1-9] | 2[3-9][0-9] | [3-6][0-9]{2} | 7[0- > > 1][0- > > 9] | 720 ) [0-9]{12}$/xo
> > > Thank you for the report and example. If you have a full patch in > unified diff format, including with a new test case, that would > certainly be appreciated.
Subject: mast.patch
diff --git a/CreditCard.pm b/CreditCard.pm index cfc3be4..5801a72 100644 --- a/CreditCard.pm +++ b/CreditCard.pm @@ -198,6 +198,7 @@ sub cardtype { return "MasterCard" if $number =~ /^5[1-5][\dx]{14}$/o + || $number =~ m/^2 ( 22[1-9] | 2[3-9][0-9] | [3-6][0-9]{2} | 7[0-1][0-9] | 720 ) [0-9]{12}$/xo ;# || ( $number =~ /^36[\dx]{12}/ && $Country =~ /^(US|CA)$/oi ); return "American Express card" if $number =~ /^3[47][\dx]{13}$/o; diff --git a/t/test.t b/t/test.t index 37a903d..653a752 100644 --- a/t/test.t +++ b/t/test.t @@ -13,6 +13,7 @@ sub test_card_identification { my %test_table=( '5212345678901234' => 'MasterCard', '5512345678901234' => 'MasterCard', + '5512345678901234' => 'MasterCard', '4123456789012' => 'VISA card', '4512345678901234' => 'VISA card', '341234567890123' => 'American Express card',
Ignore the previous one, bad copy pasta on the test. Here is a better one. On Thu Jan 07 11:56:35 2016, OAXLIN wrote: Show quoted text
> Here you go. > > On Thu Jan 07 11:39:00 2016, IVAN wrote:
> > On Thu Jan 07 11:35:12 2016, OAXLIN wrote:
> > > This URL gives a full update. Opens a Litle payment gateway page. > > > http://tinyurl.com/h2gcey7 > > > > > > Basically MasterCard needs to have this ereg added. > > > > > > || $number =~ m/^2 ( 22[1-9] | 2[3-9][0-9] | [3-6][0-9]{2} | 7[0- > > > 1][0- > > > 9] | 720 ) [0-9]{12}$/xo
> > > > > > Thank you for the report and example. If you have a full patch in > > unified diff format, including with a new test case, that would > > certainly be appreciated.
> >
Subject: mast.patch
diff --git a/CreditCard.pm b/CreditCard.pm index cfc3be4..336f622 100644 --- a/CreditCard.pm +++ b/CreditCard.pm @@ -5,7 +5,7 @@ use vars qw( @ISA $VERSION $Country ); @ISA = qw( Exporter ); -$VERSION = "0.33"; +$VERSION = "0.34"; $Country = 'US'; @@ -198,6 +198,7 @@ sub cardtype { return "MasterCard" if $number =~ /^5[1-5][\dx]{14}$/o + || $number =~ m/^2 ( 22[1-9] | 2[3-9][0-9] | [3-6][0-9]{2} | 7[0-1][0-9] | 720 ) [0-9]{12}$/xo ;# || ( $number =~ /^36[\dx]{12}/ && $Country =~ /^(US|CA)$/oi ); return "American Express card" if $number =~ /^3[47][\dx]{13}$/o; diff --git a/t/test.t b/t/test.t index 37a903d..5ad1ea4 100644 --- a/t/test.t +++ b/t/test.t @@ -13,6 +13,7 @@ sub test_card_identification { my %test_table=( '5212345678901234' => 'MasterCard', '5512345678901234' => 'MasterCard', + '2512345678901234' => 'MasterCard', '4123456789012' => 'VISA card', '4512345678901234' => 'VISA card', '341234567890123' => 'American Express card',