PHP code example of ajandera / eet

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

    

ajandera / eet example snippets


use Ajandera\EET\Receipt;
use Ajandera\EET\Strings;
use Ajandera\EET\Sender;

$receipt = new Receipt();
$receipt->uuid_zpravy = Strings::generateUUID();
$receipt->dic_popl = 'CZ78394560012';
$receipt->id_provoz = '567';
$receipt->id_pokl = '2';
$receipt->porad_cis = '1';
$receipt->dat_trzby = new \DateTime();
$receipt->celk_trzba = 100;

$sender = new Sender(
    new Certificates(__DIR__.'/../../examples/certifications/EET_CA1_Playground-CZ00000019.p12', 'eet'),
    true
);

echo $sender->sendReceipt($receipt); // return FIK code if success