question

rizwan avatar image
rizwan asked sam Deactivated answered

how to find Order is Cleared

i have one LineItem in order and i want to clear order now. but i did not find clear order event, clover saves that order and treat that order as a save. two events there

i) onOrderUpdated method of OnOrderUpdateListener2 interface
ii) Broadcast Receiver event ACTION_ORDER_SAVED

called in both cases whether we clear order or save order.

in both case if we get order Object there by order ID received in these events. order object returns as the last order info which we cleared.

so we cannot distinguish that order is saved or cleared.

how can we find order is cleared in clover  ?? 

any help would be appreciated.
Orders
10 |2000

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

1 Answer

sam avatar image
sam Deactivated answered

There's no listener/broadcast for a 'clear' for an order. In your case, I would suggest manually looking at the returned order to check if any line items or order type exist to determine if it's been "cleared."

Otherwise, your options are to listen to any of these events:

public interface OnOrderUpdateListener2 {
    void onOrderCreated(String orderId);
    void onOrderDeleted(String orderId);
    void onLineItemsDeleted(String orderId, List<String> lineItemIds);
10 |2000

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

Welcome to the
Clover Developer Community