Project

zatca

0.01
There's a lot of open issues
No release in over a year
A library for generating QR Codes for the e-invoice standard by ZATCA in Saudi Arabia.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
 Dependencies

Development

~> 9.0
~> 3.10
~> 1.3

Runtime

~> 2.1.0
~> 2.4
 Project Readme

zatca

A Ruby library for generating QR Codes for the e-invoice standard by ZATCA in Saudi Arabia.

✅ Validated to have the same output as ZATCA's SDK as of 12 November 2021.

Installation

Rubygems

gem install zatca

Bundler

bundle add zatca

Usage

require "zatca"

tags = {
  seller_name: "Mrsool",
  vat_registration_number: "310228833400003",
  timestamp: "2021-10-20T19:29:32+03:00",
  vat_total: "15",
  invoice_total: "115",
}

ZATCA.render_qr_code(tags)
# => data:image/png;base64,...
# Hint (Try pasting the above into your web browser's address bar)

If you'd like to customize the size of the QR Code you can manually use the generator like so:

require "zatca"

tags = ZATCA::Tags.new({
  seller_name: "Mrsool",
  vat_registration_number: "310228833400003",
  timestamp: "2021-10-20T19:29:32+03:00",
  vat_total: "15",
  invoice_total: "115",
})

generator = ZATCA::QRCodeGenerator.new(tags)
generator.render(size: 512)