worldline

Documentation

WPI version 1.0

Revision #9

Table of contents

  1. Overview

  2. Interface Structure

  3. Payment Solution Implementation

  4. Data Dictionary 

Overview

The Worldline Payment Interface (WPI) is an Android intent-based interface that enables easy and fast integration with payment apps. It is designed to allow additional business applications to execute payments on any Worldline offered SmartPOS device. A SmartPOS device is a payment device that runs Android.

All Worldline Payment Solutions support WPI, which means that business applications that use this interface can run everywhere without any change of code. This makes it easy for developers to build payment apps that are compatible with a wide range of payment devices and payment protocols.

The WPI interface is built on top of the Android Intent mechanism, which allows different parts of an app to communicate with each other in a structured way. By using intents to trigger payment-related actions, the WPI interface simplifies the payment integration process and makes it easier for developers to build business applications on top of Payment Solutions.

Revision History

  • Revision #9

    • Reservation / Reservation Adjustment / Purchase Reservation

      • Chapters renamed to "Pre-authorization, "Update Pre-authorization" and "Payment Completion" respectively

      • Clarification on paymentSolutionReference usage provided

Interface Structure

The WPI provides a set of intents that developers can use to build apps that work with the interface. The following table lists each intent, along with its purpose:

Type

Intent

Purpose

Financial

com.worldline.payment.action.PROCESS_TRANSACTION

Process a financial transaction

Management

com.worldline.payment.action.PROCESS_MANAGEMENT

Trigger payment solution managed actions

Extras

An extra in Android intents is a way to pass additional data or parameters to another component in order to provide more context or information for the requested action. In WPI we have extras for request and response. The request extras needs to be provided by the Business Application that is using the interface and the response extra is provided by the Payment Solution.

REQUEST

Extra

Description

Type

Condition

WPI_SERVICE_TYPE

Specify the subtype of action to be executed 

String

Mandatory

WPI_REQUEST

The request contains JSON structured data mandatory for given service type, in some specific cases this field is not given or empty

String

Mandatory for Financial
Optional for Management

WPI_VERSION

Used WPI version

Integer

Mandatory

RESPONSE

Extra

Description

Type

Condition

WPI_RESPONSE

The response contains JSON structured data processed for the requested service type

String 

Mandatory

Service Types

Each intent has several service types that specify the request.

FINANCIAL

Service Type

Purpose

WPI_SVC_PAYMENT

Used to perform a simple sale transaction also known as purchase

WPI_SVC_CANCEL_PAYMENT

Used to reverse a previous transaction

WPI_SVC_REFUND

Used to refund a previous transaction

WPI_SVC_PRE_AUTHORIZATION

Used to perform a reservation

WPI_SVC_CANCEL_PRE_AUTHORIZATION

Used to cancel a previous reservation

WPI_SVC_UPDATE_PRE_AUTHORIZATION

Used to increment a previous reservation

WPI_SVC_CANCEL_UPDATE_PRE_AUTHORIZATION

Used to cancel the previous incrementation of a reservation

WPI_SVC_PAYMENT_COMPLETION

Used to purchase a reservation / incremented reservation

WPI_SVC_CANCEL_PAYMENT_COMPLETION

Used to cancel the purchased reservation

MANAGEMENT

Service Type

Purpose

WPI_SVC_PAYMENT_MENU

Used to open the payment solution menu

WPI_SVC_DAY_END

Used to upload the transactions (online and offline) to perform the final settlement

Payment Solution Implementation

The technical design is based on defining only the mandatory attributes in the request needed to meet every requested business use case aiming to be payment protocol agnostic.

  • The payment solution shall support every combination of attributes defined in the request.

  • The result structure contains every possible attribute to be returned to meet every use case.

  • The payment solution reference must be designed in a unique way so that all follow on transactions can be handled with this. For example if you do a reservation it needs to contain all payment specific field to do all follow on transactions like cancel reservation, purchase reservation and so on.

  • WPI supports the so called reference, for more details check Data Dictionary Request Data , these field is also known as merchant reference and used for reconciliation.

Data Dictionary

Data

Request Data

All data has to be provided as JSON and needs to be provided as WPI_REQUEST extra.

Field Name

Description

Type

currency

Currency of the amount. Alpha code value defined in ISO 4217 (e.g. EUR )

String

requestedAmount

Total payment amount as minor unit. The fractional digits are evaluated based in the currency. For example, 11.91€ must be sent as 1191 and the currency as EUR

Integer

paymentSolutionReference

A previous transaction reference used for subsequent transactions like a Reversal. This value is defined by the payment application and contains all necessary data to perform subsequent transactions. This value can differ based on the payment application and can only be used on the same device.

String

reference

Reference to be send to the payment solution for reconciliation

String

Response Data

All data has to be provided as JSON and will be provided as WPI_RESPONSE extra.

Field Name

Description

Type

result

Result of the transaction (success or failure)

String (pre-defined: Result )

errorCondition

Specific error reason (see table below)

String (pre-defined: Error Conditions )

actionCode

Specific action to be performed by the business application

String (pre-defined: Action Codes )

remark

