question

01928-7325x2 avatar image
01928-7325x2 asked royveer Suspended commented

Order Not Printed And Need To Restart Printer

What is the reason that the order not printed and only works after restart?

Which is more reliable to get the order printed?

  1. Using fire order REST API (/v3/merchants/{mId}/orders/{orderId}/fire). I couldn't find it anymore in the documentation
  2. Send event to Android App (we found that sometimes the event not delivered)

Or there is a better solution to guarantee all orders printed?

Orders
10 |2000

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

voski avatar image
voski answered

Can you describe your use case for printing the order?

Can you post some sample code for how you are performing option 2: Send event to Android App (we found that sometimes the event not delivered)?

10 |2000

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

01928-7325x2 avatar image
01928-7325x2 answered 01928-7325x2 commented

We have online order application. When user complete an order, we send printer command using two methods:

  1. REST API /v3/merchants/{mId}/orders/{orderId}/fire
  2. Sending event to our Android app following doc (https://docs.clover.com/build/app-notifications/)

You can try on Clover API doc: https://www.clover.com/api_docs#!/not...

The payload we send to our app is { "event": "newonlineorder", "data": "OTHER NECESSARY ORDER INFORMATION"}

The problem is there was no complain before. But these past couple days there are many merchants complaining about order not printed or delayed.

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

voski avatar image voski commented ·

OK great so if you get the notification in your receiver what code do you call to print the order?

Using the v3 endpoint is kind of tricky as you are not able to specify where the order should print

0 Likes 0 ·
01928-7325x2 avatar image 01928-7325x2 commented ·

Once it is received, it will call the Static ReceiptPrintJob SDK API.

Classname: com.clover.sdk.v1.printer.job

Below codes might be custom class we made based on Clover SDK

new StaticReceiptPrintJob.Builder().order(order).build() .print(PrintTestActivity.this, account);

0 Likes 0 ·
Jeffrey Blattman avatar image
Jeffrey Blattman answered 01928-7325x2 commented

Our notification service is not reliable. There's no guarantee when, or if you will receive the notification. If you need to guarantee that the message to print will be received by the device in a timely manner (which it sounds like is the case), you'll need to implement your own or use an existing reliable message delivery service.

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

01928-7325x2 avatar image 01928-7325x2 commented ·

@jeff do you mean for both notification to Android and fire order API are not reliable?

0 Likes 0 ·
voski avatar image voski commented ·

@yauri Both systems are using the same underlying notification system. So any reliability issues with one should be in the other. I would not recommend using the fire order API it is not documented or publicly supported

I would try to add a retry system to the Android notifications you are sending. This would probably require the app to respond back that it has received the notification you are sending.

0 Likes 0 ·
01928-7325x2 avatar image 01928-7325x2 commented ·

@Voski ok I got it, we will add our retry system for the notification. Thanks! :D

0 Likes 0 ·

Welcome to the
Clover Developer Community