ICloverConnector
public protocol ICloverConnector : AnyObject
The CloverConnector API serves as the interface for connecting to a Clover device.
This document defines the available methods.
-
Declaration
Swift
var CARD_ENTRY_METHOD_MAG_STRIPE: Int { get } -
Declaration
Swift
var CARD_ENTRY_METHOD_ICC_CONTACT: Int { get } -
Declaration
Swift
var CARD_ENTRY_METHOD_NFC_CONTACTLESS: Int { get } -
Declaration
Swift
var CARD_ENTRY_METHOD_MANUAL: Int { get } -
Declaration
Swift
var CARD_ENTRY_METHODS_DEFAULT: Int { get } -
Declaration
Swift
var MAX_PAYLOAD_SIZE: Int { get } -
Adds a Clover Connector listener.
Declaration
Swift
func addCloverConnectorListener(_ cloverConnectorListener: ICloverConnectorListener)Parameters
cloverConnectorListenerThe connection listener.
-
Removes a Clover Connector listener.
Declaration
Swift
func removeCloverConnectorListener(_ cloverConnectorListener: ICloverConnectorListener)Parameters
cloverConnectorListenerThe connection listener.
-
Initializes the connection and starts communication with the Clover device. This is called after the connector is created and listeners have been added to it. initializeConnection() must be called before calling any other method, other than those that add or remove listeners.
Declaration
Swift
func initializeConnection() -
Requests a Sale transaction (purchase).
Declaration
Swift
func sale(_ saleRequest: SaleRequest)Parameters
saleRequestA SaleRequest object containing basic information for the transaction.
-
Requests an Auth transaction. The tip for an Auth can be adjusted through the TipAdjustAuth() call until the batch Closeout is processed. Note: The MerchantInfo.SupportsAuths boolean must be set to true.
Declaration
Swift
func auth(_ authRequest: AuthRequest)Parameters
authRequestThe request details.
-
Initiates a PreAuth transaction (a pre-authorization for a certain amount). This transaction lets the merchant know whether the account associated with a card has sufficient funds, without actually charging the card. When the merchant is ready to charge a final amount, the POS will call CapturePreAuth() to complete the Payment. Note: The MerchantInfo.SupportsPreAuths boolean must be set to true.
Declaration
Swift
func preAuth(_ preAuthRequest: PreAuthRequest)Parameters
preAuthRequestThe request details.
-
Marks a PreAuth Payment for capture by a Closeout process. After a PreAuth is captured, it is effectively the same as an Auth Payment. Note: Should only be called if the request’s PaymentID is from a PreAuthResponse.
Declaration
Swift
func capturePreAuth(_ capturePreAuthRequest: CapturePreAuthRequest)Parameters
capturePreAuthRequestThe request details.
-
Adjusts the tip for a previous Auth transaction. This call can be made until the Auth Payment has been finalized by a Closeout. Note: Should only be called if the request’s PaymentID is from an AuthResponse.
Declaration
Swift
func tipAdjustAuth(_ authTipAdjustRequest: TipAdjustAuthRequest)Parameters
authTipAdjustRequestThe request details.
-
Voids a transaction.
Declaration
Swift
func voidPayment(_ voidPaymentRequest: VoidPaymentRequest)Parameters
voidPaymentRequestA VoidRequest object containing basic information needed to void the transaction.
-
Refunds the full or partial amount of a Payment.
Declaration
Swift
func refundPayment(_ refundPaymentRequest: RefundPaymentRequest)Parameters
refundPaymentRequestThe request details.
-
Void a payment refund
Declaration
Swift
func voidPaymentRefund(_ request: VoidPaymentRefundRequest)Parameters
requestThe details of the void payment refund
-
Initiates a Manual Refund transaction (a “Refund” or credit that is not associated with a previous Payment).
Declaration
Swift
func manualRefund(_ manualRefundRequest: ManualRefundRequest)Parameters
manualRefundRequestA ManualRefundRequest object with the request details.
-
Sends a request to the Clover server to close out all transactions.
Declaration
Swift
func closeout(_ closeoutRequest: CloseoutRequest)Parameters
closeoutRequestThe request details.
-
Displays the customer-facing receipt options (print, email, etc.) for a Payment on the Clover device.
Declaration
Swift
@available(*, deprecated, message: "Use the new 'displayReceiptOptions(﹚' instead") func displayPaymentReceiptOptions(orderId: String, paymentId: String)Parameters
orderIdThe ID of the Order associated with the receipt.
paymentIdThe ID of the Payment associated with the receipt.
-
Display receipt options for a Credit, Refund, or Payment
Declaration
Swift
func displayReceiptOptions(_ receiptOptionsRequest: DisplayReceiptOptionsRequest)Parameters
receiptOptionsRequestThe request details for the credit, refund, or payment
-
If a signature is captured during a transaction, this method accepts the signature as entered.
Declaration
Swift
func acceptSignature(_ signatureVerifyRequest: VerifySignatureRequest)Parameters
signatureVerifyRequestThe accepted VerifySignatureRequest the device passed to onVerifySignatureRequest().
-
If a signature is captured during a transaction, this method rejects the signature as entered.
Declaration
Swift
func rejectSignature(_ signatureVerifyRequest: VerifySignatureRequest)Parameters
signatureVerifyRequestThe rejected VerifySignatureRequest() the device passed to onVerifySignatureRequest().
-
Asks the Clover device to capture card information and request a payment token from the payment gateway. The payment token can be used for future Sale and Auth requests in place of the card details. The merchant account must be configured to allow payment tokens. Note: The MerchantInfo.SupportsVaultCards boolean must be set to true.
Declaration
Swift
func vaultCard(_ vaultCardRequest: VaultCardRequest)Parameters
vaultCardRequestThe VaultCardRequest details, including the card entry methods allowed to capture the payment token. If the card entry methods are null, the default values (CARD_ENTRY_METHOD_MAG_STRIPE, CARD_ENTRY_METHOD_ICC_CONTACT, and CARD_ENTRY_METHOD_NFC_CONTACTLESS) will be used.
-
Sends a print request using the PrintRequest object. Used to print text, images, and images from a URL using the specified printer.
Declaration
Swift
func print(_ request: PrintRequest)Parameters
requestThe PrintRequest details.
-
Queries available printers attached to the Clover device.
Declaration
Swift
func retrievePrinters(_ request: RetrievePrintersRequest)Parameters
requestThe RetrievePrintersRequest details.
-
Queries the status of a print job.
Declaration
Swift
func retrievePrintJobStatus(_ request: PrintJobStatusRequest)Parameters
requestA PrintJobStatusRequest object containing the request details.
-
Opens the first cash drawer found connected to the Clover device. The reason for opening the cash drawer must be set on OpenCashDrawerRequest.
Declaration
Swift
func openCashDrawer(_ request: OpenCashDrawerRequest)Parameters
requestThe OpenCashDrawerRequest object defining the reason the cash drawer is being opened, and an optional device identifier.
-
Displays a string-based message on the Clover device’s screen.
Declaration
Swift
func showMessage(_ message: String)Parameters
messageThe string message to display.
-
Sends request to the clover device to send the log to the clover server
Declaration
Swift
func sendDebugLog(_ message: String)Parameters
messageThe message to send
-
Displays the welcome screen on the Clover device.
Declaration
Swift
func showWelcomeScreen() -
Displays the thank you screen on the Clover device.
Declaration
Swift
func showThankYouScreen() -
Displays an Order and associated lineItems on the Clover device. Will replace an Order that is already displayed on the device screen.
Declaration
Swift
func showDisplayOrder(_ order: DisplayOrder)Parameters
orderThe Order to display.
-
Removes the DisplayOrder object from the Clover device’s screen.
Declaration
Swift
func removeDisplayOrder(_ order: DisplayOrder)Parameters
orderThe Order to remove.
-
Sends a request to reset the Clover device back to the welcome screen. Can be used when the device is in an unknown or invalid state from the perspective of the POS. Note: This request could cause the POS to miss a transaction or other information. Use cautiously as a last resort.
Declaration
Swift
func resetDevice() -
Sends a keystroke to the Clover device that invokes an input option (OK, CANCEL, DONE, etc.) on the customer’s behalf. InputOptions are on the CloverDeviceEvent passed to onDeviceActivityStart().
Declaration
Swift
func invokeInputOption(_ inputOption: InputOption)Parameters
inputOptionThe input option to invoke.
-
Requests card information (specifically Track 1 and Track 2 card data).
Declaration
Swift
func readCardData(_ request: ReadCardDataRequest)Parameters
requestThe ReadCardDataRequest details.
-
If Payment confirmation is required during a transaction due to a Challenge, this method accepts the Payment. A Challenge may be triggered by a potential duplicate Payment or an offline Payment.
Declaration
Swift
func acceptPayment(_ payment: CLVModels.Payments.Payment)Parameters
paymentThe Payment to accept.
-
If Payment confirmation is required during a transaction due to a Challenge, this method rejects the Payment. A Challenge may be triggered by a potential duplicate Payment or an offline Payment.
Declaration
Swift
func rejectPayment(_ payment: CLVModels.Payments.Payment, challenge: Challenge)Parameters
paymentThe Payment to reject.
challengeThe Challenge that resulted in Payment rejection.
-
Retrieves a list of unprocessed Payments that were taken offline and are pending submission to the server.
Declaration
Swift
func retrievePendingPayments() -
Disposes the connection to the Clover device. After this is called, the connection to the device is severed, and the CloverConnector object is no longer usable. Instantiate a new CloverConnector object in order to call initializeConnection().
Declaration
Swift
func dispose() -
Starts a Custom Activity on the Clover device.
Declaration
Swift
func startCustomActivity(_ request: CustomActivityRequest)Parameters
requestThe CustomActivityRequest details.
-
Sends a message to a Custom Activity running on a Clover device.
Declaration
Swift
func sendMessageToActivity(_ request: MessageToActivity)Parameters
requestThe MessageToActivity request with the message to send to the Custom Activity.
-
Sends a message requesting the current status of the Clover device.
Declaration
Swift
func retrieveDeviceStatus(_ _request: RetrieveDeviceStatusRequest)Parameters
requestThe RetrieveDeviceStatusRequest details.
-
Requests the Payment information corresponding to the externalPaymentId passed in. Only valid for Payments made in the past 24 hours on the Clover device queried.
Declaration
Swift
func retrievePayment(_ _request: RetrievePaymentRequest)Parameters
requestThe RetrievePaymentRequest details.
-
Requests that callbacks be provided whenever customer provided data is accrued via the Loyalty API. Provides a list of acceptable data types that the Loyalty API may request from the customer.
Declaration
Swift
func registerForCustomerProvidedData(_ _request: RegisterForCustomerProvidedDataRequest) -
Provides customer information back to the Clover device. Typically this will be called upon receipt of a customer provided data message, with the results of a lookup into a customer database.
Declaration
Swift
func setCustomerInfo(_ _request: SetCustomerInfoRequest?)
ICloverConnector Protocol Reference