transact method

Future<void> transact({
  1. required String amount,
  2. required String accountType,
  3. required String rrn,
})

Starts a payment transaction using NFC.

amount Transaction amount in minor currency units (e.g., cents). accountType Account type for the transaction (e.g., "10" for savings, "20" for checking). rrn Retrieval Reference Number for the transaction.

Throws a PlatformException if an error occurs.

Implementation

Future<void> transact({
  required String amount,
  required String accountType,
  required String rrn,
}) async {
  try {
    await _channel.invokeMethod('transact', {
      'amount': amount,
      'accountType': accountType,
      'rrn': rrn,
    });
  } on PlatformException catch (e) {
    debugPrint('Error in transaction: ${e.message}');
    rethrow;
  }
}