Flutter Tappa

A Flutter plugin that integrates with the Tappa NFC payment SDK for Android.

Features

  • NFC payment transactions
  • Terminal initialization and configuration
  • Loyalty card reading
  • Error handling and callbacks

Getting Started

Prerequisites

  • Android device with NFC capabilities
  • Tappa SDK native library (nfcNative.so)

Installation

Add flutter_tappa to your pubspec.yaml:

dependencies:
  flutter_tappa: ^0.0.1

Android Setup

Ensure your Android project has NFC permissions in the AndroidManifest.xml:

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

### Usage

Import the package:

```dart
import 'package:flutter_tappa/flutter_tappa.dart';

Initialize the Tappa SDK:

final FlutterTappa tappa = FlutterTappa();

await tappa.initialize(
  errorCallback: (errorCode, errorMessage) {
    print('Tappa error: $errorCode - $errorMessage');
  }
);

Initialize the terminal:

await tappa.initTerminal(
  terminalId: 'TERM001',
  uniqueId: 'UID123456',
  clientId: 'CLIENT001',
  merchantLocation: 'Main Street Store'
);

Start a transaction:

await tappa.transact(
  amount: '1000', // 10.00 in minor units
  accountType: '10', // Savings account
  rrn: 'RRN12345678'
);

Read a loyalty card:

await tappa.readLoyaltyCard();

Error Codes

  • 0: Success
  • 30-39: PIN-related errors
  • 50: APDU transceive error
  • 100-104: Loyalty card errors

Example

See the 'example' folder for a complete sample Flutter application that demonstrates how to use this plugin.

License

MIT License