This plugin is used for reading data from magnetic card with the help of 3.5 mm headphone jack card reader. Currently this is working perfectly for the Android. I am working for IOS also, when I will finshed with it, you can get the same from this repository
Create a button in HTML file.
<button type="button" id="swipe-btn">Swipe</button>
jQuery('#swipe-btn').click(function(){
com.betasoft.org.jack.reader.JackReader.ReadCard(SwipeResult);
}
function SwipeResult(resp){
if(resp.card_number){
console.log('Card Number:'+ resp.card_number +
'\nExpiry Month:'+ resp.expiry_month +
'\nExpiry Year:'+ resp.expiry_year
);
}else{
console.log('Error: Card not swiped successfully');
}
// IOS
resp =resp[0];
if(typeof(resp) == "object"){
console.log('Card Number:'+ resp.card_number +
'\nExpiry Month:'+ resp.expiry_month +
'\nExpiry Year:'+ resp.expiry_year
);
}else{
console.log('Error: Card not swiped successfully');
}
}
If you have any problem related to plugin Integration please let me know.