Receipts and Events

Last updated: 2026-05-19

Receipt Data

The terminal sends receipt data as structured fields instead of a fixed text block. This lets an ECR print on different receipt widths, use custom formatting, support electronic receipts, and store transaction data for reporting.

The library can also generate a simple fixed-width receipt string. Use the language tabs below to compare the receipt callback implementation across .NET, Java, and Swift.

.NET

csharp
public void PrintReceipt(ReceiptData receipt)
{
    receiptRepository.Save(receipt);
    receiptPrinter.Print(receipt.GenerateSimpleReceipt(32));
}

Java

java
@Override
public void PrintReceipt(ReceiptData receipt) {
    receiptRepository.save(receipt);
    receiptPrinter.print(receipt.generateSimpleReceipt(32));
}

Swift

swift
func printReceipt(receipt: ReceiptData) {
    receiptRepository.save(receipt)
    receiptPrinter.print(receipt.generateSimpleReceipt(width: 32))
}

Receipt Contents

Important receipt areas include:

AreaExamples
TransactionType, timestamp, reference, currency, net amount, cashback, VAT, tip, total.
MerchantMerchant name, address, city, zip, phone, organisation number.
AuthorisationVerification method, authorisation channel, responder, response code, approval code.
CardMasked card number, card name, entry method, payment code.
EMVAID, TVR, TSI, compact or long EMV receipt text.
DCCProvider, rate, converted amount, markup, card scheme, disclaimer.

Receipt Timing

Most approved card transactions produce merchant and cardholder receipts. A cancelled transaction may produce only a cardholder receipt. If a terminal loses power during a partly completed transaction, PrintReceipt can be called after the next login, outside the context of the original active transaction.

In the Swift sample application, receipts are grouped by transaction and the merchant or cardholder copy can be selected from the history detail view.

DCC Handling

DCC lets a cardholder pay in their own currency when the terminal, card, transaction type, and card range allow it. DCC affects the ECR in two areas:

  • DCC receipts must include the required disclaimer text.
  • DCC refunds must indicate whether DCC was used in the original purchase.

Use the tabs below for the callback shape in each wrapper.

.NET

csharp
public bool CheckDccOnOriginalTransaction(string displayText, out bool dccWasUsed)
{
    Display(displayText);
    dccWasUsed = cashierPrompts.Confirm("Was DCC used in the original transaction?");
    return true;
}

Java

java
@Override
public Pair<Boolean, Boolean> CheckDccOnOriginalTransaction(String displayText) {
    Display(displayText);
    boolean dccWasUsed = cashierPrompts.confirm("Was DCC used in the original transaction?");
    return new Pair<>(true, dccWasUsed);
}

Swift

swift
func checkDccOnOriginalTransaction(displayText: String) async -> BooleanCallbackResult? {
    display(text: displayText)
    let used = await cashierPrompts.confirm("Was DCC used in the original transaction?")
    return BooleanCallbackResult(handled: true, value: used)
}

Identifying Cards

Do not rely on the receipt card name alone for issuer reporting. The card name can be product text supplied by the card. Use the masked card number IIN or the EMV AID when you need issuer or scheme classification.

Common AID or RID examples:

RIDScheme
A000000003Visa
A000000004Mastercard
A000000025American Express
A000000333UnionPay

Terminal Events

Use terminal events to keep the ECR UI in sync.

EventRecommended handling
Link downMark terminal unavailable and schedule reconnect.
Busy trueDisable new transaction buttons and show terminal busy status.
Busy falseRe-enable actions if the terminal is logged in.
Card insertedUpdate cashier UI and wait for the transaction flow.
Card acceptedStore masked card data only if needed for display or reporting.
Display textMirror the terminal or cashier message area in the ECR.
Raw XMLStore only in diagnostics or support tooling.

Log Storage and XML Trace

The library receives trace data from the terminal and stores or exposes rotating trace information. In .NET, set epas.Options.StorageDirectory when you want logs in a known support folder.

csharp
string storage = Path.Combine(
    Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
    "EpasClientLibraryLogs");

Directory.CreateDirectory(storage);
epas.Options.StorageDirectory = storage;

The Swift SDK exposes XML-level diagnostics through:

  • func log(level: LogLevel, text: String)
  • func epasMessageReceived(message: String)

The sample ECR uses these hooks to show terminal display text, XML trace, and activity logs separately.