question

Robin Walmsley avatar image
Robin Walmsley asked alexrivas commented

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

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 alexrivas commented

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!

12 comments
10 |2000

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

Robin Walmsley avatar image Robin Walmsley commented ·

Thanks for your help.

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ Robin Walmsley commented ·

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 ·
Robin Walmsley avatar image Robin Walmsley Jacob Abrams ♦♦ commented ·

We have just taken delivery of a Station Pro (dev), and the first thing I did was connect it to our Clover Cash drawer. The cash drawer is working perfectly, with our software (Aptimyz). However we have not changed the APK yet.

In fact all our hardware opens the drawer. That's a Station 1, both dev and live, a Mini 2, a Station Pro and a Station 2018.

Yet .. with our customers, using Station Pro's and the same version of the APK as here, the cash drawer is not opening.

Has there been an upgrade in the SDK that I'm seeing and they are not?

Any ideas?

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community