EmvQr

object EmvQr(source)

Entry point of the library: decodes EMVCo Merchant-Presented QR codes following the Colombian industry standard EASPBV v1.4-2025 (Redeban, Credibanco, Bre-B).

Decoding is lenient by design: malformed input never throws. The parser extracts every well-formed TLV element and stops silently at the first invalid one; absent fields decode as null (or "" for the few fields the contract defines as non-null). Standard compliance is the authorizing backend's responsibility, not this client library's — use decodeWithDiagnostics when you want to observe how much of the payload was actually parsed.

Decoding does not verify integrity; check the CRC first with isCrcValid if your flow requires it.

if (EmvQr.isCrcValid(rawText)) {
val data = EmvQr.decode(rawText)
}

Functions

Link copied to clipboard

Decodes rawText into the typed sections of QRCodeEmvCoColombiaData.

Link copied to clipboard

Decodes rawText and additionally reports ParseDiagnostics describing how much of the payload the lenient parser consumed — useful for logging and support when a QR in the field deviates from the standard.

Link copied to clipboard
fun isCrcValid(rawText: String): Boolean

Returns true when the last 4 characters of rawText match the CRC-16/CCITT-FALSE checksum (tag 63) of everything before them, computed over the UTF-8 bytes per ISO/IEC 13239.