Skip to main content

my_pos 0.3.1 copy "my_pos: ^0.3.1" to clipboard
my_pos: ^0.3.1 copied to clipboard

PlatformAndroid

Kasseneck's Flutter plugin for Android Smart POS terminals: card payments, receipt printing and the RKSV signature card (SAM) for Austrian cash registers.

Kreiseck Software Solutions

my_pos

Card payments, receipt printing and the RKSV signature card on Android Smart POS terminals.
The terminal bridge of Kasseneck, the cloud cash register system for Austria.

pub version pub points Android Apache-2.0 license by Kasseneck


my_pos connects a Flutter app to an Android Smart POS terminal: take a card payment, print the receipt on the built-in printer and sign receipts with the RKSV signature card in the terminal's SAM slot. It runs in production in the Kasseneck apps, for example the taxi register Karteck.

๐Ÿ’ณ Card payment Opens the terminal's payment screen and returns the full result (approval, reference number, STAN, card brand, ...)
๐Ÿงพ Receipt printing Text, two-column lines, images and QR codes on the built-in printer
๐Ÿ” Signature card Certificate serial and signature with the RKSV signature card in the SAM slot (ACOS, ACOS-ID, CardOS)
๐Ÿ“ฑ Tap to pay Payments through the Glass app on a phone

Android only. The app has to run on a supported terminal (or with the Glass app installed).

Installation #

dependencies:
  my_pos: ^0.3.1

Nothing else to set up: the plugin adds the package queries for the terminal's payment service to the merged manifest. Minimum Android version is 6.0 (API 23).

Card payment #

import 'package:my_pos/enums/my_pos_currency_enum.dart';
import 'package:my_pos/my_pos.dart';

final result = await MyPos.makePayment(
  amount: 12.50,
  currency: MyPosCurrency.eur,
  printCustomerReceipt: false, // the app prints its own receipt
  printMerchantReceipt: false,
  reference: 'ORDER-4711',
);

if (result.isApproved) {
  // Paid. Keep result.reference_number / result.STAN for the books.
} else if (result.isUnknown || result.isCancelled) {
  // No approval came back. Check the terminal's transaction list
  // before charging again: the card may still have been charged.
} else {
  // Declined: result.response_code says why.
}

Only isApproved means paid. A missing result (isUnknown, or isCancelled after the payment screen was closed) does not prove that no money moved.

makePayment throws a PlatformException only when the payment screen cannot be opened:

Code Meaning
NO_ACTIVITY The app is not in the foreground.
ALREADY_ACTIVE A payment is already running.
INVALID_ARGUMENT Amount is not a positive number, or the currency is missing.
PAYMENT_NOT_STARTED The payment service is missing or refused the request (unknown currency, unsupported function, ...).
RESULT_LOST The app's activity was closed for good while the payment ran. Check the terminal.

Only one payment runs at a time, and every call is answered exactly once.

Receipt printing #

import 'package:my_pos/enums/my_pos_print_response.dart';
import 'package:my_pos/models/my_pos_paper.dart';

final paper = MyPosPaper()
  ..addText('Kasseneck', fontSize: 32, alignment: PrinterAlignment.center)
  ..addDoubleText('Taxi ride', 'EUR 12,50')
  ..addDoubleText('Total', 'EUR 12,50')
  ..addQrCode('https://kasseneck.at', size: 240)
  ..addSpace(2)
  ..addCutLine();

final status = await paper.print(); // success, failed, outOfPaper or unknown

Printing never throws. On a device without the print service the answer is PrintResponse.failed at once; if the terminal does not report back within 60 seconds it is PrintResponse.unknown. An image or QR code that cannot be built is left out, the rest prints. paper.toString() gives a text preview for logs and tests.

Signature card (RKSV) #

Austrian cash registers sign every receipt (Registrierkassensicherheitsverordnung, RKSV). On a Smart POS terminal the signature card sits in a SAM slot:

import 'package:my_pos/enums/sam_slot_enum.dart';

final serial = await MyPos.getCertificateSerialHex(SamSlot.slot_1);
final signature = await MyPos.doSignature(dataToBeSigned, SamSlot.slot_1, pin);
// Base64url without padding, ready for the RKSV signature value.

doSignature hashes the data with SHA-256 before signing. Errors come as PlatformException with the code NO_SAM (no card in the slot) or ERROR_SIG.

Publishing to the terminal app store #

Terminal apps are installed from the terminal vendor's app store, not from Google Play. What helped us get through the review:

  • Ship 32-bit ARM (armeabi-v7a) next to arm64-v8a. Some terminals run a 32-bit system and cannot install an app with 64-bit libraries only.
    defaultConfig {
        ndk { abiFilters "armeabi-v7a", "arm64-v8a" }
    }
    
  • Upload a release APK signed with APK Signature Scheme v2 and keep the same key for every version.
  • Ask only for permissions the app needs; the review checks them.

Example #

example/ charges EUR 1.00 and prints a test receipt.

About Kasseneck #

Kasseneck is a cloud cash register system (Registrierkasse) for Austria: RKSV-compliant receipts from the browser, the phone or the card terminal, without extra cash register hardware. This plugin is how Kasseneck talks to card terminals.

Versioning #

Semantic versioning, see the CHANGELOG.

License #

Apache-2.0, see LICENSE. ยฉ 2023-2026 Kreiseck Software Solutions.


Made with care by Kreiseck Software Solutions for Kasseneck ยท Austria ๐Ÿ‡ฆ๐Ÿ‡น

2
likes
160
points
121
downloads

Documentation

API reference

Publisher

verified publisherkreiseck.com

Weekly Downloads

Kasseneck's Flutter plugin for Android Smart POS terminals: card payments, receipt printing and the RKSV signature card (SAM) for Austrian cash registers.

Homepage
Repository (GitHub)
View/report issues

Topics

#kasseneck #rksv #registrierkasse #payment #receipt-printer

License

Apache-2.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on my_pos

Packages that implement my_pos