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 |
capturePreAuth(CapturePreAuthRequest request)
Capture a previous Auth.
|
void |
checkBalance(CheckBalanceRequest request)
Check the balance on a card, if card supports balance inquiry
|
void |
closeout(CloseoutRequest request)
Request a closeout of all orders.
|
void |
displayPaymentReceiptOptions(DisplayReceiptOptionsRequest request)
Deprecated.
|
void |
displayReceiptOptions(DisplayReceiptOptionsRequest request)
Display receipt options for a Credit, Refund, or Payment
|
void |
dispose()
Will dispose of the underlying connection to the device
|
void |
incrementPreAuth(IncrementPreauthRequest request)
Request to increase the amount of an existing pre-auth
|
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 |
preAuth(PreAuthRequest request)
PreAuth method to obtain a Pre-Auth for a card
|
void |
print(PrintRequest request)
Request to print.
|
void |
readCardData(ReadCardDataRequest request)
Used to request card information.
|
void |
refundPayment(RefundPaymentRequest request)
Refund a specific payment
|
void |
registerForCustomerProvidedData(RegisterForCustomerProvidedDataRequest request)
Register an interest in receiving customer provided data.
|
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 |
requestSignature(SignatureRequest request)
Launch customer facing signature screen to collect a signature
|
void |
requestTip(TipRequest request)
Launch customer facing tip screen to request a tip amount
|
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 |
sendDebugLog(java.lang.String message)
Sends request to the clover device to send the log to the clover server
|
void |
sendMessageToActivity(MessageToActivity request)
Send a message to a running custom activity on the Clover device
|
void |
setCustomerInfo(SetCustomerInfoRequest request) |
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
|
void |
voidPaymentRefund(VoidPaymentRefundRequest request)
Refund a specific payment
|
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 incrementPreAuth(IncrementPreauthRequest request)
ICloverConnector
incrementPreAuth
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 voidPaymentRefund(VoidPaymentRefundRequest request)
ICloverConnector
voidPaymentRefund
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 showMessage(java.lang.String message)
ICloverConnector
showMessage
in interface ICloverConnector
message
- The message to displaypublic void sendDebugLog(java.lang.String message)
ICloverConnector
sendDebugLog
in interface ICloverConnector
message
- The message to displaypublic void showWelcomeScreen()
ICloverConnector
showWelcomeScreen
in interface ICloverConnector
public void showThankYouScreen()
ICloverConnector
showThankYouScreen
in interface ICloverConnector
@Deprecated public void displayPaymentReceiptOptions(DisplayReceiptOptionsRequest request)
displayPaymentReceiptOptions
in interface ICloverConnector
request
- The request detailspublic void displayReceiptOptions(DisplayReceiptOptionsRequest request)
ICloverConnector
displayReceiptOptions
in interface ICloverConnector
request
- The request detailspublic 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 registerForCustomerProvidedData(RegisterForCustomerProvidedDataRequest request)
ICloverConnector
registerForCustomerProvidedData
in interface ICloverConnector
public void setCustomerInfo(SetCustomerInfoRequest request)
setCustomerInfo
in interface ICloverConnector
public void startCustomActivity(CustomActivityRequest request)
ICloverConnector
startCustomActivity
in interface ICloverConnector
request
- The request detailspublic void checkBalance(CheckBalanceRequest request)
ICloverConnector
checkBalance
in interface ICloverConnector
public void requestSignature(SignatureRequest request)
ICloverConnector
requestSignature
in interface ICloverConnector
public void requestTip(TipRequest request)
ICloverConnector
requestTip
in interface ICloverConnector