https://github.com/fiskaly/fiskaly-sdk-java
fiskaly Cloud-TSE SDK for Java/JRE and Java/Android
https://github.com/fiskaly/fiskaly-sdk-java
android java jre kassensichv tse
Last synced: 6 months ago
JSON representation
fiskaly Cloud-TSE SDK for Java/JRE and Java/Android
- Host: GitHub
- URL: https://github.com/fiskaly/fiskaly-sdk-java
- Owner: fiskaly
- License: mit
- Archived: true
- Created: 2020-04-17T13:35:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-12T15:37:16.000Z (almost 5 years ago)
- Last Synced: 2023-07-26T21:49:19.011Z (almost 3 years ago)
- Topics: android, java, jre, kassensichv, tse
- Language: Java
- Homepage:
- Size: 296 KB
- Stars: 4
- Watchers: 16
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# fiskaly SDK for Java/JRE and Java/Android
The fiskaly SDK includes an HTTP client that is needed[1](#fn1) for accessing the [kassensichv.io](https://kassensichv.io) API that implements a cloud-based, virtual **CTSS** (Certified Technical Security System) / **TSE** (Technische Sicherheitseinrichtung) as defined by the German **KassenSichV** ([Kassensicherungsverordnung](https://www.bundesfinanzministerium.de/Content/DE/Downloads/Gesetze/2017-10-06-KassenSichV.pdf)).
## Features
- [X] Automatic authentication handling (fetch/refresh JWT and re-authenticate upon 401 errors).
- [X] Automatic retries on failures (server errors or network timeouts/issues).
- [ ] Automatic JSON parsing and serialization of request and response bodies.
- [X] Future: [1] compliance regarding [BSI CC-PP-0105-2019](https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Zertifizierung/Reporte/ReportePP/pp0105b_pdf.pdf?__blob=publicationFile&v=7) which mandates a locally executed SMA component for creating signed log messages.
- [ ] Future: Automatic offline-handling (collection and documentation according to [Anwendungserlass zu § 146a AO](https://www.bundesfinanzministerium.de/Content/DE/Downloads/BMF_Schreiben/Weitere_Steuerthemen/Abgabenordnung/AO-Anwendungserlass/2019-06-17-einfuehrung-paragraf-146a-AO-anwendungserlass-zu-paragraf-146a-AO.pdf?__blob=publicationFile&v=1))
## Integration
### Maven / Gradle
The fiskaly Java SDK is available via Maven.
#### JRE (version 1.6+)
Add the following to your `build.gradle`:
```groovy
dependencies {
implementation 'com.fiskaly.sdk:fiskaly-sdk:1.2.200-jre'
}
```
Additionaly to the SDK, you'll also need the fiskaly client. Follow these steps to integrate it into your project:
1. Go to [https://developer.fiskaly.com/downloads](https://developer.fiskaly.com/downloads)
2. Download the appropriate client build for your platform
3. Move the client into your project output directory or somewhere within the OS search path
#### Android
First of all, download the [fiskaly Client](https://developer.fiskaly.com/downloads) for android (e.g. `com.fiskaly.client-android-all-v1.2.200.aar`) and copy the Android Archive to `app/libs/`
Then, add the following to your `app/build.gradle`:
```groovy
dependencies {
implementation 'com.fiskaly.sdk:fiskaly-sdk:1.2.200-android'
implementation files('libs/com.fiskaly.client-android-all-v1.2.200.aar')
}
```
## Usage
### Demo
```java
package com.fiskaly.sdk.demo.jre;
import com.fiskaly.sdk.*;
public class Main {
public static void main(String[] args) throws Exception {
final String apiKey = System.getenv("FISKALY_API_KEY");
final String apiSecret = System.getenv("FISKALY_API_SECRET");
final FiskalyHttpClient client = new FiskalyHttpClient(apiKey, apiSecret, "https://kassensichv.io/api/v1");
final FiskalyHttpResponse response = client.request("GET", "/tss");
System.out.println(response);
}
}
```
## Proguard Configuration
```
-keep class com.sun.jna.* { *; }
-keepclassmembers class * extends com.sun.jna.* { public *; }
```
### Client Configuration
The SDK is built on the [fiskaly Client](https://developer.fiskaly.com/en/docs/client-documentation) which can be [configured](https://developer.fiskaly.com/en/docs/client-documentation#configuration) through the SDK.
## Related
* [fiskaly.com](https://fiskaly.com)
* [dashboard.fiskaly.com](https://dashboard.fiskaly.com)
* [kassensichv.io](https://kassensichv.io)
* [kassensichv.net](https://kassensichv.net)