The padlock Element

The padlock element represents a grid structure on which a pattern can be drawn.

{
    "type": "padlock",
    "key": String,
    "tags": Array<String>,
    "version": String,
    "rows": Integer,
    "columns": Integer,
    "validator": ?{
        "required": ?Boolean
    }
}

Please note that this element is only used by banks in Poland. Thus integrations that do not include the Polish market do not have to implement the padlock element.

Padlock with 5 rows and 5 columns

Padlock with 5 rows and 5 columns

rows Integer, always present, since v1.0.0

The rows property holds the amount of rows inside the padlock.

columns Integer, always present, since v1.0.0

The columns property holds the amount of columns inside the padlock.

validator Object, optional, since v1.0.0

The validator property may contain the required rule for the padlock element to be validated against.

validator.required Boolean, optional, since v1.0.0

If the required property is set to true, then the padlock element's value has to be a non-empty array in order to be valid.

Example

{
    "type": "padlock",
    "key": "padlock1",
    "tags": [],
    "version": "1.0.0",
    "rows": 5,
    "columns": 5
}

Returning the value of the padlock Element

The value sent back to the server for the padlock element has to be an array that holds the indices of the selected elements sorted according to the order in which they were selected. Please note that elements can be selected multiple times. The indices start at 0 and go up to a maximum value of (rows * columns) - 1.

The following example first depicts the received form and then the unencrypted response to it:

{
    "form_identifier": "ab12c34d-e45f-6789-0a12-3bc4de567fa",
    "version": "1.0.0",
    "elements": [
        {
            "type": "padlock",
            "key": "padlock1",
            "tags": [],
            "version": "1.0.0",
            "rows": 5,
            "columns": 5
        }
    ]
}
{
    "form_identifier": "ab12c34d-e45f-6789-0a12-3bc4de567fa",
    "data": [
        {
            "key": "input1",
            "value": [0, 1, 7, 13, 17, 12, 7]
        }
    ]
}

Padlock with 5 rows, 5 columns and value [0,1,7,13,17,12,7]

Padlock with 5 rows, 5 columns and value [0, 1, 7, 13, 17, 12, 7]

Changelog


1.0.0 - 01.02.2019

  • initial version

results matching ""

    No results matching ""