Class CashEvents


  • public class CashEvents
    extends Object
    This interface provides a mechanism to pop a cash drawer and record miscellaneous cash events, it should not be used not for cash payments or refunds.

    To read recorded cash events use the CashContract.

    See Also:
    CashDrawers
    • Method Detail

      • addCash

        public boolean addCash​(long amount,
                               String note)
        Record a miscellaneous "add cash" event and pops one cash drawer. Not for payments or refunds.

        This method may perform blocking IO operations depending on the specific cash drawer hardware. It must not be called from the main (UI) thread.

        Parameters:
        amount - amount being added, must be positive
        note - human readable string explaining why cash was added
        Returns:
        false if the cash event was not recorded, this may occur because the cash drawer did not pop or there was an internal error with Clover services
      • removeCash

        public boolean removeCash​(long amount,
                                  String note)
        Record a miscellaneous "remove cash" event and pops one cash drawer. Not for payments or refunds.

        This method may perform blocking IO operations depending on the specific cash drawer hardware. It must not be called from the main (UI) thread.

        Parameters:
        amount - amount being removed, must be negative
        note - human readable string explaining why cash was added
        Returns:
        false if the cash event was not recorded, this may occur because the cash drawer did not pop or there was an internal error with Clover services
      • addCash

        public boolean addCash​(long amount,
                               String note,
                               CashDrawer cashDrawer)
        Record a miscellaneous "add cash" event and pops the given cash drawer. Not for payments or refunds.

        This method may perform blocking IO operations depending on the specific cash drawer hardware. It must not be called from the main (UI) thread.

        Parameters:
        amount - amount being added, must be positive
        note - human readable string explaining why cash was added
        cashDrawer - the drawer to pop and have the event recorded against
        Returns:
        false if the cash event was not recorded, this may occur because the cash drawer did not pop or there was an internal error with Clover services
        See Also:
        CashDrawers
      • removeCash

        public boolean removeCash​(long amount,
                                  String note,
                                  CashDrawer cashDrawer)
        Record a miscellaneous "remove cash" event and pops the given cash drawer. Not for payments or refunds.

        This method may perform blocking IO operations depending on the specific cash drawer hardware. It must not be called from the main (UI) thread.

        Parameters:
        amount - amount being removed, must be negative
        note - human readable string explaining why cash was added
        cashDrawer - the drawer to pop and have the event recorded against
        Returns:
        false if the cash event was not recorded, this may occur because the cash drawer did not pop or there was an internal error with Clover services
        See Also:
        CashDrawers