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

TypePackagePurpose
CarbonTerminalse.westpay.posapplibMain implementation of terminal operations.
PaymentTerminalse.westpay.posapplibInterface implemented by CarbonTerminal.
TerminalSettingsse.westpay.posapplibTerminal ID, hosts, language, and force-login settings.
TransactionRequestse.westpay.posapplibBase transaction request.
PurchaseRequest / RefundRequestse.westpay.posapplibTransaction-specific request models.
TransactionResponsese.westpay.posapplibTransaction result, receipts, and payment details.
TransactionResponseHandlerse.westpay.posapplibCallback for completed transactions.
CardVerificationHandlerse.westpay.posapplibCallback for cardholder verification when required.

Lifecycle

  1. Create a CarbonTerminal.
  2. Build TerminalSettings.
  3. Call initialise.
  4. Wait for InitialisationResponseHandler.
  5. Call doTransaction with a request and response handler.
  6. Print or store the preformatted receipts from TransactionResponse.

Initialise

java
PaymentTerminal 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

java
PurchaseRequest 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

MethodPurpose
doTransactionStarts a purchase/refund transaction.
abortTransactionRequests that the current transaction is aborted.
getLastTransactionResultRetrieves the last known transaction result.
getTerminalStatusReads terminal status.
getPrinterStatusReads printer state.
enableNavigationBar / disableNavigationBarControls Android navigation UI.
checkForUpdatesChecks whether updates are available.
doMaintenanceStarts 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 doTransaction with createIntentForTransaction plus ActivityResultLauncher.
  • Replace legacy response handlers with createTransactionResponseFromIntent.
  • Move to se.westpay.paaslib.* packages.
  • Revisit receipt printing because PAaS 2 exposes PrintJob for text and bitmap printing.