PHP code example of nexy / pix

1. Go to this page and download the library: Download nexy/pix library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nexy / pix example snippets




= new Nexy\Pix\QRCode();

// Informe a chave Pix

// CPF
$pix->chave('12345678900'); // CPF sem pontos ou traço

// Ou CNPJ
$pix->chave('00038166000105'); // CNPJ sem pontos, barra ou traço

// Ou E-Mail
$pix->chave('[email protected]');

// Ou Telefone
$pix->chave('+5561912345678'); // O telefone deve ter código do país e DDD, sem traços, espaços ou parênteses

// Ou chave aleatória (EVP - Endereço virtual de pagamento)
$pix->chave('123e4567-e12b-12d1-a456-426655440000'); // A chave EVP é case insensitive

// Receber R$ 1.000,00
$pix->valor(1000); // A moeda padrão é o real brasileiro. Para mudar, veja Campos Opcionais.

$pix->lojista('Fulano de Tal');
$pix->cidade('BRASILIA');
$pix->pais('BR');
$pix->moeda(986); // Real brasileiro (BRL) - Conforme ISO 4217: https://pt.wikipedia.org/wiki/ISO_4217
$pix->info('Descritivo');
$pix->txId('***'); // Utilize o número do pedido/parcela ou outro campo único para o pagamento.

$link = $pix->toLink();

$pix->toFile('qrcode.png');