@ISA = qw( Exporter );
-$VERSION = "0.33_01";
+$VERSION = "0.33";
$Country = 'US';
Copyright (C) 1995,1996,1997 Jon Orwant
Copyright (C) 2001-2006 Ivan Kohler
-Copyright (C) 2007-2013 Freeside Internet Services, Inc.
+Copyright (C) 2007-2014 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,
## a lot more than just 6011*, they don't handle processing agreements, etc.
sub cardtype {
+ # Allow use as a class method
+ shift if UNIVERSAL::isa( $_[0], 'Business::CreditCard' );
+
my ($number) = @_;
$number =~ s/[\s\-]//go;
}
sub generate_last_digit {
+ # Allow use as a class method
+ shift if UNIVERSAL::isa( $_[0], 'Business::CreditCard' );
+
my ($number) = @_;
die "invalid operation" if length($number) == 8 || length($number) == 9;
## this (GPLed) code from Business::CCCheck is apparantly 4x faster than ours
## ref http://neilb.org/reviews/luhn.html#Comparison
-## maybe see if we can spped ours up a bit
+## maybe see if we can speed ours up a bit
# my @ccn = split('',$ccn);
# my $even = 0;
# $ccn = 0;
# $type = '' if $ccn % 10;
# return $type;
sub validate {
+ # Allow use as a class method
+ shift if UNIVERSAL::isa( $_[0], 'Business::CreditCard' );
+
my ($number) = @_;
my ($i, $sum, $weight);