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: (pairingCode: string) => void, onPairingSuccess: (authToken: string) => void, 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: (pairingCode: string) => void

      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: (authToken: string) => void

      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

      Frequency at which we will ping the device - millis. Defaults to 5000 (millis), minimum value is 2500 millis. To disable the PING set to -1.

    • 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. Defaults to 3000 (millis).

    Returns WebSocketPairedCloverDeviceConfiguration

Properties

Private authToken

authToken: string

Protected imageUtil

imageUtil: IImageUtil

Protected logger

logger: Logger = Logger.create()

Protected maxCharInMessage

maxCharInMessage: number = 50000

Private onPairingCodeHandler

onPairingCodeHandler: (pairingCode: string) => void

Type declaration

    • (pairingCode: string): void
    • Parameters

      • pairingCode: string

      Returns void

Private onPairingSuccessHandler

onPairingSuccessHandler: (authToken: string) => void

Type declaration

    • (authToken: string): void
    • Parameters

      • authToken: string

      Returns void

Private posName

posName: string

Private serialNumber

serialNumber: string

Private uri

uri: string = null

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

onPairingCode

  • onPairingCode(pairingCode: string): void
  • Parameters

    • pairingCode: string

    Returns void

onPairingSuccess

  • onPairingSuccess(authToken: string): void
  • Parameters

    • authToken: string

    Returns void

setAuthToken

  • setAuthToken(authToken: string): void
  • Parameters

    • authToken: string

    Returns void

setHeartbeatDisconnectTimeout

  • setHeartbeatDisconnectTimeout(heartbeatDisconnectTimeout: number): void

setHeartbeatInterval

  • setHeartbeatInterval(heartbeatInterval: number): void

setReconnectDelay

  • setReconnectDelay(reconnectDelay: number): void

Generated using TypeDoc