question

david09n avatar image
david09n asked lilluunk edited

Text print stops working after upgrading to version 4.0.5 of remote-pay-cloud API

We upgraded remote-pay-cloud api from 3.1.0 to 4.0.5

Most things (sale, refund, batch close...) are working fine. One thing stop working after the upgrade is text print: nothing is printed out the printer.


Question: what change do I need to make to our code for that text print to work on the new version?




Here's our current code (which working fine with 3.1.0):


var lines = ["line 1", "line 2"];
var pr = new sdk.remotepay.PrintRequest();
pr.setText(lines);
cloverConnector.print(pr);



We looked that the messages exchanged on the websocket and can see the following differences:


With the old API version:

-------------------------------------

From client:

id: "5"
method: "PRINT_TEXT"
packageName: "com.clover.remote_protocol_broadcast.app"
payload: "{\"method\":\"PRINT_TEXT\",\"version\":0,\"textLines\":[\"line 1\",\"line 2\"]}"
remoteApplicationID: "our app id..."
remoteSourceSDK: "com.clover.cloverconnector.cloud:3.1.0"
type: "COMMAND"
version: 2


Responses from the device:

attachment: null
attachmentEncoding: null
attachmentUri: null
authentication: null
directed: false
fragmentIndex: null
id: "360"
lastFragment: null
method: "ACK"
packageName: "com.clover.remote_protocol_broadcast.app"
payload: "{\"METHOD_TYPE\":\"ACK\",\"method\":\"ACK\",\"reason\":null,\"rejected\":false,\"sourceMessageId\":\"5\",\"sourceMethod\":\"PRINT_TEXT\"}"
remoteApplicationID: "com.clover.remote_protocol_broadcast.app:1.0-356"
remotePayCompatibilityVersion: 1
remoteSourceSDK: "com.clover.internal.apps"
type: "COMMAND"
version: 2

attachment: null
attachmentEncoding: null
attachmentUri: null
authentication: null
directed: false
fragmentIndex: null
id: "361"
lastFragment: null
method: "PRINT_JOB_STATUS_RESPONSE"
packageName: "com.clover.remote_protocol_broadcast.app"
payload: "{\"status\":\"IN_QUEUE\",\"method\":\"PRINT_JOB_STATUS_RESPONSE\",\"version\":1}"
remoteApplicationID: "com.clover.remote_protocol_broadcast.app:1.0-356"
remotePayCompatibilityVersion: 1
remoteSourceSDK: "com.clover.internal.apps"
type: "COMMAND"
version: 2

... and more responses from the device until printing is done.


With the new API version:

-------------------------------------

From client:

id: "5"
method: "PRINT_TEXT"
packageName: "com.clover.remote_protocol_broadcast.app"
payload: "{\"method\":\"PRINT_TEXT\",\"messageId\":\"5\",\"version\":0,\"textLines\":{\"elements\":[\"line 1\",\"line 2\"]}}"
remoteApplicationID: "our app id..."
remoteSourceSDK: "com.clover.cloverconnector.cloud:4.0.5"
type: "COMMAND"
version: 2

Responses from the device:

attachment: null
attachmentEncoding: null
attachmentUri: null
authentication: null
directed: false
fragmentIndex: null
id: "369"
lastFragment: null
method: "ACK"
packageName: "com.clover.remote_protocol_broadcast.app"
payload: "{\"METHOD_TYPE\":\"ACK\",\"method\":\"ACK\",\"reason\":null,\"rejected\":false,\"sourceMessageId\":\"5\",\"sourceMethod\":\"PRINT_TEXT\"}"
remoteApplicationID: "com.clover.remote_protocol_broadcast.app:1.0-356"
remotePayCompatibilityVersion: 1
remoteSourceSDK: "com.clover.internal.apps"
type: "COMMAND"
version: 2

Above is the only printing message responded from the device, and nothing printed out from the device printer.


semi-integrationsPrintRemote Pay Cloud
10 |2000

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

brohammie avatar image
brohammie answered David Marginian Deactivated edited

We have released 4.0.6 to fix this issue. Thanks again for reporting!

10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

Thank you for reporting this. We will take a look.

10 |2000

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

lilluunk avatar image
lilluunk answered lilluunk edited

Thanks for the enlightening post. I encountered similar information years ago, which turned out to be a lifesaver for me, much like https://www.masterpapers.com/blog/nursing-research-topics a service that has significantly freed up my time and reduced stress. Their team of marketing experts consistently delivers work that achieves the desired outcomes at university.

10 |2000

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