ParsedTransaction class

The structured result of parsing a single UPI transaction SMS.

Construct these via UpiParser.parse — you should not normally need to build one by hand outside of tests.

Constructors

ParsedTransaction({required double? amount, required UpiTransactionType type, required DateTime timestamp, required String rawSms, String? merchant, String? upiRef, String? bankAccount, double? availableBalance})
const

Properties

amount double?
The extracted transaction amount in rupees (e.g. 356.0 for "Rs.356").
final
availableBalance double?
The available balance left in the account after this transaction.
final
bankAccount String?
The masked bank account number, e.g. "X6299", "XX6299", "X4521".
final
hashCode int
The hash code for this object.
no setterinherited
isCredit bool
Convenience getter — true if money arrived in the account in this transaction (i.e. type is UpiTransactionType.credit).
no setter
isDebit bool
Convenience getter — true if money left the account in this transaction (i.e. type is UpiTransactionType.debit).
no setter
merchant String?
The merchant or recipient name extracted from the SMS.
final
rawSms String
The raw, unmodified SMS string that was parsed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
The date and time of the transaction, extracted from the SMS body.
final
type UpiTransactionType
Whether money left (UpiTransactionType.debit) or arrived (UpiTransactionType.credit) — or couldn't be determined (UpiTransactionType.unknown). Determined by keywords like "debited", "credited", "paid", "received".
final
upiRef String?
The UPI reference / transaction ID from the SMS.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Human-readable string representation, primarily useful when printing a ParsedTransaction to the console while debugging — e.g. checking what a new bank's SMS format parsed into.
override

Operators

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