PHP code example of wdev-rs / netracuni-php

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

    

wdev-rs / netracuni-php example snippets


$netRacuni = new WdevRs\NetRacuniPhp\NetRacuniClient('net_racuni_staging_************************************************');

$netRacuni->sandbox();

$netRacuni->production();

$netRacuni->ping()

$netRacuni->getTaxLabels()


$items = [
    "items" => [
        [
            "name" => "Test Item",
            "taxLabels" => [
                "A"
            ],
            "unit" => "KOM",
            "quantity" => 2,
            "price" => 152.66
        ]
    ]
];

$result = $netRacuni->createInvoice($items);

$invoiceUrl = $result->getInvoicePdfUrl();

$invoice = $result->getInvoice();

try {
    $result = $netRacuni->createInvoice($items);
} catch(\Exception $e) {
    Log::error($e->getMessage())
    // Example  Company no uploaded certificate, please upload one in https://netracuni.com/teams/ site
}
bash
composer