Contactless Transactions

A browser-based payment system that lets people pay by phone and receive a physical item automatically, without touching the equipment - built during the pandemic and retrofitted onto existing machines.

The client has given us permission to feature this project on the understanding that their name and specific details are redacted.

ClientXXXXXXXXXXXXXXXX Limited
UN SDGs03 Good Health And Well-Being
ImpactUnited Kingdom
TechnologiesPHP, API, IoT
Collage on beige circle: Nurse with flask, scientist at controls, rabbit, bird, sunflower, small plane, geometric diagram, 'L'ACTION' text

01 Introduction

During the Pandemic, XXXXXXXXXXXXXXXX asked us to develop a system that would let a member of the public use their mobile phone to pay for a product and receive a physical item automatically — without making any physical contact. The mechanism had to be retrofitted onto equipment that was already distributed around the UK.

02 The Project

There were several challenges to work through.

First, how the user would trigger the payment on their phone. QR codes were becoming popular, but a QR code stuck to the outside of equipment in a public space carries too high a risk of tampering for something handling payments. We chose NFC chips instead, which are far more secure as long as they aren't writeable.

Second, speed of adoption. With such a short timeframe to get the system live and in use, there was no time to educate the public or get them to download an app. So we made the payment system open directly in a web browser - the most frictionless option.

Once a customer had tapped the NFC chip, opened the browser, and paid successfully, the system needed to signal the physical device. We did this using MQTT, a lightweight publish-subscribe network protocol designed for the Internet of Things. The signal had to wake the device, send the instruction, trigger the release mechanism, and send a success message back - with every step logged in the database.

$url = 'mqtt.thingstream.io';
$port = 1883;

$client = new karpy47\PhpMqttClient\MQTTClient($url, $port);
// $client->setDebug();
$client->setAuthentication($username, $password);
$client->setEncryption('../cert.pem');
$success = $client->sendConnect($client_id, true, 20, 10000);
if ($success) {
    $client->sendSubscribe('events/connectSuccess');
    $messages = $client->getPublishMessages(
        100,
        true,
        false
    );

    foreach ($messages as $message) {
        $connectedDevice = json_decode($message['message'], true);
        if($connectedDevice['identityId'] == $device){
            echo 'device '.$device.' found';
        }
    }
    $client->sendDisconnect();
}
$client->close();

03 Conclusion

The system was rolled out successfully to its target audience. It let a specific community interact with equipment that had been retrofitted with minimal effort, and receive the products they needed without making any physical contact.

AndAnotherDay

Innovative digital products for organisations and businesses who align with the UN SDGs

Get in touch with us today to discuss your project and how we can help.

Contact