Options
All
  • Public
  • Public/Protected
  • All
Menu

This connector uses Browser specific objects to work in a manner compatible with the 1.1.0 implementation of the ICloverConnector.

It uses the domain && clientId to get the oauthtoken, then gets the merchantId, and the deviceId. This process may involve redirection of the page, and XHR requests, all of which are performed using default Browser objects.

Once these values have been obtained, a new WebSocketCloudCloverDeviceConfiguration is generated using the default Browser WebSocket implementation, and the connector is initialized.

Hierarchy

  • CloverConnector
    • LegacyCloverConnector

Implements

  • ICloverConnector

Index

Constructors

constructor

Properties

broadcaster

broadcaster: CloverConnectorBroadcaster = new CloverConnectorBroadcaster()

device

device: CloverDevice

Private httpSupport

httpSupport: HttpSupport

Private imageUtil

imageUtil: IImageUtil

isReady

isReady: boolean = false

legacyConfiguration

legacyConfiguration: any

Protected logger

logger: Logger = Logger.create()

merchantInfo

merchantInfo: MerchantInfo

Private urlParamsInfo

urlParamsInfo: object = null

Type declaration

  • [key: string]: string

Static CANCEL_INPUT_OPTION

CANCEL_INPUT_OPTION: InputOption

Static MAX_PAYLOAD_SIZE

MAX_PAYLOAD_SIZE: number = 10000000

Static URL_MERCHANT_ID_KEY

URL_MERCHANT_ID_KEY: string = "merchant_id"

Static _accessTokenKey

_accessTokenKey: string = "access_token"

Static accessTokenKey

accessTokenKey: string = '#' + LegacyCloverConnector._accessTokenKey

Methods

acceptPayment

  • acceptPayment(payment: Payment): void

acceptSignature

  • acceptSignature(request: VerifySignatureRequest): void

addCloverConnectorListener

  • addCloverConnectorListener(connectorListener: ICloverConnectorListener): void
  • Add new listener to receive broadcast notifications

    Parameters

    • connectorListener: ICloverConnectorListener

      the listener to add

    Returns void

auth

  • auth(request: AuthRequest): void

capturePreAuth

  • capturePreAuth(request: CapturePreAuthRequest): void

closeout

  • closeout(request: CloseoutRequest): void

discountAddedToDisplayOrder

  • discountAddedToDisplayOrder(discount: DisplayDiscount, order: DisplayOrder): void

discountRemovedFromDisplayOrder

  • discountRemovedFromDisplayOrder(discount: DisplayDiscount, order: DisplayOrder): void
  • Parameters

    • discount: DisplayDiscount
    • order: DisplayOrder

    Returns void

displayReceiptOptions

  • displayReceiptOptions(displayReceiptOptionsRequest: DisplayReceiptOptionsRequest): void
  • Parameters

    • displayReceiptOptionsRequest: DisplayReceiptOptionsRequest

    Returns void

dispose

  • dispose(): void

Protected generateNewConfigurationAndInitialize

  • generateNewConfigurationAndInitialize(rawConfiguration: any): void
  • Generates a WebSocketCloudCloverDeviceConfiguration with a "raw" configuration

    Parameters

    • rawConfiguration: any

      a Json object that has values that can be used to construct the object configuration.

    Returns void

Private getAccessToken

  • getAccessToken(configuration: any): string

Private getDeviceId

  • getDeviceId(configuration: any): void
  • Gets the deviceId, calling the webservice to get the device list if necessary. If the deviceId is not set, and the deviceSerialId is not set, then this will call notify of an error. If the deviceId is not set, and the deviceSerialId is set then the call to get the devices is made the result is used to build a mapping that is passed to handleDeviceResult.

    Parameters

    • configuration: any

      the raw configuration object

    Returns void

Private getMerchantId

  • getMerchantId(configuration: any): string

Protected handleDeviceResult

  • handleDeviceResult(devices: any, configuration: any): void
  • Uses the mapping of devices to find the correct deviceId to use in the configuration. This then moves on to generateNewConfigurationAndInitialize.

    Parameters

    • devices: any
    • configuration: any

    Returns void

initialize

  • initialize(config: CloverDeviceConfiguration): void
  • Initialize the connector with a new config

    Parameters

    • config: CloverDeviceConfiguration

      the configuration for the connector

    Returns void

initializeConnection

  • initializeConnection(): void

Protected initializeLegacyConnection

  • initializeLegacyConnection(configuration: any): void
  • Checks for a oauth token, does a redirect based on the configuration domain and clientid if necessary, then moves on to #onceWeHaveTheAccessToken(...)

    Parameters

    • configuration: any

      the raw configuration object

    Returns void

invokeInputOption

  • invokeInputOption(io: InputOption): void

lineItemAddedToDisplayOrder

  • lineItemAddedToDisplayOrder(lineItem: DisplayLineItem, order: DisplayOrder): void

