Class CloverConnector

java.lang.Object
com.clover.remote.client.CloverConnector
All Implemented Interfaces:
ICloverConnector, Serializable

public class CloverConnector extends Object implements ICloverConnector
Provides the default implementation of the ICloverConnector interface, connecting to the device specified in the constructor. This implementation supports the registration of one or more ICloverConnectorListener interfaces that are notified asynchronously of events and responses from the underlying connected Clover device.
See Also:
  • Field Details

    • CARD_ENTRY_METHOD_MAG_STRIPE

      public static final int CARD_ENTRY_METHOD_MAG_STRIPE
      See Also:
    • CARD_ENTRY_METHOD_ICC_CONTACT

      public static final int CARD_ENTRY_METHOD_ICC_CONTACT
      See Also:
    • CARD_ENTRY_METHOD_NFC_CONTACTLESS

      public static final int CARD_ENTRY_METHOD_NFC_CONTACTLESS
      See Also:
    • CARD_ENTRY_METHOD_MANUAL

      public static final int CARD_ENTRY_METHOD_MANUAL
      See Also:
    • MAX_PAYLOAD_SIZE

      public static final int MAX_PAYLOAD_SIZE
      See Also:
    • CANCEL_INPUT_OPTION

      public static final com.clover.remote.InputOption CANCEL_INPUT_OPTION
  • Constructor Details

    • CloverConnector

      public CloverConnector(CloverDeviceConfiguration config)
      CloverConnector constructor
      Parameters:
      config - A CloverDeviceConfiguration object containing the configuration for the device
  • Method Details

    • addCloverConnectorListener

      public void addCloverConnectorListener(ICloverConnectorListener connectorListener)
      Registers the provided listener to receive callbacks and events from the underlying device connection. Note that listeners MUST be registered prior to calling initializeConnection() to guarantee notification of all connection related callbacks.
      Specified by:
      addCloverConnectorListener in interface ICloverConnector
      Parameters:
      connectorListener - The listener to register
    • removeCloverConnectorListener

      public void removeCloverConnectorListener(ICloverConnectorListener connectorListener)
      Remove a previously added listener. If the provided listener is not registered, this call has no effect.
      Specified by:
      removeCloverConnectorListener in interface ICloverConnector
      Parameters:
      connectorListener - The listener to remove
    • initializeConnection

      public void initializeConnection()
      Description copied from interface: ICloverConnector
      Initialize the CloverConnector's connection and start communication with the device. Must be called before calling any other method other than to add or remove listeners
      Specified by:
      initializeConnection in interface ICloverConnector
    • sale

      public void sale(SaleRequest request)
      Description copied from interface: ICloverConnector
      Sale method, aka "purchase"
      Specified by:
      sale in interface ICloverConnector
      Parameters:
      request - A SaleRequest object containing basic information needed for the transaction
    • acceptSignature

      public void acceptSignature(VerifySignatureRequest request)
      Description copied from interface: ICloverConnector
      If signature is captured during a Sale, this method accepts the signature as entered
      Specified by:
      acceptSignature in interface ICloverConnector
      Parameters:
      request - Accepted request
    • rejectSignature

      public void rejectSignature(VerifySignatureRequest request)
      Description copied from interface: ICloverConnector
      If signature is captured during a Sale, this method rejects the signature as entered
      Specified by:
      rejectSignature in interface ICloverConnector
      Parameters:
      request - Rejected request
    • acceptPayment

      public void acceptPayment(com.clover.sdk.v3.payments.Payment payment)
      Description copied from interface: ICloverConnector
      If payment confirmation is required during a Sale, this method accepts the payment
      Specified by:
      acceptPayment in interface ICloverConnector
      Parameters:
      payment - Payment to accept
    • rejectPayment

      public void rejectPayment(com.clover.sdk.v3.payments.Payment payment, com.clover.remote.Challenge challenge)
      Description copied from interface: ICloverConnector
      If payment confirmation is required during a Sale, this method rejects the payment
      Specified by:
      rejectPayment in interface ICloverConnector
      Parameters:
      payment - Payment to reject
      challenge - The challenge which resulted in payment rejection
    • auth

      public void auth(AuthRequest request)
      Description copied from interface: ICloverConnector
      Auth method to obtain an Auth payment that can be used as the payment to call tipAdjust
      Specified by:
      auth in interface ICloverConnector
      Parameters:
      request - The request details
    • preAuth

      public void preAuth(PreAuthRequest request)
      Description copied from interface: ICloverConnector
      PreAuth method to obtain a Pre-Auth for a card
      Specified by:
      preAuth in interface ICloverConnector
      Parameters:
      request - The request details
    • capturePreAuth

      public void capturePreAuth(CapturePreAuthRequest request)
      Description copied from interface: ICloverConnector
      Capture a previous Auth. Note: Should only be called if request's PaymentID is from an AuthResponse
      Specified by:
      capturePreAuth in interface ICloverConnector
      Parameters:
      request - The request details
    • incrementPreAuth

      public void incrementPreAuth(IncrementPreauthRequest request)
      Description copied from interface: ICloverConnector
      Request to increase the amount of an existing pre-auth
      Specified by:
      incrementPreAuth in interface ICloverConnector
      Parameters:
      request - The request details
    • tipAdjustAuth

      public void tipAdjustAuth(TipAdjustAuthRequest request)
      Description copied from interface: ICloverConnector
      Adjust the tip for a previous Auth. Note: Should only be called if request's PaymentID is from an AuthResponse
      Specified by:
      tipAdjustAuth in interface ICloverConnector
      Parameters:
      request - The request details
    • vaultCard

      public void vaultCard(Integer cardEntryMethods)
      Description copied from interface: ICloverConnector
      Vault card information. Requests the mini capture card information and request a payment token from the payment gateway. The value returned in the response is a card, with all the information necessary to use for payment in a SaleRequest or AuthRequest
      Specified by:
      vaultCard in interface ICloverConnector
      Parameters:
      cardEntryMethods - The card entry methods allowed to capture the payment token. null will provide default values
    • voidPayment

      public void voidPayment(VoidPaymentRequest request)
      Description copied from interface: ICloverConnector
      Void a transaction, given a previously used order ID and/or payment ID
      Specified by:
      voidPayment in interface ICloverConnector
      Parameters:
      request - The request details
    • refundPayment

      public void refundPayment(RefundPaymentRequest request)
      Description copied from interface: ICloverConnector
      Refund a specific payment
      Specified by:
      refundPayment in interface ICloverConnector
      Parameters:
      request - The request details
    • voidPaymentRefund

      public void voidPaymentRefund(VoidPaymentRefundRequest request)
      Description copied from interface: ICloverConnector
      Refund a specific payment
      Specified by:
      voidPaymentRefund in interface ICloverConnector
      Parameters:
      request - The request details
    • manualRefund

      public void manualRefund(ManualRefundRequest request)
      Description copied from interface: ICloverConnector
      Manual refund method, aka "naked credit"
      Specified by:
      manualRefund in interface ICloverConnector
      Parameters:
      request - The request details
    • retrievePendingPayments

      public void retrievePendingPayments()
      Description copied from interface: ICloverConnector
      Used to request a list of pending payments that have been taken offline, but haven't processed yet. Will trigger an onRetrievePendingPaymentsResponse callback.
      Specified by:
      retrievePendingPayments in interface ICloverConnector
    • readCardData

      public void readCardData(ReadCardDataRequest request)
      Description copied from interface: ICloverConnector
      Used to request card information. Specifically track1 and track2 information
      Specified by:
      readCardData in interface ICloverConnector
      Parameters:
      request - The request details
    • sendMessageToActivity

      public void sendMessageToActivity(MessageToActivity request)
      Description copied from interface: ICloverConnector
      Send a message to a running custom activity on the Clover device
      Specified by:
      sendMessageToActivity in interface ICloverConnector
      Parameters:
      request - The request details
    • closeout

      public void closeout(CloseoutRequest request)
      Description copied from interface: ICloverConnector
      Request a closeout of all orders.
      Specified by:
      closeout in interface ICloverConnector
      Parameters:
      request - The request details
    • print

      public void print(PrintRequest request)
      Description copied from interface: ICloverConnector
      Request to print.
      Specified by:
      print in interface ICloverConnector
      Parameters:
      request - The request details: info and content needed to print
    • retrievePrinters

      public void retrievePrinters(RetrievePrintersRequest request)
      Description copied from interface: ICloverConnector
      Request to retrieve available printers.
      Specified by:
      retrievePrinters in interface ICloverConnector
      Parameters:
      request - object that contains additional information to be applied during the request
    • retrievePrintJobStatus

      public void retrievePrintJobStatus(PrintJobStatusRequest request)
      Description copied from interface: ICloverConnector
      Request the status of a given print job
      Specified by:
      retrievePrintJobStatus in interface ICloverConnector
      Parameters:
      request - object defining the print job to be queried
    • openCashDrawer

      public void openCashDrawer(OpenCashDrawerRequest request)
      Description copied from interface: ICloverConnector
      Request that the cash drawer connected to the device be opened.
      Specified by:
      openCashDrawer in interface ICloverConnector
      Parameters:
      request - object defining the reason the cash drawer is being opened, and an optional device identifier
    • showMessage

      public void showMessage(String message)
      Description copied from interface: ICloverConnector
      Show a message on the Clover Mini screen
      Specified by:
      showMessage in interface ICloverConnector
      Parameters:
      message - The message to display
    • sendDebugLog

      public void sendDebugLog(String message)
      Description copied from interface: ICloverConnector
      Sends request to the clover device to send the log to the clover server
      Specified by:
      sendDebugLog in interface ICloverConnector
      Parameters:
      message - The message to display
    • showWelcomeScreen

      public void showWelcomeScreen()
      Description copied from interface: ICloverConnector
      Return the device to the Welcome Screen
      Specified by:
      showWelcomeScreen in interface ICloverConnector
    • showThankYouScreen

      public void showThankYouScreen()
      Description copied from interface: ICloverConnector
      Show the thank you screen on the device
      Specified by:
      showThankYouScreen in interface ICloverConnector
    • displayPaymentReceiptOptions

      @Deprecated public void displayPaymentReceiptOptions(DisplayReceiptOptionsRequest request)
      Deprecated.
      Display the payment receipt screen for the orderId/paymentId combination in the DisplayReceiptOptionsRequest object.
      Specified by:
      displayPaymentReceiptOptions in interface ICloverConnector
      Parameters:
      request - The request details
    • displayReceiptOptions

      public void displayReceiptOptions(DisplayReceiptOptionsRequest request)
      Description copied from interface: ICloverConnector
      Display receipt options for a Credit, Refund, or Payment
      Specified by:
      displayReceiptOptions in interface ICloverConnector
      Parameters:
      request - The request details
    • showDisplayOrder

      public void showDisplayOrder(com.clover.remote.order.DisplayOrder order)
      Description copied from interface: ICloverConnector
      Show the DisplayOrder on the device. Replaces the existing DisplayOrder on the device.
      Specified by:
      showDisplayOrder in interface ICloverConnector
      Parameters:
      order - The order to display
    • removeDisplayOrder

      public void removeDisplayOrder(com.clover.remote.order.DisplayOrder order)
      Description copied from interface: ICloverConnector
      Remove the DisplayOrder from the device.
      Specified by:
      removeDisplayOrder in interface ICloverConnector
      Parameters:
      order - The order to remove
    • dispose

      public void dispose()
      Description copied from interface: ICloverConnector
      Will dispose of the underlying connection to the device
      Specified by:
      dispose in interface ICloverConnector
    • invokeInputOption

      public void invokeInputOption(com.clover.remote.InputOption io)
      Description copied from interface: ICloverConnector
      Used to invoke user options on the mini such as "OK", "CANCEL", "DONE", etc.
      Specified by:
      invokeInputOption in interface ICloverConnector
      Parameters:
      io - The option to invoke
    • resetDevice

      public void resetDevice()
      Description copied from interface: ICloverConnector
      Used to reset the device if it gets in an invalid state from POS perspective. This could cause a missed transaction or other missed information, so it needs to be used cautiously as a last resort
      Specified by:
      resetDevice in interface ICloverConnector
    • retrieveDeviceStatus

      public void retrieveDeviceStatus(RetrieveDeviceStatusRequest request)
      Description copied from interface: ICloverConnector
      Send a message requesting the current status of the device.
      Specified by:
      retrieveDeviceStatus in interface ICloverConnector
      Parameters:
      request - The request details
    • retrievePayment

      public void retrievePayment(RetrievePaymentRequest request)
      Description copied from interface: ICloverConnector
      Sends a request to get a payment. Only valid for payments made in the past 24 hours on the device queried.
      Specified by:
      retrievePayment in interface ICloverConnector
      Parameters:
      request - The request details
    • registerForCustomerProvidedData

      public void registerForCustomerProvidedData(RegisterForCustomerProvidedDataRequest request)
      Description copied from interface: ICloverConnector
      Register an interest in receiving customer provided data.
      Specified by:
      registerForCustomerProvidedData in interface ICloverConnector
    • setCustomerInfo

      public void setCustomerInfo(SetCustomerInfoRequest request)
      Specified by:
      setCustomerInfo in interface ICloverConnector
    • startCustomActivity

      public void startCustomActivity(CustomActivityRequest request)
      Description copied from interface: ICloverConnector
      Request to start a Custom Activity on the Clover device
      Specified by:
      startCustomActivity in interface ICloverConnector
      Parameters:
      request - The request details
    • checkBalance

      public void checkBalance(CheckBalanceRequest request)
      Description copied from interface: ICloverConnector
      Check the balance on a card, if card supports balance inquiry
      Specified by:
      checkBalance in interface ICloverConnector
    • requestSignature

      public void requestSignature(SignatureRequest request)
      Description copied from interface: ICloverConnector
      Launch customer facing signature screen to collect a signature
      Specified by:
      requestSignature in interface ICloverConnector
    • requestTip

      public void requestTip(TipRequest request)
      Description copied from interface: ICloverConnector
      Launch customer facing tip screen to request a tip amount
      Specified by:
      requestTip in interface ICloverConnector