Set Mode request
An overview of the Set Mode request message for Android.
👉 The Set Mode request is used to set the operation mode of the POS application (Attended, Semi-Unattended, Full-Unattended or ECR-Controlled).
The client app must implement a mechanism to send messages using Android intents and URI calls and to receive the result in a custom URI callback.
- Set Mode request originating from the client app to set the card terminal mode.
- Set Mode response originating from the card terminal the result of setting the card terminal mode.
Set Mode request
Using this action, the user can set the operation of the app into one of four modes:
- 0️⃣ | Attended mode: This is the default operation of the app
- 1️⃣ | Semi-Unattended mode: All the app dialogs and screens are auto dismissable with timeouts. The app returns the results and the focus to the caller 3rd app
- 2️⃣ | Full-Unattended mode: All the app dialogs and screens are auto dismissable with timeouts. The app returns the results to the caller 3rd app which is mandatory not to have UI and be a service
- 3️⃣ | ECR-Controlled: Allows third-party apps to apply POS app controls
For a typical Set Mode request, the client app must provide the following information:
The above information elements must create a URI call, i.e.
Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse( "vivapayclient://pay/v1" + "?appId=com.example.myapp" + "&action=setMode" + "&mode=1" + "&pin=123456" + "&callback=mycallbackscheme://result")); payIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); startActivity(payIntent);
Set Mode response
After executing the Set Mode action the app will return the response to indicate if the app operate in unattended mode successful or not.
The result is received as a URI in the callback activity intent:
Uri result = getIntent().getData();
The table below summarizes the contents of an approved response.
A Set Mode response result for the success is :
mycallbackscheme://result?status=success&message=Set mode successfully 1&action=setMode
It is expected that POS activation will fail for various reasons. A POS activation response looks as follows:
mycallbackscheme://result?status=fail&message=Wrong request parameters&action=setMode
Key to card terminal product categories
To understand the icons used on the above tables, see the below table.
|Product category||Terminal models||Icon|
|Android Card Terminals||Android Card Terminal Ethernet, Android Card Terminal 4G, Mobile Card Terminal Plus, Mobile Card Terminal.|
|Viva Wallet POS app for Android||Mini Card Reader, Pocket Card Terminal connected via Bluetooth or USB to the Viva Wallet POS app for Android.|
|Linux Card Terminals||Countertop, IM20, S900, S800, D200.|
If you would like to integrate with Viva Wallet, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!