victor-renan / pixgenerator
A static PIX (copy and paste) generator
v1.0.1
2025-03-11 13:20 UTC
Requires (Dev)
- phpunit/phpunit: ^11.5
This package is auto-updated.
Last update: 2025-06-11 14:08:24 UTC
README
A library with no-dependency for generating PIX copy-and-paste codes for static QR Codes. Based on Pix Manual Reference By the BCB (Banco Central do Brasil).
Installation
Latest version via Packagist:
composer require victor-renan/pixgenerator
Usage
Getting Started
<?php // Import the PixGenerator class use VictorRenan\PixGenerator\PixGenerator; // Creates an instance using your Pix key $generator = new PixGenerator('<PixKey>'); // Create the static code $code = $generator->getCode()
Customizing the generated code
// ... // Sets the transaction amount $generator->setTransactionAmount(1.00); // Sets the transaction id $generator->setTransactionId('txId'); // Sets the merchant name $generator->setMerchantName('Jonh Doe'); // Sets the merchant city $generator->setMerchantCity('Brasilia'); // Sets additional info message $generator->setAdditionalInfo('Message');
Testing
Clone this repoitory and install the dev-dependencies via Composer. After this, you can run PHPUnit:
./vendor/bin/phpunit