Technical Tuesday: Automated EMV card terminal integration testing

It is crucial that card acceptance works smoothly at the Point of Sale. Therefore, testing is very important to everyone here at payworks and we decided to build a robot which automatically tests our whole solution by autonomously operating a card reader coupled together with our SDK

Paying via card is easy and convenient. We are used to this and it is annoying to both the shopper and the merchant when things do not work smoothly at the point of sale. This is why we text excessively to make sure that all transactions are behaving as you expect it.

However thorough testing takes a lot of time: Time that we would rather use to build awesome new features and improve our product. Therefore, we built a robot that does all testing for us whenever we commit a new version to our continuous integration system.

Manual testing of credit card solutions is no fun

In the payment card industry, testing payment solutions is a manual and repetitious process. It usually involves a large deck of testing cards, numerous test scenarios and a careful person going through all of them. One by one. Popular examples for such testing suites are ADVT (Visa) and M-TIP (MasterCard). This not only takes a long time, but manual testing is also very prone to human errors.

Card emulation hardware like the Collis SmartLink Box makes our lives easier already by emulating a variety of different cards and providing valuable feedback to the tester. Using a TCP interface, the Collis software is connected to our testing app. We have also formalized test cases such that our tester app automatically selects the right card emulation when testing.

This makes testing faster, but still involves a human being for inserting/removing the card and entering PINs into the card reader.

Our new colleague is a robot and does the repetitious work

We decided to build a solution that can automate that last remaining steps. Quickly a LEGO MINDSTORMS EV3 system was chosen as the construction system.

Robot Component Overview

The core component of the EV3 system is in fact a small 300 MHz ARM9 machine. With the LeJos firmware installed, it becomes a vivid Linux machine, allowing SSH and executing Java programs. LeJos comes with a Java SDK that makes developing software on the brick fast and easy.

The robot’s brick runs our small web service based on NanoHTTPD. Our testing app connects to that via HTTP and issues commands such as POST /entryPin/1234. The software then employs its sensors and motors for entering the PIN into the device.

It took us several iterations to come up with a final construction that is both reliable and fast. We are using touch sensors for calibrating the motors during the initial start-up. Some parts needed extra fixation and are secured using cable ties. For performing accurate movements, we employed new linear actuators (the gray cylinders next to the left touch sensor). In general, we are amazed by the motors’ power and precision.

Linear Aactuators and Touch Sensor

The current solution can run through all supported test cases without human interaction. Only those involving swiping are not (yet) possible. Each test case takes around 50 seconds, making both ADVT and M-TIP finish in less than half an hour.

PIN Entry Arm