By @R4shSec
A CLI tool for decoding and parsing EMVCo / DuitNow QR codes — extracts merchant details, currency, account info, and more from Malaysia National QR images.
- Decodes QR codes directly from image files
- Parses the full EMVCo TLV (Tag-Length-Value) structure recursively
- Resolves DuitNow sub-tags (merchant account, mobile number, ID type)
- Supports multiple QR codes in a single image
- Outputs as a human-readable table or structured JSON
- Graceful error handling for missing files, unreadable images, and blank results
- Python 3.10+
opencv-pythonpyzbarPillowqreader
Install dependencies:
pip install -r requirements.txtLinux users:
pyzbarrequires the nativezbarlibrary.sudo apt install libzbar0
python3 main.py --image <path-to-qr.png> [--json]| Argument | Required | Description |
|---|---|---|
--image |
Yes | Path to the QR code image file |
--json |
No | Output parsed result as JSON |
Default table output:
python3 main.py --image qr.pngJSON output:
python3 main.py --image qr.png --jsonSample output:
--- QR Code 1 ---
Raw: 00020201021126440014A000000615...
Payload format indicator: 01
Point of initiation method: 12
Merchant account info:
Tag 00: A000000615000101
Tag 06: 0***********3
Tag 12: 8
Merchant category code: 0000
Transaction currency: 458 (MYR)
Country code: MY
Merchant name: R****************U
Merchant city: MY
CRC: 7E6D
| Tag | Field | Notes |
|---|---|---|
00 |
Payload format indicator | Always 01 (EMVCo v1) |
01 |
Point of initiation | 11 = static, 12 = dynamic |
26 |
Merchant account info | DuitNow / PayNet sub-tags |
52 |
Merchant category code | ISO 18245 MCC |
53 |
Transaction currency | ISO 4217 (e.g. 458 = MYR) |
54 |
Transaction amount | Optional |
58 |
Country code | ISO 3166-1 alpha-2 |
59 |
Merchant name | — |
60 |
Merchant city | — |
62 |
Additional data | Bill number, reference |
63 |
CRC checksum | CRC-16/CCITT integrity check |
merchant-qr-parser/
├── main.py # CLI entry point
├── requirements.txt # Python dependencies
└── README.md
| Standard | Status |
|---|---|
| EMVCo QR Code Specification | ✅ |
| Malaysia DuitNow (PayNet) | ✅ |
MIT © @R4shSec