displaySwipeCard

The displaySwipeCard method prompts the user to swipe a magnetic card using the terminal's MSR (Magnetic Stripe Reader). You can customize the messages shown on the display.

This method returns the Track 2 data of the card once it has been read.

Request

📘

JSON-RPC 2.0

All methods in TweezerComm follow a JSON-RPC 2.0 structure. See Get Startedfor more details on how the requests are structured and sent.

To invoke this method, set the method field to displaySwipeCard, and include the service name and parameters as shown below.

{
    "jsonrpc": "2.0",
    "method": "displaySwipeCard",
    "params": [
        "ashrait",
        {
            "string1": "stringDisplay1",
            "string2": "stringDisplay2",
            "string3": "stringDisplay3",
            "string4": "stringDisplay4",
            "OpenMSR": true,
            "timeout": 120
        }
    ],
    "id": "1234"
}

Request Parameters

The table below describes the parameters of the request:

NameTypeDescription
string1stringFirst line of display text
string2stringSecond line of display text
string3stringThird line of display text
string4stringFourth line of display text
OpenMSRbooleanWhether to open the magnetic stripe reader
timeoutintegerTimeout duration in seconds

Response

A successful request will return the following response:

{
    "jsonrpc": "2.0",
    "id": "1234",
    "result": {
        "statusCode": 0,
        "track2": "120134687465103900=6163595030067654872"
    }
}

Response Parameters

The table below describes the response parameters for this method:

NameTypeDescription
statusCodeintegerOperation status (0 = success)
track2stringCard track 2 data from magnetic stripe