Skip to content

This plugin is used for reading magnetic card data using the headphone jack in Android.

License

Notifications You must be signed in to change notification settings

KumarSunil007/phonegap-jack-reader-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jack-Reader

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

Usages:

Create a button in HTML file.

    <button type="button" id="swipe-btn">Swipe</button>
    

To read card data use following following function ( use jQuery as well) :

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.

About

This plugin is used for reading magnetic card data using the headphone jack in Android.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published