Skip to content

Commit 36d511e

Browse files
author
Jan van Esdonk
committed
add save_pin and getters and setters to SyncTokenRequest, new createSyncTask method
1 parent 8c3133d commit 36d511e

File tree

3 files changed

+113
-3
lines changed

3 files changed

+113
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Simply add to your pom.xml:
99
<dependency>
1010
<groupId>me.figo</groupId>
1111
<artifactId>sdk</artifactId>
12-
<version>1.4.0</version>
12+
<version>1.3.10</version>
1313
</dependency>
1414
```
1515

src/main/java/me/figo/FigoSession.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,35 @@ public TaskTokenResponse createSyncTask(String state, String redirect_url, List<
12401240
return this.queryApi("/rest/sync", new SyncTokenRequest(state, redirect_url, syncTasks, accountIds), "POST", TaskTokenResponse.class);
12411241
}
12421242

1243+
/**
1244+
* Create a sync task.
1245+
*
1246+
* Set the parameters you don't need to NULL
1247+
*
1248+
* @param state
1249+
* String passed on through the complete synchronization process and to the redirect target at the end. It should be used to validated the
1250+
* authenticity of the call to the redirect URL
1251+
* @param redirect_url
1252+
* URI the user is redirected to after the process completes
1253+
* @param syncTasks
1254+
* Tasks to sync while talking to the bank. Transactions are activated by default
1255+
* @Param accountIDs
1256+
* Accounts to sync
1257+
* @Param disableNotifications
1258+
* Disable notifications for this sync
1259+
* @Param autoContinue
1260+
* Continue on error
1261+
* @Param savePin
1262+
* Save the pin for further syncs
1263+
* @return TaskTokenResponse
1264+
*
1265+
* @exception FigoException Base class for all figoExceptions
1266+
* @exception IOException IOException
1267+
*/
1268+
public TaskTokenResponse createSyncTask(String state, String redirect_url, List<String>syncTasks, List<String>accountIds, boolean disableNotifications, int ifNotSyncedSince, boolean autoContinue, boolean savePin) throws IOException, FigoException {
1269+
return this.queryApi("/rest/sync", new SyncTokenRequest(state, redirect_url, syncTasks, accountIds, disableNotifications, ifNotSyncedSince, autoContinue, savePin), "POST", TaskTokenResponse.class);
1270+
}
1271+
12431272
/**
12441273
* Create a sync task
12451274
* @param syncTokenRequest

src/main/java/me/figo/internal/SyncTokenRequest.java

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ public class SyncTokenRequest {
5050
*/
5151
@Expose
5252
public List<String> account_ids;
53+
54+
/**
55+
* optional flag to save pin for auto sync
56+
*/
57+
@Expose
58+
public boolean save_pin;
5359

5460

5561
/**
@@ -110,6 +116,81 @@ public SyncTokenRequest(String state, String redirect_uri,
110116
this.sync_tasks = sync_tasks;
111117
this.account_ids = account_ids;
112118
}
113-
114-
119+
120+
public SyncTokenRequest(String state, String redirect_uri, List<String> sync_tasks,
121+
List<String> account_ids, boolean disable_notifications,
122+
int if_not_synced_since, boolean auto_continue, boolean save_pin) {
123+
this.state = state;
124+
this.redirect_uri = redirect_uri;
125+
this.disable_notifications = disable_notifications;
126+
this.if_not_synced_since = if_not_synced_since;
127+
this.auto_continue = auto_continue;
128+
this.sync_tasks = sync_tasks;
129+
this.account_ids = account_ids;
130+
this.save_pin = save_pin;
131+
}
132+
133+
public String getState() {
134+
return state;
135+
}
136+
137+
public void setState(String state) {
138+
this.state = state;
139+
}
140+
141+
public String getRedirectUri() {
142+
return redirect_uri;
143+
}
144+
145+
public void setRedirectUri(String redirect_uri) {
146+
this.redirect_uri = redirect_uri;
147+
}
148+
149+
public boolean isDisableNotifications() {
150+
return disable_notifications;
151+
}
152+
153+
public void setDisableNotifications(boolean disable_notifications) {
154+
this.disable_notifications = disable_notifications;
155+
}
156+
157+
public int getIfNotSyncedSince() {
158+
return if_not_synced_since;
159+
}
160+
161+
public void setIfNotSyncedSince(int if_not_synced_since) {
162+
this.if_not_synced_since = if_not_synced_since;
163+
}
164+
165+
public boolean isAutoContinue() {
166+
return auto_continue;
167+
}
168+
169+
public void setAutoContinue(boolean auto_continue) {
170+
this.auto_continue = auto_continue;
171+
}
172+
173+
public List<String> getSyncTasks() {
174+
return sync_tasks;
175+
}
176+
177+
public void setSyncTasks(List<String> sync_tasks) {
178+
this.sync_tasks = sync_tasks;
179+
}
180+
181+
public List<String> getAccountIds() {
182+
return account_ids;
183+
}
184+
185+
public void setAccountIds(List<String> account_ids) {
186+
this.account_ids = account_ids;
187+
}
188+
189+
public boolean isSavePin() {
190+
return save_pin;
191+
}
192+
193+
public void setSavePin(boolean save_pin) {
194+
this.save_pin = save_pin;
195+
}
115196
}

0 commit comments

Comments
 (0)