Options
All
  • Public
  • Public/Protected
  • All
Menu

Configuration used to create a connection to a device via the Clover cloud.

Hierarchy

  • WebSocketCloverDeviceConfiguration
    • WebSocketCloudCloverDeviceConfiguration

Implements

  • CloverDeviceConfiguration

Index

Constructors

constructor

  • new WebSocketCloudCloverDeviceConfiguration(applicationId: string, webSocketFactoryFunction: any, imageUtil: IImageUtil, cloverServer: string, accessToken: string, httpSupport: HttpSupport, merchantId: string, deviceId: string, friendlyId: string, forceConnect?: boolean, heartbeatInterval?: number, reconnectDelay?: number, heartbeatDisconnectTimeout?: number): WebSocketCloudCloverDeviceConfiguration
  • Parameters

    • applicationId: string

      the applicationId that uniquely identifies the POS. e.g. com.company.MyPOS:2.3.1 for the first connection

    • webSocketFactoryFunction: any

      the function that will return an instance of the CloverWebSocketInterface that will be used when connecting. For Browser implementations, this can be BrowserWebSocketImpl.createInstance. For NodeJS implementations, this will be defined differently.

    • imageUtil: IImageUtil

      utility to translate images into base64 strings.

    • cloverServer: string

      the base url for the clover server used in the cloud connection. EX: https://www.clover.com, http://localhost:9000

    • accessToken: string

      the OAuth access token that will be used when contacting the clover server

    • httpSupport: HttpSupport

      the helper object used when making http requests.

    • merchantId: string

      the merchant the device belongs to.

    • deviceId: string

      the id (not uuid) of the device to connect to

    • friendlyId: string

      an identifier for the specific terminal connected to this device. This id is used in debugging and may be sent to other clients if they attempt to connect to the same device. It will also be sent to other clients that are currently connected if this device does a forceConnect.

    • Default value forceConnect: boolean = false

      if true, overtake any existing connection.

    • Optional heartbeatInterval: number

      Frequency at which we will ping the device - millis. Defaults to -1, which means the heartbeat check is disabled.

    • Optional reconnectDelay: number

      upon disconnect, duration to wait until a reconnect is attempted - millis. Defaults to 3000 (millis), minimum value is 3000 millis. To disable the reconnect set to -1.

    • Optional heartbeatDisconnectTimeout: number

      If a response to a heartbeat ping is not received within this time we will call disconnect.

    Returns WebSocketCloudCloverDeviceConfiguration

Properties

Private accessToken

accessToken: string

Private cloverServer

cloverServer: string

Private deviceId

deviceId: string

Private forceConnect

forceConnect: boolean

Private friendlyId

friendlyId: string

Private httpSupport

httpSupport: HttpSupport

Protected imageUtil

imageUtil: IImageUtil

Protected logger

logger: Logger = Logger.create()

Protected maxCharInMessage

maxCharInMessage: number = 50000

Private merchantId

merchantId: string

Protected webSocketImplClass

webSocketImplClass: any

Methods

getApplicationId

  • getApplicationId(): string

getCloverDeviceType

  • getCloverDeviceType(): any

getCloverTransport

  • getCloverTransport(): CloverTransport
  • Returns CloverTransport

getHeartbeatDisconnectTimeout

  • getHeartbeatDisconnectTimeout(): number

getHeartbeatInterval

  • getHeartbeatInterval(): number

getImageUtil

getMaxMessageCharacters

  • getMaxMessageCharacters(): number

getMessagePackageName

  • getMessagePackageName(): string
  • Returns string

getName

  • getName(): string
  • Returns string

getReconnectDelay

  • getReconnectDelay(): number

setHeartbeatDisconnectTimeout

  • setHeartbeatDisconnectTimeout(heartbeatDisconnectTimeout: number): void

setHeartbeatInterval

  • setHeartbeatInterval(heartbeatInterval: number): void

setReconnectDelay

  • setReconnectDelay(reconnectDelay: number): void

Generated using TypeDoc