https://gitlab.com/ja4nm/qr-server
The other day I had to pay some bills using SEPA payment forms. The way I usually do this, is by manually transcribing each SEPA form into my online banking application. This is very time-consuming and error-prone task. I find myself constantly double or triple checking each value in a form and It is very annoying.
Luckily, this SEPA forms usually contain a QR code with all the values. There are mobile banking applications which can make a payment just by scanning this QR code. However, I don’t feel comfortable having my main banking account accessible from my phone. It’s just my personal preference.
So I thought to myself... I am gonna make an app for that. It hardly took me a day. The app scans a QR code, starts a minimal HTTP web server and displays a content of the QR code on a local website. As long as your PC is connected to the same Wi-Fi network, you can then access that website from your PC and copy the content. The HTTP server has 3 endpoints:
Initially I wanted to use the app just by myself. However, I got a quite positive feedback when I showed the app to some friends, so I decided to publish it on the Play Store. I am also providing the link to the Git repo at the beginning of the post, in case anyone is interested in contributing to the project.
In February 2021 I had some time to add a webhook functionality to the app. The app is now able to execute a custom HTTP post request when a QR code is scanned. The request will contain the content and other data about the QR code, which has been scanned. Optionally, you can set a token value to identify the client, from which a QR code has been scanned. This makes the app very handy for automating your tasks. Here is an example request which is sent when a QR code is scanned.
{ "deviceManufacturer": "OnePlus", "deviceModel": "8T", "meta": { "ERROR_CORRECTION_LEVEL": "L", "BYTE_SEGMENTS": [ "aHR0cDovL2phbm0uc2k=" ] }, "rawBase64": "QOaHR0cDovL2phbm0uc2kOwR7A==", "text": "http:\/\/janm.si", "timestamp": 1613683828422, "token": "DoOSpEvfkuySaWi8" }
For example, when you scan a QR code on the SEPA payment form you can now make an API call to your bank and execute your payment automatically. Or if you have a company and your inventory items are marked with QR codes, you can send a request which marks the scanned item as present in your database. Or you can even use a Twitter API and tweet automatically when a QR code is scanned. The sky is the limit …