Socket
Book a DemoInstallSign in
Socket

node-pix-payload

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pix-payload

This library that aims to build the payload of pix payment, with this payload the developer can generate the qr code payable or pay informed the same in the bank's app.

1.4.0
latest
Source
npmnpm
Version published
Weekly downloads
35
483.33%
Maintainers
1
Weekly downloads
 
Created
Source

node-pix-payload

This package that aims to build the payment pix payload, with this payload the developer can generate the qr code to pay or pay informing the same in the bank's app

  • Installation
  • Example
  • Saving

Installation

Inside your project folder do:

npm i node-pix-payload

Example

Example static

const Payload = require('node-pix-payload');

const payload_static = Payload.setPixKey('1c995784-b8a4-482a-952e-4b8cd6928216')
.setDescription('payment xyz')
.setMerchantName('IJ Solutions')
.setMerchantCity('MACEIO')
.setAmount('100.00')
.setTxid('ij123');

payload_static.getData().then((data) =>{
    console.log(data)
})
.catch(err => console.log(err));  

Example dynamic

const Payload = require('node-pix-payload');

const location = 'qrpix.seupsp.com.br/qr/v2/c-8c7193b-34cc6180be87850a-89193060-9705a6b8';
const payload = Payload.setMerchantName('IJ Solutions')
                .setMerchantCity('VICOSA')
                .setAmount('113.00')
                .setTxid('***')
                .setUrl(location)
                .setUniquePayment(true);

payload.getData().then((data) => {
    console.log(data);
}).catch(err => console.log(err))  

Saving

Possible output formats are: png and svg. format default is png.

    const location = 'qrpix.seupsp.com.br/qr/v2/c-8c7193b-34cc6180be87850a-89193060-9705a6b8';
    const payload_dynamic = Payload.setMerchantName('IJ Solutions')
                    .setMerchantCity('VICOSA')
                    .setAmount('113.00')
                    .setTxid('***')
                    .setUrl(location)
                    .setUniquePayment(true);

    const data = await payload_dynamic.getData();
    data.outPut('files/qrcode_dynamic.png');

Output svg

   const payload_static = Payload.setPixKey('1c995784-b8a4-482a-952e-4b8cd6928216')
    .setDescription('payment xyz')
    .setMerchantName('IJ Solutions')
    .setMerchantCity('MACEIO')
    .setAmount('100.00')
    .setTxid('ij123');

    const data = await payload_static.getData();
    data.outPut('files/qrcode_static.svg','svg');

Keywords

pix

FAQs

Package last updated on 04 Apr 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.