Skip to content

abidiahmedcom/emv_nfc_reader

Repository files navigation

emv_nfc_reader

EMV NFC Reader Showcase

A powerful Flutter plugin for reading and extracting comprehensive data from EMV (Europay, Mastercard, and Visa) NFC cards.

Features

  • Standard Data Extraction: PAN (Card Number), Expiry Date.
  • Advanced Data Extraction:
    • Cardholder Name (from tags or Track 1 fallback).
    • Bank Details (IBAN, BIC).
    • PAN Sequence Number.
  • Usage & Security Counters:
    • Application Transaction Counter (ATC) in decimal.
    • PIN Try Counter in decimal.
    • Last Online ATC in decimal.
  • Transaction History: Extracts and parses the card's internal transaction log (Date, Time, Amount, Currency).
  • Proprietary Data: Fetches Issuer Application Data (IAD), Application Default Action (ADA), and Form Factor Indicator.
  • Robust Parsing: Handles PDOL (Processing Options Data Object List) and AFL (Application File Locator) logic automatically.

Getting Started

Android Setup

Add the following permission to your AndroidManifest.xml:

<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />

Usage

import 'package:emv_nfc_reader/emv_nfc_reader.dart';

final _emvNfcReader = EmvNfcReader();

// Start scanning for a card
try {
  final Map<String, String>? cardData = await _emvNfcReader.startReading();
  if (cardData != null) {
      print('PAN: ${cardData['pan']}');
      print('Expiry: ${cardData['expiry']}');
      print('Holder: ${cardData['cardholder']}');
      print('ATC: ${cardData['atc']}');
  }
} catch (e) {
  print('Error reading card: $e');
}

Data Fields

The startReading() method returns a Map<String, String> containing:

Key Description
pan Formatted Card Number
expiry Expiry Date (MM/YY)
cardholder Cardholder Name
iban International Bank Account Number
atc Transaction Counter (Decimal)
pinTry PIN Attempts Remaining (Decimal)
transactions Historical transactions (formatted)
... And many more technical tags

Limitations

  • Hardware Dependency: Requires an NFC-enabled Android device.
  • Issuer Privacy: Some banks opt-out of sharing certain fields (like IBAN or Name) via the contactless interface.
  • Security: This library cannot extract PINs or Private Keys.

Feedback

If you found this useful, give the package a ⭐ on GitHub and a 👍 on pub.dev. It helps other developers discover it!

Have questions or feature requests? Open an issue on GitHub or drop a comment below.

License

MIT License.

About

Flutter credit card reader and validator package that detects card types, formats card numbers in real time, and simplifies building payment and checkout forms in Flutter applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors