I use the Ping Action to check if the terminal is online, but I have found it to be unreliable. It almost always happens after restarting the terminal or when the network reconnects.
1, After restarting the terminal, even when the terminal is already displaying the ‘powered by square’ waiting screen, the Ping Action still returns a pending status, making it unable to confirm a normal connection to the terminal. Interestingly, I can create a checkout, and the terminal will display a waiting for payment message. ping action also change to complated after checkout created.
2, The deadline_duration is ineffective. I’m not sure if it’s because I’m in Japan, but even if I set the deadline_duration to 3 minutes, it still gives me a notification after the default 5 minutes.
Please check the following log, the terminal is already displaying the ‘powered by square’ waiting screen, but the Ping Action is still being canceled due to a timeout.
terminal.action.created
{
"merchant_id": "MLH97HP6BN08G",
"type": "terminal.action.created",
"event_id": "47cca21d-a33c-3417-b69c-3a80a30a7084",
"created_at": "2024-03-04T07:41:42.895Z",
"data": {
"type": "action",
"id": "termapia:0rtbENEfwdaiAiCE",
"object": {
"action": {
"app_id": "sq0idp-r8ehAgS7GAw1bS1k65I5xQ",
"created_at": "2024-03-04T07:41:42.895Z",
"deadline_duration": "PT3M",
"device_id": "307CS145B3001491",
"id": "termapia:0rtbENEfwdaiAiCE",
"status": "PENDING",
"type": "PING",
"updated_at": "2024-03-04T07:41:42.895Z"
}
}
}
}
ping action CANCELED after 5min.
{
"merchant_id": "MLH97HP6BN08G",
"type": "terminal.action.updated",
"event_id": "4bff0838-c228-3b17-b1c4-81be42bdbb14",
"created_at": "2024-03-04T07:46:58.746Z",
"data": {
"type": "action",
"id": "termapia:0rtbENEfwdaiAiCE",
"object": {
"action": {
"app_id": "sq0idp-r8ehAgS7GAw1bS1k65I5xQ",
"cancel_reason": "TIMED_OUT",
"created_at": "2024-03-04T07:41:42.895Z",
"deadline_duration": "PT3M",
"device_id": "307CS145B3001491",
"id": "termapia:0rtbENEfwdaiAiCE",
"status": "CANCELED",
"type": "PING",
"updated_at": "2024-03-04T07:46:58.746Z"
}
}
}
}
I want to make sure the terminal is online before I create checkout, so I can be friendly and prompt you when I know the terminal isn’t connecting. Thank you !