POS Activation
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.
- POS Activation request originating from the client app to trigger the POS activation.
- POS Activation response originating from the card terminal app to return the result of the POS activation request.
POS Activation request
With the POS Activation action the user can activate the POS. For a typical POS activation 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 | Activate POS action. For successful validation, should not be empty. | 'activatePos' |
callback | The URI callback that will handle the result. For successful validation, should not be empty. | 'mycallbackscheme://result' |
apikey | The API key required for the POS activation. For successful validation, should not be empty. | “qwerty123456“ |
apiSecret | The API secret required for the POS activation. For successful validation, should not be empty. | “qwerty123456“ |
sourceID | The source that POS will be assigned to. Not required for succesfull validation. If not provided “Default” source will be used | “qwerty123456“ |
pinCode | Optional parameter for PIN code for settings lock (if provided, settings are automatically locked and PIN set to the supplied value). | 123142 |
activateMoto | Optional boolean parameter for activating Moto payment method. | The default value = false Example = false |
activateQRCodes | Optional boolean parameter for activating QR payment method. | The default value = false Example = false |
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=activatePos"
+ "&apikey=qwerty123456"
+ "&apiSecret=qwerty123456"
+ "&sourceID=qwerty123456"
+ "&pinCode=1234"
+ "&activateMoto=true"
+ "&activateQRCodes=true"
+ "&callback=mycallbackscheme://result"
(UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(
request: url)
}
POS Activation response
After executing a POS activation, the Card Terminal App responds with a POS activation response result to indicate if the POS activation was successfull or not.
The result is received as a URI in the application(_:open:options:) method on the AppDelegate file:
The table below summarizes the contents of an approved response.
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. | 'Transaction successful' |
action | Activate POS action. | 'activatePos' |
virtualId | App FirebaseId | '60DEC5165EBC41DEAAE693FD51B1F3FC' |
sourceTerminalId | Connected Terminal Id - optional | '16027706' |
merchantID | Activated Merchant Id - optional | ‘c21ac4b3-b1e1-4e7c-a65e-aedee7412321’ |
A POS activation response result for an approved transaction looks as follows:
mycallbackscheme://result?status=success&message=Pos%2520Activated&action=activatePos&sourceTerminalId=16027706&merchantId=c21ac4b3-b1e1-4e7c-a65e-aedee7412321&virtualId=60DEC5165EBC41DEAAE693FD51B1F3FC
It is expected that POS activation will fail for various reasons. A POS activation response looks as follows:
mycallbackscheme://result?status=fail&message=User Already logged in USER_CANCEL&action=activatePos
Get Support
If you have any questions about our solutions, or questions about how to integrate with our solutions, please refer to our Get Support page.