PAaS 1 Library
Last updated: 2026-05-14
PAaS 1 Library
PAaS 1 is the legacy Java PAaS library distributed as posapplib-1.10.0.jar. Existing integrations may still use it, but new integrations should use PAaS 2 Library unless Westpay advises otherwise.
Main Types
| Type | Package | Purpose |
|---|---|---|
CarbonTerminal | se.westpay.posapplib | Main implementation of terminal operations. |
PaymentTerminal | se.westpay.posapplib | Interface implemented by CarbonTerminal. |
TerminalSettings | se.westpay.posapplib | Terminal ID, hosts, language, and force-login settings. |
TransactionRequest | se.westpay.posapplib | Base transaction request. |
PurchaseRequest / RefundRequest | se.westpay.posapplib | Transaction-specific request models. |
TransactionResponse | se.westpay.posapplib | Transaction result, receipts, and payment details. |
TransactionResponseHandler | se.westpay.posapplib | Callback for completed transactions. |
CardVerificationHandler | se.westpay.posapplib | Callback for cardholder verification when required. |
Lifecycle
- Create a
CarbonTerminal. - Build
TerminalSettings. - Call
initialise. - Wait for
InitialisationResponseHandler. - Call
doTransactionwith a request and response handler. - Print or store the preformatted receipts from
TransactionResponse.
Initialise
javaPaymentTerminal terminal = new CarbonTerminal(); TerminalSettings settings = new TerminalSettings(); settings.setTerminalId("80000001"); settings.setConfigurationHosts(new String[] { "185.27.171.42:55133" }); settings.setAuthorisationHosts(new String[] { "185.27.171.42:55144" }); boolean accepted = terminal.initialise( settings, response -> { TerminalStatus status = response.getTerminalStatus(); log("Initialisation completed: " + status); }, notification -> log("Notification: " + notification) );
Transaction
javaPurchaseRequest request = new PurchaseRequest(); request.setCurrencyId(752); request.setTotalAmount(10000); request.setSaleId("sale-1001"); boolean accepted = terminal.doTransaction( request, response -> { if (response.getError() == TransactionError.NONE) { print(response.getMerchantReceipt()); print(response.getCardholderReceipt()); } else { showError(response.getError().toString()); } }, verification -> true );
Common Operations
| Method | Purpose |
|---|---|
doTransaction | Starts a purchase/refund transaction. |
abortTransaction | Requests that the current transaction is aborted. |
getLastTransactionResult | Retrieves the last known transaction result. |
getTerminalStatus | Reads terminal status. |
getPrinterStatus | Reads printer state. |
enableNavigationBar / disableNavigationBar | Controls Android navigation UI. |
checkForUpdates | Checks whether updates are available. |
doMaintenance | Starts supported maintenance flow. |
Serial Communication Package
The legacy docs also include se.westpay.libserial. This package contains lower-level serial communication helpers such as SerialCommunication, Com.BaudRates, Com.StopBits, Com.DataBits, and Com.Parity. Most PAaS app integrations should stay at the PaymentTerminal abstraction unless a Westpay integration guide specifically requires serial-level access.
Migration Note
PAaS 2 changes the transaction launch model from direct doTransaction callbacks to Android Intent launch/result handling. When migrating:
- Replace
doTransactionwithcreateIntentForTransactionplusActivityResultLauncher. - Replace legacy response handlers with
createTransactionResponseFromIntent. - Move to
se.westpay.paaslib.*packages. - Revisit receipt printing because PAaS 2 exposes
PrintJobfor text and bitmap printing.