lineItemRemovedFromDisplayOrder

  • lineItemRemovedFromDisplayOrder(lineItem: DisplayLineItem, order: DisplayOrder): void
  • Parameters

    • lineItem: DisplayLineItem
    • order: DisplayOrder

    Returns void

manualRefund

  • manualRefund(request: ManualRefundRequest): void

notifyDeviceError

  • notifyDeviceError(errorType: ErrorType, errorCode: DeviceErrorEventCode, cause: PlatformError, message: string): void
  • Parameters

    • errorType: ErrorType
    • errorCode: DeviceErrorEventCode
    • cause: PlatformError
    • message: string

    Returns void

notifyDeviceNotConnected

  • notifyDeviceNotConnected(message: string): void

notifyInvalidData

  • notifyInvalidData(message: string): void

Private onceWeHaveTheAccessToken

  • onceWeHaveTheAccessToken(configuration: any): void

openCashDrawer

  • openCashDrawer(request: OpenCashDrawerRequest | string): void

Private parseStuff

  • parseStuff(params: string[]): void

Private parseURL

  • parseURL(windowLocationObject: Location): void

Private parseWindowURL

  • parseWindowURL(): void

preAuth

  • preAuth(request: PreAuthRequest): void

print

  • print(request: PrintRequest): void

readCardData

  • readCardData(request: ReadCardDataRequest): void

refundPayment

  • refundPayment(request: RefundPaymentRequest): void

registerForCustomerProvidedData

  • registerForCustomerProvidedData(request: RegisterForCustomerProvidedDataRequest): void
  • Parameters

    • request: RegisterForCustomerProvidedDataRequest

    Returns void

rejectPayment

  • rejectPayment(payment: Payment, challenge: Challenge): void

rejectSignature

  • rejectSignature(request: VerifySignatureRequest): void

removeCloverConnectorListener

  • removeCloverConnectorListener(connectorListener: ICloverConnectorListener): void
  • Remove a listener

    Parameters

    • connectorListener: ICloverConnectorListener

      the listener to remove

    Returns void

removeDisplayOrder

  • removeDisplayOrder(order: DisplayOrder): void

resetDevice

  • resetDevice(): void

retrieveDeviceStatus

  • retrieveDeviceStatus(request: RetrieveDeviceStatusRequest): void

retrievePayment

  • retrievePayment(request: RetrievePaymentRequest): void

retrievePendingPayments

  • retrievePendingPayments(): void

retrievePrintJobStatus

  • retrievePrintJobStatus(request: PrintJobStatusRequest): void

retrievePrinters

  • retrievePrinters(request: RetrievePrintersRequest): void

sale

  • sale(request: SaleRequest): void

sendDebugLog

  • sendDebugLog(message: string): void

sendMessageToActivity

  • sendMessageToActivity(request: MessageToActivity): void

setCustomerInfo

  • setCustomerInfo(request: SetCustomerInfoRequest): void

setupSaleRequest

  • setupSaleRequest(request: SaleRequest): void

showDisplayOrder

  • showDisplayOrder(order: DisplayOrder): void

showMessage

  • showMessage(message: string): void

showThankYouScreen

  • showThankYouScreen(): void

showWelcomeScreen

  • showWelcomeScreen(): void

startCustomActivity

  • startCustomActivity(request: CustomActivityRequest): void

tipAdjustAuth

  • tipAdjustAuth(request: TipAdjustAuthRequest): void

validatePrintRequest

  • validatePrintRequest(request: PrintRequest): boolean

vaultCard

  • vaultCard(cardEntryMethods: number): void

voidPayment

  • voidPayment(request: VoidPaymentRequest): void

voidPaymentRefund

  • voidPaymentRefund(request: VoidPaymentRefundRequest): void

Static Protected buildMapOfSerialToDevice

  • buildMapOfSerialToDevice(devicesVX: any): any
  • Builds a mapping of the passed set of devices, from the device serial number to the device.

    Parameters

    • devicesVX: any

    Returns any

    the mapping from the device serial number to the device

Static populateBaseResponse

  • populateBaseResponse(response: BaseResponse, success: boolean, responseCode: ResponseCode, reason?: string, message?: string): void
  • Parameters

    • response: BaseResponse
    • success: boolean
    • responseCode: ResponseCode
    • Optional reason: string
    • Optional message: string

    Returns void

Static populatePaymentResponse

  • populatePaymentResponse(response: PaymentResponse, success: boolean, responseCode: ResponseCode, payment: Payment, signature?: Signature, reason?: string, message?: string): void
  • Parameters

    • response: PaymentResponse
    • success: boolean
    • responseCode: ResponseCode
    • payment: Payment
    • Optional signature: Signature
    • Optional reason: string
    • Optional message: string

    Returns void

Static Private redirect

  • redirect(configuration: any): void

Static setResponseFlags

  • setResponseFlags(response: any, payment: Payment): void

Generated using TypeDoc