public class CloverConnector extends java.lang.Object implements ICloverConnector
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.Modifier and Type | Field and Description |
---|---|
static com.clover.remote.InputOption |
CANCEL_INPUT_OPTION |
static int |
CARD_ENTRY_METHOD_ICC_CONTACT |
static int |
CARD_ENTRY_METHOD_MAG_STRIPE |
static int |
CARD_ENTRY_METHOD_MANUAL |
static int |
CARD_ENTRY_METHOD_NFC_CONTACTLESS |
static int |
MAX_PAYLOAD_SIZE |
Constructor and Description |
---|
CloverConnector(CloverDeviceConfiguration config)
CloverConnector constructor
|
Modifier and Type | Method and Description |
---|---|
void |
acceptPayment(com.clover.sdk.v3.payments.Payment payment)
If payment confirmation is required during a Sale, this method accepts the payment
|
void |
acceptSignature(VerifySignatureRequest request)
If signature is captured during a Sale, this method accepts the signature as entered
|
void |
addCloverConnectorListener(ICloverConnectorListener connectorListener)
Registers the provided listener to receive callbacks and events from the underlying device connection.
|
void |
auth(AuthRequest request)
Auth method to obtain an Auth payment that can be used as the payment
to call tipAdjust
|
void |
cancel()
Cancels the current user action on the device.
|
void |
capturePreAuth(CapturePreAuthRequest request)
Capture a previous Auth.
|
void |
closeout(CloseoutRequest request)
Request a closeout of all orders.
|
void |
displayPaymentReceiptOptions(java.lang.String orderId,
java.lang.String paymentId)
Display the payment receipt screen for the orderId/paymentId combination.
|
void |
dispose()
Will dispose of the underlying connection to the device
|
void |
initializeConnection()
Initialize the CloverConnector's connection and start communication with the device.
|
void |
invokeInputOption(com.clover.remote.InputOption io)
Used to invoke user options on the mini such as "OK", "CANCEL", "DONE", etc.
|
void |
manualRefund(ManualRefundRequest request)
Manual refund method, aka "naked credit"
|
void |
openCashDrawer(OpenCashDrawerRequest request)
Request that the cash drawer connected to the device be opened.
|
void |
openCashDrawer(java.lang.String reason)
Will trigger cash drawer to open that is connected to Clover Mini
|
void |
preAuth(PreAuthRequest request)
PreAuth method to obtain a Pre-Auth for a card
|
void |
print(PrintRequest request)
Request to print.
|
void |
printImage(Bitmap bitmap)
Print an image on the Clover Mini printer
|
void |
printImageFromURL(java.lang.String url)
Print an image on the Clover Mini printer
|
void |
printText(java.util.List<java.lang.String> messages)
Print simple lines of text to the Clover Mini printer
|
void |
readCardData(ReadCardDataRequest request)
Used to request card information.
|
void |
refundPayment(RefundPaymentRequest request)
Refund a specific payment
|
void |
rejectPayment(com.clover.sdk.v3.payments.Payment payment,
com.clover.remote.Challenge challenge)
If payment confirmation is required during a Sale, this method rejects the payment
|
void |
rejectSignature(VerifySignatureRequest request)
If signature is captured during a Sale, this method rejects the signature as entered
|
void |
removeCloverConnectorListener(ICloverConnectorListener connectorListener)
Remove a previously added listener.
|
void |
removeDisplayOrder(com.clover.remote.order.DisplayOrder order)
Remove the DisplayOrder from the device.
|
void |
resetDevice()
Used to reset the device if it gets in an invalid state from POS perspective.
|
void |
retrieveDeviceStatus(RetrieveDeviceStatusRequest request)
Send a message requesting the current status of the device.
|
void |
retrievePayment(RetrievePaymentRequest request)
Sends a request to get a payment.
|
void |
retrievePendingPayments()
Used to request a list of pending payments that have been taken offline, but
haven't processed yet.
|
void |
retrievePrinters(RetrievePrintersRequest request)
Request to retrieve available printers.
|
void |
retrievePrintJobStatus(PrintJobStatusRequest request)
Request the status of a given print job
|
void |
sale(SaleRequest request)
Sale method, aka "purchase"
|
void |
sendMessageToActivity(MessageToActivity request)
Send a message to a running custom activity on the Clover device
|
void |
showDisplayOrder(com.clover.remote.order.DisplayOrder order)
Show the DisplayOrder on the device.
|
void |
showMessage(java.lang.String message)
Show a message on the Clover Mini screen
|
void |
showThankYouScreen()
Show the thank you screen on the device
|
void |
showWelcomeScreen()
Return the device to the Welcome Screen
|
void |
startCustomActivity(CustomActivityRequest request)
Request to start a Custom Activity on the Clover device
|
void |
tipAdjustAuth(TipAdjustAuthRequest request)
Adjust the tip for a previous Auth.
|
void |
vaultCard(java.lang.Integer cardEntryMethods)
Vault card information.
|
void |
voidPayment(VoidPaymentRequest request)
Void a transaction, given a previously used order ID and/or payment ID
|
public static final int CARD_ENTRY_METHOD_MAG_STRIPE
public static final int CARD_ENTRY_METHOD_ICC_CONTACT
public static final int CARD_ENTRY_METHOD_NFC_CONTACTLESS
public static final int CARD_ENTRY_METHOD_MANUAL
public static final int MAX_PAYLOAD_SIZE
public static final com.clover.remote.InputOption CANCEL_INPUT_OPTION
public CloverConnector(CloverDeviceConfiguration config)
config
- A CloverDeviceConfiguration object containing the configuration for the devicepublic void addCloverConnectorListener(ICloverConnectorListener connectorListener)
initializeConnection()
to guarantee notification of all
connection related callbacks.addCloverConnectorListener
in interface ICloverConnector
connectorListener
- The listener to registerpublic void removeCloverConnectorListener(ICloverConnectorListener connectorListener)
removeCloverConnectorListener
in interface ICloverConnector
connectorListener
- The listener to removepublic void initializeConnection()
ICloverConnector
initializeConnection
in interface ICloverConnector
public void sale(SaleRequest request)
ICloverConnector
sale
in interface ICloverConnector
request
- A SaleRequest object containing basic information needed for the transactionpublic void acceptSignature(VerifySignatureRequest request)
ICloverConnector
acceptSignature
in interface ICloverConnector
request
- Accepted requestpublic void rejectSignature(VerifySignatureRequest request)
ICloverConnector
rejectSignature
in interface ICloverConnector
request
- Rejected requestpublic void acceptPayment(com.clover.sdk.v3.payments.Payment payment)
ICloverConnector
acceptPayment
in interface ICloverConnector
payment
- Payment to acceptpublic void rejectPayment(com.clover.sdk.v3.payments.Payment payment, com.clover.remote.Challenge challenge)
ICloverConnector
rejectPayment
in interface ICloverConnector
payment
- Payment to rejectchallenge
- The challenge which resulted in payment rejectionpublic void auth(AuthRequest request)
ICloverConnector
auth
in interface ICloverConnector
request
- The request detailspublic void preAuth(PreAuthRequest request)
ICloverConnector
preAuth
in interface ICloverConnector
request
- The request detailspublic void capturePreAuth(CapturePreAuthRequest request)
ICloverConnector
capturePreAuth
in interface ICloverConnector
request
- The request detailspublic void tipAdjustAuth(TipAdjustAuthRequest request)
ICloverConnector
tipAdjustAuth
in interface ICloverConnector
request
- The request detailspublic void vaultCard(java.lang.Integer cardEntryMethods)
ICloverConnector
vaultCard
in interface ICloverConnector
cardEntryMethods
- The card entry methods allowed to capture the payment token. null will provide default valuespublic void voidPayment(VoidPaymentRequest request)
ICloverConnector
voidPayment
in interface ICloverConnector
request
- The request detailspublic void refundPayment(RefundPaymentRequest request)
ICloverConnector
refundPayment
in interface ICloverConnector
request
- The request detailspublic void manualRefund(ManualRefundRequest request)
ICloverConnector
manualRefund
in interface ICloverConnector
request
- The request detailspublic void retrievePendingPayments()
ICloverConnector
retrievePendingPayments
in interface ICloverConnector
public void readCardData(ReadCardDataRequest request)
ICloverConnector
readCardData
in interface ICloverConnector
request
- The request detailspublic void sendMessageToActivity(MessageToActivity request)
ICloverConnector
sendMessageToActivity
in interface ICloverConnector
request
- The request detailspublic void closeout(CloseoutRequest request)
ICloverConnector
closeout
in interface ICloverConnector
request
- The request detailspublic void print(PrintRequest request)
ICloverConnector
print
in interface ICloverConnector
request
- The request details: info and content needed to printpublic void retrievePrinters(RetrievePrintersRequest request)
ICloverConnector
retrievePrinters
in interface ICloverConnector
request
- object that contains additional information to be applied during the requestpublic void retrievePrintJobStatus(PrintJobStatusRequest request)
ICloverConnector
retrievePrintJobStatus
in interface ICloverConnector
request
- object defining the print job to be queriedpublic void openCashDrawer(OpenCashDrawerRequest request)
ICloverConnector
openCashDrawer
in interface ICloverConnector
request
- object defining the reason the cash drawer is being opened, and an optional device identifierpublic void cancel()
ICloverConnector
cancel
in interface ICloverConnector
public void printText(java.util.List<java.lang.String> messages)
ICloverConnector
printText
in interface ICloverConnector
messages
- A list of text to printpublic void printImage(Bitmap bitmap)
ICloverConnector
printImage
in interface ICloverConnector
bitmap
- An image to print
NOTE: This method is not implemented for the Java SDK. Use ICloverConnector.printImageFromURL(String)
instead.public void printImageFromURL(java.lang.String url)
ICloverConnector
printImageFromURL
in interface ICloverConnector
url
- The url of an image to printpublic void showMessage(java.lang.String message)
ICloverConnector
showMessage
in interface ICloverConnector
message
- The message to displaypublic void showWelcomeScreen()
ICloverConnector
showWelcomeScreen
in interface ICloverConnector
public void showThankYouScreen()
ICloverConnector
showThankYouScreen
in interface ICloverConnector
public void displayPaymentReceiptOptions(java.lang.String orderId, java.lang.String paymentId)
ICloverConnector
displayPaymentReceiptOptions
in interface ICloverConnector
orderId
- The ID of the order to print a receipt forpaymentId
- The ID of the payment to print a receipt forpublic void openCashDrawer(java.lang.String reason)
ICloverConnector
openCashDrawer
in interface ICloverConnector
reason
- Reason for opening the cash drawerpublic void showDisplayOrder(com.clover.remote.order.DisplayOrder order)
ICloverConnector
showDisplayOrder
in interface ICloverConnector
order
- The order to displaypublic void removeDisplayOrder(com.clover.remote.order.DisplayOrder order)
ICloverConnector
removeDisplayOrder
in interface ICloverConnector
order
- The order to removepublic void dispose()
ICloverConnector
dispose
in interface ICloverConnector
public void invokeInputOption(com.clover.remote.InputOption io)
ICloverConnector
invokeInputOption
in interface ICloverConnector
io
- The option to invokepublic void resetDevice()
ICloverConnector
resetDevice
in interface ICloverConnector
public void retrieveDeviceStatus(RetrieveDeviceStatusRequest request)
ICloverConnector
retrieveDeviceStatus
in interface ICloverConnector
request
- The request detailspublic void retrievePayment(RetrievePaymentRequest request)
ICloverConnector
retrievePayment
in interface ICloverConnector
request
- The request detailspublic void startCustomActivity(CustomActivityRequest request)
ICloverConnector
startCustomActivity
in interface ICloverConnector
request
- The request details