Class CashDrawer


  • @Deprecated
    public class CashDrawer
    extends Object
    Deprecated.
    This class interacts with cash drawers that are connected via configured Clover printers. For a more generalized API for working with cash drawers, please use CashDrawers.
    Class for interacting with connected cash drawers.
    • Method Detail

      • open2

        @Deprecated
        public static boolean open2​(Context context,
                                    Account account)
        Deprecated.
        Open a cash drawer connected to a printer. If more than one printer exists that supports cash drawers, the system will prompt the user to select the printer.
        Parameters:
        context - A context.
        account - A Clover account.
        Returns:
        true if the cash drawer service could be contacted and asked to open the cash drawer. A true return value DOES NOT mean the cash drawer physically opened, only that it was asked to open. There are a variety of factors that can cause the cash drawer to not open, including but not limited to it being locked and it not being connected. If false is returned, the cash drawer did not open. This is not typical but can occur if the service used by this class is being re-installed at call time or is otherwise not available on the device. In this case it is appropriate to inform the user of the error and allow them to re-attempt the operation.
      • open2

        @Deprecated
        public static boolean open2​(Context context,
                                    Account account,
                                    int cashDrawerNumber)
        Deprecated.
        Prefer interacting with cash drawers via CashDrawers
        Open specified cash drawer
        Parameters:
        context - A context.
        account - A Clover account.
        cashDrawerNumber - A cash drawer number, usually applicable to devices which support multiple cash drawers. This value can be '1' for those printers which support only one cash drawer port
        Returns:
        true if the cash drawer service could be contacted and asked to open the cash drawer. A true return value DOES NOT mean the cash drawer physically opened, only that it was asked to open. There are a variety of factors that can cause the cash drawer to not open, including but not limited to it being locked and it not being connected. If false is returned, the cash drawer did not open. This is not typical but can occur if the service used by this class is being re-installed at call time or is otherwise not available on the device. In this case it is appropriate to inform the user of the error and allow them to re-attempt the operation.
      • open2

        @Deprecated
        public static boolean open2​(Context context,
                                    Account account,
                                    boolean openAny)
        Deprecated.
        Prefer interacting with cash drawers via CashDrawers
        Open a cash drawer connected to a printer.
        Parameters:
        context - A context.
        account - A Clover account.
        openAny - If multiple receipt printers are configured and false, the system will prompt the user to select the printer (or cash drawer if applicable). If true, the system will open the cash drawer on the first configured receipt printer (when multiple cash drawers are supported opens the cash drawer numbered '1').
        Returns:
        true if the cash drawer service could be contacted and asked to open the cash drawer. A true return value DOES NOT mean the cash drawer physically opened, only that it was asked to open. There are a variety of factors that can cause the cash drawer to not open, including but not limited to it being locked and it not being connected. If false is returned, the cash drawer did not open. This is not typical but can occur if the service used by this class is being re-installed at call time or is otherwise not available on the device. In this case it is appropriate to inform the user of the error and allow them to re-attempt the operation.
      • open2

        @Deprecated
        public static boolean open2​(Context context,
                                    Account account,
                                    Printer printer)
        Deprecated.
        Prefer interacting with cash drawers via CashDrawers
        Open a cash drawer connected to the designated printer.
        Parameters:
        context - A context.
        account - A Clover account.
        printer - The printer to which the cash drawer is connected.
        Returns:
        true if the cash drawer service could be contacted and asked to open the cash drawer. A true return value DOES NOT mean the cash drawer physically opened, only that it was asked to open. There are a variety of factors that can cause the cash drawer to not open, including but not limited to it being locked and it not being connected. If false is returned, the cash drawer did not open. This is not typical but can occur if the service used by this class is being re-installed at call time or is otherwise not available on the device. In this case it is appropriate to inform the user of the error and allow them to re-attempt the operation.
      • open2

        @Deprecated
        public static boolean open2​(Context context,
                                    Account account,
                                    Printer printer,
                                    int cashDrawerNumber)
        Deprecated.
        Prefer interacting with cash drawers via CashDrawers
        Opens specified cash drawer. In case device does not support multiple cash drawers, supplied cash drawer number is ignored and opens the only supported cash drawer connected to the printer
        Parameters:
        context - A context.
        account - A Clover account.
        printer - The printer to which the cash drawer is connected.
        cashDrawerNumber - A cash drawer number, usually applicable to devices which support multiple cash drawers. This value can be '1' for those printers which support only one cash drawer port
        Returns:
        true if the cash drawer service could be contacted and asked to open the cash drawer. A true return value DOES NOT mean the cash drawer physically opened, only that it was asked to open. There are a variety of factors that can cause the cash drawer to not open, including but not limited to it being locked and it not being connected. If false is returned, the cash drawer did not open. This is not typical but can occur if the service used by this class is being re-installed at call time or is otherwise not available on the device. In this case it is appropriate to inform the user of the error and allow them to re-attempt the operation.