Repository: joseviniciusnunes/qrcode-pix
Branch: master
Commit: 1fb4405dbe22
Files: 13
Total size: 18.6 KB
Directory structure:
gitextract_e_7_k0cf/
├── .editorconfig
├── .github/
│ └── workflows/
│ └── main.yml
├── .gitignore
├── LICENSE
├── README.md
├── __tests__/
│ └── QrCode.test.ts
├── example/
│ └── example.ts
├── jest.config.js
├── lib/
│ ├── index.d.ts
│ └── index.js
├── package.json
├── src/
│ └── index.ts
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
[*]
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single
max_line_length = 120
[**/**.yml]
indent_style = space
indent_size = 2
max_line_length = 300
charset = utf-8
================================================
FILE: .github/workflows/main.yml
================================================
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: yarn install
run: yarn
- name: yarn test
run: yarn test
================================================
FILE: .gitignore
================================================
node_modules
build
coverage
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2020 Jose Vinicius
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
<p align="center">
<img src="https://user-images.githubusercontent.com/22475804/114474255-346b1a00-9bcc-11eb-877f-0095c6fd5dba.jpg" height="200px" />
<h1 align="center">QR Code PIX - NodeJS and Browser</h1>
</p>
<br />
QR Code generator for the Brazilian payment system PIX
[](https://github.com/joseviniciusnunes/qrcode-pix/actions)
[](https://www.npmjs.com/package/qrcode-pix)
---
## Installation
```bash
yarn add qrcode-pix --exact
```
or
```bash
npm i qrcode-pix --save-exact
```
---
## Quick Start
```js
import { QrCodePix } from 'qrcode-pix';
const qrCodePix = QrCodePix({
version: '01',
key: 'test@mail.com.br', //or any PIX key
name: 'Fulano de Tal',
city: 'SAO PAULO',
transactionId: 'YOUR_TRANSACTION_ID', //max 25 characters
message: 'Pay me :)',
cep: '99999999',
value: 150.99,
});
console.log(qrCodePix.payload()); // '00020101021126510014BR.GOV.BCB.PIX...'
console.log(await qrCodePix.base64()); // 'data:image/png;base64,iVBORw0...'
```
---
## Interface
```js
interface IParameter {
version: string;
key: string;
city: string;
name: string;
value?: number;
transactionId?: string;
message?: string;
cep?: string;
currency?: number; //default: 986 ('R$')
countryCode?: string; //default: 'BR'
}
interface IResponse {
payload: () => string; //payload for QrCode
base64: (options?) => Promise<string>; //QrCode image base64
}
```
---
## Specification
### Latest revision version: 3.0.2 (2022-02-04)
### Specification by Bacen [(DOC)](https://www.bcb.gov.br/content/estabilidadefinanceira/forumpireunioes/AnexoI-PadroesParaIniciacaodoPix.pdf)
---
## Donate
### Contribute to keeping revisions up to date.
<img src="https://user-images.githubusercontent.com/22475804/152584043-f4e28661-66e5-4fef-a0c0-25ddea08a41d.png" height="100px" />
================================================
FILE: __tests__/QrCode.test.ts
================================================
import { QrCodePix, QrCodePixParams } from '../src/index';
describe('QRCode PIX Generate', () => {
it('Test validate version schema', async () => {
const param: QrCodePixParams = {
version: '02', //02 is not valid
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
};
expect(() => QrCodePix(param)).toThrow('Version not supported');
});
it('Test QrCode', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
});
await expect(response.base64()).resolves.toBe(qrCodeTest);
});
it('01 - Basic Payload', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
});
expect(response.payload()).toBe(
'00020126380014BR.GOV.BCB.PIX0116test@mail.com.br5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62070503***6304102F'
);
});
it('02 - Basic - Currency', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
currency: 986,
});
expect(response.payload()).toBe(
'00020126380014BR.GOV.BCB.PIX0116test@mail.com.br5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62070503***6304102F'
);
});
it('03 - Basic - Value', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
value: 100.99,
});
expect(response.payload()).toBe(
'00020126380014BR.GOV.BCB.PIX0116test@mail.com.br5204000053039865406100.995802BR5913FULANO DE TAL6009SAO PAULO62070503***63049359'
);
});
it('04 - Basic - countryCode', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
countryCode: 'BR',
});
expect(response.payload()).toBe(
'00020126380014BR.GOV.BCB.PIX0116test@mail.com.br5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62070503***6304102F'
);
});
it('05 - Basic - cep', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
cep: '85000100',
});
expect(response.payload()).toBe(
'00020126380014BR.GOV.BCB.PIX0116test@mail.com.br5204000053039865802BR5913FULANO DE TAL6009SAO PAULO61088500010062070503***63041747'
);
});
it('06 - Basic - Transaction ID', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
transactionId: 'my_transaction_id',
});
expect(response.payload()).toBe(
'00020126380014BR.GOV.BCB.PIX0116test@mail.com.br5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62210517my_transaction_id630461CE'
);
});
it('07 - Basic - message', async () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
message: 'is my message :)',
});
expect(response.payload()).toBe(
'00020126580014BR.GOV.BCB.PIX0116test@mail.com.br0216is my message :)5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62070503***63045A4E'
);
});
it('ignore value zero', () => {
const response = QrCodePix({
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
value: 0,
});
expect(response.payload()).toBe(
'00020126380014BR.GOV.BCB.PIX0116test@mail.com.br5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62070503***6304102F'
);
});
it('should not accept negative values', () => {
const param: QrCodePixParams = {
version: '01',
key: 'test@mail.com.br',
name: 'Fulano de Tal',
city: 'SAO PAULO',
value: -10,
};
expect(() => QrCodePix(param)).toThrow('Value must be a positive number');
});
});
const qrCodeTest =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAAklEQVR4AewaftIAAAdDSURBVO3BQY4cy5LAQDLQ978y5y19lUCiqjVSfDez/7DWJQ5rXeSw1kUOa13ksNZFDmtd5LDWRQ5rXeSw1kUOa13ksNZFDmtd5LDWRQ5rXeSw1kUOa13khw+p/EkVfzOVqWJSmSqeqEwVk8qTikllqnii8idVfOKw1kUOa13ksNZFfviyim9S+U0qb1RMKk9Upoo3KiaVqWJSeUNlqnhS8U0q33RY6yKHtS5yWOsiP/wylTcq3lCZKiaVqeITKk8qvkllqnhSMalMFd+k8kbFbzqsdZHDWhc5rHW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Q5rXeSw1kUOa13ksNZFDmtd5LDWRQ5rXeSw1kUOa13ksNZF/g9c2Z2lcelbXgAAAABJRU5ErkJggg==';
================================================
FILE: example/example.ts
================================================
import { QrCodePix } from '../src';
const qrCodePix = QrCodePix({
version: '01',
key: 'test@mail.com.br', //or any PIX key
name: 'Fulano de Tal',
city: 'SAO PAULO',
transactionId: 'YOUR_TRANSACTION_ID',
message: 'Pay me :)',
cep: '99999999',
value: 150.99,
});
console.log(qrCodePix.payload());
qrCodePix.base64().then((res) => {
console.log(res);
});
================================================
FILE: jest.config.js
================================================
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
forceExit: true,
testTimeout: 10000,
collectCoverageFrom: ['src/*.ts'],
collectCoverage: true,
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
testMatch: ['**/**.test.ts'],
};
================================================
FILE: lib/index.d.ts
================================================
import qrcode from 'qrcode';
interface QrCodePixParams {
version: string;
key: string;
city: string;
name: string;
value?: number;
transactionId?: string;
message?: string;
cep?: string;
currency?: number;
countryCode?: string;
}
declare function QrCodePix({ version, key, city, name, value, message, cep, transactionId, currency, countryCode, }: QrCodePixParams): {
payload: () => string;
base64: (options?: qrcode.QRCodeToDataURLOptions | undefined) => Promise<string>;
};
export { QrCodePixParams, QrCodePix };
================================================
FILE: lib/index.js
================================================
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QrCodePix = void 0;
const qrcode_1 = __importDefault(require("qrcode"));
const crc_1 = require("crc");
const yup_1 = require("yup");
function QrCodePix({ version, key, city, name, value, message, cep, transactionId = '***', currency = 986, countryCode = 'BR', }) {
yup_1.string().equals(['01'], 'Version not supported').validateSync(version);
yup_1.string()
.min(2, 'countryCode: 2 characters')
.max(2, 'countryCode: 2 characters')
.nullable()
.validateSync(countryCode);
yup_1.string().min(8, 'cep: 8 characters').max(8, 'cep: 8 characters').nullable().validateSync(cep);
if (String(value) === '0') {
value = undefined;
}
yup_1.number().nullable().positive('Value must be a positive number').validateSync(value);
yup_1.string().max(25, 'transactionId: max 25 characters').nullable().validateSync(transactionId);
const payloadKeyString = generateKey(key, message);
const payload = [
genEMV('00', version),
genEMV('26', payloadKeyString),
genEMV('52', '0000'),
genEMV('53', String(currency)),
];
if (value) {
payload.push(genEMV('54', value.toFixed(2)));
}
name = String(name)
.substring(0, 25)
.toUpperCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '');
city = String(city)
.substring(0, 15)
.toUpperCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '');
payload.push(genEMV('58', countryCode.toUpperCase()));
payload.push(genEMV('59', name));
payload.push(genEMV('60', city));
if (cep) {
payload.push(genEMV('61', cep));
}
payload.push(genEMV('62', genEMV('05', transactionId)));
payload.push('6304');
const stringPayload = payload.join('');
const crcResult = crc_1.crc16ccitt(stringPayload).toString(16).toUpperCase().padStart(4, '0');
const payloadPIX = `${stringPayload}${crcResult}`;
return {
payload: () => payloadPIX,
base64: (options) => qrcode_1.default.toDataURL(payloadPIX, options),
};
}
exports.QrCodePix = QrCodePix;
function generateKey(key, message) {
const payload = [genEMV('00', 'BR.GOV.BCB.PIX'), genEMV('01', key)];
if (message) {
payload.push(genEMV('02', message));
}
return payload.join('');
}
function genEMV(id, parameter) {
const len = parameter.length.toString().padStart(2, '0');
return `${id}${len}${parameter}`;
}
================================================
FILE: package.json
================================================
{
"name": "qrcode-pix",
"author": "José Vinicius <joseviniciuus@outlook.com>",
"version": "5.0.0",
"main": "lib/index.js",
"license": "MIT",
"repository": "joseviniciusnunes/qrcode-pix",
"keywords": [
"qrcode",
"pix"
],
"dependencies": {
"crc": "^4.1.1",
"qrcode": "^1.5.0",
"yup": "^0.32.11"
},
"scripts": {
"example": "ts-node-dev ./example/example.ts",
"test": "jest --detectOpenHandles --ci",
"build": "tsc --build"
},
"devDependencies": {
"@babel/preset-typescript": "^7.12.1",
"@types/jest": "^26.0.15",
"@types/qrcode": "^1.3.5",
"@types/yup": "^0.29.9",
"jest": "^26.6.3",
"ts-jest": "^26.4.4",
"ts-node-dev": "^1.0.0",
"typescript": "^4.1.2"
}
}
================================================
FILE: src/index.ts
================================================
import qrcode, { QRCodeToDataURLOptions } from 'qrcode';
import { crc16ccitt } from 'crc';
import { string, number } from 'yup';
interface QrCodePixParams {
version: string;
key: string;
city: string;
name: string;
value?: number;
transactionId?: string;
message?: string;
cep?: string;
currency?: number;
countryCode?: string;
}
function QrCodePix({
version,
key,
city,
name,
value,
message,
cep,
transactionId = '***',
currency = 986,
countryCode = 'BR',
}: QrCodePixParams) {
string().equals(['01'], 'Version not supported').validateSync(version);
string()
.min(2, 'countryCode: 2 characters')
.max(2, 'countryCode: 2 characters')
.nullable()
.validateSync(countryCode);
string().min(8, 'cep: 8 characters').max(8, 'cep: 8 characters').nullable().validateSync(cep);
if (String(value) === '0') {
value = undefined;
}
number().nullable().positive('Value must be a positive number').validateSync(value);
string().max(25, 'transactionId: max 25 characters').nullable().validateSync(transactionId);
const payloadKeyString = generateKey(key, message);
const payload: string[] = [
genEMV('00', version),
genEMV('26', payloadKeyString),
genEMV('52', '0000'),
genEMV('53', String(currency)),
];
if (value) {
payload.push(genEMV('54', value.toFixed(2)));
}
name = String(name)
.substring(0, 25)
.toUpperCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '');
city = String(city)
.substring(0, 15)
.toUpperCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '');
payload.push(genEMV('58', countryCode.toUpperCase()));
payload.push(genEMV('59', name));
payload.push(genEMV('60', city));
if (cep) {
payload.push(genEMV('61', cep));
}
payload.push(genEMV('62', genEMV('05', transactionId)));
payload.push('6304');
const stringPayload = payload.join('');
const crcResult = crc16ccitt(stringPayload).toString(16).toUpperCase().padStart(4, '0');
const payloadPIX = `${stringPayload}${crcResult}`;
return {
payload: () => payloadPIX,
base64: (options?: QRCodeToDataURLOptions) => qrcode.toDataURL(payloadPIX, options),
};
}
function generateKey(key: string, message?: string): string {
const payload: string[] = [genEMV('00', 'BR.GOV.BCB.PIX'), genEMV('01', key)];
if (message) {
payload.push(genEMV('02', message));
}
return payload.join('');
}
function genEMV(id: string, parameter: string): string {
const len = parameter.length.toString().padStart(2, '0');
return `${id}${len}${parameter}`;
}
export { QrCodePixParams, QrCodePix };
================================================
FILE: tsconfig.json
================================================
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"declaration": true,
"esModuleInterop": true,
"skipLibCheck": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./lib"
},
"include": ["src"],
"exclude": ["__tests__/**"],
"declaration": true
}
gitextract_e_7_k0cf/ ├── .editorconfig ├── .github/ │ └── workflows/ │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── __tests__/ │ └── QrCode.test.ts ├── example/ │ └── example.ts ├── jest.config.js ├── lib/ │ ├── index.d.ts │ └── index.js ├── package.json ├── src/ │ └── index.ts └── tsconfig.json
SYMBOL INDEX (8 symbols across 3 files)
FILE: lib/index.d.ts
type QrCodePixParams (line 2) | interface QrCodePixParams {
FILE: lib/index.js
function QrCodePix (line 10) | function QrCodePix({ version, key, city, name, value, message, cep, tran...
function generateKey (line 60) | function generateKey(key, message) {
function genEMV (line 67) | function genEMV(id, parameter) {
FILE: src/index.ts
type QrCodePixParams (line 5) | interface QrCodePixParams {
function QrCodePix (line 18) | function QrCodePix({
function generateKey (line 96) | function generateKey(key: string, message?: string): string {
function genEMV (line 104) | function genEMV(id: string, parameter: string): string {
Condensed preview — 13 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (20K chars).
[
{
"path": ".editorconfig",
"chars": 264,
"preview": "[*]\nindent_style = space\nindent_size = 4\ncharset = utf-8\nend_of_line = lf\ntrim_trailing_whitespace = true\ninsert_final_n"
},
{
"path": ".github/workflows/main.yml",
"chars": 291,
"preview": "name: Tests\n\non:\n push:\n branches: [master]\n pull_request:\n branches: [master]\n\n workflow_dispatch:\n\njobs:\n bu"
},
{
"path": ".gitignore",
"chars": 28,
"preview": "node_modules\nbuild\ncoverage\n"
},
{
"path": "LICENSE",
"chars": 1070,
"preview": "MIT License\n\nCopyright (c) 2020 Jose Vinicius\n\nPermission is hereby granted, free of charge, to any person obtaining a c"
},
{
"path": "README.md",
"chars": 2037,
"preview": "<p align=\"center\">\n <img src=\"https://user-images.githubusercontent.com/22475804/114474255-346b1a00-9bcc-11eb-877f-0095"
},
{
"path": "__tests__/QrCode.test.ts",
"chars": 7315,
"preview": "import { QrCodePix, QrCodePixParams } from '../src/index';\n\ndescribe('QRCode PIX Generate', () => {\n it('Test validat"
},
{
"path": "example/example.ts",
"chars": 391,
"preview": "import { QrCodePix } from '../src';\n\nconst qrCodePix = QrCodePix({\n version: '01',\n key: 'test@mail.com.br', //or "
},
{
"path": "jest.config.js",
"chars": 388,
"preview": "module.exports = {\n preset: 'ts-jest',\n testEnvironment: 'node',\n forceExit: true,\n testTimeout: 10000,\n "
},
{
"path": "lib/index.d.ts",
"chars": 562,
"preview": "import qrcode from 'qrcode';\ninterface QrCodePixParams {\n version: string;\n key: string;\n city: string;\n nam"
},
{
"path": "lib/index.js",
"chars": 2684,
"preview": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule"
},
{
"path": "package.json",
"chars": 839,
"preview": "{\n \"name\": \"qrcode-pix\",\n \"author\": \"José Vinicius <joseviniciuus@outlook.com>\",\n \"version\": \"5.0.0\",\n \"main"
},
{
"path": "src/index.ts",
"chars": 2832,
"preview": "import qrcode, { QRCodeToDataURLOptions } from 'qrcode';\nimport { crc16ccitt } from 'crc';\nimport { string, number } fro"
},
{
"path": "tsconfig.json",
"chars": 389,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"es6\",\n \"module\": \"commonjs\",\n \"strict\": true,\n \"decla"
}
]
About this extraction
This page contains the full source code of the joseviniciusnunes/qrcode-pix GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 13 files (18.6 KB), approximately 6.7k tokens, and a symbol index with 8 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.