TransactionRequest class
Immutable request describing one transaction to run on the reader.
The amount is carried as an integer in minor units (cents, pence, etc.) to avoid floating-point rounding. The POS app is responsible for converting from a display amount to minor units.
Constructors
-
TransactionRequest({required TransactionType transactionType, required int amountMinorUnits, required String currency, required String idempotencyKey, String? referenceId, String? description, List<
EntryMode> allowedEntryModes = const [EntryMode.chip, EntryMode.tap, EntryMode.swipe], List<EntryMode> preferredEntryModes = const [], bool requestSignature = false, Duration? timeout, Map<String, dynamic> ? metadata}) -
TransactionRequest.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
allowedEntryModes
→ List<
EntryMode> -
Which entry modes the reader should accept for this transaction.
Defaults to chip / tap / swipe; manual is not a default.
final
- amountMinorUnits → int
-
Amount in the currency's smallest unit (cents for USD, pence for
GBP, etc.). Stored as
int, neverdouble.final - currency → String
-
ISO 4217 currency code (e.g.
USD).final - description → String?
-
Optional short description; may be shown on the reader display.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- idempotencyKey → String
-
Caller-supplied idempotency key. The same key must produce the
same authoritative result if replayed.
final
-
metadata
→ Map<
String, dynamic> ? -
Opaque POS-supplied metadata to attach to the gateway call.
final
-
preferredEntryModes
→ List<
EntryMode> -
Optional ordering hint: when both reader and POS offer multiple
allowed entry modes, the reader / driver should prefer them in
this order. Entries that are not also in allowedEntryModes
are ignored. Empty list means "no preference".
final
- referenceId → String?
-
POS-supplied reference id (order id, ticket id, etc.). Passed
through to em-api; opaque to the SDK.
final
- requestSignature → bool
-
Whether to collect a signature after a successful read. The POS
renders the signature; the SDK just reports whether one is
required.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration?
-
Maximum time to wait for a card. Null means "use SDK default".
final
- transactionType → TransactionType
-
Sale / refund / void / authOnly / capture.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override