public interface PaymentTerminal
The POS application should perform these steps in order to use the payment terminal:
CarbonTerminal
and setting that up.
initialise
.
doTransaction
when it needs to
perform a transaction.
The methods of PaymentTerminal
works asynchronously. They return immediately,
and the result of the operation is returned later in a callback that must be passed to
the method.
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction()
Aborts a transaction in progress.
|
boolean |
checkForUpdates(UpdateCheckResponseHandler response)
Checks for updates to the payment terminal.
|
boolean |
disableNavigationBar()
Makes the navigation bar disappear.
|
boolean |
doMaintenance(MaintenanceResponseHandler response)
Open the system menu in the payment terminal.
|
boolean |
doTransaction(TransactionRequest transaction,
TransactionResponseHandler response,
CardVerificationHandler cardCheck)
Performs a transaction.
|
boolean |
enableDataRoaming(boolean enable)
Enable/ Disable Data roaming.
|
boolean |
enableNavigationBar(NavigationBarButtons[] buttons)
Show the navigation bar with back and/or home buttons.
|
boolean |
getLastTransactionResult(TransactionResponseHandler response)
Gets the result of the last completed transaction.
|
PrinterStatus |
getPrinterStatus() |
int |
getSleepTime()
Gets the sleep time value.
|
int |
getSuspendTime()
Gets the suspend time value.
|
boolean |
getTerminalStatus(TerminalStatusResponseHandler response) |
boolean |
initialise(TerminalSettings settings,
InitialisationResponseHandler response,
NotificationHandler notification)
Initialises the payment terminal.
|
boolean |
openPaymentServiceMenu(MenuFeatures[] disabledMenuFeatures,
MaintenanceResponseHandler response)
Open the system menu in the payment terminal.
|
boolean |
readCustomCard(CustomCardRequest request,
CustomCardResponseHandler response)
Asks the payment application to read a custom card.
|
boolean |
reverseLastTransaction(ReversalResponseHandler response)
Reverses the previous transaction.
|
boolean |
setApn(ApnInfo apnInfo)
Set APN settings.
|
boolean |
setParameter(Parameter parameter,
int value)
Set parameter.
|
boolean |
setScreenBrightness(int brightnessPercent)
Set screen brightness.
|
boolean |
setSleepTime(DisplayUtilities.SleepTime time)
Set the sleep time value.
|
boolean |
setSuspendTime(DisplayUtilities.SuspendTime time)
Set the suspend time value.
|
boolean |
setTransactionAmounts(TransactionAmounts transactionAmounts)
If a zero amount is provided in the transaction request,
this call can be used to update the transaction with an amount.
|
boolean |
shutdown(boolean restart)
Shuts down the payment terminal.
|
PrintJob |
startPrintJob()
Starts a new printer job.
|
boolean |
validateMerchantPassword(java.lang.String password)
Validate the merchant password.
|
boolean initialise(TerminalSettings settings, InitialisationResponseHandler response, NotificationHandler notification)
settings
- The settings for the payment terminal.response
- A callback that will be called with the result of the initialisation.notification
- Optional. A callback that will be called for different events.true
if the request was sent successfully, otherwise false
.
Note that this does not indicate the success or failure of the initialisation.
If no InitialisationResponseHandler
is provided the method will return false.boolean doTransaction(TransactionRequest transaction, TransactionResponseHandler response, CardVerificationHandler cardCheck)
transaction
- The details of the transaction.response
- A callback that will be called with the result of the transaction.cardCheck
- Optional.true
if the request was sent successfully,
otherwise false.
. Note that this does not indicate the
success or failure of the transaction.
If no TransactionResponseHandler
is provided the method will return false.boolean readCustomCard(CustomCardRequest request, CustomCardResponseHandler response)
request
- Contains parameters for the request. This is optional; set to null if
no extra parameters are required.response
- A callback that will be called with the result of the card read.true
if the request was sent successfully,
otherwise false.
. Note that this does not indicate the
success or failure of the action.
If no CustomCardResponseHandler
is provided the method will return false.void abortTransaction()
doTransaction
that the transaction was
cancelled.boolean setTransactionAmounts(TransactionAmounts transactionAmounts)
transactionAmounts
- true
if the set transaction amount was sent successfully,
otherwise false.
.boolean reverseLastTransaction(ReversalResponseHandler response)
response
- A callback that will be called when the reversal is completed.true
if the request was sent successfully,
otherwise false.
. Note that this does not indicate the
success or failure of the reversal.
If no ReversalResponseHandler
is provided the method will return false.boolean getLastTransactionResult(TransactionResponseHandler response)
doTransaction(TransactionRequest, TransactionResponseHandler, CardVerificationHandler)
.
The response can be null if the result of the previous transaction is not available.
This happens if there has not been a previous transaction, or if a new transaction has
been started, but not completed.
Note that this method cannot be called while a transaction is in progress. If it is
called then, it will return false
.
This method requires Westpay Payment Application v2.0.11 or higher.response
- A callback that will be called with the results of the last completed
transaction. This response contains the same data that is contained
in the transaction response.
If the callback is not given, the method returns false
.true
if the request was sent successfully, otherwise false
.boolean doMaintenance(MaintenanceResponseHandler response)
response
- A callback that will be called when the maintenance is completed.true
if the request was sent successfully,
otherwise false.
. Note that this does not indicate the
success or failure of the maintenance.
If no MaintenanceResponseHandler
is provided the method will return false.boolean openPaymentServiceMenu(MenuFeatures[] disabledMenuFeatures, MaintenanceResponseHandler response)
disabledMenuFeatures
- An array of MenuFeatures that should not be visible in the payment service menu.response
- A callback that will be called when the maintenance is completed.true
if the request was sent successfully,
otherwise false.
. Note that this does not indicate the
success or failure of the maintenance.
If no MaintenanceResponseHandler
is provided the method will return false.PrintJob startPrintJob()
PrinterStatus getPrinterStatus()
boolean validateMerchantPassword(java.lang.String password)
password
- The password in plain text.true
if the validation was successfully,
otherwise false.
.boolean checkForUpdates(UpdateCheckResponseHandler response)
response
- Not used, reserved for future use.true
if the Application Updater was started,
otherwise false.
.
If no UpdateCheckResponseHandler
is provided the method will return false.boolean shutdown(boolean restart)
restart
- If set to true, the terminal will restart after shut down.true
if the request was sent successfully,
otherwise false.
. Note that this does not indicate the
success or failure of the shutdown.
If no TerminalStatusResponseHandler
is provided the method will return false.boolean getTerminalStatus(TerminalStatusResponseHandler response)
boolean enableNavigationBar(NavigationBarButtons[] buttons)
buttons
- Buttons to be enabled on the navigation bar.true
if operation was successful,
otherwise false.
.setSystemUiVisibility
NOTE: This method (enableNavigationBar) should not be used together with disableNavigationBar
in the same activity, this will cause a RuntimeException.
boolean disableNavigationBar()
NOTE: This method (disableNavigationBar) should not be used together with enableNavigationBar in the same activity, this will cause a RuntimeException.
true
if operation was successful,
otherwise false.
.boolean setParameter(Parameter parameter, int value)
parameter
- Parameter type.value
- Parameter value.true
if the timeout was successfully set,
otherwise false.
.int getSleepTime()
boolean setSleepTime(DisplayUtilities.SleepTime time)
time
- SleepTime
value.true
if operation was successful,
otherwise false.
.int getSuspendTime()
boolean setSuspendTime(DisplayUtilities.SuspendTime time)
time
- SuspendTime
value.true
if operation was successful,
otherwise false.
.boolean setScreenBrightness(int brightnessPercent)
brightnessPercent
- Value for the brightness, valid values are 0 - 100 percent.boolean setApn(ApnInfo apnInfo)
apnInfo
- This object to set APN parameters.
false.
.boolean enableDataRoaming(boolean enable)
enable
- Enable/Disable flag (if value is true, then enable the data roaming. otherwise disable).
false.
.