GithubHelp home page GithubHelp logo

obahareth / zatca Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mrsool/zatca

3.0 1.0 2.0 50.38 MB

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

License: MIT License

Ruby 99.89% Shell 0.11%

zatca's Introduction

zatca

A Ruby library for generating QR Codes and e-invoices according to the standard created by ZATCA in Saudi Arabia.

This library supports both Phase 1 and Phase 2. Phase 2 support is still new so there may be bugs. Please report any issues you find.

Installation

Rubygems

gem install zatca-zdk

Bundler

bundle add zatca-sdk

Migrating from Original Version

If you were using the original version of this library, you can migrate to the new version by changing the gem name in your Gemfile from zatca to zatca-sdk.

As of this moment there are no new changes to the API, so you should be able to use the new version without any changes to your code.

This fork was made because my access to the original repository was removed and I wanted to continue maintaining the library.

Usage

Phase 1

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: 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: tags)
generator.render(size: 512)

Phase 2

Documentation lives in the wiki

Notice of Non-Affiliation and Disclaimer

This library is not affiliated, associated, authorized, endorsed by, or in any way officially connected with ZATCA (Zakat, Tax and Customs Authority), or any of its subsidiaries or its affiliates. The official ZATCA website can be found at https://zatca.gov.sa.

zatca's People

Contributors

obahareth avatar wes4m avatar

Stargazers

 avatar Anas avatar Roman avatar

Watchers

 avatar

zatca's Issues

Enhance How Gem is Required

It would be great to have a structure similar to ActiveSupport, something like so:

Being able either require "zatca" (all of zatca) or specific modules like require "zatca/qr_code"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.