1. Go to this page and download the library: Download catidegla/pi-spi-qr 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/ */
catidegla / pi-spi-qr example snippets
use Catidegla\PiSpiQr\QrCode;
// A printed QR at the counter. The payer types the amount.
echo QrCode::static('341c3e1b-4312-49ec-b75e-4c8c74c10fd7', 'SN')
->merchantName('Chez Fatou')
->merchantCity('Dakar')
->toPayload();
// One sale at the till. The transaction id is
use Catidegla\PiSpiQr\Payload;
$payload = Payload::parse($scanned);
$payload->alias(); // 341c3e1b-4312-49ec-b75e-4c8c74c10fd7
$payload->amount(); // 1500, or null when the payer enters it
$payload->transactionId(); // TILL-1-000842
$payload->country(); // CI
foreach ($payload->problems() as $problem) {
echo $problem, PHP_EOL;
}