Validation logic for Swiss QR bill data.
Summary
Functions
Validates that a string contains only characters allowed in Swiss QR codes.
Validates a creditor reference (ISO 11649 / SCOR format). Must start with RF, followed by 2 check digits, then 1-21 alphanumeric chars. Check digits are validated using mod-97-10.
Validates the mod-10 recursive check digit of a QR reference.
Uses the standard Swiss modulo-10 table.
Returns false for empty or non-digit input.
Validates a complete QR bill. Returns {:ok, bill} or {:error, errors}.
Returns non-blocking advisory warnings for a bill (these do not affect validity).
Functions
Validates that a string contains only characters allowed in Swiss QR codes.
Validates a creditor reference (ISO 11649 / SCOR format). Must start with RF, followed by 2 check digits, then 1-21 alphanumeric chars. Check digits are validated using mod-97-10.
Validates the mod-10 recursive check digit of a QR reference.
Uses the standard Swiss modulo-10 table.
Returns false for empty or non-digit input.
Validates a complete QR bill. Returns {:ok, bill} or {:error, errors}.
Returns non-blocking advisory warnings for a bill (these do not affect validity).
Currently warns when the QR-IBAN / QR-reference (QRR) combination is used with a non-CHF currency. Per SIX IG QR-bill v2.4 this combination is reserved for CHF; EUR invoices must use a regular IBAN with a Creditor Reference (SCOR) or no reference (NON). It becomes a hard rejection once euroSIC is discontinued (EUR QR-bills move to SEPA Credit Transfer by November 2027 at the latest).