transaction_sms_parser 0.0.1 copy "transaction_sms_parser: ^0.0.1" to clipboard
transaction_sms_parser: ^0.0.1 copied to clipboard

A powerful Dart/Flutter package for parsing transaction SMS messages from banks, payment apps, and digital wallets. Extract amounts, account info, card details, wallet providers, merchant names, and balances.

๐Ÿ’ณ Transaction SMS Parser #

Pub Version License: MIT Dart Flutter

A powerful and intelligent Dart/Flutter package for parsing transaction SMS messages from banks, payment apps, and digital wallets. Extract comprehensive transaction details including amounts, account types, card information, wallet providers, merchant details, and balance information with high accuracy.

โœจ Features #

  • ๐Ÿฆ Multi-Source Support: Parse SMS from 30+ Indian banks and financial institutions
  • ๐Ÿ’ณ Card Detection: Identify credit/debit cards with scheme detection (Visa, Mastercard, RuPay, Amex, Maestro, Diners)
  • ๐Ÿ“ฑ Digital Wallets: Support for 14 popular wallets (PayTM, PhonePe, Amazon Pay, MobiKwik, etc.)
  • ๐Ÿ”„ UPI Transactions: Extract UPI IDs, merchant info, and reference numbers (95+ UPI handles supported)
  • ๐Ÿ’ฐ Smart Parsing: Intelligent extraction of amounts, transaction types (debit/credit), and balances
  • ๐Ÿช Merchant Detection: Identify merchant names and payment details
  • ๐Ÿ“Š Balance Information: Available balance and outstanding balance (for credit cards)
  • ๐ŸŽฏ Type-Safe: Full TypeScript-like type safety with Dart enums and models
  • ๐Ÿงช Well-Tested: Comprehensive test coverage
  • ๐Ÿš€ High Performance: Optimized pattern matching and processing

๐ŸŽฏ Supported Features #

Account Types #

  • Bank Accounts (AC, Account, A/C)
  • Credit Cards (Visa, Mastercard, RuPay, Amex, Diners)
  • Debit Cards (Visa, Mastercard, Maestro, RuPay, SBI Maestro)
  • Digital Wallets (14 providers)
  • UPI Transactions (95+ UPI handles)

Card Schemes #

Scheme Supported
Visa โœ…
Mastercard โœ…
Maestro โœ…
RuPay โœ…
American Express โœ…
Diners Club โœ…
SBI Maestro โœ…

Supported Wallets #

Wallet Code
PayTM paytm
PhonePe phonePe
Amazon Pay amazonPay
MobiKwik mobikwik
Freecharge freecharge
Airtel Money airtelMoney
Ola Money olaMoney
Jio Money jioMoney
HDFC PayZapp payZapp
Yes Bank Wallet yesBank
ItzCash itzCash
Oxigen oxigen
Simpl simpl
LazyPay lazyPay

Supported Banks (30+) #

SBI, HDFC, ICICI, Axis, Kotak, PNB, Bank of Baroda, Bank of India, IDBI, IDFC First, Yes Bank, RBL, IndusInd, Federal Bank, Citi, HSBC, Standard Chartered, DBS, Union Bank, Canara Bank, and more...

๐Ÿ“ฆ Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  transaction_sms_parser: ^0.0.1

Then run:

dart pub get
# or for Flutter projects
flutter pub get

๐Ÿš€ Quick Start #

import 'package:transaction_sms_parser/transaction_sms_parser.dart';

void main() {
  const smsMessage = 'Rs.500.00 debited from card 1234 on 01-Jan-23. Avbl bal Rs.10000.00';
  
  final transactionInfo = TransactionEngine.getTransactionInfo(smsMessage);
  
  print('Account Type: ${transactionInfo.account.type}');
  print('Card Number: ${transactionInfo.account.number}');
  print('Transaction Type: ${transactionInfo.transaction.type}');
  print('Amount: ${transactionInfo.transaction.amount}');
  print('Balance: ${transactionInfo.balance?.available}');
}

๐Ÿ“– Usage Examples #

1. Bank Account Transaction #

const message = 'Rs.1000.00 credited to AC 5678 on 01-Jan-23. Available balance Rs.20000.00';
final result = TransactionEngine.getTransactionInfo(message);

// Output:
// account.type: AccountType.account
// account.number: "5678"
// account.bankName: "HDFC Bank" (if detected)
// transaction.type: TransactionType.credit
// transaction.amount: "1000.00"
// balance.available: "20000.00"

2. Credit Card Transaction with Full Details #

const message = 'Rs.2000 spent on HDFC Visa Credit Card 4321. Avbl credit limit Rs.50000. Outstanding Rs.10000';
final result = TransactionEngine.getTransactionInfo(message);

