PHP code example of victor-renan / pixgenerator
1. Go to this page and download the library: Download victor-renan/pixgenerator 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/ */
victor-renan / pixgenerator example snippets
// 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()
// ...
// 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');