Code Monkey home page Code Monkey logo

magnetictrackparser's Introduction

Quick Build Code Climate Code Coverage The Central Repository

⭐ Star it ⤴️ if you love it!

Magnetic Track Parser

Magnetic Track Parser is a Java library that can parse magnetic track data from a bank issued credit card, such as might be returned from a USB magnetic card stripe reader.

Magnetic Track Parser depends on the Credit Card Number library.

The goal of this project is to use publicly and freely available documentation to create a reliable Java library to provide information about credit cards.

Resources

Some resources consulted are:

Design Principles

  • All classes are immutable and thread-safe
  • Secure data follows standards in the Java Cryptography Architecture (JCA) Reference Guide
  • The standard toString() function formats data in a readable form
  • Internationalization of card numbers is supported
  • Validity is enforced by JUnit 5 tests
  • Java 8 or newer is required
  • Android friendly

Download and Use in Projects

You can download the jar on the Maven Central Repository. The download page has instructions on how to use the library in your Maven or Gradle build.

Examples

How to Parse Magnetic Track Data

To parse a magnetic track, use code like:

BankCardMagneticTrack track = 
  BankCardMagneticTrack.from("%B5350290149345177^FATEHI/SUALEH^16042010000000000000000000000000000567001000?;5350290149345177=16042010000056700100?");
System.out.println(track);

and you will get this output:

TRACK 1: %B5350290149345177^FATEHI/SUALEH^16042010000000000000000000000000000567001000?
  Primary Account Number: 5350290149345177
  Name: Sualeh Fatehi
  Expiration Date: 2016-04
  Service Code: 201
  Discretionary Data: 0000000000000000000000000000567001000
TRACK 2: ;5350290149345177=16042010000056700100?
  Primary Account Number: 5350290149345177
  Expiration Date: 2016-04
  Service Code: 201
  Discretionary Data: 0000056700100
TRACK 3:  Not Available.

Bank Card Information: 
  Raw Account Number: 5350290149345177
  Primary Account Number: 5350290149345177
    Major Industry Identifier: 5 - Banking and financial
    Issuer Identification Number: 53502901
    Card Brand: MasterCard
    Last Four Digits: 5177
    Passes Luhn Check? Yes
    Is Primary Account Number Valid? Yes
  Name: Sualeh Fatehi
  Expiration Date: 2016-04
    Is Expired? Yes
  Service Code: 
    2 - Interchange: International interchange. Technology: Integrated circuit card.
    0 - Authorization Processing: Normal.
    1 - Allowed Services: No restrictions. PIN Requirements: None.

Who Uses

  • Dmitry Holodov's excellent Android app, SwipeYours uses magnetictrackparser. See details in SetCardActivity.java. This Android app helps developers understand the new Android Host Card Emulation feature for payments, and is written with open source, in the same spirit as magnetictrackparser.

magnetictrackparser's People

Contributors

dependabot[bot] avatar sualeh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magnetictrackparser's Issues

Cannot read AccountNumber object

Im using a magnetic card reader that has a class which helps return the track data track by track.
I am then taking data from track 2, trimming it so as to remain with the card/primary account number and passing it in the constructor for new AccountNumber object. When I call the toString() method of this object nothing is being printed in my logcat. What could be the issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.