Terminal / transaction specific message for detailed error descriptions. Text provided by payment app in English

String

timestamp

Date and time of the transaction, indicated by the acquirer

Format according to ISO 8601

String

currency

Currency code of the transaction. Alpha code value defined in ISO 4217 e.g. EUR

String

authorizedAmount

Amount of the transaction. The fraction is taken from the currency code. Example:

Currency = EUR

requestedAmount = 3190

=> 31,90 €

Integer

brandName

Brand name of used payment card, like MasterCard, VISA, AMEX and so on.

String

customerLanguage

Language used on all screens towards the cardholder and when formatting the receipt. Language code will be returned for english > en

Format according to ISO 630-1 (alpha-2 code)

String

applicationIdentifier

Payment card application identifier dependent on the used card e.g. for MasterCard A00000041010

String

applicationLabel

Payment card application label, depending on the used card e.g. MasterCard DEBIT

String

formattedReceipt

Merchant and cardholder receipt are contained in this field. Both receipts are available as text preformatted. Check the subsequent chapter below for an example. The receipt wide is defined by the payment application (often 32 characters) and depends on the printer capabilities or configuration.

The receipt language is the same as it is for the payment app.

Object

paymentSolutionReference

Transaction specific and unique identification. This value is defined by the payment application and contains all necessary data to perform subsequent transactions. This value can differ based on the payment application and can only be used on the same device.

String

reference

Reference to be send to the payment app for reconciliation

String

RESULT

Result

Description

WPI_RESULT_SUCCESS

In case of successful transaction

WPI_RESULT_FAILURE

In case of failed transaction

ERROR CONDITIONS

Error Condition

Description

WPI_ERR_COND_NONE

Will always be present if no error occurred

WPI_ERR_COND_SERVICE_NOT_SUPPORTED

The requested service type is not supported by the Payment Application/Service

WPI_ERR_COND_ABORTED

The initiator of the request has sent an abort request, which was accepted and processed

WPI_ERR_COND_BUSY

The Payment Application/Service is busy. Try later

WPI_ERR_COND_CARD_READ_ERR

The payment application was not able to read the card. Either due to inconsistent data or wrong card handling

WPI_ERR_COND_USER_CANCEL

The user has aborted the transaction

WPI_ERR_COND_USER_TIMEOUT

A timeout occurred while waiting for user interaction

WPI_ERR_COND_HOST_REFUSAL

The Acquirer/Issuer refused the transaction

WPI_ERR_COND_NETWORK_ISSUE

Network issue occurred (host not reachable, network down, … )

WPI_ERR_COND_TRANSACTION_TIMEOUT

Timeout occurred during transaction (other than with user interaction )

WPI_ERR_COND_ENCRYPTION_ISSUE

Encryption issue (PAN, PIN …) caused the transaction to be aborted

WPI_ERR_COND_INVALID_KEY

The secure component of the terminal is missing a key it needs to perform the transaction

WPI_ERR_COND_INVALID_TRANSACTION_REQ

Invalid transaction request received. One of the fields in the transaction request object was invalid

WPI_ERR_COND_INTERNAL

Internal error within payment service

WPI_ERR_COND_INVALID_AMOUNT

Entered invalid amount

WPI_ERR_COND_INVALID_CURRENCY

Transaction started with invalid currency. The currency is a global attribute of the underlying payment service

WPI_ERR_COND_BAD_AMOUNT_VALUE

Bad amount value is used for the ongoing transaction, especially when a transaction is cancelled with a zero amount

WPI_ERR_COND_APP_NOT_SUPPORTED

None of the applications on the EMV NFC/IC chip card are accepted or the ISO/PAN on the magnetic stripe track didn’t result in a brand being accepted

WPI_ERR_COND_MISSING_MANDATORY_PARAMETER

A mandatory parameter is missing in the request

WPI_ERR_COND_GENERIC

A generic error that is not specified in detail

ACTION CODES

Action code

Description

WPI_ACTION_CODE_NONE

No additional action to be performed

WPI_ACTION_CODE_ASK_LEGAL_IDENTIFICATION

Ask the cardholder for a legal identification and write the identification data down on the receipt

WPI_ACTION_CODE_ASK_SIGNATURE

Ask the cardholder to sign the merchant receipt to complete the authorization

RECEIPTS

