This plugin reads payment related cards by using NFC technology. Tested with VISA and Master Card. The plugin will return card number, expire date (MM/YY), holder name and card status (unknown, active, locked).
Fork of https://github.com/paytrek/emv-card-reader
Only Android is supported. Apple CoreNFC does not support payment related cards, only Apple Pay can use NFC to extract card detail. Please check CoreNFC documentation for more.
Add dependency in pubsec.yaml
,
dependencies:
emv_card_reader:
git:
url: [email protected]:jordanliu/flutter-emv-reader.git
Create NFC reader,
final emv = EmvCardReader();
final s = await emv.start();
final a = await emv.available();
if (a) {
print('NFC is available in this device');
}
Read NFC data once,
final card = await emv.read();
print(card.number);
Stream NFC data,
emv.stream().listen((card) => print(card.number));
Close NFC reader,
emv.stop();