Integrating the EPAS client library
The steps to integrate the EPAS Client Library are:
- Add the library module to the ECR project.
- Add an instance of the library to the ECR application.
- Implement required methods.
- Implement optional handler methods as required.
1. Add a reference to EpasClientLibrary.dll
The EPAS Client Library is implemented as a .NET Framework 4.7.2 class library.
2. Create an EpasClient instance
The EPAS Client Library is implemented by the Epas
using Westpay.Epas;
public class SampleECR : IClientApp
{
/// <summary>
/// Instance of the EPAS client library
/// </summary>
EpasClient mEpas = null;
public SampleECR()
{
// Create the EPAS client library instance
mEpas = new EpasClient(this);
}
.
.
.
}
Note: An
EpasClient
instance is only connected to one terminal at a time. If the ECR needs to interact with several terminals simultaneously, one instance must be created for each terminal.
3. Implement IClientApp
The Epas
- Display
- Print
Recipt - Print
Report - Verify
Signature - Handle
Voice Referral - Payment
Code Required - Vat
Amount Required - Loyalty
Card Presented - Check
Dcc On Original Transaction - Parameter
Download Available - Log
4. Optional methods
The client library offers a range of handler methods that are optional, and the ECR can implement any that will be useful.
Each handler method is implemented as a callback. The ECR simply assigns a method reference to the
appropriate library callback handler in Epas
About callbacks
When the library calls methods in the ECR, only one method will be called at any time. This is done to ensure that there are no
race conditions, since events can happen quickly and it would be confusing if, for example, the CardAccepted
handler is called
while the CardInserted
handler is still executing.
It is, therefore, recommended that the ECR returns from interface methods and handlers as quickly as possible so that the remainder of the transaction can be processed without delay.
There is one exception to this, which is IClient
Using the library
The next step is to start using the library