November 10, 20245 min readAppStar Team
Offline QR Payment: Mobile Fuel Stations in Brazil
Mobile app for fuel payment without internet with sync on connection.
mobileQRpaymentsofflineBrazilcase-study
About the Project
For a network of mobile fuel stations in rural Brazil, we developed a QR payment system that works without a permanent internet connection.
Problem
Mobile fuel stations serve remote areas where:
- No stable internet — 2G connection or none at all
- Cash is inconvenient — security, accounting, collection
- Terminals don't work — require online connection
- Customers prefer QR — don't want to carry cash
Client Requirements
- Accept payment without internet
- Sync when connection appears
- Work on basic Android devices
- Accounting integration
Our Solution
Offline-First Architecture
Workflow: Customer → QR code → Terminal (offline) → Local DB → Synchronization → Central server
How It Works
- QR generation — customer shows code from app
- Scanning — terminal reads and verifies signature
- Local transaction — record in encrypted DB
- Fuel dispensing — confirmation on screen
- Synchronization — when internet appears
Offline Payment Security
- Cryptographic signature — QR contains signed data
- Transaction limits — offline operation amount limits
- QR expiration — automatic invalidation
- Blacklists — synchronization on connection
Mobile Applications
For Customers (iOS + Android)
- Payment QR code generation
- Transaction history
- Balance and top-up
- Nearby station search
For Station Operators (Android)
- QR code scanner
- Transaction log
- Data synchronization
- Shift reports
Results
| Metric | Before | After |
|---|---|---|
| Payment method | 100% cash | 70% QR |
| Transaction time | 2-3 min | 15 sec |
| Accounting errors | 8% | <1% |
| Cash collection | daily | weekly |
Business Impact
- Collection reduction: $24,000/year
- Theft reduction: $18,000/year
- Time savings: +20% customers per day
- Customer loyalty: +35% repeat visits
Technical Features
Synchronization
- Priority transaction queue
- Conflict resolution
- Retry logic with exponential backoff
- Data compression for 2G
Security
- AES-256 local DB encryption
- RSA QR code signing
- Certificate pinning
- Replay attack protection
Reliability
- Works offline up to 7 days
- Automatic recovery
- Audit logging
- Backup systems
Technologies
- Customer app: React Native
- Station terminal: Android (Kotlin)
- Backend: Laravel (PHP)
- Database: PostgreSQL + SQLite (local)
- Synchronization: Custom protocol
Need an offline solution? Let's discuss your project