net.authorize.util
Class Luhn

java.lang.Object
  extended by net.authorize.util.Luhn

public class Luhn
extends Object

See Also:
Luhn_algorithm (WikiPedia)

Constructor Summary
protected Luhn()
           
 
Method Summary
static CardType getCardType(String cardNumber)
          Return the CardType by inspecting the first digits of the card number.
static String stripNonDigits(String cardNumber)
          Strips non-digits from the cardNumber provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Luhn

protected Luhn()
Method Detail

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.