How It Works with Auto Payment
Listen On-Device
Reads full bank notifications (EXTRA_BIG_TEXT, EXTRA_TEXT_LINES, EXTRA_TEXT), extracts the web order code (e.g. AP849201) and credit amount, and ignores outgoing debits or personal chats.
Persist to SQLite First
Every matched payment is saved immediately into local SQLite (PaymentDatabaseHelper, deduplicated by SHA-256 fingerprint) before making any network request.
Push & Auto-Recover
Posts JSON to /api/webhooks/bank-notify. If your server is restarting or offline, SyncPendingWorker automatically retries every 15 minutes (or tap Sync Now anytime).
App Screens & Capabilities (v1.1.0)
Dashboard Screen (Danh sách đơn)
- Live Notification Listener health banner showing whether Android listener permission is active.
- Total matched VND KPI summary across received bank credits.
- One-tap Sync Now action, live search bar, and status filter chips (
All,Synced,Pending,Failed). - Per-order cards with one-tap Retry and tap-to-inspect modal showing the raw bank message and server HTTP response.
Settings Screen (Cấu hình)
- Webhook URL: Point to your deployed server endpoint, e.g.
https://your-domain.com/api/webhooks/bank-notify. - Webhook Secret (
X-Webhook-Secret): Must matchNUXT_WEBHOOK_SECRETon yourauto-paymentserver. - Order Code Prefix: Defaults to
AP(matchingNUXT_ORDER_PREFIX). - Known Bank Apps Only: Optional filter restricting listening strictly to recognized Vietnamese bank & e-wallet packages.
- Test Webhook & Device Shortcuts: Built-in webhook ping tester plus quick links to Android Notification Access, Battery Optimization Exemption, and local database cleanup.
First-Time Phone Setup
- Open the Releases page and scan the embedded QR code with your phone camera to download and sideload the latest APK (or grab a build artifact from GitHub Actions).
- Launch the app, go to Settings (
Cấu hình), and grant Notification Access when prompted. - Disable Battery Optimization for Auto Payment Android so Android does not kill the background listener or
SyncPendingWorker. - Enter your Webhook URL, Webhook Secret, and Order Code Prefix, then tap Test Webhook to verify connectivity with your Auto Payment server.
Filtering happens strictly on-device. Notifications that do not contain a credit amount and your configured order code prefix (e.g. APxxxxxx) are discarded immediately and never leave your phone.
Webhook Payload Format
Every matched incoming credit notification is sent as application/json; charset=utf-8 with an optional X-Webhook-Secret header:
{
"groupKey": "0|com.VCB|...",
"postTime": "Nov 27, 2026 5:30:00 PM",
"strPostTime": "2026-11-27 17:30:00",
"title": "Vietcombank",
"msg": "SD TK 0123456789 +150,000VND luc 27/11/2026. ND: AP849201",
"pck": "com.VCB",
"orderCode": "AP849201",
"amount": 150000
}
Building From Source
Requires JDK 17 and Android SDK 34:
git clone https://github.com/sinhsac/auto-payment-android.git
cd auto-payment-android
# Run unit tests and assemble the debug APK
./gradlew testDebugUnitTest assembleDebug
# Generated APK path:
# app/build/outputs/apk/debug/app-debug.apk
Install via ADB
adb install -r app/build/outputs/apk/debug/app-debug.apk