Package com.clover.sdk.v3.cash
Class CashEvents
- java.lang.Object
-
- com.clover.sdk.v3.cash.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 theCashContract
.- See Also:
CashDrawers
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARG_ACCOUNT
Extra type:Account
.static String
ARG_CASH_EVENT
Extra type:CashEvent
.static String
ARG_SUCCESS
For internal use only.static String
EXTRA_CASH_DRAWER_IDENTIFIER
Extra type: String.static String
EXTRA_CASH_DRAWER_NUMBER
Extra type: Integer.static String
METHOD_ADD_ENTRY
For internal use only.
-
Constructor Summary
Constructors Constructor Description CashEvents(Context context, Account account)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addCash(long amount, String note)
Record a miscellaneous "add cash" event and pops one cash drawer.boolean
addCash(long amount, String note, CashDrawer cashDrawer)
Record a miscellaneous "add cash" event and pops the given cash drawer.boolean
removeCash(long amount, String note)
Record a miscellaneous "remove cash" event and pops one cash drawer.boolean
removeCash(long amount, String note, CashDrawer cashDrawer)
Record a miscellaneous "remove cash" event and pops the given cash drawer.
-
-
-
Field Detail
-
METHOD_ADD_ENTRY
public static final String METHOD_ADD_ENTRY
For internal use only.- See Also:
- Constant Field Values
-
ARG_ACCOUNT
public static final String ARG_ACCOUNT
Extra type:Account
. This is not an arg, actually an extra. For internal use only.- See Also:
- Constant Field Values
-
ARG_CASH_EVENT
public static final String ARG_CASH_EVENT
Extra type:CashEvent
. This is not an arg, actually an extra. For internal use only.- See Also:
- Constant Field Values
-
EXTRA_CASH_DRAWER_IDENTIFIER
public static final String EXTRA_CASH_DRAWER_IDENTIFIER
Extra type: String. For internal use only.- See Also:
CashDrawer.getIdentifier()
, Constant Field Values
-
EXTRA_CASH_DRAWER_NUMBER
public static final String EXTRA_CASH_DRAWER_NUMBER
Extra type: Integer. For internal use only.
-
ARG_SUCCESS
public static final String ARG_SUCCESS
For internal use only.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CashEvents
public CashEvents(Context context, Account account)
Constructor.- Parameters:
context
-account
- Obtain account withCloverAccount.getAccount(Context)
-
-
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 positivenote
- 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 negativenote
- 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 positivenote
- human readable string explaining why cash was addedcashDrawer
- 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 negativenote
- human readable string explaining why cash was addedcashDrawer
- 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
-
-