SwissQrBill.PaymentReference (swiss_qr_bill v0.1.3)

Copy Markdown View Source

Payment reference information for Swiss QR bills.

Reference types:

  • :qrr — QR payment reference (27 digits, used with QR-IBAN)
  • :scor — Creditor Reference / ISO 11649 (RF prefix, used with regular IBAN)
  • :non — No reference

Summary

Functions

Returns the formatted reference for display.

Creates a payment reference.

Returns the QR code data fields.

Returns the reference type as a string per spec ("QRR", "SCOR", "NON").

Types

reference_type()

@type reference_type() :: :qrr | :scor | :non

t()

@type t() :: %SwissQrBill.PaymentReference{
  reference: String.t() | nil,
  type: reference_type()
}

Functions

formatted_reference(payment_reference)

@spec formatted_reference(t()) :: String.t() | nil

Returns the formatted reference for display.

  • QRR: groups of 5 from the right
  • SCOR: groups of 4 from the left
  • NON: nil

new(type, reference \\ nil)

@spec new(reference_type(), String.t() | nil) :: t()

Creates a payment reference.

qr_code_data(pr)

@spec qr_code_data(t()) :: [String.t() | nil]

Returns the QR code data fields.

type_string(payment_reference)

@spec type_string(t()) :: String.t()

Returns the reference type as a string per spec ("QRR", "SCOR", "NON").