Receipts
ECR17 terminals can send receipt lines as S messages when ECR printing is enabled. The library exposes them through setOnReceiptLine.
client.setOnReceiptLine((line) => {
appendReceiptLine(line.text);
});
await client.enableEcrPrinting(true);
Drain window
Set receiptDrainMs when configuring the client. After a transaction result, the session keeps forwarding receipt lines until the configured silence window expires.
Start with receiptDrainMs: 1500. Increase only if the terminal emits receipt lines slowly on your LAN.
Display model
Append receipt lines to a log area so the operator can confirm what the terminal printed.
Persist raw lines with the payment record only when your compliance and privacy policy allows it.
Limits
Receipt lines are terminal-generated display text. Do not parse them as the source of truth for authorization, amount, or reversal state. Use the structured response fields for business decisions.