Transaction class
Represents a transaction to be tracked by the Contentsquare analytics system.
Usage
// Basic transaction with required fields
final transaction = CustomerTransaction(
price: 29.99,
currency: Currency.USD,
);
// Transaction with optional transaction ID
final transactionWithId = CustomerTransaction(
price: 430.99,
currency: Currency.EUR,
transactionId: "order_12345",
);
See Also
- Currency - Supported currency codes
- CSQ.trackTransaction - Method to send transactions to Contentsquare
Constructors
- Transaction({required double price, required Currency currency, String? id})
-
Creates a new Transaction with the specified price, currency, and optional transaction ID.
const
Properties
- currency → Currency
-
The currency code for the transaction. (e.g., Currency.USD for US dollars)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
An optional transaction identifier. (e.g., "order_12345" or "txn_abc123")
final
- price → double
-
The price or amount of the transaction. (e.g., 29.99 for a $29.99 purchase)
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited