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.
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);- Dynamic Pix (
cob/cobvcharges) — 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.
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.
dotnet restore
dotnet build
dotnet testMIT — see LICENSE.