Get Activation Code request

An overview of the Get Activation Code message.

Overview

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.

Get Activation Code request

With the Get Activation Code action the user can request an activation code. For a typical Get Activation Code request the client app must provide the following information:

Field Description Example Required Card terminal support
scheme The Viva's custom URL scheme, the host and the version. 'vivapayclient://pay/v1' Viva Wallet POS app for Android
appId The client app ID. For successful validation, should not be empty. 'com.example.myapp' Viva Wallet POS app for Android
action Get Activation Code action. For successful validation, should not be empty. 'getActivationCode' Viva Wallet POS app for Android
callback The URI callback that will handle the result. For successful validation, should not be empty. 'mycallbackscheme://result' Viva Wallet POS app for Android

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=getActivationCode"
                                + "&callback=mycallbackscheme://result"));

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

Get Activation Code response

After executing a Get Activation Code request, the Card Terminal App responds with a response result to indicate if the request was successful or not, along with the activation code (if the request was successful).

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 Wallet POS app for Android
status The status of the transaction. 'success' Viva Wallet POS app for Android
message A string containing information about the transaction status. 'Transaction successful' Viva Wallet POS app for Android
action Get Activation Code action. 'getActivationCode' Viva Wallet POS app for Android
virtualId App FirebaseId '60DEC5165EBC41DEAAE693FD51B1F3FC' Viva Wallet POS app for Android
activationCode Activation Code to use for POS Activation. ‘913398365’ Viva Wallet POS app for Android
merchantID Optional parameter - Activated Merchant Id. `c21ac4b3-b1e1-4e7c-a65e-aedee7412321` Viva Wallet POS app for Android

A Get Activation Code response result for an approved transaction looks as follows:

It is expected that a Get Activation Code request will fail for various reasons. A failed Get Activation Code 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 Wallet POS app for Android Mini Card Reader, Pocket Card Terminal connected via Bluetooth or USB to the Viva Wallet POS app 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 Get Support page to see how we can help!