A PHP library for generating PIX QR codes.
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.
- PHP >= 7.0
- GD Extension
You can install the library via Composer:
composer require dolalima/pix-php<?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();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
The MIT License (MIT). Please see License File for more information.