PHPackages                             robier/fiscalization - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. robier/fiscalization

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

robier/fiscalization
====================

Croatian fiscalization library

152PHP

Since Sep 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/robier/fiscalization)[ Packagist](https://packagist.org/packages/robier/fiscalization)[ RSS](/packages/robier-fiscalization/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Croatian Fiscalization
======================

[](#croatian-fiscalization)

Library for connecting your shop to the Croatian FINA.

### Before usage

[](#before-usage)

There are 2 types of certificates **demo** and **production**. Depending on type of certificate, you need to use different client as demo and production FINA environments has different URLs. No matter the type, there are 2 certificates needed for this library to work properly. Root certificate (that are publicly available for download) and personal one that is used for signing the payload before sending it to the FINA.

Download [DEMO](https://www.fina.hr/fina-demo-ca-certifikati) or [PRODUCTION](https://www.fina.hr/ca-fina-root-certifikati) root certificate. Certificate should be in TXT format.

Get [DEMO](https://www.fina.hr/demo-certifikati) or [PRODUCTION](https://www.fina.hr/fiskalizacija) certificate by applying for it. File will be in p12 format.

When you finish procedure, you should have 3 items:

- FINA root certificate
- your own certificate
- passphrase for your own certificate

Those 3 items are necessary to successfully communicate with FINA servers.

---

Example:

```
use Robier\Fiscalization\Bill;
use Robier\Fiscalization\Certificate;
use Robier\Fiscalization\Client;
use Robier\Fiscalization\Company;
use Robier\Fiscalization\Oib;
use Robier\Fiscalization\Operator;
use Robier\Fiscalization\Refund;
use Robier\Fiscalization\Tax;

$company = new Company(new Oib('96918429930'), true);
$operator = new Operator(new Oib('07392314075'));

$id = new Bill\Identifier(23, 'MAGE5', 1);

$bill = new Bill(
    $company,
    $operator,
    new DateTimeImmutable(),
    $id,
    Bill\PaymentType::cash(),
    Bill\SequenceType::shop()
);

$bill
    ->addTax(new Tax\Vat(100_00, 25_00, 25_00))
    ->addTax(new Tax\Vat(50_00, 5_00, 2_50))
    ->addTax(new Tax\Vat(300_00, 25_00, 75_00))
    ->addTax(new Tax\Vat(400_00, 25_00, 100_00))
    ->addTax(new Tax\ConsumptionTax(600_00, 3_00, 18_00))
    ->setTaxFreeAmount(100_00)
    ->setMarginTaxAmount(50_00)
    ->addRefund(new Refund('Povratna naknada', 10_00))
;

$certificate = new Certificate(
    __DIR__ . '/config/certificates/demo_root.txt', // root certificate path
    __DIR__ . '/config/certificates/FISKAL_1.p12', // private certificate path
    '************' // private certificate passphrase
);

$client = Client::demo($certificate);

$client->send($bill); // sends bill to FINA
$client->check($bill); // checks bill trough demo checking (available only in DEMO client)
$client->ping(); // checks if server is avaliable
```

### Docker

[](#docker)

Local development should be done via docker.

Build docker container:

```
docker/build
```

After you build your docker container, you can go inside and use it via:

```
docker/run ash
```

Or run command inside docker from outside via:

```
docker/run composer install
```

### Tests

[](#tests)

Everything should be tested. You can run tests with command:

```
docker/run vendor/bin/phpunit
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3607521?v=4)[Robert](/maintainers/robier)[@robier](https://github.com/robier)

---

Top Contributors

[![robier](https://avatars.githubusercontent.com/u/3607521?v=4)](https://github.com/robier "robier (9 commits)")

### Embed Badge

![Health badge](/badges/robier-fiscalization/health.svg)

```
[![Health](https://phpackages.com/badges/robier-fiscalization/health.svg)](https://phpackages.com/packages/robier-fiscalization)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
