org.davesag.generica.util
Class CreditCardUtils
java.lang.Object
org.davesag.generica.util.CreditCardUtils
- All Implemented Interfaces:
- Serializable
- public class CreditCardUtils
- extends Object
- implements Serializable
The CreditCardUtils utils provide simple methods for
determining details of a credit card.
- Since:
- Generica 1.0
- Version:
- CVS Revision $Id: CreditCardUtils.java,v 1.7 2004/03/30 13:00:43 davesag Exp $
- Author:
- Dave Sag
http://www.davesag.com
- See Also:
- Serialized Form
|
Nested Class Summary |
class |
CreditCardUtils.CardType
An inner class that holds handy information about each type of credit
card. |
|
Constructor Summary |
CreditCardUtils()
Default constructor that builds a list of card types for us. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CARD_TYPES
public static CreditCardUtils.CardType[] CARD_TYPES
Array of all card types
CreditCardUtils
public CreditCardUtils()
- Default constructor that builds a list of card types for us. The known
cards are as follows. perhaps this data should go into a config file or
property file.
- American Express
- Diners Club
- Carte Blanche
- Discover
- EnRoute
- JCB - 16 digit
- JCB - 15 digit
- Master Card
- Bankcard
- Visa - 16 digit
- Visa - 13 digit
getCardType
public static CreditCardUtils.CardType getCardType(BigInteger number)
- Get the CardType given the card number.
- Parameters:
number - The card number.
- Returns:
- The CardType that describes the card number.
getCardBrand
public static String getCardBrand(BigInteger number)
- Get the Card's usual name given the card number.
- Parameters:
number - The card number.
- Returns:
- The typical name of the card baring the number provided. Eg
Visa.
Dave Sag Generica API version 0.5.9 - (prerelease) Copyright © 2003 - 2004 Dave Sag.