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 code
  • amount → Transaction amount (string)
  • ecrRefNo → ECR Reference Number

Response Fields

  • responseCode → Approved / Failed
  • approvalCode → Authorization code
  • rrn → Retrieval Reference Number

Transaction Type Codes

CodeTransaction Type
0Purchase
1Purchase with Naqd/Cashback
2Refund
3Authorization
4Purchase Advice (Full)
5Purchase Advice (Partial)
6Auth Extension
7Auth Void
9Cash Advance
10Reconciliation
11Reversal
15Bill Payment
17Register
18Start Session
19End Session
23Duplicate / Previous Txn
24Check Status
25Health Check