View Source QRNBU.Validators.Reference (NBU payment QR v0.3.3)
Validator for payment reference number.
Validates reference strings used to identify specific invoices or transactions.
Summary
Functions
Validates reference string.
Functions
Validates reference string.
Rules
- Maximum 35 characters
- Any alphanumeric characters and common separators allowed
Examples
iex> QRNBU.Validators.Reference.validate("INV-12345")
{:ok, "INV-12345"}
iex> QRNBU.Validators.Reference.validate("")
{:error, "Reference cannot be empty"}
iex> QRNBU.Validators.Reference.validate(String.duplicate("A", 36))
{:error, "Reference must not exceed 35 characters"}