App to App
Purpose
The Android App‑to‑App integration uses Intent‑based communication between your ECR application and the Nami Pay app installed on the same device. This allows transactions to be initiated and results returned without direct socket programming.
Prerequisites
- Android 8.0 (API level 26) or higher
- Nami Pay app installed on the same device
- Valid ECR Reference Number (CRN)
- Proper Android permissions configured (
INTERNET,BROADCAST, etc.) - Your app registered to send and receive broadcast intents
How It Works
npm install react-native-ecr-sdk
Integration Example
// Send transaction via broadcast
val intent = Intent("com.nami.payment.TRANSACTION")
intent.putExtra("txnType", 0) // Purchase
intent.putExtra("amount", "100")
intent.putExtra("ecrRefNo", "REF001")
sendBroadcast(intent)
// Register receiver for response
val receiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val responseCode = intent.getStringExtra("responseCode")
val approvalCode = intent.getStringExtra("approvalCode")
val rrn = intent.getStringExtra("rrn")
}
}
registerReceiver(receiver, IntentFilter("com.nami.payment.RESPONSE"))
Transaction Flow
Broadcast TRANSACTION Intent
→ Nami Pay App processes card payment
→ Result RESPONSE Intent
→ Your App receives transaction result
Request and Response Details
Request Fields
txnType→ Transaction type codeamount→ Transaction amount (string)ecrRefNo→ ECR Reference Number
Response Fields
responseCode→ Approved / FailedapprovalCode→ Authorization coderrn→ Retrieval Reference Number
Transaction Type Codes
| Code | Transaction Type |
|---|---|
| 0 | Purchase |
| 1 | Purchase with Naqd/Cashback |
| 2 | Refund |
| 3 | Authorization |
| 4 | Purchase Advice (Full) |
| 5 | Purchase Advice (Partial) |
| 6 | Auth Extension |
| 7 | Auth Void |
| 9 | Cash Advance |
| 10 | Reconciliation |
| 11 | Reversal |
| 15 | Bill Payment |
| 17 | Register |
| 18 | Start Session |
| 19 | End Session |
| 23 | Duplicate / Previous Txn |
| 24 | Check Status |
| 25 | Health Check |
Updated 10 days ago
