P2P Protocol Activation

An overview of the Peer to Peer Activation intent for Android.

Overview

👉 The Viva peer to peer integration activation request is used to activate the Viva peer to Peer protocol Integrations and the operation mode.

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.

The response will not include the Device IP address and port.

For a typical Peer to Peer Activation 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'
callback The URI callback that will handle the result. 'mycallbackscheme://result' 'Viva.com Terminal' application for Android
action Action set mode which change the operation of the app. 'toggleProtocol' 'Viva.com Terminal' application for Android
protocol Protocol that will be enable 'ecr_p2p' 'Viva.com Terminal' application for Android
enable Set the selected operation enable/disable 'true' 'Viva.com Terminal' application for Android boolean
mode Set the selected operation.
0 = Attended,
1 = Semi-Unattended
2 = Full-Unattended,
3 = ECR-Controlled
'mode=0' '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)

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=toggleProtocol"
                                + "&protocol=ecr_p2p"
                                + "&enable=true"
                                + "&mode=0"
                                + "&pin=123456"
                                + "&callback=mycallbackscheme://result"));

payIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(payIntent);

P2P Activation Response

After executing the toggleProtocol action the app will return the response to indicate if the app enable the toggle successful or not.

A Protocol Activation response for an successful transaction looks as follows:

A Protocol Activation response for all possible failed transaction messages looks as follows:

The result is received as a URI in the callback activity intent:

Uri result = getIntent().getData();

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, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!