Callbacks and Notifications

Last updated: 2026-05-19

Callbacks and Notifications

The EPAS wrappers are not just request or response APIs. A large part of the public surface is callback-driven. This page complements the integration guide by listing the callback families and what they mean.

Core Operational Callbacks

These callbacks are part of the normal transaction lifecycle.

CallbackPurpose
DisplayShow cashier-facing text from the terminal.
Print receiptReceive structured merchant and cardholder receipts.
Print reportReceive report output as plain text.
Verify signatureAsk whether the cashier accepts the signature.
Handle voice referralCollect an approval code during voice referral.
Payment code requiredCollect a payment code from cashier or operator.
VAT amount requiredCollect VAT or sales tax amount when the terminal requires it.
Loyalty card presentedDecide how to handle a presented loyalty card.
Check DCC on original transactionConfirm whether a prior transaction used DCC.
Parameter download availablePermit or defer a terminal parameter update.
LogReceive wrapper and terminal log messages.

Status and Notification Callbacks

These callbacks keep the ECR UI and diagnostics aligned with the terminal state.

NotificationPurpose
Link statusConnection up or down between ECR and terminal.
Busy statusLong-running terminal work such as download or service state.
Card actionCard inserted or removed.
Card acceptedCard accepted by terminal, often with masked PAN details.
Raw messageRaw EPAS message received for support or diagnostics use.

Swift Delegate Shape

The Swift wrapper uses EpasClientDelegate on the main actor.

UI and printing

swift
func display(text: String)
func printReceipt(receipt: ReceiptData)
func printReport(report: String)
func log(level: LogLevel, text: String)

Cashier decision callbacks

swift
func verifySignature(displayText: String) async -> BooleanCallbackResult?
func forceFallback(displayText: String) async -> BooleanCallbackResult?
func handleVoiceReferral(displayText: String) async -> TextCallbackResult?
func paymentCodeRequired(displayText: String) async -> TextCallbackResult?
func vatAmountRequired(displayText: String) async -> DecimalCallbackResult?
func loyaltyCardPresented(cardNumber: String) async -> BooleanCallbackResult?
func checkDccOnOriginalTransaction(displayText: String) async -> BooleanCallbackResult?
func parameterDownloadAvailable(displayText: String) async -> Bool

Terminal status and diagnostics

swift
func linkStatusChanged(isConnected: Bool)
func busyStatusChanged(isBusy: Bool)
func cardStatusChanged(isInserted: Bool)
func epasMessageReceived(message: String)

Design Notes

  • Callback handlers should return quickly.
  • UI prompts should be marshalled to the correct UI thread or actor.
  • Even after an abort request, final receipts and responses may still arrive.
  • Receipt callbacks may happen more than once per transaction.
  • Raw-message callbacks should normally be enabled only in diagnostics or support scenarios.

For behavioural examples, see Client Callbacks.