Skip to content
JonathaBarbalhoPublic

About

.NET toolkit for Brazilian payments and fiscal documents: Pix, Boleto, CNAB, NFS-e/DANFSe

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

BrazilKit

A .NET toolkit for Brazilian payments and fiscal documents — Pix, Boleto, CNAB, and NFS-e/DANFSe.

Pix (static BR Code) is implemented. Boleto, CNAB, and NFS-e/DANFSe are still planned.

Pix

BrazilKit.Pix builds and parses the static Pix BR Code (the EMV-MPM payload/"copia e cola"), renders it as a QR Code image, and simulates the JSON notification the Pix API sends to a receiver's webhook. See docs/pix.md for the design decisions behind it, and samples/BrazilKit.Pix.Sample for a runnable example.

var data = new StaticBrCodeData(
    PixKey: "123e4567-e12b-12d1-a456-426655440000",
    MerchantName: "Loja Exemplo",
    MerchantCity: "Sao Paulo",
    Amount: 25.75m,
    TransactionId: "PEDIDO123");

var brCode = StaticBrCodeBuilder.Build(data);       // brCode.Value is the copy-and-paste BR Code
var png = PixQrCodeGenerator.GeneratePng(brCode.Value);

What BrazilKit.Pix does not do

  • Dynamic Pix (cob/cobv charges) — that requires a PSP integration authenticated with mTLS, out of scope for a payload-formatting library.
  • Validate that a Pix key is real or owned by anyone — a key is treated as an opaque string.
  • Run a webhook server — the webhook simulator only builds the notification JSON; it makes no HTTP call and receives none.
  • Integrate with any PSP or bank — there is no network access anywhere in this library.

Structure

  • src/libs — the toolkit's libraries: BrazilKit.Core, BrazilKit.Pix, and, as they land, one library per remaining domain area (Boleto, CNAB, NFS-e).
  • src/app — a host application, once one is needed.
  • tests — automated tests, one test project per library.
  • samples — sample projects showing how to use the libraries.
  • docs — design notes and reference material, including a glossary of the domain terms used throughout the codebase.

Building and testing

dotnet restore
dotnet build
dotnet test

License

MIT — see LICENSE.

About

.NET toolkit for Brazilian payments and fiscal documents: Pix, Boleto, CNAB, NFS-e/DANFSe

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages