MethodChannelAmwalEcr class base

Drives the terminal through the native ECR SDK on the other side of a MethodChannel.

The whole of this class is about one guarantee: one call, one answer. A money-moving request is sent exactly once and its future completes exactly once, whatever the host does afterwards. Nothing here retries, and nothing here can complete a future a second time — a late reply arriving after a cancel is dropped, because by then the caller has already been told the outcome is unknown and has acted on it.

Inheritance

Constructors

MethodChannelAmwalEcr({MethodChannel? channel})
channel is for tests, which pass one carrying a mock handler. Leave it unset in production so the plugin binds to kEcrMethodChannel.

Properties

channel → MethodChannel
Visible for tests, which swap in a channel with a mock handler.
final
hashCode → int
The hash code for this object.
no setterinherited
inFlightCount → int
How many operations are still waiting on the host. For tests and for a till that wants to refuse a second transaction while one is running.
no setter
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.
override
closeReceipt(EcrRequest request) → Future<EcrReceiptClosed>
Asks the terminal to put its receipt away and go back to its idle screen.
override
inquire(EcrRequest request) → Future<EcrInquiry>
Asks what became of an earlier transaction, by its receipt number.
override
inquireByReference(EcrRequest request) → Future<EcrInquiry>
Asks what became of an earlier transaction, by the reference it was sent with.
override
isReachable(EcrRequest request) → Future<bool>
Whether the terminal is listening. Never throws: an unreachable terminal is an answer, not an error.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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.
override
receipt(EcrRequest request) → Future<EcrReceipt>
Fetches an earlier transaction's e-receipt.
override
refund(EcrRequest request) → Future<EcrResult>
Returns money against an earlier transaction.
override
sale(EcrRequest request) → Future<EcrResult>
Takes a payment.
override
signOn(EcrRequest request) → Future<EcrSignOn>
Asks what the terminal is and what it will accept.
override
toString() → String
A string representation of this object.
inherited
voidTransaction(EcrRequest request) → Future<EcrResult>
Cancels an earlier transaction in full.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited