This example sends a signing request to the fiskaltrust.Service via REST.
A zero receipt is sent to a specified url and CashBox and the response is printed.
Note: If the http statuscode 204 is returned the CashBox may not yet be activated and you'll need to send a start receipt first. For instructions on how to do this please consult our videos about sending requests to the fiskaltrust.Service
This example can be used as a starting point to implement the fiskaltrust.Interface
Note: The german cash transaction is being implemented at the moment in the fiskaltrust.Service. Since the implementation is similar, you can use the austrian service for testing.
To compile the example the C
compiler gcc
and the buildtool make
is needed.
Note: On windows we recommend installing these with a package manager like scoop or chocolatey
To build the example, the curl library needs to be available.
Note: We tested the example with version 7.x.x, other versions may not work.
The curl library can be downloaded as pre compiled libraries. Please downlaod the prebuild libraries (curl, OpenSSL, brotli, libssh2, nghttp2, zlib) from here
Please copy libbrotlicommon-static.a
, libcurl*.dll
, libnghttp*.a
, libssh*.dll
,libssl*.dll
, libcrypto*.dll
and libz*.a
to the .\build\
folder
Note: This list of libraries will be reminded by executing the program from a window, in the error message.
curl certificate is included in the curl zip file, next to the libcurl*.dll, copy curl-ca-bundle.crt
to this project folder.
Install the library via your distributions package manager.
Distribution | Command |
---|---|
Ubuntu/Debian | apt-get install libcurl4 libcurl4-openssl-dev |
Fedora | dnf install libcurl |
OpenSUSE | zypper install libcurl4 libcurl4-openssl-dev |
This JSON parser is used in this project.
Build the library open the VS 2015 command prompt, navigate to the json-c folder and using the following commands:
mkdir build
cd build
cmake ../
cmake --build . --target install
Note: To run these commands the VS build tools need to be installed.
After the library is compiled, the file json-c.dll
has to be copied to C:\Windows\System32
or to .\build\
.
To complile the library follow those instructions.
Note: You may also have to look into the Install prerequisites.
- Run the
make
command.
- Run the powershell script
configure.ps1
and follow the instructions. - Run the
make
command.
Example:
.\configure.ps1 make