POS Activation request
An overview of the POS Activation request message for iOS.
Overview
👉 The POS Activation request is used to complete the activation process of the Viva POS App, including sign-in and initial configuration.
The client app must implement a mechanism to send messages using URL schemes and to receive the result in a custom URI callback.
- POS Activation request originating from the client app to trigger the Viva.com Terminal App activation.
- POS Activation response originating from the ‘Viva.com Terminal’ application to return the result of the Viva.com Terminal App activation request.
POS Activation request
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 ('Client ID') required for the POS activation. For successful validation, this should not be empty. You can find this credential here. | “xxxxx.apps.vivapayments.com“ |
| apiSecret | The API Secret ('Client secret') required for the POS activation. For successful validation, this should not be empty. You can find this credential here. | “qtFskX94T2f2Dkhc364pa1cgaFn3D“ |
| sourceID | The source that the POS will be assigned to. Not required for successful validation | [A payment source (physical store) that is associated with a terminal] How to create a payment source for stores |
| 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 ( default value = false) for activating Moto payment method | true |
| activateQRCodes | Optional boolean parameter ( default value = false) for activating QR payment method | true |
| disableManualAmountEntry | Optional boolean parameter ( default value = false) for disabling manual amount entry | true |
| forceCardPresentmentForRefund | Optional boolean parameter ( default value = false) for forcing card presentment for refund | true |
| lockRefund | Optional boolean parameter ( default value = false) for locking refund with pin | true |
| lockTransactionsList | Optional boolean parameter ( default value = false) for locking transaction list with pin | true |
| lockMoto | Optional boolean parameter ( default value = false) for locking moto with pin | true |
| lockPreauth | ptional boolean parameter ( default value = false) for locking preauth with pin | true |
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=xxxxx.apps.vivapayments.com"
+ "&apiSecret=qtFskX94T2f2Dkhc364pa1cgaFn3D"
+ "&sourceID=1234"
+ "&pinCode=9876"
+ "&activateMoto=true"
+ "&activateQRCodes=true"
+ "&disableManualAmountEntry=true"
+ "&forceCardPresentmentForRefund=true"
+ "&lockRefund=true"
+ "&lockTransactionsList=true"
+ "&lockMoto=true"
+ "&lockPreauth=true"
+ "&callback=mycallbackscheme://result"
(UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(
request: url)
}POS Activation response
After executing a POS activation, the ‘Viva.com Terminal’ application 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. Please see a list of possible error codes. |
'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 request looks as follows:
It is expected that POS activation will fail for various reasons. A POS activation response looks as follows:
Error codes
The following error codes may be displayed in the response to this request.
| Code | Message |
|---|---|
| 6000 | wrongParameters |
| 6099 | generic |
| 800615 | tokenActivationPosFailed |
| 800625 | posActivationFailed |
| 800715 | verifyUserCodeFailed |
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!