Get Activation Code request
An overview of the Get Activation Code request message for iOS.
Our ‘viva.com | Terminal’ application (tap-on-phone) supports Apple Tap to Pay in the UK, the Netherlands, France & Italy.
Overview
👉 The Get Activation Code request is used to obtain an activation code without needing to interact with the Viva.com | Terminal App manually. An activation code is required for manual card terminal activation through the Viva account.
The client app must implement a mechanism to send messages using URL schemes and to receive the result in a custom URI callback.
- Get Activation Code request originating from the client app to get the activation code for Viva.com | Terminal App activation.
- Get Activation Code response originating from the ‘viva.com | Terminal’ application to return the result of get activation code request.
Get Activation Code request
For a typical Get Activation Code request, the client app must provide the following information:
Field | Description | Example |
---|---|---|
scheme | The Viva's custom URL scheme, the host and the version. | 'vivapayclient://pay/v1' |
appId | The client app ID. For successful validation, should not be empty. | 'com.example.myapp' |
action | Get activation code action. For successful validation, should not be empty. | 'getActivationCode' |
callback | The URI callback that will handle the result. For successful validation, should not be empty. | 'mycallbackscheme://result' |
The above information elements must create a URI call, i.e.
// USE LIKE THIS
func activatePos() {
let url = "vivapayclient://pay/v1"
+ "?appId=com.example.myapp"
+ "&action=ActivationCode"
+ "&callback=mycallbackscheme://result"
(UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(
request: url)
}
Get Activation Code response
If the request is successful, the response will have the status request along with the activation code.
Field | Description | Example |
---|---|---|
callback | The URI callback that will handle the result. | 'mycallbackscheme://result' |
status | The status of the transaction. | 'success' |
message | A string containing information about the transaction status. | 'Fetched activation code' |
action | Get Activation Code action. | 'getActivationCode' |
virtualId | App FirebaseId | '60DEC5165EBC41DEAAE693FD51B1F3FC' |
activationCode | Activation Code to use for Viva.com | Terminal App Activation | '913398365' |
merchantID | Activated Merchant Id - optional | ‘c21ac4b3-b1e1-4e7c-a65e-aedee7412321’ |
A Get Activation Code response for an approved transaction looks as follows:
mycallbackscheme://result?status=success&message=Fetched%2520activation%2520code&action=getActivationCode&virtualId=88932C88A4C04051B42594AF99B5FA4D&activationCode=734888368
It is expected that Get Activation Code will fail for various reasons. A Get Activation Code failure response looks as follows:
mycallbackscheme://result?status=fail&message=User Already logged in &action=getActivationCode
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!