Set Mode request

An overview of the Set Mode request message for Android.

Overview

👉 The Set Mode request is used to set the operation mode of the ‘viva.com | Terminal’ 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

Using this action, the user can set the operation of the app into one of four modes:

For a typical Set Mode request, the client app must provide the following information:

Field Description Example Required Card terminal support Character limit Type
appId The client app ID. For successful validation, should not be empty. 'com.example.myapp' ✅ 'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android
callback The URI callback that will handle the result. 'mycallbackscheme://result' ✅ 'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android
action Action set mode which change the operation of the app. 'setMode' ✅ 'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android
mode Set the selected operation.
0 = Attended,
1 = Semi-Unattended
2 = Full-Unattended,
3 = ECR-Controlled
'mode=0' ✅ 'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android
pin Pin (4-6 digits length) parameter is used to lock the severe actions in app Settings - Refund - Capture Card - History transaction.

⚠️The pin is mandatory.
'pin=252856' ✅ 'viva.com | Terminal' application for Android Min. length = 4
Max. length = 6
integer (int32)
cashless Support of cash devices.
The default value is true.
'cashless=true' 'viva.com | Terminal' application for Android
Supported only on IM30 devices.
boolean

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.

Field Description Example Card terminal support
callback The URI callback that will handle the result. 'mycallbackscheme://result' 'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android
status The status of the set mode. 'status=success' 'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android
message A string containing information about the set mode status. The message indicate successful set it or not or the pin is not saved. 'message=Set mode successfully 1'
or
'message=Pin not saved successfully'
'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android
action Action set mode which change the operation of the app. 'action=setMode' 'viva.com | Terminal' application for Android'viva.com | Terminal' application for Android

A Set Mode response result for the success is :

It is expected that POS activation will fail for various reasons. A POS activation response looks as follows:

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. Android Card Terminals
'viva.com | Terminal' application for Android Mini Card Reader, Pocket Card Terminal connected via Bluetooth or USB to the 'viva.com | Terminal' application for Android. Android Card Terminals
Linux Card Terminals Countertop, IM20, S900, S800, D200. Linux Card Terminals

Get Support

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!