Terminal cannot complete the payment

I have a few questions regarding the Terminal API.

  1. When the checkout status changes to “CANCELED,” we are not receiving webhook notifications.
    Our program is designed to continuously wait for webhook notifications after calling “Cancel terminal checkout” api and proceeds with processing after the checkout status has changed to “CANCELED”. During program testing, the following phenomenon occurred:

Phenomenon:
When repeatedly testing “Create terminal checkout” api followed by “Cancel terminal checkout” api, it was observed that after the third iteration (not consistently every time), webhook notifications for the checkout changing to “CANCELED” were no longer received. However, upon checking the status using “Get terminal checkout”, the checkout status was indeed “CANCELED”.
While we understand that webhook notifications are expected when updating the checkout status, we are perplexed as to why notifications for the checkout changing to “CANCELED” are not being received.I’m not sure if this has anything to do with our frequent api calls.

  1. The terminal keeps displaying payment preparation and cannot complete the payment.
    After I restarted terminal, the problem was fixed and payment could continue. May I ask under what circumstances the terminal cannot complete the payment? Does this type of error occur if the api is called too often or in the wrong order?
    here is the picture when the error occurred

Thanks.

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

https://developer.squareup.com/docs/refunds-api/webhooks
Test in the Sandbox
Guidelines and Limitations

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Do you have a checkout_id that didn’t trigger a webhook when you called cancel? :slightly_smiling_face:

@Bryan-Square There are two checkout ids,please check it.

1.The “CANCELED” notification was received, but the interval was very long
app_id:sq0idp-r8ehAgS7GAw1bS1k65I5xQ
checkout_id:1HBdvHYXTRrqO

2024-02-21T07:09:21.154Z CANCEL_REQUESTED
2024-02-21T08:19:33.921Z CANCELED

2.terminal freeze, can not do payment.just only be resolved by restarting
app_id:sq0idp-r8ehAgS7GAw1bS1k65I5xQ
checkout_id:wci0X7HqLjlqO

I took a look at the webhook logs and I see the terminal.checkout.updated event for the checkouts when they got canceled.

{
  "merchant_id": "MLH97HP6BN08G",
  "type": "terminal.checkout.updated",
  "event_id": "0ad8ccc2-bd48-3efd-8f5f-7a71f952328c",
  "created_at": "2024-02-21T08:19:33.921Z",
  "data": {
    "type": "checkout",
    "id": "1HBdvHYXTRrqO",
    "object": {
      "checkout": {
        "amount_money": {
          "amount": 1,
          "currency": "JPY"
        },
        "app_id": "sq0idp-r8ehAgS7GAw1bS1k65I5xQ",
        "cancel_reason": "BUYER_CANCELED",
        "created_at": "2024-02-21T06:56:08.947Z",
        "device_options": {
          "device_id": "307CS145B3001491",
          "skip_receipt_screen": false,
          "tip_settings": {
            "allow_tipping": false
          }
        },
        "id": "1HBdvHYXTRrqO",
        "location_id": "LB3QFWDV18WRQ",
        "payment_options": {
          "autocomplete": true
        },
        "payment_type": "CARD_PRESENT",
        "status": "CANCELED",
        "updated_at": "2024-02-21T08:19:33.921Z"
      }
    }
  }
}
{
  "merchant_id": "MLH97HP6BN08G",
  "type": "terminal.checkout.updated",
  "event_id": "8c91a5fc-cb7e-3bd7-b55d-dec79da583b9",
  "created_at": "2024-02-28T10:46:51.132Z",
  "data": {
    "type": "checkout",
    "id": "wci0X7HqLjlqO",
    "object": {
      "checkout": {
        "amount_money": {
          "amount": 3500,
          "currency": "JPY"
        },
        "app_id": "sq0idp-r8ehAgS7GAw1bS1k65I5xQ",
        "cancel_reason": "BUYER_CANCELED",
        "created_at": "2024-02-28T10:37:29.531Z",
        "device_options": {
          "device_id": "307CS145B3001491",
          "skip_receipt_screen": false,
          "tip_settings": {
            "allow_tipping": false
          }
        },
        "id": "wci0X7HqLjlqO",
        "location_id": "LB3QFWDV18WRQ",
        "payment_options": {
          "autocomplete": true
        },
        "payment_type": "FELICA_QUICPAY",
        "status": "CANCELED",
        "updated_at": "2024-02-28T10:46:51.132Z"
      }
    }
  }
}

:slightly_smiling_face:

Yes, the “CANCELED” notification was received after I shut down the terminal.

Could you investigate why the terminal is crashing? If it’s related to the methods and sequence of our API calls, please provide guidance on the correct approach.

So the payment was stuck in a loop? How long did you wait till you restarted the device? Also are you able to replicate this reliably? If so what are the steps to reproduce? :slightly_smiling_face:

I waited for approximately 5 minutes and then restarted the terminal.

I cannot reliably reproduce it, but it has occurred twice. I am using FeliCa e-money payment, where the card needs to be touched near the blue box and kept in place until the payment is complete. The problem occurs when the card is removed from the terminal before the payment is completed.

it seems to be stuck at the error check or the payment is incomplete.I have attached images of the error.
can you check what happened in terminal? or how can I avoid this error?

I just wanted to drop in and say that I too have seen this on our end. We’re not doing anything to frequent, just normal operation. It will get stuck spinning trying to process the payment. When I get called out to inspect the device, I usually just restart it. Upon restart, my app will get the CANCELED/COMPLETED notification.

Since I’m not one of the clerks and the clerks don’t particularly pay close attention, I have not been able to pinpoint what could be causing it. At the present moment it seems random.

The frequency of this issue is super low, maybe once a day or two. I would say that it started in earnest no more than a week ago. I will try to keep an eye out and report back if I find anything.

Thank you for providing your findings. The team is looking into this. Please provide any checkout_id that this happens with. Also often time we see issues when the customer removes the card to quickly so you may want to keep an eye out for that. :slightly_smiling_face:

please check it first. I am still testing, and if I reproduce the error, I will provide the checkout_id of the error.
app_id:sq0idp-r8ehAgS7GAw1bS1k65I5xQ
checkout_id:wci0X7HqLjlqO