Skip to content

Commit 8a50b7d

Browse files
author
Alexander Geist
committed
figo adapter
1 parent b2eeecb commit 8a50b7d

File tree

12 files changed

+344
-201
lines changed

12 files changed

+344
-201
lines changed

multibanking-persistence/src/main/java/de/adorsys/multibanking/domain/UserEntity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package de.adorsys.multibanking.domain;
22

3+
import domain.BankApiUser;
34
import lombok.Data;
45
import org.springframework.data.annotation.Id;
56
import org.springframework.data.mongodb.core.mapping.Document;
67

8+
import java.util.List;
9+
710
/**
811
* Created by alexg on 07.02.17.
912
*/
@@ -14,6 +17,8 @@ public class UserEntity {
1417
@Id
1518
private String id;
1619

20+
private List<BankApiUser> apiUser;
21+
1722
public UserEntity id(String id) {
1823
this.id = id;
1924
return this;

multibanking-persistence/src/main/java/de/adorsys/multibanking/repository/BankAccessRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@Repository
1414
public interface BankAccessRepository extends MongoRepository<BankAccessEntity, String> {
1515

16-
Optional<BankAccessEntity> findById(String id);
16+
Optional<BankAccessEntity> findByIdAndUserId(String id, String userId);
1717

1818
List<BankAccessEntity> findByUserId(String userId);
1919
}

onlinebanking-adapter/pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@
1111
<packaging>jar</packaging>
1212

1313
<dependencies>
14-
<!-- hbci -->
1514
<dependency>
1615
<groupId>de.adorsys</groupId>
1716
<artifactId>hbci4j-adorsys</artifactId>
1817
<version>3.0.9</version>
1918
</dependency>
19+
<dependency>
20+
<groupId>me.figo</groupId>
21+
<artifactId>sdk</artifactId>
22+
<version>1.5.0</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>de.adorsys.envutils</groupId>
26+
<artifactId>envutils4j</artifactId>
27+
<version>0.2</version>
28+
</dependency>
2029
<dependency>
2130
<groupId>org.projectlombok</groupId>
2231
<artifactId>lombok</artifactId>

onlinebanking-adapter/src/main/java/domain/BankAccess.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,4 @@ public class BankAccess {
1313
private String bankCode;
1414
private String passportState;
1515

16-
public BankAccess bankName(String bankName) {
17-
this.bankName = bankName;
18-
return this;
19-
}
20-
21-
public BankAccess bankLogin(String bankLogin) {
22-
this.bankLogin = bankLogin;
23-
return this;
24-
}
25-
26-
public BankAccess bankCode(String bankCode) {
27-
this.bankCode = bankCode;
28-
return this;
29-
}
30-
31-
public BankAccess passportState(String passportState) {
32-
this.passportState = passportState;
33-
return this;
34-
}
35-
36-
3716
}

onlinebanking-adapter/src/main/java/domain/BankAccount.java

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
package domain;
22

33
import lombok.Data;
4-
import org.kapott.hbci.structures.Konto;
4+
5+
import java.util.HashMap;
6+
import java.util.Map;
57

68
/**
79
* Created by alexg on 07.02.17.
810
*/
911
@Data
1012
public class BankAccount {
1113

14+
private Map<BankApi, String> externalIdMap;
1215
private BankAccountBalance bankAccountBalance;
16+
private String owner;
1317
private String countryHbciAccount;
1418
private String blzHbciAccount;
1519
private String numberHbciAccount;
@@ -19,19 +23,6 @@ public class BankAccount {
1923
private String bicHbciAccount;
2024
private String ibanHbciAccount;
2125

22-
public static BankAccount fromKonto(Konto konto) {
23-
BankAccount BankAccount = new BankAccount();
24-
BankAccount.numberHbciAccount(konto.number);
25-
BankAccount.bicHbciAccount(konto.bic);
26-
BankAccount.blzHbciAccount(konto.blz);
27-
BankAccount.countryHbciAccount(konto.country);
28-
BankAccount.currencyHbciAccount(konto.curr);
29-
BankAccount.ibanHbciAccount(konto.iban);
30-
BankAccount.nameHbciAccount((konto.name + " " + (konto.name2 != null ? konto.name2 : "")).trim());
31-
BankAccount.typeHbciAccount(konto.type);
32-
return BankAccount;
33-
}
34-
3526
public BankAccount bankAccountBalance(BankAccountBalance bankAccountBalance) {
3627
this.bankAccountBalance = bankAccountBalance;
3728
return this;
@@ -76,4 +67,19 @@ public BankAccount ibanHbciAccount(String ibanHbciAccount) {
7667
this.ibanHbciAccount = ibanHbciAccount;
7768
return this;
7869
}
70+
71+
public BankAccount externalId(BankApi bankApi, String externalId) {
72+
if (externalIdMap == null) {
73+
externalIdMap = new HashMap<>();
74+
externalIdMap.put(bankApi, externalId);
75+
}
76+
return this;
77+
}
78+
79+
public BankAccount owner(String owner) {
80+
this.owner = owner;
81+
return this;
82+
}
83+
84+
7985
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package domain;
2+
3+
/**
4+
* Created by alexg on 17.05.17.
5+
*/
6+
public enum BankApi {
7+
HBCI, FIGO, FINAPI
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package domain;
2+
3+
import lombok.Data;
4+
5+
/**
6+
* Created by alexg on 17.05.17.
7+
*/
8+
@Data
9+
public class BankApiUser {
10+
11+
private String apiUserId;
12+
private String apiPassword;
13+
private BankApi bankApi;
14+
15+
16+
}

onlinebanking-adapter/src/main/java/domain/Booking.java

Lines changed: 1 addition & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -28,157 +28,6 @@ public class Booking {
2828
private String usage;
2929
private String addkey;
3030
private boolean isSepa;
31+
private BankApi bankApi;
3132

32-
public String getExternalId() {
33-
return externalId;
34-
}
35-
36-
public Booking externalId(String externalId) {
37-
this.externalId = externalId;
38-
return this;
39-
}
40-
41-
public BankAccount getOtherAccount() {
42-
return otherAccount;
43-
}
44-
45-
public Booking otherAccount(BankAccount otherAccount) {
46-
this.otherAccount = otherAccount;
47-
return this;
48-
}
49-
50-
public Date getValutaDate() {
51-
return valutaDate;
52-
}
53-
54-
public Booking valutaDate(Date valutaDate) {
55-
this.valutaDate = valutaDate;
56-
return this;
57-
}
58-
59-
public Date getBookingDate() {
60-
return bookingDate;
61-
}
62-
63-
public Booking bookingDate(Date bookingDate) {
64-
this.bookingDate = bookingDate;
65-
return this;
66-
}
67-
68-
public BigDecimal getAmount() {
69-
return amount;
70-
}
71-
72-
public Booking amount(BigDecimal amount) {
73-
this.amount = amount;
74-
return this;
75-
}
76-
77-
public boolean isReversal() {
78-
return isReversal;
79-
}
80-
81-
public Booking reversal(boolean reversal) {
82-
isReversal = reversal;
83-
return this;
84-
}
85-
86-
public BigDecimal getBalance() {
87-
return balance;
88-
}
89-
90-
public Booking balance(BigDecimal balance) {
91-
this.balance = balance;
92-
return this;
93-
}
94-
95-
public String getCustomerRef() {
96-
return customerRef;
97-
}
98-
99-
public Booking customerRef(String customerRef) {
100-
this.customerRef = customerRef;
101-
return this;
102-
}
103-
104-
public String getInstRef() {
105-
return instRef;
106-
}
107-
108-
public Booking instRef(String instRef) {
109-
this.instRef = instRef;
110-
return this;
111-
}
112-
113-
public BigDecimal getOrigValue() {
114-
return origValue;
115-
}
116-
117-
public Booking origValue(BigDecimal origValue) {
118-
this.origValue = origValue;
119-
return this;
120-
}
121-
122-
public BigDecimal getChargeValue() {
123-
return chargeValue;
124-
}
125-
126-
public Booking chargeValue(BigDecimal chargeValue) {
127-
this.chargeValue = chargeValue;
128-
return this;
129-
}
130-
131-
public String getAdditional() {
132-
return additional;
133-
}
134-
135-
public Booking additional(String additional) {
136-
this.additional = additional;
137-
return this;
138-
}
139-
140-
public String getText() {
141-
return text;
142-
}
143-
144-
public Booking text(String text) {
145-
this.text = text;
146-
return this;
147-
}
148-
149-
public String getPrimanota() {
150-
return primanota;
151-
}
152-
153-
public Booking primanota(String primanota) {
154-
this.primanota = primanota;
155-
return this;
156-
}
157-
158-
public String getUsage() {
159-
return usage;
160-
}
161-
162-
public Booking usage(String usage) {
163-
this.usage = usage;
164-
return this;
165-
}
166-
167-
public String getAddkey() {
168-
return addkey;
169-
}
170-
171-
public Booking addkey(String addkey) {
172-
this.addkey = addkey;
173-
return this;
174-
}
175-
176-
public boolean isSepa() {
177-
return isSepa;
178-
}
179-
180-
public Booking sepa(boolean sepa) {
181-
isSepa = sepa;
182-
return this;
183-
}
18433
}

0 commit comments

Comments
 (0)