WMI - Management Interface
Interface structure and activity launch
The WMI provides a set of intents that developers can use to build apps that work with the interface.
For management purpose com.worldline.management.action.PROCESS_OPERATION intent should be used.
| Type | Category | Intent | Purpose |
|---|---|---|---|
| Management | Display Action - these actions start the payment solution that are processing financial transactions or require user interaction. Notice: Android intents are used | com.worldline.payment.action.PROCESS_OPERATION | Process a management request |
Here is intent creation code:
public Intent formatWmiRequest(String sessionId, WpiPurchaseRequest req) \{
String json = GSON.toJson(req);
Intent intent = new Intent("com.worldline.management.action.WMI_SVC_CHECK_STATUS");
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
intent.putExtra("WMI_SERVICE_TYPE", "WPI_SVC_PAYMENT");
intent.putExtra("WMI_REQUEST", json);
intent.putExtra("SHOW_OVERLAY ", false)
return intent;
}
Intent contains a set of extras and needs to have FLAG_ACTIVITY_REORDER_TO_FRONT set.
| Extra | Description | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | Specify the subtype of action to be executed, see WMI Service Types | String | Mandatory |
| WMI_REQUEST | The request contains JSON structured data that is mandatory for the given service type | String | Mandatory |
| SHOW_OVERLAY | The flag controls whether a transparent overlay (false) or a spinner (true) should be displayed at the start of the intent | Boolean | Optional |
To launch intent registerForActivityResult method should be used. In the response, the intent returns the following data.
| Extra | Description | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | Specify the subtype of action to be executed | String | Mandatory |
| WMI_RESPONSE | The response contains JSON structured data processed for the requested service type | String | Mandatory |
And here is response parsing sample code:
public WmiPurchaseResponse parsePurchaseResponse(ActivityResult result) {
Intent intent = result.getData();
String json = intent.getStringExtra("WMI_RESPONSE");
WmiPurchaseResponse resp = GSON.fromJson(json, WmiPurchaseResponse.class);
return resp;
}
| Please remember |
|---|
| The important thing to note is that ToM can only handle one intent invocation at a time (of any intent type — it doesn’t matter whether it’s a financial or informational function). Therefore, it is crucial to make the next request only after receiving the response from the previous one. |
Checking application status
This function is intended to be used outside of payment acceptance context to determine the current Tap on Mobile application status and assess whether it is properly authenticated and ready to perform payment acceptance functions.
Request
| Extra | Description | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | WMI_SVC_CHECK_STATUS | String | Mandatory |
WMI_SVC_CHECK_STATUS - list of supported request parameters None – might be created for future use.
Response
| Extra | Description | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | WMI_SVC_CHECK_STATUS | String | Mandatory |
| WMI_RESPONSE | JSON structured response parameters as described in subsequent table | String | Mandatory |
WMI_SVC_CHECK_STATUS - list of supported response parameters
| Field name | Description | Type | Condition |
|---|---|---|---|
| result | Result of the transaction, see WMI Result | String | Mandatory |
| errorCondition | Specific error reason For more information check WMI Error codes) | String | Mandatory |
| remark | Terminal / transaction specific message for detailed error descriptions. Text provided by payment app. | String | Conditional – only for NOT successful transaction |
| appStatus | Tap on Mobile application status indicating whether application is already registered. For more information check WMI Application Statuses |
Terminal registration
This function is intended to be used outside of payment acceptance context to determine the current Tap on Mobile application status and assess whether it is properly authenticated and ready to perform payment acceptance functions.
Request
| Extra | Desription | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | WMI_SVC_REGISTER | String | Mandatory |
WMI_SVC_REGISTER - list of supported request parameters
| Field name | Description | Type | Condition |
|---|---|---|---|
| registrationToken | TID specific registration token retrieved from Tap on Mobile backend (Merchant API); in case this parameter is not present, Tap on Mobile app will collect all required permissions and launch QR-code reader to scan the registration token; | String | Optional |
Response
| Extra | Description | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | WMI_SVC_REGISTER | String | Mandatory |
| WMI_RESPONSE | JSON structured response parameters as described in subsequent table | String | Mandatory |
WMI_RESPONSE - list of supported response parameters
| Field name | Description | Type | Condition |
|---|---|---|---|
| result | Result of the transaction, see WMI Result | String | Mandatory |
| errorCondition | Specific error reason For more information check WMI Error codes | String | Mandatory |
| remark | Terminal / transaction specific message for detailed error descriptions. Text provided by payment app. | String | Conditional – only for NOT successful transaction |
Terminal unregistration
This function is intended to be used only with already registered terminal. It allows to unregister the currently assigned TID from the mobile application instance.
Request
| Extra | Desription | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | WMI_SVC_AUTH_UNREGISTER | String | Mandatory |
WMI_SVC_AUTH_UNREGISTER - list of supported request parameters None – might be created for future use.
Response
| Extra | Desription | Type | Condition |
|---|---|---|---|
| WMI_SERVICE_TYPE | WMI_SVC_AUTH_UNREGISTER | String | Mandatory |
| WMI_RESPONSE | JSON structured response parameters as described in subsequent table | String | Mandatory |
WMI_SVC_AUTH_UNREGISTER - list of supported response parameters**
| Field name | Description | Type | Condition |
|---|---|---|---|
| result | Result of the transaction, see WMI Result | String | Mandatory |
| errorCondition | Specific error reason For more information check WMI Error codes and proper error handling | String | Mandatory |
| remark | Terminal / transaction specific message for detailed error descriptions. Text provided by payment app. | String | Conditional – only for NOT successful transaction |
Warning: Be cautious when using the unregister function, see more with Unregister
WMI Error codes
| Error condition | Description |
|---|---|
| WMI_ERR_COND_NONE | Will always be present if no error occurred, confirms successful result |
| WMI_ERR_COND_AUTH_NOT_POSSIBLE | Valid terminal registration was not found. |
| WMI_ERR_COND_GENERIC | A mobile application generic error that is not explicitly outlined here |
| WMI_ERR_COND_INTERNAL | Backend-driven generic error that is not explicitly outlined here |
| WMI_ERR_COND_INVALID_JSON | Wrong structure of WMI_REQUEST json |
| WMI_ERR_COND_NETWORK_ISSUE | Problems with network connection |
| WMI_ERR_COND_SERVICE_NOT_SUPPORTED | Requested service type is not supported by the Payment Application |
| WMI_ERR_COND_TERMINAL_BUSY | Terminal communication is exclusively restricted to another 3rd party application package |
| WMI_ERR_PERMISSION | To old version of Tap on Mobile application. Upgrade to newest is needed |
WMI Application Statuses
| Status | Description |
|---|---|
| NEW | Technical status (should not be expected) indicating that the registration process may be performed; the Tap on Mobile application is not registered. |
| INITIALIZED | The registration process may be performed; the Tap on Mobile application is not registered. |
| REGISTERED | The Tap on Mobile application is registered but not yet authenticated. WPI functions may be performed. |
| AUTHENTICATED | Technical status (should not be expected) indicating that the Tap on Mobile application is still performing configuration activities. |
| ACTIVE | The Tap on Mobile application is authenticated and ready to perform payment acceptance functions (WPI). |
| ERROR | The Tap on Mobile application crashed. |
WMI Result
| Result | Description |
|---|---|
| WMI_RESULT_SUCCESS | In case of a successful transaction |
| WMI_RESULT_FAILURE | In case of a failed transaction |
WMI Service Types
| Action Code | Description |
|---|---|
| WMI_SVC_CHECK_STATUS | Service type for checking the current Tap on Mobile application status |
| WMI_SVC_REGISTER | Service type for initiating the terminal enrollment sequence |
| WMI_SVC_AUTH_UNREGISTER | Service type for unregistering the terminal by the third-party application package previously used for enrollment |