TransactionResult class
Terminal result of one startTransaction invocation.
The POS app uses status to drive its sale state. The SDK is not allowed to set status to TransactionResultStatus.approved unless gatewayResponse is present and itself reports approved.
Constructors
- TransactionResult({required TransactionResultStatus status, required String requestIdempotencyKey, required int amountMinorUnits, required String currency, String? referenceId, String? transactionId, EntryMode entryMode = EntryMode.unknown, CardSummary? card, GatewayTransactionResponse? gatewayResponse, ReaderError? error, DateTime? completedAt})
- TransactionResult.approved({required String requestIdempotencyKey, required int amountMinorUnits, required String currency, required GatewayTransactionResponse gatewayResponse, String? referenceId, String? transactionId, EntryMode entryMode = EntryMode.unknown, CardSummary? card, DateTime? completedAt})
-
factory
- TransactionResult.cancelled({required String requestIdempotencyKey, required int amountMinorUnits, required String currency, String? referenceId, ReaderError? error, DateTime? completedAt})
-
factory
- TransactionResult.declined({required String requestIdempotencyKey, required int amountMinorUnits, required String currency, required GatewayTransactionResponse gatewayResponse, String? referenceId, String? transactionId, EntryMode entryMode = EntryMode.unknown, CardSummary? card, DateTime? completedAt})
-
factory
- TransactionResult.failed({required String requestIdempotencyKey, required int amountMinorUnits, required String currency, required ReaderError error, String? referenceId, GatewayTransactionResponse? gatewayResponse, DateTime? completedAt})
-
factory
-
TransactionResult.fromJson(Map<
String, dynamic> json) -
factory
- TransactionResult.timedOut({required String requestIdempotencyKey, required int amountMinorUnits, required String currency, String? referenceId, ReaderError? error, DateTime? completedAt})
-
factory
- TransactionResult.unknown({required String requestIdempotencyKey, required int amountMinorUnits, required String currency, String? referenceId, ReaderError? error, DateTime? completedAt})
-
factory
Properties
- amountMinorUnits → int
-
Amount in minor units, echoed from the request. For partial
approvals, the actually-approved amount lives on
gatewayResponse.approvedAmountMinorUnits.final - card → CardSummary?
-
Safe-to-display card summary.
final
- completedAt → DateTime
-
UTC completion time.
final
- currency → String
-
ISO 4217 currency code, echoed from the request.
final
- entryMode → EntryMode
-
How the card was presented.
final
- error → ReaderError?
-
Set only on non-approved outcomes that originated from an SDK or
platform error (network failures, reader errors, etc.).
final
- gatewayResponse → GatewayTransactionResponse?
-
Gateway response when the gateway was reached.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- referenceId → String?
-
Echoes the POS-supplied reference id, if any.
final
- requestIdempotencyKey → String
-
Echoes the idempotency key the POS supplied on the request.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → TransactionResultStatus
-
final
- transactionId → String?
-
Gateway-assigned transaction id, when applicable.
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.
inherited