Options
All
  • Public
  • Public/Protected
  • All
Menu

This is the base class that is used when connecting directly to a device via the "Network Pay Display".

A pairing scheme is used when connecting, so the function callbacks for when a pairing code is received, and when the pairing completes must be implemented here.

Hierarchy

  • WebSocketCloverDeviceConfiguration
    • WebSocketPairedCloverDeviceConfiguration

Implements

  • CloverDeviceConfiguration
  • PairingDeviceConfiguration

Index

Constructors

constructor

  • new WebSocketPairedCloverDeviceConfiguration(endpoint: string, applicationId: string, posName: string, serialNumber: string, authToken: string, onPairingCode: function, onPairingSuccess: function, webSocketFactoryFunction: any, imageUtil: IImageUtil, heartbeatInterval?: number, reconnectDelay?: number, heartbeatDisconnectTimeout?: number): WebSocketPairedCloverDeviceConfiguration
  • Parameters

    • endpoint: string

      the endpoint of the Clover device. e.g. wss://192.168.1.15:12345/remote_pay

    • applicationId: string

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

    • posName: string

      Displayed during pairing to display the POS name on the Mini. e.g. MyPOS

    • serialNumber: string

      Displayed during pairing to display the device identifier. e.g. 'Aisle 3' or 'POS-35153234'

    • authToken: string

      The authToken retrieved from a previous pairing activity, passed as an argument to onPairingSuccess. This will be null for the first connection.

    • onPairingCode: function

      Function that will be called when a pairing code is sent. Typically, this would be displayed to the user, and they would enter this code into the device screen.

        • (pairingCode: string): void
        • Parameters

          • pairingCode: string

          Returns void

    • onPairingSuccess: function

      Function that willbe called when the pairing process is complete, a authentication token is sent that be reused.

        • (authToken: string): void
        • Parameters

          • authToken: string

          Returns void

    • webSocketFactoryFunction: any

      the function that will return an instance of the CloverWebSocketInterface that will be used when connecting.

    • imageUtil: IImageUtil

      utility to translate images into base64 strings.

    • Optional heartbeatInterval: number
    • Optional reconnectDelay: number
    • Optional heartbeatDisconnectTimeout: number

    Returns WebSocketPairedCloverDeviceConfiguration

Properties

Private authToken

authToken: string

Protected heartbeatDisconnectTimeout

heartbeatDisconnectTimeout: number = 3000

Protected heartbeatInterval

heartbeatInterval: number = WebSocketCloverDeviceConfiguration.DEFAULT_HEARTBEAT_INTERVAL

Protected imageUtil

imageUtil: IImageUtil

Protected logger

logger: Logger = Logger.create()

maxCharInMessage

maxCharInMessage: number = 50000

Private onPairingCodeHandler

onPairingCodeHandler: function

Type declaration

    • (pairingCode: string): void
    • Parameters

      • pairingCode: string

      Returns void

Private onPairingSuccessHandler

onPairingSuccessHandler: function

Type declaration

    • (authToken: string): void
    • Parameters

      • authToken: string

      Returns void

Private posName

posName: string

protected

protected: number = 4

Protected reconnectDelay

reconnectDelay: number = WebSocketCloverDeviceConfiguration.DEFAULT_RECONNECT_DELAY

Private serialNumber

serialNumber: string

Private uri

uri: string = null

Protected webSocketImplClass

webSocketImplClass: any

Static Protected MINIMUM_ALLOWED_HEARTBEAT_INTERVAL

MINIMUM_ALLOWED_HEARTBEAT_INTERVAL: number = 2500

Methods

getApplicationId

  • getApplicationId(): string

getCloverDeviceType

  • getCloverDeviceType(): any

getCloverTransport

  • getCloverTransport(): CloverTransport

getHeartbeatDisconnectTimeout

  • getHeartbeatDisconnectTimeout(): number

getHeartbeatInterval

  • getHeartbeatInterval(): number

getImageUtil

getMaxMessageCharacters

  • getMaxMessageCharacters(): number

getMessagePackageName

  • getMessagePackageName(): string

getName

  • getName(): string

getReconnectDelay

  • getReconnectDelay(): number

onPairingCode

  • onPairingCode(pairingCode: string): void

onPairingSuccess

  • onPairingSuccess(authToken: string): void

setAuthToken

  • setAuthToken(authToken: string): void

setHeartbeatDisconnectTimeout

  • setHeartbeatDisconnectTimeout(heartbeatDisconnectTimeout: number): void

setHeartbeatInterval

  • setHeartbeatInterval(heartbeatInterval: number): void

setReconnectDelay

  • setReconnectDelay(reconnectDelay: number): void

Generated using TypeDoc