Skip to content

Latest commit

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

trackParser

trackParser is a tiny credit card or magstripe card parser that reads in the raw string from the card and converts it to usable data. This can be used to charge a credit card as well as just read what is inside random magnetic stripe cards. For more information how magnetic cards work as well as the 3 different types of tracks available for the cards, visit This Wikipedia Article On The Magnetic Stripe Card

NOTE ************************************

This library DOES support track 1, track 2, AND track 3 though track 3 is rarely used

Installation

Currently it is only available through npm or right here on github

$ npm install trackparser

Usage

consttrackParser=require('trackparser').trackParserconsttrackParserSync=require('trackparser').trackParserSync// method for parsing a credit cardvarcardinfo=trackParserSync("STRING HERE")console.log(cardinfo)// method for parsing a credit card with a callbacktrackParser("STRING HERE",function(cardinfo){console.log(cardinfo)})

More Examples

varcardinfo=trackParserSync("STRING HERE")if(cardinfo.successful){// the parsing was successfulconsole.log(cardinfo.account,cardinfo.lastName,cardinfo.firstName,cardinfo.expYear,cardinfo.expMonth,cardinfo.cvv)}else{console.log("There was an error parsing the track data")}// method for parsing a credit card with a callbacktrackParser("STRING HERE",function(cardinfo){if(cardinfo.successful){// the parsing was successfulconsole.log(cardinfo.account,cardinfo.lastName,cardinfo.firstName,cardinfo.expYear,cardinfo.expMonth,cardinfo.cvv)}else{console.log("There was an error parsing the track data")}})

About

A credit card parser that takes in the raw track data and returns everything you need to charge a credit card

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages