From de2afa193aab9a7aac09d19781c7b12794132dca Mon Sep 17 00:00:00 2001 From: Mauricio Astudillo Toledo Date: Mon, 19 Aug 2024 13:18:34 -0400 Subject: [PATCH] feat: improve validation in sale command when agent is not connected --- src/pos.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pos.js b/src/pos.js index 499a615..a5c9fbb 100644 --- a/src/pos.js +++ b/src/pos.js @@ -79,7 +79,7 @@ export class TransbankPOSWebSocket extends EventEmitter { let ts = Date.now(); let eventName = method + ".response" + ts; - if (!this.isConnected && this.socket!==null) { + if (!this.isConnected || this.socket == null) { reject("Debe conectarse para poder enviar mensajes: Puede conectarse con POS.connect()") return }