Business::CreditCard::Object - a Credit Card object


Business-CreditCard-Object documentation  | view source Contained in the Business-CreditCard-Object distribution.

Index


NAME

Top

Business::CreditCard::Object - a Credit Card object

SYNOPSIS

Top

	my $card = Business::CreditCard::Object->new("4929-4929-4929-4929");

	if ($card->is_valid) { 
		print "Card " . $card->number . " is a " . $card->type;
	}

DESCRIPTION

Top

This provides an OO interface around the Business::CreditCard module. You instantiate it with a card number, and can ask if it is valid, for a standardised version of the card number, and what type of card it is.

METHODS

Top

new

	my $card = Business::CreditCard::Object->new("4929-4929-4929-4929");

Construct a new Card object. The card number can contain optional numbers and/or spaces.

is_valid

This computes the checksum for the card given and returns a boolean value for whether or not the number passes this check.

type

This returns the type of card given. See Business::CreditCard for a list of possible values.

number

This returns a standardised version of the card number as a string of digits with all spaces and minus signs removed. The object will also stringify to this value.

AUTHOR

Top

Tony Bowden

BUGS and QUERIES

Top

Please direct all correspondence regarding this module to: bug-Business-CreditCard-Object@rt.cpan.org

SEE ALSO

Top

Business::CreditCard

COPYRIGHT

Top


Business-CreditCard-Object documentation  | view source Contained in the Business-CreditCard-Object distribution.