Zum Hauptinhalt springen

Function structures

iPOS Interface

This interface is a communication channel for interacting with the fiskaltrust.Middleware. It provides three basic functions: "echo", "sign", and "journal". The functions "echo" and "sign" return bare-objects, the function "journal" returns a wrapped-object.

Echo Function

This function provides fast and easy communication checks. The transferred message is sent back directly.

Asynchronous Echo call (v1 - Germany and Italy):

var request = new ifPOS.v1.EchoRequest { Message = "Message" };
ifPOS.v1.EchoResponse response = await proxy.EchoAsync(request);

Synchronous Echo call (v0 - Austria and France):

string result = proxy.Echo("Message");

Sign Function

This is the key function of the fiskaltrust.Middleware. Once the sign function is called, the receipt data is transferred for processing. The result of the processing is then sent back as receipt response.

Asynchronous Sign call (v1 - Germany and Italy):

var request = new ifPOS.v1.ReceiptRequest();
// Fill the properties of the request
ifPOS.v1.ReceiptResponse response = await proxy.SignAsync(request);

Synchronous Sign call (v0 - Austria and France):

var request = new ifPOS.v0.ReceiptRequest();
// Fill the properties of the request
ifPOS.v0.ReceiptResponse response = proxy.Sign(request);

Journal Function

With this function, a variety of information can be retrieved from the fiskaltrust.Middleware, ranging from the status information to a general notifications protocol.

Asynchronous Journal call (v1 - Germany and Italy):

var request = new ifPOS.v1.JournalRequest();
// Fill the properties of the request
await foreach (var response in proxy.JournalAsync(request))
{
byte[] arr = response.Chunk.ToArray();
// Handle resulting byte chunk by e.g. writing it to a file
}

Synchronous Journal call (v0 - Austria and France):

Stream stream = proxy.Journal(ftJournalType, 0, DateTime.UtcNow.Ticks);

A list with possible values for the request parameter ftJournalType is provided in the reference table "Type of Journal: ftJournalType". The journal depends on national requirements and therefore the function has to run in the appropriate mode: exporting data in chunks, or as a whole.

Timestamps

The journal function expects the timestamps to be .NET Ticks.

The following conversion formulas can be used to convert between unix time and .NET Ticks:

ConversionFormula
unix time -> Ticks621355968000000000 + unixtime * 10000000
Ticks -> unix time(ticks - 621355968000000000) / 10000000