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.