Skip to main content

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.

TypeCategoryIntentPurpose
ManagementDisplay 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_OPERATIONProcess 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.

ExtraDescritpionTypeCondition
WMI_SERVICE_TYPESpecify the subtype of action to be executed:
- WMI_SVC_CHECK_STATUS - Service type for checking 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 3rd party application package used previously for enrollment
StringMandatory
WMI_REQUESTThe request contains JSON structured data that is mandatory for the given service type.
The JSON structure is described in the following chapters for each function.
StringMandatory
SHOW_OVERLAYThe flag controls whether a transparent overlay (false) or a spinner (true) should be displayed at the start of the intent.BooleanOptional

To launch intent registerForActivityResult method should be used. In the response, the intent returns the following data.

ExtraDescritpionTypeCondition
WMI_SERVICE_TYPESpecify the subtype of action to be executedStringMandatory
WMI_RESPONSEThe response contains JSON structured data processed for the requested service typeStringMandatory

And here is response parsing sample code:

    public WmiPurchaseResponse parsePurchaseResponse(ActivityResult result) \{
if (result.getResultCode() == Activity.RESULT_CANCELED) \{
throw new RuntimeException("Intent cancelled.");
}
if (result.getResultCode() != Activity.RESULT_OK) \{
throw new RuntimeException("Invalid result code: " + result.getResultCode());
}

Intent intent = result.getData();
if (intent == null) \{
throw new RuntimeException("Received intent without bundled data");
}

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

ExtraDesriptionTypeCondition
WMI_SERVICE_TYPEWMI_SVC_CHECK_STATUSStringMandatory

WMI_SVC_CHECK_STATUS - list of supported request parameters None – might be created for future use.

Response

ExtraDesriptionTypeCondition
WMI_SERVICE_TYPEWMI_SVC_CHECK_STATUSStringMandatory
WMI_RESPONSEJSON structured response parameters as described in subsequent tableStringMandatory

WMI_SVC_CHECK_STATUS - list of supported response parameters

Field nameDescriptionTypeCondition
resultResult of the transaction:
- WMI_RESULT_SUCCESS In case of successful transaction
- WMI_RESULT_FAILURE In case of failed transaction
StringMandatory
errorConditionSpecific error reason
For more information check WMI Error codes)
StringMandatory
remarkTerminal / transaction specific message for detailed error descriptions. Text provided by payment app.StringConditional – only for NOT successful transaction
appStatusTap on Mobile application status indicating whether application is already registered.
For more information check 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

ExtraDesriptionTypeCondition
WMI_SERVICE_TYPEWMI_SVC_REGISTERStringMandatory

WMI_SVC_REGISTER - list of supported request parameters

Field nameDescriptionTypeCondition
registrationTokenTID 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;StringOptional

Response

ExtraDesriptionTypeCondition
WMI_SERVICE_TYPEWMI_SVC_REGISTERStringMandatory
WMI_RESPONSEJSON structured response parameters as described in subsequent tableStringMandatory

WMI_RESPONSE - list of supported response parameters

Field nameDescriptionTypeCondition
resultResult of the transaction:
- WMI_RESULT_SUCCESS In case of successful transaction
- WMI_RESULT_FAILURE In case of failed transaction
StringMandatory
errorConditionSpecific error reason
For more information check WMI Error codes
StringMandatory
remarkTerminal / transaction specific message for detailed error descriptions. Text provided by payment app.StringConditional – 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

ExtraDesriptionTypeCondition
WMI_SERVICE_TYPEWMI_SVC_AUTH_UNREGISTERStringMandatory

WMI_SVC_AUTH_UNREGISTER - list of supported request parameters None – might be created for future use.

Response

ExtraDesriptionTypeCondition
WMI_SERVICE_TYPEWMI_SVC_AUTH_UNREGISTERStringMandatory
WMI_RESPONSEJSON structured response parameters as described in subsequent tableStringMandatory

WMI_SVC_AUTH_UNREGISTER - list of supported response parameters**

Field nameDescriptionTypeCondition
resultResult of the transaction:
- WMI_RESULT_SUCCESS In case of successful transaction
- WMI_RESULT_FAILURE In case of failed transaction
StringMandatory
errorConditionSpecific error reason
For more information check WMI Error codes and proper error handling
StringMandatory
remarkTerminal / transaction specific message for detailed error descriptions. Text provided by payment app.StringConditional – only for NOT successful transaction

WMI Error codes

Error conditionDescription
WMI_ERR_COND_NONEWill always be present if no error occurred, confirms successful result
WMI_ERR_COND_AUTH_NOT_POSSIBLEValid terminal registration was not found.
WMI_ERR_COND_GENERICA mobile application generic error that is not explicitly outlined here
WMI_ERR_COND_INTERNALBackend-driven generic error that is not explicitly outlined here
WMI_ERR_COND_INVALID_JSONWrong structure of WMI_REQUEST json
WMI_ERR_COND_NETWORK_ISSUEProblems with network connection
WMI_ERR_COND_SERVICE_NOT_SUPPORTEDRequested service type is not supported by the Payment Application
WMI_ERR_COND_TERMINAL_BUSYTerminal communication is exclusively restricted to another 3rd party application package
WMI_ERR_PERMISSIONTo old version of Tap on Mobile application. Upgrade to newest is needed

Tap on Mobile backend API

