Class FinancialCard

    • Method Detail

      • parse

        public static FinancialCard parse​(java.lang.String cardData)
        This method takes the raw card data from the swipe and attempts to extract financial card data.
        Parameters:
        cardData - Raw magnetic strip data.
        Returns:
        FinancialCard object containing parsed data if possible, otherwise null.
      • toString

        public java.lang.String toString()
        Returns this object as a human readable string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String containing human readable string.
      • verifyCardChecksum

        public static boolean verifyCardChecksum​(java.lang.String cardNumber)
        This method takes a card number and applies Luhn's algorithm to verify the card checksum. This method can detect minor transpositions and obviously invalid card numbers, but it cannot detect fake credit card numbers.
        Parameters:
        cardNumber - Card number to verify.
        Returns:
        True if the card number passes, false otherwise.
        See Also:
        http://en.wikipedia.org/wiki/Luhn_algorithm
      • isNumberValid

        public boolean isNumberValid()
        Gets whether or not the credit card number passes Luhn's algorithm.
        Returns:
        the numberValid
      • getIssuer

        public FinancialCardIssuer getIssuer()
        Gets the card issuer determined based on card number patterns.
        Returns:
        The card issuer.