// Output:
// account.type: AccountType.card
// account.cardType: CardType.credit
// account.cardScheme: CardScheme.visa
// account.bankName: "HDFC Bank"
// account.number: "4321"
// transaction.type: TransactionType.debit
// transaction.amount: "2000.00"
// balance.available: "50000.00"
// balance.outstanding: "10000.00"

3. Digital Wallet Transaction #

const message = 'Rs.250 debited from Paytm wallet. Available bal Rs.750';
final result = TransactionEngine.getTransactionInfo(message);

// Output:
// account.type: AccountType.wallet
// account.walletType: WalletType.paytm
// account.name: "paytm"
// transaction.type: TransactionType.debit
// transaction.amount: "250.00"
// balance.available: "750.00"

4. UPI Transaction #

const message = 'Rs.500 sent to merchant@ybl via UPI. UPI Ref No 123456789. Avbl bal Rs.5000';
final result = TransactionEngine.getTransactionInfo(message);

// Output:
// account.type: AccountType.upi
// account.name: "merchant@ybl"
// transaction.type: TransactionType.debit
// transaction.amount: "500.00"
// transaction.merchant: "merchant"
// transaction.referenceNo: "123456789"
// balance.available: "5000.00"

5. PhonePe Transaction #

const message = 'Rs 150.00 debited from account ending 1234 to 9876543210@ybl on 04-11-25. UPI Ref: 432198765';
final result = TransactionEngine.getTransactionInfo(message);

// Output:
// account.type: AccountType.upi
// account.name: "9876543210@ybl"
// transaction.amount: "150.00"
// transaction.referenceNo: "432198765"

๐Ÿ”ง API Reference #

Main Class: TransactionEngine #

getTransactionInfo(String message)

Parses a complete transaction SMS and returns a TransactionInfo object.

static TransactionInfo getTransactionInfo(String message)

Models #

TransactionInfo

class TransactionInfo {
  final AccountInfo account;
  final Balance? balance;
  final Transaction transaction;
}

AccountInfo

class AccountInfo {
  final AccountType? type;           // card, wallet, account, upi
  final String? number;              // Last 4 digits
  final String? name;                // Wallet/account name
  final WalletType? walletType;      // Specific wallet provider
  final CardType? cardType;          // credit or debit
  final CardScheme? cardScheme;      // visa, mastercard, etc.
  final String? bankName;            // Bank name
}

Transaction

class Transaction {
  final TransactionType? type;       // debit or credit
  final String? amount;              // Transaction amount
  final String? merchant;            // Merchant name or UPI ID
  final String? referenceNo;         // Transaction reference
}

Balance

class Balance {
  final String? available;           // Available balance
  final String? outstanding;         // Outstanding amount (cards)
}

Individual Parsers #

You can also use individual parsers for specific information:

// Transaction amount only
final amount = TransactionParser.getTransactionAmount('Rs.500 debited');
print(amount); // "500.00"

// Transaction type only
final type = TransactionParser.getTransactionType('Amount credited');
print(type); // TransactionType.credit

// Account info only
final account = AccountParser.getAccountInfo('Payment from AC 1234');
print(account.type); // AccountType.account
print(account.number); // "1234"

// Balance only
final balance = BalanceParser.getBalance('Available balance Rs.10000', BalanceKeywordType.available);
print(balance); // "10000.00"

// Merchant info only
final merchant = MerchantParser.extractMerchantInfo('Paid to merchant@upi');
print(merchant.merchant); // "merchant"

๐Ÿงช Testing #

The package includes comprehensive tests. Run them with:

dart test
# or for Flutter projects
flutter test

๐Ÿค Contributing #

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup #

  1. Clone the repository
  2. Run dart pub get or flutter pub get
  3. Make your changes
  4. Add tests for new features
  5. Run tests with dart test or flutter test
  6. Submit a pull request

๐Ÿ“„ License #

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments #

  • Inspired by the need to parse financial SMS messages in Indian banking ecosystem
  • Built with โค๏ธ using Dart and Flutter
  • Special thanks to all contributors

๐Ÿ“ž Support #

If you like this package, please give it a โญ on GitHub!

For issues and feature requests, please file them in the issue tracker.

๐Ÿ”„ Changelog #

See CHANGELOG.md for a list of changes in each version.

๐Ÿ“š Additional Resources #


Made with โค๏ธ for the Flutter community

1
likes
150
points
12
downloads

Publisher

verified publishermabud.dev

Weekly Downloads

A powerful Dart/Flutter package for parsing transaction SMS messages from banks, payment apps, and digital wallets. Extract amounts, account info, card details, wallet providers, merchant names, and balances.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on transaction_sms_parser