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:
Name | Type | Description |
---|---|---|
string1 | string | First line of display text |
string2 | string | Second line of display text |
string3 | string | Third line of display text |
string4 | string | Fourth line of display text |
OpenMSR | boolean | Whether to open the magnetic stripe reader |
timeout | integer | Timeout 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:
Name | Type | Description |
---|---|---|
statusCode | integer | Operation status (0 = success) |
track2 | string | Card track 2 data from magnetic stripe |
Updated 8 days ago