dolalima/pix-php

PHP library for the PIX Tools for Qrcode generation

0.0.1 2025-09-12 17:14 UTC

This package is auto-updated.

Last update: 2025-09-12 17:14:34 UTC


README

Latest Version on Packagist Total Downloads Software License

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

The MIT License (MIT). Please see License File for more information.