question

Robin Walmsley avatar image
Robin Walmsley asked ·

Opening CashDrawer with 3rd party app on Station / Mini 2 and Station Pro

Our app is a POS which has the ability to take cash payments without using the Clover Payments app. The app is installed with many customers using Station 1 hardware.

Recently we have acquired new customers who have the new Station Pro, and we're being told the cash drawer will not open any more, unless with a key or by using the Clover Payments App and selecting Cash. Whilst this isn't a major disaster for our clients it is confusing as we have a Pay by Cash button on our POS which does not open the cash drawer for them.

Am I correct that the following command does not work on a Station Pro to open the drawer?

com.clover.sdk.v1.printer.CashDrawer.open(activity, mAccount, new Printer.Builder().type(new Type("SEIKO_USB")).category(Category.RECEIPT).build())

does this now have to be replaced with

com.clover.sdk.v1.printer.CashDrawer.open2(activity, mAccount, true);

If so, does the second option work with ALL Clover hardware, so would we be able to replace the first command, or do we need to have an if / case statement to decide which command to use based on the hardware installed?

Additionally, if my assumption above is correct, it is my understanding that the Mini 2 has the same hardware/code (brains) as the Station Pro, and yet the Mini 2 I have here DOES open the Clover cash drawer. In fact the only hardware our client's have that does not support the first command, is the new Station Pro.

Thanks

Robin Walmsley


PaymentConnector
10 |2000 characters needed characters left characters exceeded

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

1 Answer

Jacob Abrams avatar image
Jacob Abrams answered ·

There are currently two cash drawer APIs in clover-android-sdk: com.clover.sdk.v1.printer.CashDrawer (older) and com.clover.sdk.cashdrawer.CashDrawers (newer).

The older API is tied to printers and already partially deprecated. The newer API has removed printer relationship but as of today (Sept 15, 2020) the newer API has behaviour hardcoded by the Clover device model, so it does not dynamically support new devices and is currently broken on Station Pro, so please do not use it yet! The newer API is about to receive an update in the clover-android-sdk which will hopefully be released this month that will make it work on all devices and it has a more complete and clear API, so watch github.com/clover/clover-android-sdk for a coming update.

If you want a solution ASAP the older API will continue working for the foreseeable future despite being deprecated, just make sure you do not specify a printer type or category and prefer to set the openAny parameter to true, thus you should use this method:

com.clover.sdk.v1.printer.CashDrawer.open2(Context context, Account account, boolean openAny)

Please ignore the return value from open2, it always returns false!

2 comments Share
10 |2000 characters needed characters left characters exceeded

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

Thanks for your help.

0 Likes 0 · ·

Welcome. The clover-android-sdk was updated yesterday, the newer cashdrawer SDK com.clover.sdk.cashdrawer.CashDrawers now works with Station Pro (and future devices).

0 Likes 0 · ·

Welcome to the
Clover Developer Community