question

zedwick avatar image
zedwick asked zedwick commented

Merchant with flaky internet having problems with orders in the API

My app takes certain actions when orders are closed. A merchant who uses my app has poor internet, and many orders that they say are "good" orders. Is there a better way to test than if an order's state is still "open"? Here is an example of one such order.

(
    [href] => https://www.clover.com/v3/merchants/xxxxxxxx/orders/TR652JZYESJG4
    [id] => TR652JZYESJG4
    [currency] => USD
    [employee] => stdClass Object
        (
            [id] => xxxxxxxx
        )

    [total] => 3037
    [orderType] => stdClass Object
        (
            [id] => A9N25GV2C8N8M
        )

    [taxRemoved] => 
    [isVat] => 
    [state] => open
    [manualTransaction] => 
    [groupLineItems] => 1
    [testMode] => 
    [createdTime] => 1455228771000
    [clientCreatedTime] => 1455228769000
    [modifiedTime] => 1455228851000
    [device] => stdClass Object
        (
            [id] => 85bd9b65-7609-47c7-a448-3ca5090d44ca
        )

)
Orders
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mike M avatar image Mike M commented ·

Is this via a Clover device? If so, when you fetch the order details, are you doing it via API or a Connector?

0 Likes 0 ·
zedwick avatar image zedwick commented ·

They are using a clover register, I'm accessing it via the api

0 Likes 0 ·

1 Answer

Mike M avatar image
Mike M answered zedwick commented

If you are developing an Android app, I would highly recommend taking advantage of Clover's broadcasts for order states or taking a look at the onOrderUpdateListener of the OrderConnector. These will allow you to bypass the internet delay.

Another way to determine if an order is closed is to verify that the payments add up to the total amount of the order, but you should be able to use an order's state. An order will always be marked closed by our platform when 100% of the order is paid. An order will also be locked when the first payment is added.

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zedwick avatar image zedwick commented ·

This is a web app, and the customer swears that her interface shows this order as closed and paid. Do you have the ability to look up this order and see what's going on?

0 Likes 0 ·
Mike M avatar image Mike M commented ·

Can you first try adding forceRealTime parameter to your API request? You may be experiencing this: https://docs.clover.com/notices/read-...

0 Likes 0 ·

Welcome to the
Clover Developer Community