ZATCA FATOORA QR Code
A Go library to encode data for ZATCA FATOORA-compliant QR Codes.
Documentation
Example Code
import (
"github.com/ibrasho/zatca-fatoora-qr-code"
"github.com/skip2/go-qrcode"
)
func main() {
qr := fatoora.NewQRData(
sellerName,
vatRegistrationNumber,
invoiceTimestamp,
strconv.FormatFloat(invoiceTotal, 'f', 2, 64),
strconv.FormatFloat(vatTotal, 'f', 2, 64),
)
// return LTV-encoded []byte
qr.LTV()
// return base64-encoded string (use this to generate the QR)
qr.Base64()
// You can use "github.com/skip2/go-qrcode" to generate the actual image
}