-
Notifications
You must be signed in to change notification settings - Fork 47
Description
I cannot seem to get the parser to recognize the AAMVA format. There are other plugins that do that, but I'm already using your plugin to parse payment card data so I need a modification that will parse driver's licenses.
Here's the configuration I'm using:
$.cardswipe({
firstLineOnly: false,
success: cardSwipeComplete,
parsers: [aamva, "generic"],
debug: true,
error: errorCallback,
prefixCharacter: '%',
});
I write to the console whenever any one of the states is entered, but they never fire. In debug mode I get into the PENDING state, since I've changed the prefix from the standard "%B" to simply "%", but success, start, end, failure, none of those states gets entered.
I have not yet written the aamva parser, so I was hoping you could help. Here's the GIT that another developer published for that purpose: https://github.com/winfinit/aamvajs
Here's the standard for AAMVA (its actually in a table, but all the fields are there in three tracks):
AAMVA Driver’s License Format
TRACK 1
Field ID Character Contents Length*
a Start Sentinel (%) 1
b State or Province 2
c City 13
d Name 35
e Address 29
f End Sentinel (?) 1
g Linear Redundancy Check
(LRC) Character 1
TRACK 2
Field ID Characte r Contents Length
a Start Sentinel (;) 1
b ANSI User Code 1
c ANSI User ID 5
d Jurisdiction ID/DL 14
e Expiration date 4
f Birthdate 8
g Remainder of Jurisdiction ID/DL 5
h End Sentinel (?) 1
i Linear Redundancy Check
(LRC) Character 1
TRACK 3
Field ID Character Contents Length
a Start Sentinel (%) 1
b Template Version # 1
c Security Version # 1
d Postal Code 11
e Class 2
f Restrictions 10
g Endorsements 4
h Sex 1
i Height 3
j Weight 3
k Hair Color 3
l Eye Color 3
m ID # 10
n Reserved Space 16
o Error Correction 6
p Security 5
q End Sentinel (?) 1
r Linear Redundancy Check
(LRC) Character 1