Payment Terminals

Messaging To and From ECR On Device App

Broadcast Intents are used for messaging

Edit "Messaging To and From ECR On Device App" on GitHub

Intent Actions Used

Messages sent to and from the Swedbank Pay Payment App ar sent using broadcast intents.

Payment App Sending to Business App

When the payment app is broadcasting messages to business apps it uses the following two actions:

  • com.swedbankpay.payment.intent.ECR_NEXO_MESSAGE
  • com.swedbankpay.payment.intent.ECR_ADMIN

Messages sent to and from the Swedbank Pay Payment App are sent using broadcast intents.

For messages sent to the payment app the intent com.swedbankpay.payment.intent.TERMINAL_NEXO_MESSAGE is used, and for messages sent from the payment app to another app the intent com.swedbankpay.payment.intent.ECR_NEXO_MESSAGE is used.

The complete nexo SaleToPOIResponse or SaleToPOIRequest is placed as a byte array in the property extra of the intent.

1
2
3
4
5
6
7
private fun sendMessageIntent(data: ByteArray) {
    Intent().also { intent: Intent ->
        intent.setAction("com.swedbankpay.payment.intent.TERMINAL_NEXO_MESSAGE")
        intent.putExtra(Intent.EXTRA_TEXT, data)
        sendBroadcast(intent)
    }
}

Business App Sending to Payment App

When a business app is broadcasting messages to the payment app it uses the following:

  • com.swedbankpay.payment.intent.TERMINAL_NEXO_MESSAGE
  • com.swedbankpay.payment.intent.TERMINAL_ADMIN

The business app should use TEMINAL_ADMIN with Intent.extras set to the admin action OPEN_ADMIN_MENU to access the configuration menu of the payment app. The other available admin actions are not really used, since whenever any of these intents are received the receiver is supposed to move itself to front.

Available admin actions

1
2
3
4
5
enum class AdminAction {
    MOVE_TO_BACK,
    MOVE_TO_FRONT,
    OPEN_ADMIN_MENU
}

Note: The payment app sends ECR_ADMIN action with nothing in intent.extras. Just move the business app to front.