Giter VIP home page Giter VIP logo

fiskaltrust / middleware-demo-dotnet Goto Github PK

View Code? Open in Web Editor NEW
3.0 7.0 7.0 128 KB

Demo applications that demonstrate how to call the fiskaltrust.Middleware from .NET/C#. This repository contains examples using GRPC, WCF and REST using both JSON and XML.

Home Page: https://docs.fiskaltrust.cloud

License: MIT License

C# 100.00%
middleware kassensichv rksv pos-systems dotnet csharp demo-application

middleware-demo-dotnet's Introduction

fiskaltrust.Middleware demo (C#)

Demo applications that demonstrate how to call the fiskaltrust.Middleware from .NET/C#. This repository contains examples for GRPC, WCF and REST based communication, using both JSON and XML.

Getting Started

Prerequisites

In order to use this demo application, the following prerequisites are required:

  • The demo application: Either clone and run locally, or download the latest binaries from Releases
  • The fiskaltrust.Middleware running on your machine, which can be configured and downloaded via the fiskaltrust.Portal (AT, DE, FR). Start it (either by running it as a service, or with the test.cmd file), and let it run in the background to handle your requests.
  • Your Cashbox Id is visible in the portal. It is also displayed in the startup console log of the Middleware.

This example uses the fiskaltrust.interface and the fiskaltrust.Middleware communication helper packages, which provide a convenient way to implement the middleware interface from .NET. These packages can be downloaded directly from NuGet.

Running the Demo

The Demo app needs three startup parameters: cashbox-id, url and market. The Middleware logs out all available endpoints (i.e. the URLs) as configured in the portal on startup.

For the HTTP example, further parameters can optionally be provided (the communication type and the access token, with the latter only being required when connecting to SignaturCloud).

Minimal startup example:

fiskaltrust.Middleware.Demo.Grpc.exe --cashbox-id "54c6b434-cd27-442e-b39f-0960c4ad1bda" --url "grpc://localhost:13151"

If a parameter is not passed, the user will be prompted at startup.

  1. The demo will show up a list of available demo receipts, pulled from the src/fiskaltrust.Middleware.Demo.Shared/ReceiptExamples folder. Before executing any receipt, make sure that the SCU is initialized, by calling the initial-operation-receipt/the start receipt.
  2. To execute a receipt against the middleware, select it by its leading number and press Enter.
  3. This will print the example to the command line and send it to the Sign endpoint of the Middleware. After the receipt is processed, the Middleware will return the result back to the demo app, which again prints it to the console.
  4. Alternatively, a Journal request can also be executed. This is used to export different types of data from the middleware - system information, processed receipts, etc.
  5. To go back to the command list, press enter

Documentation

The full documentation for the interface can be found on https://docs.fiskaltrust.cloud. It is activeliy maintained and developed in our interface-doc repository.

More information is also available after logging into the portal with a user that has the PosCreator role assigned.

Communication

The fiskaltrust.Middleware supports different communication protocols, effectively giving our customers the possibility to use it on all platforms. Hence, different protocols are recommended for different platforms.

gRPC

gRPC is a cross-platform communication protocol and therefore widely supported by operating systems and programming frameworks. For using it with .NET, we provide a "code-first" client on NuGet.

The .proto files (i.e. the interface description) can be used to generate clients for all supported programming languages and downloaded here.

gRPC is not supported for Middleware versions < 1.3.

WCF/SOAP

Our WCF implementation supports multiple communication technologies:

  • http
  • https
  • net.pipe
  • net.tcp

Both the middleware and demo automatically detect the communication type for WCF from the given URL. This option is only available when running on Windows.

The WSDL file can be downloaded here.

HTTP/REST

HTTP/REST communication is available via JSON and XML, and probably the easiest approach for multi-platform communication. In Middleware versions < 1.3, the REST helper is required - higher versions automatically support this protocol without any helpers.

User specific protocols

With the helper topology, it is possible to solve every scenario. Please contact our support if you required assistance for a special case scenario.

Contributions

We welcome all kinds of contributions and feedback, e.g. via Issues or Pull Requests.

Related resources

Our latest samples are available for the following programming languages and tools:

csharp            java            node            android            node

Additionally, other samples (including legacy ones) can be found in our demo repository.

middleware-demo-dotnet's People

Contributors

florianstadlberger avatar minamoeini avatar stefankert avatar steininger avatar szilardbaizat avatar tschmiedlechner avatar volllly avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

middleware-demo-dotnet's Issues

Decode JWT as QR

Hello,

how can I decode the JWT Signautre (Format 3) to print the QR Code on my receipt?

E.g. I have:
V0;ftOZMtkCbCE0mdTBZThJ68zw;Kassenbeleg-V1;Beleg^12.00_2.50_0.00_0.00_0.00^14.50:Bar;26;210;2022-01-06T08:59:55.000Z;2022-01-06T08:59:55.000Z;ecdsa-plain-SHA384;unixTime;XytZYZ3rsrc4N9gEUMHvWaDQtACG/x/bCyOE8VGpcAZnM4+h+5Ppuy/hfAxPZLlgNdTLmiAtz7wpq8xMiqdYhr0e65Nc5J+zwFIesDMQAg6w9iyXyIUEB11qZuQ0W7F6;BIm0dPWXnx74aAFWmXacv5aJQVNi9+VaUFELgx1eVcXDmJHhR5SzQzY5tYRSF50FHBOK9UToc0xTf8SEmp5+AEbA033BQhtfGk65aszM5VcvMyyWU4aCuk8zXoTv1OU83Q==

It does not work with tools like:

https://jwt.io/

Update der Cashboxen für alle PosOperator

Wir verwenden für unsere PosOperator die CashBox mit .NET Launcher.
Wie können wir ein Update der Cashboxen für alle PosOperator auf die aktuellste Version anstossen?
Ist das notwendig, wenn ja wie?

Grpc.Core.RpcException: Status(StatusCode=Unimplemented,

I run my middleware on grpc://localhost:18000 but get an error:


Please provide a value for 'Middleware URL' (String): grpc://localhost:18000
Please provide a value for 'CashboxID' (Guid): 93a2053a-0830-4245-8008-d59ae1d98a88
Please provide a value for 'Market (AT, DE or FR)': DE
Grpc.Core.RpcException: Status(StatusCode=Unimplemented, Detail="")
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei ProtoBuf.Grpc.Internal.Reshape.<UnaryTaskAsyncImpl>d__10`2.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.PosRetryProxyClient.<>c__DisplayClass6_0.<<EchoAsync>b__0>d.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.RetryPolicyHandler`1.<>c__DisplayClass3_0`1.<<RetryFuncAsync>b__0>d.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.RetryPolicyHandler`1.<RetryFuncAsync>d__3`1.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Interface.Client.Common.RetryLogic.PosRetryProxyClient.<EchoAsync>d__6.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei fiskaltrust.Middleware.Demo.Grpc.Demo.<ExecuteEchoAsync>d__6.MoveNext()

what can I do?

Woher bekomme ich die CashBox Identification?

Wenn ich eine neue Queue anlege, dann muss ich die CashBox Identification festlegen.
Ist das ein willkürlicher Wert oder muss ich einen Speziellen verwenden!?

Ich hätte aus den Anleitungen folgendes verstanden:
Bei der Anlage einer Queue für eine Fiskaly TSE ist bei der CashBox Identification = client ID = OrganizationId aus TSE Config zu verwenden!
Und wie funktioniert das bei der Diebold TSE!?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.