![Fluent Assertions Faces Backlash After Abandoning Open Source Licensing](https://cdn.sanity.io/images/cgdhsj6q/production/98cc622027c44eed628584f02cb3b6e79be011c7-1500x1500.webp?w=400&fit=max&auto=format)
Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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.
✨ You could use it in both frontend and backend Nodejs projects.
✅ 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
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();
// Read the following sections for more details.
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:
invoice.toTlv();
// or using tags array
import { toTlv } from '@axenda/zatca';
toTlv(tags)
You cloud generate Base64 string from the invoice or from the tags array:
invoice.toBase64();
// or using tags array
import { tagsToBase64 } from '@axenda/zatca';
tagsToBase64(tags);
You can generate image data (png) from base64 string and render it in browser:
await invoice.render();
// or using tags array
import { renderTags } from '@axenda/zatca';
await renderTags(tags);
Use the image data to display the QR code in browser:
<!-- For React -->
<img src={imageData} alt="Invoice QR Code">
<!-- For Angular -->
<img [src]="imageData"/>
<!-- Just use the imageData variable no matter what framework you use -->
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 3,741 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.