-
Notifications
You must be signed in to change notification settings - Fork 1
Introduction
patricnson edited this page Sep 13, 2021
·
1 revision
To implement the EPAS Client Library is almost as simple as importing it to your project. Follow these steps and you should be ready to send your first transactions within minutes.
void Display(string text);
void PrintReceipt(ReceiptData receipt);
void PrintReport(string report);
bool VerifySignature(string displayText, out bool signatureOk);
bool HandleVoiceReferral(string displayText, out string approvalCode);
bool PaymentCodeRequired(string displayText, out string paymentCode);
bool VatAmountRequired(string displayText, out decimal vatAmount);
bool LoyaltyCardPresented(string cardNumber, out bool cardAccepted);
bool CheckDccOnOriginalTransaction(string displayText, out bool dccWasUsed);
void ParameterDownloadAvailable(string displayText, out bool permitDownload);
void Log(LogLevel level, string text);
These are explored in detail in the API document found in this repo.
- CardActionNotification CardStatus
- CardAcceptedNotification CardAccepted
- StatusNotification BusyStatus
- StatusNotification LinkStatus
- EpasMessageReceiver RawMessageHandler
These are documented in the API document
TerminalNetworkConnection tnc = new TerminalNetworkConnection()
{
TerminalConnectionDetails =
new IPEndPoint(IPAddress.Parse("192.168.0.18"), 3000),
UseKeepAlive = true
};
if (mEpas.ConnectNetwork(tnc) == ApiResult.OK)
{
......
TerminalEnvironment te = new TerminalEnvironment()
{
AuthorisationServer = new IPEndPoint(IPAddress.Parse("185.27.171.42"), 55144),
ConfigurationServer = new IPEndPoint(IPAddress.Parse("185.27.171.42"), 55133),
ISO639_1_LanguageCode = TerminalEnvironment.LangSwedish,
OperatorId = "cashier_1",
TerminalId = "80000082"
};
if (mEpas.Login(te, out LoginResponse lr) == ApiResult.OK)
{
if (lr?.LoggedIn)
{
......
if (mEpas.Purchase(499, out TransactionResponse tr) == ApiResult.OK)
{
if (tr.Approved)
{
MessageBox.Show("Purchase approved");
}
else
{
MessageBox.Show("Purchase declined: " + tr.ToString());
}
}
The library will call IClientApp methods and optional handlers during the transaction.
LogoutResponse lr;
epas.Logout(out lr);
epas.Disconnect();
There is not much more to it really. If you want some extra control over the integration then you should consider:
- You will probably want to do your own receipt formatting.
- You will have to supply the terminal ID and server addresses.
- You will have to manage your own transaction totals and daily accounts.
- Currently limited to .Net on Windows, though we plan to introduce a Java library in the future.
- Currently limited to network connections, but we plan to add USB / serial in the future.