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.
| Callback | Purpose |
|---|---|
| Display | Show cashier-facing text from the terminal. |
| Print receipt | Receive structured merchant and cardholder receipts. |
| Print report | Receive report output as plain text. |
| Verify signature | Ask whether the cashier accepts the signature. |
| Handle voice referral | Collect an approval code during voice referral. |
| Payment code required | Collect a payment code from cashier or operator. |
| VAT amount required | Collect VAT or sales tax amount when the terminal requires it. |
| Loyalty card presented | Decide how to handle a presented loyalty card. |
| Check DCC on original transaction | Confirm whether a prior transaction used DCC. |
| Parameter download available | Permit or defer a terminal parameter update. |
| Log | Receive wrapper and terminal log messages. |
Status and Notification Callbacks
These callbacks keep the ECR UI and diagnostics aligned with the terminal state.
| Notification | Purpose |
|---|---|
| Link status | Connection up or down between ECR and terminal. |
| Busy status | Long-running terminal work such as download or service state. |
| Card action | Card inserted or removed. |
| Card accepted | Card accepted by terminal, often with masked PAN details. |
| Raw message | Raw EPAS message received for support or diagnostics use. |
Swift Delegate Shape
The Swift wrapper uses EpasClientDelegate on the main actor.
UI and printing
swiftfunc display(text: String) func printReceipt(receipt: ReceiptData) func printReport(report: String) func log(level: LogLevel, text: String)
Cashier decision callbacks
swiftfunc 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
swiftfunc 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.