Pix QrCode - Pay-In
With the use of this API, it is possible to implement Pix QR code in your business, thus facilitating the receipt of funds from your customers.
About Pix
Pix, the instant payment system of the Central Bank of Brazil, has become increasingly popular due to its convenience and speed, being a convenient option for companies in different sectors.
By using the Pix QR code, your customers can perform financial transactions quickly and securely, without the need to enter bank data or make transfers through other platforms. By offering this payment option in your business, you can increase customer satisfaction and, consequently, improve your financial results.
AgilSpot Pay's API offers an extremely useful functionality for its users: the token key, also known as the Pix key. This key allows the customer to copy and paste the information into their banking app, making it easier to complete the payment. In addition, it is possible to convert this key into a Pix QR Code image, making the financial transaction process even more agile and practical.

A practical example of how the Pix Key can be handled, offering the user two payment options through a single return. This is possible because the Pix Key is a unique information that can be associated with different types of transactions, such as payments through QR code or direct transfer.
By using an API that handles the Pix Key, it is possible to provide the user with the choice between the two payment options, without needing to generate different keys for each one. Thus, the customer can choose the payment method that they consider most convenient at the moment, without having to worry about obtaining new payment information.
Generate the Pix QR Code from the Pix key
If you need to convert a Pix Key to a QR Code, one option is to use the PHP language along with the Mpdf\QrCode library. This library is one of the most widely used by developers for generating QR Codes in PHP and offers a range of features for customizing the generated image.

The process of converting a Pix Key to a QR Code using this library is relatively simple. First, you need to define the Pix Key that will be used as the basis for generating the code. Then, using the QRcode function of the Mpdf\QrCode library, it is possible to generate the corresponding QR Code for the Pix Key.
<?php
use Mpdf\QrCode\QrCode;
use Mpdf\QrCode\Output;
$objNewQrCode = new QrCode($pix_copia_cola); // Converting to QR Code
$imageNew = (new Output\Png)->output($objNewQrCode, 500);
?>
//
<img src="data:image/png;base64,<?= base64_encode($imageNew)?>" style="display: block; margin-left: auto; margin-right: auto; width: 10%">
<h1><?php echo $pix_copia_cola;?></h1> // Only Pix Key
Last updated