Hi !
I am trying to convert the Nodejs Example ExampleCLI.js to server side code.TI am using the same configuration.
But in my Program
the WebSocketCloudCloverDeviceConfiguration having webSocketImplClass: [Function (anonymous)]
but the ExampleCLI.js giving webSocketImplClass: [Function: get]
for both of them the config parameters for
and
{
remoteApplicationId: 'appid'
webSocketLibrary: 'nodejs-websocket',
connectorType: 'Cloud',
cloverServer: 'https://sandbox.dev.clover.com/',
merchantId: 'mid',
deviceId: 'did',
accessToken: 'at',
friendlyId: 'Register_1',
action: 'Sale'
}
but for my server side code its not working.I am getting
error TypeError: Cannot read property 'postData' of undefined
at WebSocketCloudCloverTransport.obtainWebSocketUrlAndSendPushAlert (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\transport\websocket\WebSocketCloudCloverTransport.js:102:26)
at WebSocketCloudCloverTransport.initialize (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\transport\websocket\WebSocketCloudCloverTransport.js:79:22)
at new WebSocketCloudCloverTransport (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\transport\websocket\WebSocketCloudCloverTransport.js:53:15)
at WebSocketCloudCloverDeviceConfiguration.getCloverTransport (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\device\WebSocketCloudCloverDeviceConfiguration.js:74:25)
at WebsocketCloudCloverDevice.DefaultCloverDevice [as constructor] (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\device\DefaultCloverDevice.js:34:92)
at new WebsocketCloudCloverDevice (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\device\WebsocketCloudCloverDevice.js:25:23)
at Function.CloverDeviceFactory.get (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\device\CloverDeviceFactory.js:24:28)
at CloverConnector.initialize (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\CloverConnector.js:44:65)
at CloverConnector.initializeConnection (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\CloverConnector.js:51:18)
at C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\lib\CloverCloudPAyAPI.js:68:29
Trace
at Logger.toConsole (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\util\Logger.js:46:29)
at Logger.emit (events.js:376:20)
at Function.CloverDeviceFactory.get (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\device\CloverDeviceFactory.js:27:38)
at CloverConnector.initialize (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\CloverConnector.js:44:65)
at CloverConnector.initializeConnection (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\remote-pay-cloud\dist\com\clover\remote\client\CloverConnector.js:51:18)
at C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\lib\CloverCloudPAyAPI.js:68:29
at Layer.handle [as handle_request] (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\express\lib\router\layer.js:95:5)
at next (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\LocalRep\Clover\remote-pay-cloud-nodejs-example\node_modules\express\lib\router\layer.js:95:5)
error.
I would appreciate any help on this.
here I found the below lines
For Browser implementations, this can be BrowserWebSocketImpl.createInstance. For NodeJS implementations, this will be defined differently.
May I know how to define differently for nodejs?
Thanks
Ambika