The seam between the Dart API and whatever drives the terminal.
Federated so a test can stand in for the host without a binding, and so a future platform — a desktop till, a web bridge — can be added without the public API changing shape.
Implementations must hold to the same rules the native hosts do:
- exactly one completion per call, and never a second one after a cancel;
- no retry of any kind. Nothing in this package may send a money-moving request the caller did not ask for. A duplicate submission is a customer charged twice, and there is no failure worth that;
- a failure whose outcome is unknown is reported as such, never as a decline.
- Inheritance
-
- Object
- PlatformInterface
- AmwalEcrPlatform
- Implementers
Constructors
- AmwalEcrPlatform()
- Registers the subclass against the interface's token, which is what stops an unrelated object being installed as instance.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
String operationId) → Future< bool> -
Asks the host to abandon the operation with
operationId. -
closeReceipt(
EcrRequest request) → Future< EcrReceiptClosed> - Asks the terminal to put its receipt away and go back to its idle screen.
-
inquire(
EcrRequest request) → Future< EcrInquiry> - Asks what became of an earlier transaction, by its receipt number.
-
inquireByReference(
EcrRequest request) → Future< EcrInquiry> - Asks what became of an earlier transaction, by the reference it was sent with.
-
isReachable(
EcrRequest request) → Future< bool> - Whether the terminal is listening. Never throws: an unreachable terminal is an answer, not an error.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printReceipt(
EcrRequest request) → Future< EcrPrintOutcome> - Asks the Amwal payment app to print a receipt image (app-to-app only).
-
probeReachability(
EcrRequest request) → Future< EcrReachability> - Asks whether the terminal is there, with the underlying error when it is not. Never throws for an unreachable link — see EcrReachability.error.
-
receipt(
EcrRequest request) → Future< EcrReceipt> - Fetches an earlier transaction's e-receipt.
-
refund(
EcrRequest request) → Future< EcrResult> - Returns money against an earlier transaction.
-
sale(
EcrRequest request) → Future< EcrResult> - Takes a payment.
-
signOn(
EcrRequest request) → Future< EcrSignOn> - Asks what the terminal is and what it will accept.
-
toString(
) → String -
A string representation of this object.
inherited
-
voidTransaction(
EcrRequest request) → Future< EcrResult> - Cancels an earlier transaction in full.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ AmwalEcrPlatform
-
The implementation in use. Defaults to the method-channel host.
getter/setter pair