fints4k/README.md

111 lines
4.0 KiB
Markdown
Raw Normal View History

# fints4k
2019-10-12 19:46:20 +00:00
fints4k is an implementation of the FinTS 3.0 online banking protocol used by most German banks.
2019-10-12 19:46:20 +00:00
It's fast, easy extendable and running on multiple platforms: JVM, Android, (iOS, JavaScript, Windows, MacOS, Linux).
2019-10-12 19:46:20 +00:00
## Features
- Retrieving account information, balances and turnovers (Kontoumsätze und -saldo).
- Transfer money and real-time transfers (SEPA Überweisungen und Echtzeitüberweisung).
- Supports TAN methods chipTAN manual, Flickercode, QrCode and Photo (Matrix code), pushTAN, smsTAN and appTAN.
2019-10-12 19:46:20 +00:00
2024-08-22 16:09:40 +00:00
However, this is quite a low level implementation and in most cases not what you want to use.
In most cases you want to use a higher level abstraction like [FinTs4kBankingClient](https://git.dankito.net/codinux/BankingClient).
2019-10-12 19:46:20 +00:00
## Setup
Not uploaded to Maven Central yet, will do this the next few days!
Gradle:
```
2024-08-22 16:09:40 +00:00
repositories {
mavenCentral()
maven {
setUrl("https://maven.dankito.net/api/packages/codinux/maven")
}
}
2019-10-12 19:46:20 +00:00
dependencies {
2024-09-17 15:35:09 +00:00
implementation("net.codinux.banking:fints4k:1.0.0-Alpha-13")
2019-10-12 19:46:20 +00:00
}
```
Maven:
```
2024-08-22 16:09:40 +00:00
// add Repository https://maven.dankito.net/api/packages/codinux/maven
2019-10-12 19:46:20 +00:00
<dependency>
<groupId>net.dankito.banking</groupId>
2024-08-22 16:09:40 +00:00
<artifactId>fints4k-jvm</artifactId>
<version>1.0.0-Alpha-11</version>
2019-10-12 19:46:20 +00:00
</dependency>
```
## Usage
2024-08-22 16:09:40 +00:00
Quite outdated, have to update it. In most cases use [FinTs4kBankingClient](https://git.dankito.net/codinux/BankingClient).
See e.g. [JavaShowcase](fints4k/src/test/java/net/dankito/banking/fints/JavaShowcase.java) or [FinTsClientTest](fints4k/src/test/kotlin/net/dankito/banking/fints/FinTsClientTest.kt).
2019-10-12 19:46:20 +00:00
```java
// Set your bank code (Bankleitzahl) here.
// BankInfo contains e.g. a bank's FinTS server address, country code and BIC (needed for money transfer)
List<BankInfo> foundBanks = new InMemoryBankFinder().findBankByNameBankCodeOrCity("<bank code, bank name or city>");
2020-04-22 09:50:51 +00:00
if (foundBanks.isEmpty() == false) { // please also check if bank supports FinTS 3.0
BankData bank = new BankDataMapper().mapFromBankInfo(foundBanks.get(0));
2020-04-22 09:50:51 +00:00
// set your customer data (customerId = username you use to log in; pin = online banking pin / password)
CustomerData customer = new CustomerData("<customer_id>", "<pin>");
2020-04-22 09:50:51 +00:00
FinTsClientCallback callback = new SimpleFinTsClientCallback(); // see advanced showcase for configuring callback
2020-04-22 09:50:51 +00:00
FinTsClient finTsClient = new FinTsClient(callback, new Java8Base64Service());
2020-04-22 09:50:51 +00:00
AddAccountResponse addAccountResponse = finTsClient.addAccount(bank, customer);
2020-04-22 09:50:51 +00:00
if (addAccountResponse.isSuccessful()) {
System.out.println("Successfully added account for " + bank.getBankCode() + " " + customer.getCustomerId());
2020-04-22 09:50:51 +00:00
if (addAccountResponse.getBookedTransactions().isEmpty() == false) {
System.out.println("Account transactions of last 90 days:");
showGetTransactionsResponse(addAccountResponse);
2020-04-22 09:50:51 +00:00
}
}
else {
System.out.println("Could not add account for " + bank.getBankCode() + " " + customer.getCustomerId() + ":");
showResponseError(addAccountResponse);
2020-04-22 09:50:51 +00:00
}
2019-10-12 19:46:20 +00:00
// see advanced show case what else you can do with this library, e.g. retrieving all account transactions and transferring money
}
2019-10-12 19:46:20 +00:00
```
## Logging
fints4k uses slf4j as logging facade.
2019-10-12 19:46:20 +00:00
So you can use any logger that supports slf4j, like Logback and log4j, to configure and get fints4k's log output.
2019-10-12 19:46:20 +00:00
## Sample applications
### WebApp
Directly requesting bank servers is forbidden in browsers due to CORS.
In order to use fints4k directly in browser you need a CORS proxy like the one from CorsProxy
[Application.kt](SampleApplications/CorsProxy/src/main/kotlin/net/codinux/web/cors/Application.kt) or https://github.com/Rob--W/cors-anywhere.
2020-05-17 10:10:10 +00:00
Set CORS proxy's URL in WebApp [main.kt](SampleApplications/WebApp/src/main/kotlin/main.kt).
Start sample WebApp then with
```shell
./gradlew WebApp:run --continuous
```
## License
2020-05-17 10:10:10 +00:00
Not free for commercial applications. More details to follow or [contact](mailto:sales@codinux.net) us.