JCB 3 16
JCB 2131, 1800 15
+--
+
from Neale Banks <neale@lowendale.com.au>
According to a booklet I have from Westpac (an Aussie bank), a card number
starting with 5610 or 56022[1-5] is a BankCard
BankCards have exactly 16 digits.
+--
+
from "Becker, Max" <Max.Becker@firstgate.com>
It's mostly used in the UK and is either called "Switch" or "Solo".
Card Type Prefix Length
8[1-2]
4936
+--
+
from http://en.wikipedia.org/wiki/Credit_card_number#Prefixes
As of November 8, 2004, MasterCard and Diner's club formed an alliance.
Cards issued in Canada and the USA start with 55 and are treated as
Please ensure that your POS terminals, websites and any pertinent
internal systems can accept these new IINs.
+--
+
from http://en.wikipedia.org/wiki/Laser_(debit_card)#Technical
Laser cards are prefixed with either "6304", "6706", "6771" or "6709", and
may be between 16 and 19 characters in length.
+--
+
from https://www.discovernetworkvar.com/pdf_docs/9-2_VAR_ALERT_Sep_2009.pdf
Be sure to update your POS systems now with the following expanded Issuer
Identification Number ("IIN") Ranges. The IIN Range table listed below
applicable.
2 The PAN length for this IIN Range (36000000 to 36999999) is 14 digits.
+--
+
+from SBH Israel / Nir Alfandari:
+Local Isracard: 8(-9?) digits
+
+From http://www.wysiwyg.co.il/Anatomy-of-CreditCard-Number-formats.asp#IsraCard-algorithm
+8-9 digits, non-LUHN validation
+
+From Erik Levinse:
+ i think it's like luhn, except instead of 212121... you put
++987654321 under the number you're validating, multiply each, and do mod 11 on
++the sum, instead of mod 10.
+
Revision history for Perl extension Business::CreditCard.
0.32 unreleased
+ - Add Israeli Isracard (no checksum yet)
- Add LICENSE=>perl to Makefile.PL; add license to META.yml,
closes: cpan #27735
@ISA = qw( Exporter );
-$VERSION = "0.31";
+$VERSION = "0.32_01";
$Country = 'US';
Solo
China Union Pay
Laser
+ Isracard
Unknown
"Not a credit card" is returned on obviously invalid data values.
Copyright (C) 1995,1996,1997 Jon Orwant
Copyright (C) 2001-2006 Ivan Kohler
-Copyright (C) 2007-2009 Freeside Internet Services, Inc.
+Copyright (C) 2007-2011 Freeside Internet Services, Inc.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
#$number =~ s/\D//g;
{
local $^W=0; #no warning at next line
- return "Not a credit card" unless length($number) >= 13 && 0+$number;
+ return "Not a credit card"
+ unless ( length($number) >= 13
+ || length($number) == 8 || length($number) == 9 #Isracard
+ )
+ && 0+$number;
}
return "Switch"
return "Laser"
if $number =~ /^6(304|7(06|09|71))[\dx]{12,15}$/o;
+ return "Isracard"
+ if $number =~ /^[\dx]{8,9}$/;
+
return "Unknown";
}
sub generate_last_digit {
my ($number) = @_;
+
+ #XXX doesn't work for Isracard, should die
+
my ($i, $sum, $weight);
$number =~ s/\D//g;
sub validate {
my ($number) = @_;
+
my ($i, $sum, $weight);
return 0 if $number =~ /[^\d\s]/;
$number =~ s/\D//g;
+ return 1 if $number =~ /^[\dx]{8,9}$/; #XXX Isracard does not use LUHN,
+ # validation not yet implemented
+
return 0 unless length($number) >= 13 && 0+$number;
for ($i = 0; $i < length($number) - 1; $i++) {
'5610xxxxxxxxxxxx' => 'BankCard',
'6250xxxxxxxxxxxx' => 'Discover card', #China Union Pay
'6280xxxxxxxxxxxx' => 'Discover card', #China Union Pay
+ '12345678' => 'Isracard',
+ '123456780' => 'Isracard',
);
while( my ($k, $v)=each(%test_table) ){
if(cardtype($k) ne $v){