1. Go to this page and download the library: Download fiskaly/fiskaly-sdk-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/ */
fiskaly / fiskaly-sdk-php example snippets
iskalyClient\FiskalyClient;
/** initialize the fiskaly API client class using credentials */
try {
$client = FiskalyClient::createUsingCredentials('http://localhost:8080/invoke', $_ENV["FISKALY_API_KEY"], $_ENV["FISKALY_API_SECRET"], 'https://kassensichv.io/api/v1');
} catch (Exception $e) {
exit($e);
}
/** get version of client and SMAERS */
try {
$version = $client->getVersion();
echo "Version: ", $version, "\n\n";
} catch (Exception $e) {
exit($e);
}
/** initialize the fiskaly API client class using context */
try {
$client = FiskalyClient::createUsingContext('http://localhost:8080/invoke', $_SESSION["FISKALY_CONTEXT"]);
} catch (Exception $e) {
exit($e);
}