Class Track2

java.lang.Object
org.jpos.core.Track2

public class Track2 extends Object
This class is based on the old 'CardHolder' class and adds support for multiple PAN and Expiration dates taken from manual entry, track1, track2. It also corrects the name.
Since:
jPOS 2.0.5
  • Constructor Details

    • Track2

      public Track2(Track2.Builder builder)
      Copies the track2 fields from the supplied Track2.Builder.
      Parameters:
      builder - builder carrying the parsed or assembled track2 fields
  • Method Details

    • getPan

      public String getPan()
      Returns the primary account number.
      Returns:
      primary account number
    • getExp

      public String getExp()
      Returns the expiration date.
      Returns:
      expiration date in YYMM form, or null if absent
    • getCvv

      public String getCvv()
      Returns the CVV/CVC value, when present.
      Returns:
      CVV/CVC value, or null if not present in the track
    • getServiceCode

      Returns the service code.
      Returns:
      three-digit service code, or null if absent
    • getDiscretionaryData

      Returns the discretionary data trailing the service code.
      Returns:
      remaining discretionary data trailing the service code, or null
    • getTrack

      public String getTrack()
      Returns the raw track2 string this object was built from.
      Returns:
      raw track2 string this object was built from, or null when assembled programmatically
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • builder

      public static Track2.Builder builder()
      Creates a new builder for assembling a Track2.
      Returns:
      a new Track2.Builder for assembling a Track2