![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@axenda/zatca
Advanced tools
[![NPM](https://nodei.co/npm/@axenda/zatca.png?mini=true)](https://npmjs.org/package/@axenda/zatca)
An unofficial package to help developers implement ZATCA (Fatoora) QR code easily which is required for e-invoicing in Saudi Arabia.
✅ Validated to have the same output as ZATCA's SDK as of 18 November 2021.
To get started, install the package:
npm i --save @axenda/zatca
First, import Invoice class or Tag class to represent an invoice QR code:
import { Invoice } from '@axenda/zatca';
// or
import { Tag } from '@axenda/zatca';
Second, create an instance of Invoice or an array of Tag class:
const invoice = new Invoice({
sellerName: 'Axenda',
vatRegistrationNumber: '1234567891',
invoiceTimestamp: '2021-12-04T00:00:00Z',
invoiceTotal: '100.00',
invoiceVatTotal: '15.00',
});
// or
const tags: Tag[] = [
new Tag(1, 'Axenda'),
new Tag(2, '1234567891'),
new Tag(3, '2021-12-04T00:00:00Z'),
new Tag(4, '100.00'),
new Tag(5, '15.00'),
];
Now you can generate TLV string from the invoice or from the tags array:
const tlv = invoice.toTlv();
// or
import { toTlv } from '@axenda/zatca';
const tlv = toTlv(tags)
You cloud generate Base64 string from the invoice or from the tags array:
const base64 = invoice.toBase64();
// or
import { tagsToBase64 } from '@axenda/zatca';
const base64 = tagsToBase64(tags);
You can generate image data (png) from base64 string and render it in browser:
const imageData = await invoice.render();
// or
import { renderTags } from '@axenda/zatca';
const imageData = await renderTags(tags);
Use the image data to display the QR code in browser:
<img src='{imageData}' alt="Invoice QR Code">
Simple, all you need to generate a QR code is:
import { Invoice } from '@axenda/zatca';
const invoice = new Invoice({
sellerName: 'Axenda',
vatRegistrationNumber: '1234567891',
invoiceTimestamp: '2021-12-04T00:00:00Z',
invoiceTotal: '100.00',
invoiceVatTotal: '15.00',
});
const imageData = await invoice.render();
To run test suites, first install dependencies, then run npm test
:
npm install
npm test
We welcome contributions of all kinds from anyone. Please take a moment to review the guidelines for contributing.
The MIT License (MIT). Please see License File for more information.
FAQs
[![NPM](https://nodei.co/npm/@axenda/zatca.png?mini=true)](https://npmjs.org/package/@axenda/zatca)
The npm package @axenda/zatca receives a total of 2,831 weekly downloads. As such, @axenda/zatca popularity was classified as popular.
We found that @axenda/zatca demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.