CarbonTerminal

class CarbonTerminal(applicationPackage: String = "", serviceClassName: String = "") : PaymentTerminal

This class provides an implementation of the PaymentTerminal interface. Also this class provides other methods to utilize the PAaS library API.

Parameters

applicationPackage
serviceClassName

Constructors

Link copied to clipboard
fun CarbonTerminal(applicationPackage: String = "", serviceClassName: String = "")

Functions

Link copied to clipboard
open override fun abortTransaction()

Aborts a transaction in progress. An abort-transaction request is sent to the payment application. If there is no active transaction the request is ignored. If there is an active transaction the payment application will attempt to abort it.

Link copied to clipboard
open override fun checkForUpdates(context: Activity): Boolean

Checks for updates to the payment terminal. Calling this method will start the Application Updater program.

Link copied to clipboard

Creates the CustomCardResponse from the Intent.

Link copied to clipboard
open override fun createIntentForCustomCard(customCardRequest: CustomCardRequest): Intent

Creates the Intent that allow the user to perform a read custom card.

Link copied to clipboard
open override fun createIntentForMaintenance(): Intent

Creates the Intent that allows the user to open the maintenance menu in the payment application.

Link copied to clipboard
open override fun createIntentForOpenMenu(disabledMenuFeatures: Array<MenuFeatures>): Intent

Open the system menu in the payment terminal. The payment terminal will take over the screen and show its System functions menu. When the user exits the menu, response callback is called and the POS application should start the appropriate activity to take over.

Link copied to clipboard
open override fun createIntentForTransaction(transaction: TransactionRequest): Intent?

Creates an Intent from a TransactionRequest.

Link copied to clipboard

Creates an TransactionResponse from a Intent.

Link copied to clipboard
open override fun disableNavigationBar(context: Context): Boolean

Makes the navigation bar disappear.

Link copied to clipboard
open override fun enableNavigationBar(context: Context, navigationBarButtons: Array<NavigationBarButtons>): Boolean

Show the navigation bar with back and/or home buttons. This method will add the provided buttons to the navigation bar, that means that if the HOME button already been enabled by another activity and the provided button is BACK for this activity, both buttons will be shown. Hiding the navigation bar can be done by using the Android API method View.setSystemUiVisibility with the flags View.SYSTEM_UI_FLAG_HIDE_NAVIGATION and View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY int the application.

Link copied to clipboard
open override fun enableSuspend(context: Context, enable: Boolean): Boolean

Enable/disable the suspend time.

Link copied to clipboard

Gets the result of the last completed transaction. The response will contain the same data as the original response to .doTransaction.

Link copied to clipboard
open override fun getPrinterStatus(context: Context): PrinterStatus

Get printer status.

Link copied to clipboard
open override fun getProduct(): String

Retrieves the device product text.

Link copied to clipboard
open override fun getSerialNumber(): String

Retrieves the device serial number.

Link copied to clipboard
open override fun getSleepTime(context: Context): SleepTimeValues?

Gets the sleep time value.

Link copied to clipboard
open override fun getSuspendTime(): SuspendTimeValues?

Gets the suspend time value.

Link copied to clipboard

Retrieve the terminal status.

Link copied to clipboard
open override fun initialise(settings: TerminalSettings, response: InitialisationResponseHandler, notification: NotificationHandler?): Boolean

Initialises the payment terminal. Before the payment terminal can be used to process transactions, it has to be initialised. The initialisation process includes contacting the payment processor and downloading the current terminal settings.

Link copied to clipboard
open override fun isSuspendEnabled(): Boolean

Check if suspend time is enabled.

Link copied to clipboard
open override fun isSystemSecure(): Boolean

Check if the terminal has a secure or non-secure system.

Link copied to clipboard
open override fun notifyExit(context: Context): Boolean

Notifying the 'application exit' Start payment application when call this function. PAaS library users(paas applications) should send this to the payment app, before exit their applications.

Link copied to clipboard
fun register(context: Context?, response: RegisterResponseHandler? = null): Boolean

Registers the payment terminal, which involves creating resources needed by the terminal API.

Link copied to clipboard

Set the card verification handler.

Link copied to clipboard
open override fun setParameter(parameter: Parameter, value: Int): Boolean

Set parameter.

Link copied to clipboard
open override fun setScreenBrightness(context: Context, brightnessPercent: Int): Boolean

Set screen brightness.

Link copied to clipboard
open override fun setSleepTime(context: Context, time: SleepTimeValues): Boolean

Set the sleep time value.

Link copied to clipboard
open override fun setSuspendTime(context: Context, time: SuspendTimeValues): Boolean

Set the suspend time value.

Link copied to clipboard
open override fun setTransactionAmounts(transactionAmounts: TransactionAmounts): Boolean

If a zero amount is provided in the transaction request, this call can be used to update the transaction with an amount.

Link copied to clipboard
open override fun shutdown(restart: Boolean): Boolean

Shuts down the payment terminal.

Link copied to clipboard
open override fun startPrintJob(context: Context): PrintJob

Starts a new printer job.

Link copied to clipboard
open override fun systemWakeUp(context: Context): Boolean

Wakeup the system when in sleep mode.

Link copied to clipboard
fun unregister(context: Context?)

Unregister the payment terminal, which involves freeing the resources used by the terminal API.

Link copied to clipboard
open override fun validateMerchantPassword(password: String): Boolean

Validate the merchant password.