Each response contains a transaction receipt for merchants and cardholders. The below example shows a pretty printed version of the JSON that the payment solution will provide - for demonstration purpose as usually each receipt content is in one line. As it is written in the JSON specification ( https://www.ietf.org/rfc/rfc4627.txt ) every control character has to be escaped like shown below but on the same line.

"formattedReceipt":{
  "merchant":"    This is to confirm your transaction\\n
    registered at:\\n
    ----------------------------------------\\n
            SPS-Softpos Pilot 02\\n
              Grzybowska 4/246\\n
              00-131 Warszawa\\n
    ----------------------------------------\\n
    15.02.2023 22:36\\n
    0,03 PLN\\n
    Visa **** **** **** 7984\\n
           Transaction details: \\n
    Status:                       AUTHORIZED\\n
    Authorization code:           (0) 741451\\n
    ARQC:                   61BC5EDC34F63979\\n
    AID:                      A0000000031010\\n
    Contactless\\n
    Type:                               Sale\\n
    POS ID:                         APP00002\\n
    MID:                           103810047\\n
    VISA CARD",
  "client":"    This is to confirm your transaction\\n
    registered at:\\n
    ----------------------------------------\\n
          SPS-Softpos Pilot 02\\n
                Grzybowska 4/246\\n
                00-131 Warszawa\\n
    ----------------------------------------\\n
    15.02.2023 22:36\\n
    0,03 PLN\\n
    Visa **** **** **** 7984\\n
          Transaction details: \\n
    Status:                       AUTHORIZED\\n
    Authorization code:           (0) 741451\\n
    ARQC:                   61BC5EDC34F63979\\n
    AID:                      A0000000031010\\n
    Contactless\\n
    Type:                               Sale\\n
    POS ID:                         APP00002\\n
    MID:                           103810047\\n
    VISA CARD"
}

Financial

Each financial transaction has a minimum set of fields that needs to be there per service type. In the subsequent chapters this is described in detail. 

The response always contains the following fields:

Field Name

Type

Condition

result

String

Mandatory

errorCondition

String

Mandatory

remark

String

Conditional

  • only for not successful transactions

actionCode

String

Conditional

  • only for successful transactions

timestamp

String (ISO 8601)

Conditional

  • only for successful transactions

currency

String

Conditional

  • only for successful transactions

authorizedAmount

Integer

Conditional

  • only for successful transactions

customerLanguage

String

Conditional

  • only for successful transactions in which a payment card was used
    (e.g. on reference based transactions the card is not inserted and therefore we cannot get these data)

brandName

String

Conditional

  • only for successful transactions in which a payment card was used
    (e.g. on reference based transactions the card is not inserted and therefore we cannot get these data)

applicationIdentifier

String

Conditional

  • only for successful transactions in which a payment card was used
    (e.g. on reference based transactions the card is not inserted and therefore we cannot get these data)

applicationLabel

String

Conditional

  • only for successful transactions in which a payment card was used
    (e.g. on reference based transactions the card is not inserted and therefore we cannot get these data)

formattedReceipt

Object

Conditional

  • only for successful transactions

paymentSolutionReference

String

Conditional

  • only for successful transactions

Purchase

Service Type: WPI_SVC_PAYMENT

Request: JSON

Field Name

Type

Condition

currency

String

Mandatory

requestedAmount

Integer

Mandatory

reference

String

Optional

Cancellation

The cancellation is also known as reversal. The cancellation can be executed for several service types, the cancellation service type depends on the initial service type and needs to be set and used correctly by the business application.

Service Type: WPI_SVC_CANCEL_PAYMENT, WPI_SVC_CANCEL_PRE_AUTHORIZATION, WPI_SVC_CANCEL_UPDATE_PRE_AUTHORIZATION, WPI_SVC_CANCEL_PAYMENT_COMPLETION

Request: JSON

Field Name

Type

Condition

paymentSolutionReference

String

Mandatory

Refund

Service Type: WPI_SVC_REFUND

Request: JSON

Field Name

Type

Condition

currency

String

Mandatory

requestedAmount

Integer

Mandatory

reference

String

Optional

Pre-authorization

Service Type: WPI_SVC_PRE_AUTHORIZATION

Request: JSON

Field Name

Type

Condition

currency

String

Mandatory

requestedAmount

Integer

Mandatory

reference

String

Optional

Update Pre-authorization

This service is used to increase the pre-authorization amount, which involves specifying the requested amount for the increment. The reference of pre-authorization is provided through the paymentSolutionReference , which will be use to make the update pre-authorization. The requestedAmount is just the amount that shall be incremented, not the total one

Service Type: WPI_SVC_PRE_AUTHORIZATION

Request: JSON

Field Name

Type

Condition

currency

String

Mandatory

requestedAmount

Integer

Mandatory

paymentSolutionReference

String

Mandatory

reference

String

Optional

Payment Completion

To complete a previous pre-authorization the paymentSolutionReference has to be used. The final amount should be equal to or less than the total pre-authorization amount (this includes all previous Update pre-authorization calls). If you use a higher amount for the completion, the transaction may not be successful because the higher amount was not reserved - we do not recommend to use higher amounts.

Service Type: WPI_SVC_PAYMENT_COMPLETION

Request: JSON

Field Name

Type

Condition

currency

String

Mandatory

requestedAmount

Integer

Mandatory

paymentSolutionReference

String

Mandatory

reference

String

Optional

Management

Management actions has no request parameters. 

The response always contains the following fields:

Field Name

Type

Condition

result

String

Mandatory

errorCondition

String

Mandatory

formattedReceipt

Object

Conditional

  • Only for Day-End

Payment Menu

This is used to open the payment solution menu to trigger payment solution specific actions.

Service Type: WPI_SVC_PAYMENT_MENU

Day-End

The day-end is used to upload the offline transactions to the host and sends back a receipt with the transaction summary per brand with no of transactions as well as the full amount since the last day-end.

Service Type: WPI_SVC_DAY_END