.NET Function Reference
Last updated: 2026-05-19
.NET Function Reference
The .NET wrapper exposes its operational surface through Westpay.Epas.EpasClient, related request or response models, callback delegates, and OperatingParameters.
Construction and Core Surface
| Member | Purpose |
|---|---|
EpasClient(IClientApp app) | Creates one client instance for one terminal integration context. |
Options | Exposes OperatingParameters for runtime behaviour such as currency, tip, card-removal handling, and XML logging. |
Session and Connection Functions
| Function | Purpose |
|---|---|
ConnectNetwork(TerminalNetworkConnection connectionDetails, bool forceReconnect = false) | Connects the ECR to the terminal over TCP or IP. |
Disconnect() | Closes the terminal connection. |
Login(TerminalEnvironment environment, out LoginResponse response) | Logs in to the terminal using terminal and backend environment data. |
Logout(out LogoutResponse response) | Logs out the current terminal session. |
Purchase and Payment Functions
| Function | Purpose |
|---|---|
Purchase(PurchaseRequest request, out TransactionResponse response, string requestDescription = null) | Runs a full purchase using the explicit request model. |
Purchase(PurchaseTransactionAmounts transactionAmounts, out TransactionResponse response) | Runs a purchase using amount plus cashback style input. |
Purchase(decimal purchaseAmount, out TransactionResponse response) | Runs a simple amount-only purchase. |
Purchase(decimal purchaseAmount, string paymentMethod, out TransactionResponse response) | Runs an alternative payment method purchase when supported. |
PurchaseBeforeAmount(out TransactionResponse response) | Starts a purchase flow before the final amount is known. |
SendPurchaseAmounts(PurchaseTransactionAmounts transactionAmount) | Completes a pre-amount purchase by supplying the final amounts. |
Refund(RefundRequest request, out TransactionResponse response) | Runs a refund using the explicit refund model. |
Refund(decimal refundAmount, out TransactionResponse response) | Runs a simple refund by amount. |
Refund(AltMethodTransaction transactionDetails, out TransactionResponse response) | Runs a refund for an alternative payment method transaction. |
CashAdvance(decimal cashAmount, out TransactionResponse response) | Runs a cash advance transaction. |
ReverseLastTransaction(string transactionReference, out TransactionResponse response, ...) | Reverses the most recent matching transaction when allowed. |
GetLastTransaction(string terminalId, out LastTransactionResponse response) | Retrieves the most recent transaction details from the terminal. |
RequestTransactionAbort() | Sends a best-effort abort request for the active transaction. |
SendCustomerInquiry(CustomerInquiryRequest request, out CustomerInquiryResponse response) | 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
| Function | Purpose |
|---|---|
EnableCardReaders(bool enable, EnableCardReaderOptions cardReaderOptions, out EnableReadersResponse response) | Opens or closes terminal card readers outside an active transaction. |
RequestAdministrativeOperation(AdminOperation operation, out AdminResponse response) | Requests an administrative terminal flow such as host login, parameter update, or print configuration. |
Print(PrintRequest request, out PrintResponse response) | Requests terminal-side printing using a structured print request. |
Print(PrintRequest request, Action<ApiResult, PrintResponse> callback) | Requests terminal-side printing asynchronously through a callback. |
SendRawXml(string xml) | Sends raw EPAS XML directly to the terminal for diagnostics or advanced scenarios. |
Client Callback Interface
The .NET wrapper uses IClientApp for operational callbacks.
Required and operational callbacks
| Signature | Purpose |
|---|---|
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. |
bool VerifySignature(string displayText, out bool signatureOk) | Requests signature approval or rejection. |
bool ForceFallback(string displayText, out bool forceFallbackOk) | Requests fallback approval or rejection. |
bool HandleVoiceReferral(string displayText, out string approvalCode) | Requests a voice-referral approval code. |
bool PaymentCodeRequired(string displayText, out string paymentCode) | Requests a payment code. |
bool VatAmountRequired(string displayText, out decimal vatAmount) | Requests a VAT amount. |
bool LoyaltyCardPresented(string cardNumber, out bool useForPayment) | Requests a loyalty-card handling decision. |
bool CheckDccOnOriginalTransaction(string displayText, out bool dccWasUsed) | Requests DCC confirmation during eligible refund flows. |
void ParameterDownloadAvailable(string displayText, out bool permitDownload) | Requests approval to start parameter download. |
void Log(LogLevel level, string text) | Receives wrapper and terminal log entries. |
Logging and Support Functions
| Function | Purpose |
|---|---|
CleanAllLogFiles() | Deletes the wrapper-managed trace log files. |
StartNewLogFile() | Starts a fresh trace log file and rotates older logs. |
StopLogFileTemporarily() | Temporarily stops file logging until the next log write resumes it. |
Close() | Closes internal background components and releases resources. |
Event and Notification Delegates
| Delegate or handler | Purpose |
|---|---|
LinkStatus | Reports connection state changes. |
BusyStatus | Reports terminal busy-state changes. |
CardStatus | Reports card inserted or removed state. |
CardAccepted | Reports accepted-card details such as masked PAN. |
RawMessageHandler | Receives raw EPAS messages for diagnostics. |
Usage Notes
- The .NET wrapper is synchronous on transaction calls and uses
outparameters for typed responses. ApiResult.OKindicates transport and parsing success, not transaction approval.- The callback and status surface is broad enough that many production integrations can keep almost all terminal-facing logic outside the transaction call sites.
- The .NET wrapper still exposes some support helpers that are not yet mirrored in Swift, mainly around a few lower-level diagnostics utilities.