home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>C<Business::CreditCard> - Validate/generate credit card checksums/names</TITLE>
- <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
- <LINK REV="made" HREF="mailto:">
- </HEAD>
-
- <BODY>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> C<Business::CreditCard> - Validate/generate credit card checksums/names</P></STRONG>
- </TD></TR>
- </TABLE>
-
- <A NAME="__index__"></A>
- <!-- INDEX BEGIN -->
-
- <UL>
-
- <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
-
- <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <LI><A HREF="#author">AUTHOR</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P><CODE>Business::CreditCard</CODE> - Validate/generate credit card checksums/names</P>
- <P>
- <HR>
- <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
- <UL>
- <LI>Linux</LI>
- <LI>Solaris</LI>
- <LI>Windows</LI>
- </UL>
- <HR>
- <H1><A NAME="synopsis">SYNOPSIS</A></H1>
- <PRE>
- use Business::CreditCard;
- </PRE>
- <PRE>
-
- print validate("5276 4400 6542 1319");
- print cardtype("5276 4400 6542 1319");
- print generate_last_digit("5276 4400 6542 131");</PRE>
- <P>Business::CreditCard is available at a CPAN site near you.</P>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>These subroutines tell you whether a credit card number is
- self-consistent -- whether the last digit of the number is a valid
- checksum for the preceding digits.</P>
- <P>The <CODE>validate()</CODE> subroutine returns 1 if the card number provided passes
- the checksum test, and 0 otherwise.</P>
- <P>The <CODE>cardtype()</CODE> subroutine returns a string containing the type of
- card: ``MasterCard'', ``VISA'', and so on. My list is not complete;
- I welcome additions.</P>
- <P>The <CODE>generate_last_digit()</CODE> subroutine computes and returns the last
- digit of the card given the preceding digits. With a 16-digit card,
- you provide the first 15 digits; the subroutine returns the sixteenth.</P>
- <P>This module does <EM>not</EM> tell you whether the number is on an actual
- card, only whether it might conceivably be on a real card. To verify
- whether a card is real, or whether it's been stolen, or what its
- balance is, you need a Merchant ID, which gives you access to credit
- card databases. The Perl Journal (http://tpj.com/tpj) has
- a Merchant ID so that I can accept MasterCard and VISA payments; it
- comes with the little pushbutton/slide-your-card-through device you've
- seen in restaurants and stores. That device calculates the checksum
- for you, so I don't actually use this module.</P>
- <P>These subroutines will also work if you provide the arguments
- as numbers instead of strings, e.g. <CODE>validate(5276440065421319)</CODE>.</P>
- <P>To install this module, change directories to wherever
- your system keeps Perl modules (e.g. <CODE>/usr/local/lib/perl5</CODE>) and
- create a <CODE>Business</CODE> directory if there's isn't one already.
- Then copy this file there. That's it!</P>
- <P>
- <HR>
- <H1><A NAME="author">AUTHOR</A></H1>
- <P>Jon Orwant</P>
- <P>The Perl Journal and MIT Media Lab</P>
- <P><A HREF="mailto:orwant@tpj.com">orwant@tpj.com</A></P>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> C<Business::CreditCard> - Validate/generate credit card checksums/names</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-