Implementing the Tap on Mobile integrated authentication mode requires integrating the third-party application backend directly with the ToM backend API. Storing OAuth2 access credentials directly in the mobile application is not allowed. This integration process requires covering the following areas:

  1. ToM backend API OAuth2 authentication;
  2. The logic to retrieve and manage merchant terminals structure in 3rd party application backend;
  3. The logic to lock free terminal selected for registration.

###ToM backend API OAuth2 authentication

The Oauth2 token endpoint provides access tokens which are used to authenticate and authorise requests to protected resources as described in the ToM API and subsequent sections.

To request an access token it is required to provide a valid client ID and client secret.

Request Parameters

The following parameters are used in the OAuth2 token endpoint (/oauth2/token).

ParameterDescriptionTypeCondition
grant_typeA string indicating which grant type is being used: client_credentialsStringMandatory
scopeThe scope of the access token, indicating the permissions that are granted to the clientStringOptional (depends on API)
client_idA unique identifier for the client application, issued by the authorization serverStringMandatory
client_secretA secret string used to authenticate the client application with the authorization serverStringMandatory

Response Parameters

The response from the token endpoint will include a number of parameters:

ParameterDescriptionTypeCondition
access_tokenA string containing the access token, which will be used for the terminal authentication endpointStringMandatory
scopeThe scope of the access token, indicating the permissions that are granted to the clientStringOptional (depends on API)
token_typeThe type of access token. For example “Bearer”StringMandatory
expires_inThe number of seconds before the access token expires and a new one must be requestedIntegerMandatory

Retrieving and managing merchant’s terminal structure

Merchant applications access to ToM backend API should reflect the complete merchant organization structure. Organization structure uses up to three tier levels, i.e.:

CONTRACT_ID is optional and only used in case lower level tiers require aggregation; VAT_ID is optional and only used in case lower level tiers require aggregation; MID is the lowest and most common merchant organization structure tier; TIDs are allocated on a MID level.

Merchant structure is always assigned and edited by the acquiring entity. However, merchant’s 3rd party application backend should be capable of retrieving this structure from ToM backend, track the potential changes in it and be capable of deciding which TID should be assigned during the registration process.

ToM API documentation lists several merchant level functions that may be used for terminal management, however a suggested function for retrieving current merchant terminal structure is POST /api/v1/terminals/search.

Request Parameters

Complete list of function request elements is available in ToM API specification (https://sandbox-wl-emea.softpos.eu/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/Terminals/search_8). Tables below summarize most important parameters and function filters.

ParameterDescriptionTypeCondition
pageInteger defining a zero-based page index (default is 0)IntegerOptional
sizeInteger defining number of items to be returned in a single page (default is 10)IntegerOptional
sortString defining response list sorting criteria in the format: property,(asc|desc). Default order is ascending. Multiple sort criteria are supportedStringOptional

Request Body

ParameterDescriptionTypeCondition
contract_idMerchant tier level identifier or combination of identifiers defining which part of terminal structure should be returnedStringOptional
vat_idMerchant tier level identifier or combination of identifiers defining which part of terminal structure should be returnedStringOptional
midMerchant tier level identifier or combination of identifiers defining which part of terminal structure should be returnedStringOptional
tidTerminal identifier. Used when current terminal details need to be checkedStringOptional
connectedTerminal assignment status: true – terminal is linked to a device; false – terminal is unassigned and availableBooleanOptional
disabledFlag indicating whether the terminal is temporarily restricted from performing operationsBooleanOptional

Response Parameters

Complete list of response elements is available in ToM API specification (https://sandbox-wl-emea.softpos.eu/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/Terminals/search_8). Table below summarizes most important fields.

ParameterDescriptionTypeCondition
idTerminal UUID stored in the ToM backendString (UUID)Mandatory
external_id3rd party terminal identifier (if assigned and present)StringOptional
tidToM backend recognized active TID selected for assignmentStringMandatory
midToM backend recognized MID corresponding to the selected TIDStringMandatory

Locking a terminal selected for registration

The decision on the TID selected for registration should be followed by the generation of a registration token. Creating a registration token moves the TID to ‘locked’ status. It means that throughout the registration token validity, TID cannot be manually registered in standalone mode.

ToM API function for the registration token generation operation is POST /api/v1/terminals/{id}/registration-token, where id is a terminal UUID stored in ToM backend.

Important note: registration token’s expiry timestamp may be extended by calling POST /api/v1/terminals/{id}/registration-token/refresh ToM API function. This operation maintains previous token value and new validity timestamp is returned in the response.

Request Parameters

Complete list of request elements is available in ToM API specification (https://sandbox-wl-emea.softpos.eu/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/Terminals%20Registrations/registrationToken). Table below summarizes most important fields.

ParameterDescriptionTypeCondition
idTerminal UUID stored in the ToM backendString (UUID)Mandatory

Request Body

ParameterDescriptionTypeCondition
emailOptional parameter allowing to provide an email address of the user who should receive a welcome email containing the registration token in QR-code format; an empty body should be used when no user notification is requiredStringOptional

Response Parameters

Complete list of response elements is available in ToM API specification (https://sandbox-wl-emea.softpos.eu/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config#/Terminals%20Registrations/registrationToken). Table below summarizes most important fields.

ParameterDescriptionTypeCondition
tokenGenerated registration token to be used in the Tap on Mobile application for registering the selected TIDStringMandatory
expiry_dateRegistration token expiry timestampString (timestamp)Mandatory
createdRegistration token creation timestamp

| String (timestamp) | Mandatory |