Java Function Reference

Last updated: 2026-05-19

Java Function Reference

The Java wrapper exposes its operational surface through se.westpay.epas.connections.classes.EpasClient, IClientApp, ApiDefinitions, and related request or response models.

Construction and Core Surface

MemberPurpose
new EpasClient(IClientApp app)Creates one client instance for one terminal integration context.
setParameter(ApiDefinitions.AppParamIds appParamId, Object parameterValue)Sets application-level wrapper parameters before use.
complete()Finalises parameter chaining and activates the configured settings.

Session and Connection Functions

FunctionPurpose
connectNetwork(ApiDefinitions.TerminalNetworkConnection connectionDetails, Object... objects)Connects the ECR to the terminal over TCP or IP.
disconnect()Closes the terminal connection.
login(ApiDefinitions.TerminalEnvironment environment)Logs in to the terminal using environment and backend host details.
logout()Logs out the current terminal session.

Purchase and Payment Functions

FunctionPurpose
purchase(ApiDefinitions.PurchaseTransactionAmounts transactionAmounts)Runs a standard purchase using amount plus optional cashback.
purchase(double purchaseAmount, String paymentMethod)Runs an alternative payment method purchase when supported.
purchase(PurchaseRequest purchaseRequest)Runs a purchase using the full request model.
purchaseBeforeAmount()Starts a purchase before the final amount is known.
sendPurchaseAmounts(ApiDefinitions.PurchaseTransactionAmounts purchaseAmount)Completes a pre-amount purchase by supplying the final amounts.
refund(double refundAmount)Runs a simple refund by amount.
refund(RefundRequest refundRequest)Runs a refund using the full refund model.
cashAdvance(double purchaseAmount)Runs a cash advance transaction.
reversal(String transactionReference)Reverses the latest matching transaction when permitted.
getLastTransaction(String terminalId)Retrieves the most recent transaction details from the terminal.
requestTransactionAbort()Sends a best-effort abort request for the active transaction.
sendCustomerInquiry(CustomerInquiryRequest request)Shows a customer inquiry dialogue on the terminal and returns the customer selection.
abortCustomerInquiry()Aborts the currently active customer inquiry dialogue.

Terminal Control and Administration

FunctionPurpose
enableCardReaders(boolean enable, ApiDefinitions.EnableCardReaderOptions cardReaderOptions)Opens or closes terminal card readers outside an active transaction.
requestPrint(String data, String output)Requests terminal-side printing using text or XHTML output format.
requestAdministrativeOperation(ApiDefinitions.AdminOperation operation)Requests an administrative terminal flow such as host login, parameter update, or print configuration.
sendRawXml(String xml)Sends raw EPAS XML directly to the terminal and returns only the API result.
sendRawXmlWithResult(String xml)Sends raw EPAS XML directly to the terminal and also returns the raw terminal result text.
close()Closes the wrapper and underlying terminal integration resources.

The current Java wrapper also supports the same business flows as the .NET wrapper through its underlying EPAS operations, even where the wrapper groups some implementation details differently from Swift.

Client Callback Interface

The Java wrapper uses IClientApp for operational callbacks and notification enablement.

Required and operational callbacks

SignaturePurpose
void Display(String text)Shows cashier-facing text from the terminal.
void PrintReceipt(ReceiptData receipt)Receives merchant and cardholder receipts.
void PrintReport(String report)Receives report text.
Pair<Boolean, Boolean> VerifySignature(String displayText)Requests signature approval or rejection.
Pair<Boolean, Boolean> ForceFallback(String displayText)Requests fallback approval or rejection.
Pair<Boolean, String> HandleVoiceReferral(String displayText)Requests a voice-referral approval code.
Pair<Boolean, String> PaymentCodeRequired(String displayText)Requests a payment code.
Pair<Boolean, Double> VatAmountRequired(String displayText)Requests a VAT amount.
Pair<Boolean, Boolean> LoyaltyCardPresented(String cardNumber)Requests a loyalty-card handling decision.
Pair<Boolean, Boolean> CheckDccOnOriginalTransaction(String displayText)Requests DCC confirmation during eligible refund flows.
boolean ParameterDownloadAvailable(String displayText)Requests approval to start parameter download.
void Log(ApiDefinitions.LogLevel level, String text)Receives wrapper and terminal log entries.

Settings and Support Functions

FunctionPurpose
setParameter(ApiDefinitions.AppParamIds appParamId, Object parameterValue)Sets wrapper application parameters such as timers and size limits.
complete()Finalises parameter chaining and applies settings before operational use.
stopLogFileTemporarily()Temporarily stops file logging until logging resumes automatically.
cleanAllLogFiles()Deletes stored trace log files.
startNewLogFile()Starts a new trace log file and rotates older files.

Notification Controls and Callbacks

Notification enablement methods

FunctionPurpose
IsRawMessageHandlerEnabled()Enables or disables raw EPAS message diagnostics.
IsCardAcceptedNotificationEnabled()Enables or disables accepted-card callbacks.
IsCardActionNotificationEnabled()Enables or disables card inserted or removed callbacks.
IsBusyStatusNotificationEnabled()Enables or disables busy-state callbacks.

Notification callback methods

FunctionPurpose
CardActionNotification(boolean cardInserted)Reports card inserted or removed state.
CardAcceptedNotification(ApiDefinitions.CardAcceptedEventArgs args)Reports accepted-card details such as masked PAN.
BusyStatusNotification(boolean state)Reports terminal busy-state changes.
LinkStatusNotification(boolean state)Reports connection state changes.
EpasMessageReceiver(String message)Receives raw EPAS XML for diagnostics.

Usage Notes

  • The Java wrapper typically returns Pair<ApiResult, T> rather than using out parameters.
  • Parameter setup and complete() are part of the public integration surface and should be documented alongside connection and transaction flows.
  • Notification enablement flags are part of the effective public API because they control whether the callback methods are used at runtime.
  • The Java wrapper exposes more diagnostic and support-oriented helper functions than the current Swift wrapper, especially around raw XML response capture and some parameter controls.

Related Types