dolalima / pix-php
PHP library for the PIX Tools for Qrcode generation
0.0.1
2025-09-12 17:14 UTC
Requires
- php: >=7.0
- endroid/qr-code: ^6.0
README
A PHP library for generating PIX QR codes.
About the Project
This library allows you to generate PIX QR codes in your PHP projects. It is compliant with the standards defined by the Central Bank of Brazil.
Getting Started
Prerequisites
- PHP >= 7.0
- GD Extension
Installation
You can install the library via Composer:
composer require dolalima/pix-php
Usage
<?php require 'vendor/autoload.php'; use PixPhp\Pix; // Create a new Pix instance with your data $pix = new Pix( 'your.pix.key@example.com', // Your PIX key 'Your Name', // Your name 'Your City', // Your city 'TXID1234', // A unique transaction ID 10.00 // The amount ); // Add unreserved template (optional) $pix->setUnreservedTemplate('COM.SISGR.LTI', 'TC-123456'); // Get the QR code as a base64 encoded image $qrCode = $pix->getQrCode(); // Display the QR code echo '<img src="' . $qrCode . '" />'; // You can also get the PIX string $pixString = $pix->getPixString();
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
The MIT License (MIT). Please see License File for more information.