PHP code example of gosimple / rs-fiscal

1. Go to this page and download the library: Download gosimple/rs-fiscal 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/ */

    

gosimple / rs-fiscal example snippets


use GoSimple\RsFiscal\Pib;

Pib::isValid('101134702');   // true
Pib::isValid('101134703');   // false (bad check digit)
Pib::checkDigit('10113470'); // 2

use GoSimple\RsFiscal\IpsQr;

$payload = IpsQr::build([
    'account' => '310-1234567891211-86', // or a plain 18-digit account
    'name'    => 'ACME DOO',
    'amount'  => 3596.00,                 // optional
    'purpose' => 'Racun 2026-1042',       // optional
    'reference' => '97-1234',             // optional
]);
// K:PR|V:01|C:1|R:310123456789121186|N:ACME DOO|I:RSD3596,00|S:Racun 2026-1042|RO:97-1234

// Render $payload into an actual QR image with any QR library.