{"id":18809570,"url":"https://github.com/leguass7/brpix-api-node","last_synced_at":"2025-10-16T10:39:44.701Z","repository":{"id":44571414,"uuid":"346566428","full_name":"leguass7/brpix-api-node","owner":"leguass7","description":"API para transações PIX usando gerencianet.com.br","archived":false,"fork":false,"pushed_at":"2022-06-12T19:40:40.000Z","size":1441,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-02T17:28:31.665Z","etag":null,"topics":["api","gerencianet","nodejs","pix","qrcode"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leguass7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-11T03:29:56.000Z","updated_at":"2023-07-03T13:21:40.000Z","dependencies_parsed_at":"2022-08-31T14:23:05.111Z","dependency_job_id":null,"html_url":"https://github.com/leguass7/brpix-api-node","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/leguass7/brpix-api-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leguass7%2Fbrpix-api-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leguass7%2Fbrpix-api-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leguass7%2Fbrpix-api-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leguass7%2Fbrpix-api-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leguass7","download_url":"https://codeload.github.com/leguass7/brpix-api-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leguass7%2Fbrpix-api-node/sbom","scorecard":{"id":583320,"data":{"date":"2025-08-11","repo":{"name":"github.com/leguass7/brpix-api-node","commit":"78bf89057fa746237e830064c1132b7e14798e32"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/deploy-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/deploy-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-publish.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/deploy-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy-publish.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/leguass7/brpix-api-node/deploy-publish.yml/master?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T19:46:08.032Z","repository_id":44571414,"created_at":"2025-08-20T19:46:08.032Z","updated_at":"2025-08-20T19:46:08.032Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279179363,"owners_count":26120429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","gerencianet","nodejs","pix","qrcode"],"created_at":"2024-11-07T23:16:53.296Z","updated_at":"2025-10-16T10:39:44.683Z","avatar_url":"https://github.com/leguass7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# brpix-api-node\nEssa é uma lib para fluxo de pagamento com o PIX. Utiliza para os testes o (PSP) endpoint da [GERENCIANET.COM.BR](https://gerencianet.com.br/pix/)\n\n![standard-image](https://img.shields.io/badge/code%20style-standard-brightgreen.svg) [![Coverage Status](https://coveralls.io/repos/github/leguass7/brpix-api-node/badge.svg?branch=master)](https://coveralls.io/github/leguass7/brpix-api-node?branch=master) [![NPM](https://img.shields.io/npm/v/brpix-api-node.svg)](https://www.npmjs.com/package/brpix-api-node) [![ci](https://github.com/leguass7/brpix-api-node/actions/workflows/deploy.yml/badge.svg?branch=master)](https://github.com/leguass7/brpix-api-node/actions/workflows/deploy.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n## Como utilizar?\n 1) Crie uma conta de desenvolvedor na [GERENCIANET.COM.BR](https://gerencianet.com.br/pix/)\n 2) Crie uma aplicação no menu **Minhas aplicações** e adquira o ```Client_Id```, ```Client_Secret```\n 3) Em seguida adquira um certificado *.p12* de homologação no menu **Meus certificados** \n 4) Configure no ```.env``` do seu repositório as respectivas informações conforme o ```.env.example```\n\n### Instalação\n```\nyarn add brpix-api-node\n``` \nou \n```\nnpm -i brpix-api-node\n```\n\n### Exemplo de implementação\n```js\nimport { ApiPix } from 'brpix-api-node'\n\n/** @type {IApiPixConfig} */\nconst apiConfig = {\n  clientId: process.env.CLIENT_ID,\n  clientSecret: process.env.CLIENT_SECRET,\n  baseURL: 'https://api-pix-h.gerencianet.com.br',\n  // debug: true,\n  certificate: {\n    path: './certificates/certificate.p12',\n    passphrase: '' // senha do certificado (vazio para homologação)\n  }\n}\n\n// nova instância \nconst pix = new ApiPix(apiConfig)\n\n// inicia acesso no PSP\npix.init().then(() =\u003e {\n  console.log('token de acesso adquirido', api.token)\n})\n\n// ou também pode iniciar acesso assim\nconst response = await api.getAccessToken()\nconsole.log(response.accessToken)\n```\n\n### Criar uma cobrança PIX dinâmica\n\n```js\n/** @type {IRequestCreateImmediateCharge} */\nconst request = {\n  calendario: {\n    expiracao: 3600 // 1 hora\n  },\n  chave: '12345678900', // chave pix do cobrador\n  devedor: {\n    cpf: '98765432100',\n    nome: 'Fulano de Tal'\n  },\n  solicitacaoPagador: 'Pagamento do pedido 123',\n  valor: {\n    original: '10.20'\n  }\n}\n\n\n// levando um txid\nconst txid = 'GERE_O_SEU_TXID_123'\nconst cob = await pix.createCob(request, txid)\n\n//ou  gerando txtid automaticamente\nconst cob = await pix.createCob(request)\n\n//ou  pode adquirir um txid da classe antes da requisição\nconst myTxid = pix.txidGenerate()\nconst cob = await pix.createCob(request, myTxid)\n\n// seguindo para gerar QRCode\nif(response \u0026\u0026 response.location) {\n  /** @type {IQRCodePayload} */\n  const payload = {\n      amount: cob.valor.original,\n      merchantCity: 'Cidade do cobrador',\n      merchantName: 'Nome do cobrador', \n      pixKey: request.chave,\n      txid: cob.txid,\n      uniquePayment: true,\n      url: cob.location // importante para pix dinâmico\n    }\n    const codePayload = new QRCodePayload(payload)\n\n    // pode adquirir a string do QRCode\n    console.log('string payload', codePayload.getPayload()) \n\n    // adquirir string base64 para imagem QRCode\n    const strBase64 =  await codePayload.getQRCode()\n\n    /** \n     * Use no frontend\n     * \u003cimg src={strBase64} /\u003e\n     */\n}\n\n```\n\n### Criar um pix QRCode stático\n\n```javascript\nimport { QRCodePayload } from 'brpix-api-node'\n\n// instanciando QRCode\nconst codePayload = new QRCodePayload({\n  isStatic: true, // importante sinalizar que é pix estático\n  txid: 'GERE_SEU_TXID_123456', // no pix estático será preenchido com '***' automaticamente\n  pixKey: 'CHAVE_PIX_DO_COBRADOR',\n  amount: '1.50',\n  merchantCity: 'Cidade_do_cobrador',\n  merchantName: 'Nome_do_cobrador',\n  uniquePayment: false, // true se deve ser usado apenas uma vez\n  description: 'Descricao do pagamento'\n})\n\n// ou assim \nconst codePayload = new QRCodePayload()\n  .set('txid', 'GERE_SEU_TXID_123456')\n  .set('isStatic', true)\n  .set('pixKey', 'CHAVE_PIX_DO_COBRADOR')\n  .set('amount', '1.50')\n  .set('merchantCity', 'Cidade_do_cobrador')\n  .set('merchantName', 'Nome_do_cobrador')\n  .set('uniquePayment', false)\n  .set('description', 'Descricao do pagamento')\n\n // pode adquirir a string do QRCode\n console.log('string payload', codePayload.getPayload()) \n\n // adquirir string base64 para imagem QRCode\n const strBase64 = await codePayload.getQRCode({ width: 400 })\n /** \n  * Use no frontend\n  * \u003cimg src={strBase64} /\u003e\n  */\n\n  // ou \n  await codePayload.save(`./qrcode-${txid}.png`, { width: 400, type: 'png' })\n\n```\n\n\n### Contribuindo\nSolicitações pull são bem-vindas! Se você vir algo que gostaria de adicionar, faça. Para mudanças drásticas, abra uma ```issue``` primeiro.\n\n## MIT License\n\nCopyright (c) 2021 [Leandro Sbrissa](https://github.com/leguass7)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleguass7%2Fbrpix-api-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleguass7%2Fbrpix-api-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleguass7%2Fbrpix-api-node/lists"}