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

  • Parameters

    • legacyConfiguration: any

    Returns LegacyCloverConnector

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: {} = 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
  • Parameters

    • request: AuthRequest

    Returns void

capturePreAuth

  • capturePreAuth(request: CapturePreAuthRequest): void

checkBalance

  • checkBalance(request: CheckBalanceRequest): void

closeout

  • closeout(request: CloseoutRequest): void

discountAddedToDisplayOrder

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

discountRemovedFromDisplayOrder

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

displayReceiptOptions

  • displayReceiptOptions(displayReceiptOptionsRequest: DisplayReceiptOptionsRequest): 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
  • Get the access token, either from the configuration or from the window URL, or redirect.

    Parameters

    • configuration: any

    Returns 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
  • Get the merchantId or redirect.

    Parameters

    • configuration: any

    Returns 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

incrementPreAuth

  • incrementPreAuth(request: IncrementPreAuthRequest): 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
  • Returns 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

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
  • Gets the merchantId, redirecting if necessary, then moves on to #getDeviceId(...)

    Parameters

    • configuration: any

      the raw configuration object

    Returns void

openCashDrawer

  • openCashDrawer(request: OpenCashDrawerRequest | string): void

Private parseStuff

  • parseStuff(params: string[]): void
  • Parameters

    • params: string[]

    Returns void

Private parseURL

  • parseURL(windowLocationObject: Location): void
  • Parameters

    • windowLocationObject: Location

    Returns void

Private parseWindowURL

  • parseWindowURL(): void
  • Returns void

preAuth

  • preAuth(request: PreAuthRequest): void
  • Parameters

    • request: PreAuthRequest

    Returns void

print

  • print(request: PrintRequest): void
  • Parameters

    • request: PrintRequest

    Returns void

readCardData

  • readCardData(request: ReadCardDataRequest): void

refundPayment

  • refundPayment(request: RefundPaymentRequest): void

registerForCustomerProvidedData

  • registerForCustomerProvidedData(request: RegisterForCustomerProvidedDataRequest): void

rejectPayment

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

rejectSignature

  • rejectSignature(request: VerifySignatureRequest): void

removeCloverConnectorListener

  • removeCloverConnectorListener(connectorListener: ICloverConnectorListener): void

removeDisplayOrder

  • removeDisplayOrder(order: DisplayOrder): void

requestSignature

  • requestSignature(request: SignatureRequest): void

requestTip

  • requestTip(request: TipRequest): 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
  • Parameters

    • request: SaleRequest

    Returns 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
  • Parameters

    • configuration: any

    Returns void

Static setResponseFlags

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

Generated using TypeDoc