question

ahmed2403 avatar image
ahmed2403 asked ·

Closing connection from pay and display app

What is the best way to make our POS software disconnect from the Clover Mini USB pay and display app? Should we be using the Dipose() method? As we have used this when our application is closed, but the USB pay and display app still seems to be showing fine on the Clover Mini screen.

This sometimes causes issues as if there is a sale request from before, and it hasn't been closed properly (e.g. customer didn't proceed with the sale) then when the pos software loads back up it is still using the connection from before and sale from before as well which confuses the listener events.

Clover Mini
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.

ahmed2403 avatar image
ahmed2403 answered ·

Yes we are only disposing when our POS application is being closed/shutdown, so I guess all is fine there.

The only confusing part is our POS is making sale requests fine, but when it comes to refund request then OnRefundPaymentResponse listner gives "Device Connection Error" message even though connection hasn't been disposed? Then after the refund request attempt fails, if we immediately do a sale request it works?

Any ideas what could be causing this?

13 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.

Implement onDeviceDisconnected in ICloverConnector listener and see if the connection is getting dropped.

0 Likes 0 · ·
ahmed2403 avatar image ahmed2403 David Marginian ♦♦ ·

Done that, connection isn't being dropped, however I do see some things missing with the ICloverConnector as per image attached if this helps?

Although, even with these errors a sale request still executes fine...

0 Likes 0 · ·
clover2.png (92.8 KiB)

Looking through the SDK that error should only happen if the device is null (you didn't initialize or disposed of the connector) or the device isn't ready - if you aren't seeing OnDeviceDisconnected get called I am not sure how that is happening. You can put some breakpoints in CloverConnector.cs and find out pretty quickly.

0 Likes 0 · ·
Show more comments
David Marginian avatar image
David Marginian answered ·

You should be connecting to and maintaining a connection to the device and only using dispose when your POS is shutdown.

It sounds like you need to read through and implement our best practices - https://docs.clover.com/clover-platform/docs/remote-pay-sdk-best-practices.

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Welcome to the
Clover Developer Community