net.authorize.util
Class Luhn
java.lang.Object
net.authorize.util.Luhn
public class Luhn
- extends Object
- See Also:
- Luhn_algorithm (WikiPedia)
Constructor Summary |
protected |
Luhn()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Luhn
protected Luhn()
stripNonDigits
public static String stripNonDigits(String cardNumber)
- Strips non-digits from the cardNumber provided.
- Parameters:
cardNumber
-
- Returns:
- Return the cardNumber string stripped of everything but numeric digits.
getCardType
public static CardType getCardType(String cardNumber)
- Return the CardType by inspecting the first digits of the card number.
- Parameters:
cardNumber
-
- Returns:
- Return the CardType
Copyright © 2014. All Rights Reserved.