thalesog / pix-utils Goto Github PK
View Code? Open in Web Editor NEWSet of tools to parse, generate and validate payments of Brazil Instant Payment System (Pix) in Javascript
License: MIT License
Set of tools to parse, generate and validate payments of Brazil Instant Payment System (Pix) in Javascript
License: MIT License
v2.0.0
version don't support browser
When used, we have issues with TextEncoder
module.
pix-utils/src/types/pixFunctions.ts
Line 14 in 6279dd0
esta interface nao deve ser usada como esta, o correto seria utilizar o codigo importado de dynamicPayload =>
// PIXFetchParams adicionado na linha abaixo
import { PIXFetchResults, PIXFetchParams } from '../dynamicPayload';
import { PixDynamicObject, PixStaticObject } from './pixElements';
import { PixError } from './pixError';
export interface PixFnDefault {
readonly toBRCode: () => string;
readonly toImage: () => Promise<string>;
}
export interface PixStaticFn extends PixFnDefault {
readonly throwIfError: () => PixStaticObject;
}
export interface PixDynamicFn extends PixFnDefault {
// trocado abaixo por PIXFetchParams
readonly fetchPayload: (params: PIXFetchParams) => Promise<PIXFetchResults | PixError>;
readonly throwIfError: () => PixDynamicObject;
}
export {};
Return with pix payload, the pix key type.
Ex:
const pix = parsePix(
'[email protected] por Pix-Utils52040000530398654041.005802BR5914Thales Ogliari6015SAO MIGUEL DO O62070503***6304059A'
);
// {
// type: 'STATIC',
// merchantCategoryCode: '0000',
// transactionCurrency: '986',
// countryCode: 'BR',
// merchantName: 'Thales Ogliari',
// merchantCity: 'SAO MIGUEL DO O',
// pixKey: '[email protected]',
+ pixKeyType: 'EMAIL',
// transactionAmount: 1,
// infoAdicional: 'Gerado por Pix-Utils',
// txid: '***',
// toBRCode: [Function: toBRCode],
// toImage: [Function: toImage]
// }
I'm submitting a ...
[ X ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
I'm having trouble generating a pix key (brcode) with additional information (message).
I have another project that gets the message sent on the PIX to relate to my bank.
When I do a pix manually, sending a message, my script finds the message.
But when I use pix-utils passing an infoAdditional
, when sending the PIX the message appears,
but when I see the extract there is no message.
Would it be something outdated in the lib, a bug or is the function to add a message not implemented?
infoAdditional
is the custom message right?
Thanks
I'm submitting a ...
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[*] question about how to use this project
Como funciona o PIX dinâmico?
Baseado neste exemplo:
const pix = createDynamicPix({
merchantName: 'Thales Ogliari',
merchantCity: 'Sao Paulo',
url: 'https://pix.thalesogliari.com.br',
}).throwIfError();
Percebi que passamos apenas 3 parametros,
mas minha duvida é, para que serve a URL?
o que acontece com ela ? após o pagamento ela vai ser chamada pelo banco ao concluir a transação ?
e se ele é dinâmico por que não tem o campo valor ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.