Identifying yourself when exchanging with the payment gateway

Identification is performed by means of an HTTP header.

The used method is HTTP Basic Authentication.

In each HTTP request, the header must contain the information allowing the merchant to authenticate via the SEPA Web Service.

Description of HTTP headers:

Table 1. Description of HTTP headers
Header Description Create a mandate View mandate details Download a mandate Update a mandate
Accept Determines the format of the contents that will be returned by the server.

REST architecture that allows to perform data exchange in JSON format.

'Accept:application/ json' 'Accept:application/ json'

'Accept:application/octet-stream'

Note:

In response to the http request, a binary response (pdf) is expected.

'Accept:application/ json'
Authorization

Contains the user authentication token.

It is composed of:

  • Site_id ; Shop ID (target point of sales).
  • Certificate: Value of the TEST or PRODUCTION key.

This information is encoded in base 64.

Note:

The Site_id and Certificate values are available in your Back Office.

  • Site_id: Settings > Shop > Configuration tab.
  • Certificate: Settings > Shop > Keys tab.
The key value determines a test or production request.

Example of an authentication token encoded in base 64:

"Basic MTIzNDU2Nzg6OTk

5OTk5OTk5OTk5O

Tk5OQ==

Example of an authentication token encoded in base 64:

"Basic MTIzNDU2Nzg6OTk

5OTk5OTk5OTk5O

Tk5OQ==

Example of an authentication token encoded in base 64:

"Basic MTIzNDU2Nzg6OTk

5OTk5OTk5OTk5O

Tk5OQ==

Example of an authentication token encoded in base 64:

"Basic MTIzNDU2Nzg6OTk

5OTk5OTk5OTk5O

Tk5OQ==

Content-type Determines the format of the contents sent to the server.

'content-type:application/json'

'content-type:application/json'

'content-type:application/json'

'content-type:application/json'

The steps of building a header are:

  1. Use the Basic Authentication method.
  2. Specify the used method in the Authorization header: Basic followed by the Base64 representation of the Site_id and Certificate values separated by the “:” character.
  3. Encode the obtained result in Base64.
  4. Add the chain to "Basic".

    Note:
    Make sure to use a space character after Basic.

Sending headers with cURL

In order to add headers to your request, use the -H or --header option.

Example:

To specify the content type:

  curl -H "Content-type:application/json" https://secure.lyra.com/sdd			

In order to see the headers sent in your request and in the response, use the -v option.
  curl -H "Content-type:application/json" https://secure.lyra.com/sdd