Last updated:
0 purchases
mypos flutter
mypos_flutter #
Bridge with native MyPos SDK
/!\ WORK IN PROGRESS /!
Currently still testing and developing full implementation of the SDK.
ONLY WORKS ON ANDROID FOR NOW
Feel free to add your contribution to this project by submitting pull request or opening issues
Installation #
Use this package as a library
Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
mypos_flutter: ^0.1.0
copied to clipboard
Install it
You can install packages from the command line:
with Flutter:
$ flutter packages get
copied to clipboard
Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.
Getting Started #
Initialising the library
import 'package:mypos_flutter/mypos_flutter.dart';
import 'package:mypos_flutter/currency.dart';
import 'package:mypos_flutter/language.dart';
import 'package:mypos_flutter/connection_type.dart';
MyposFlutter.setCurrency(Currency.RON);
MyposFlutter.setConnectionType(ConnectionType.BLUETOOTH);
MyposFlutter.setLanguage(Language.ROMANIAN);
MyposFlutter.setConnectionListener((dynamic event) {
print("CONNECTION LISTENER FLUTTER");
print(event);
print("-----------------------");
});
MyposFlutter.setPOSReadyListener((dynamic event) {
print("CONNECTION READY FLUTTER");
print(event);
print("-----------------------");
_stateCallback(ApplicationState.Ready);
});
MyposFlutter.setPOSInfoListener((dynamic event) {
print("POS INFO FLUTTER");
print(event);
var state = PosInfoState.fromEvent(event);
print("-----------------------");
print(state);
print(state.status_code);
print(state.message);
print("-----------------------");
});
copied to clipboard
Making a payment
import 'package:mypos_flutter/mypos_flutter.dart';
import 'package:mypos_flutter/receipt_configuration.dart';
MyposFlutter.purchase(
"12.34" /*amount*/,
"9999999999" /*transaction reference*/,
ReceiptConfiguration.PRINT_AUTOMATICALLY,
);
copied to clipboard
Methods supported #
✅ POSHandler.setCurrency
✅ POSHandler.setApplicationContext
✅ POSHandler.clearDefaultReceiptConfig
✅ POSHandler.setLanguage
✅ POSHandler.setConnectionType
✅ POSHandler.connectDevice
✅ POSHandler.isTerminalBusy
✅ POSHandler.setConnectionListener
✅ POSHandler.setPOSInfoListener
❌ POSHandler.setTransactionClearedListener
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.