public class FigoSession extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
access_token |
protected String |
apiEndpoint |
protected int |
timeout |
| Constructor and Description |
|---|
FigoSession(String accessToken)
Creates a FigoSession instance
|
FigoSession(String accessToken,
int timeout)
Creates a FigoSession instance
|
FigoSession(String accessToken,
int timeout,
String apiEndpoint)
Creates a FigoSession instance
|
| Modifier and Type | Method and Description |
|---|---|
Notification |
addNotification(Notification notification)
Register a new notification on the server for the user
|
Payment |
addPayment(Payment payment)
Create a new payment
|
protected com.google.gson.Gson |
createGson()
Instantiate the GSON class.
|
Account |
getAccount(String accountId)
Returns the account with the specified ID
|
AccountBalance |
getAccountBalance(Account account)
Returns the balance details of the supplied account
|
AccountBalance |
getAccountBalance(String accountId)
Returns the balance details of the account with he specified ID
|
List<Account> |
getAccounts()
All accounts the user has granted your App access to
|
Bank |
getBank(Account account)
Get Bank for account
|
Bank |
getBank(String bankId)
Get bank
|
Notification |
getNotification(String notificationId)
Retrieve a specific notification by ID
|
List<Notification> |
getNotifications()
All notifications registered by this client for the user
|
Payment |
getPayment(Account account,
String paymentId)
Retrieve a specific payment by ID
|
Payment |
getPayment(String accountId,
String paymentId)
Retrieve a specific payment by ID
|
List<Payment> |
getPayments()
Retrieve all payments
|
List<Payment> |
getPayments(Account account)
all payments on a certain account
|
List<Payment> |
getPayments(String accountId)
Retrieve all payments on a certain account
|
String |
getSyncURL(String state,
String redirect_url)
URL to trigger a synchronisation.
|
Transaction |
getTransaction(String accountId,
String transactionId)
Retrieve a specific transaction by ID
|
List<Transaction> |
getTransactions()
All transactions on all account of the user
|
List<Transaction> |
getTransactions(Account account)
Retrieve all transactions on a specific account of the user
|
List<Transaction> |
getTransactions(Account account,
String since,
Integer count,
Integer offset,
Boolean include_pending)
Get an array of Transaction objects, one for each transaction of the user matching the criteria.
|
List<Transaction> |
getTransactions(String accountId)
Retrieve all transactions on a specific account of the user
|
List<Transaction> |
getTransactions(String accountId,
String since,
Integer count,
Integer offset,
Boolean include_pending)
Get an array of Transaction objects, one for each transaction of the user matching the criteria.
|
User |
getUser()
Get the current figo Account
|
protected <T> T |
queryApi(String path,
Object data,
String method,
Type typeOfT)
Query the figo API via HTTP
|
void |
removeAccount(Account account)
Remove an account
|
void |
removeAccount(String accountId)
Remove an account
|
void |
removeBankPin(Bank bank)
Remove the stored PIN for a bank (if there was one)
|
void |
removeBankPin(String bankId)
Remove the stored PIN for a bank (if there was one)
|
void |
removeNotification(Notification notification)
Remove a stored notification from the server
|
void |
removePayment(Payment payment)
Remove a stored payment from the server
|
void |
removeUser()
Delete figo Account
|
String |
submitPayment(Payment payment,
String tanSchemeId,
String state)
Submit payment to bank server
|
String |
submitPayment(Payment payment,
String tanSchemeId,
String state,
String redirectUri)
Submit payment to bank server
|
Account |
updateAccount(Account account)
Modify an account
|
AccountBalance |
updateAccountBalance(Account account,
AccountBalance accountBalance)
Modify balance or account limits
|
AccountBalance |
updateAccountBalance(String accountId,
AccountBalance accountBalance)
Modify balance or account limits
|
Bank |
updateBank(Bank bank)
Modify a bank
|
Notification |
updateNotification(Notification notification)
Update a stored notification
|
Payment |
updatePayment(Payment payment)
Update a stored payment
|
User |
updateUser(User user)
Modify figo Account
|
protected String apiEndpoint
protected String access_token
protected int timeout
public FigoSession(String accessToken)
accessToken - the access token to bind this session to a userpublic FigoSession(String accessToken, int timeout)
accessToken - the access token to bind this session to a usertimeout - the timeout used for queriespublic FigoSession(String accessToken, int timeout, String apiEndpoint)
accessToken - the access token to bind this session to a usertimeout - the timeout used for queriesapiEndpoint - which endpoint to use (customize for different figo deployment)protected <T> T queryApi(String path, Object data, String method, Type typeOfT) throws FigoException, IOException
T - Type of expected responsepath - Endpoint to querydata - Payload to sendmethod - HTTP verb to usetypeOfT - Type of expected responseFigoExceptionIOExceptionprotected com.google.gson.Gson createGson()
public User getUser() throws FigoException, IOException
FigoExceptionIOExceptionpublic User updateUser(User user) throws FigoException, IOException
user - modified user object to be savedFigoExceptionIOExceptionpublic void removeUser()
throws FigoException,
IOException
FigoExceptionIOExceptionpublic List<Account> getAccounts() throws FigoException, IOException
FigoExceptionIOExceptionpublic Account getAccount(String accountId) throws FigoException, IOException
accountId - figo ID of the account to be retrievedFigoExceptionIOExceptionpublic Account updateAccount(Account account) throws FigoException, IOException
account - the modified account to be savedFigoExceptionIOExceptionpublic void removeAccount(String accountId) throws FigoException, IOException
accountId - ID of the account to be removedFigoExceptionIOExceptionpublic void removeAccount(Account account) throws FigoException, IOException
account - Account to be removedFigoExceptionIOExceptionpublic AccountBalance getAccountBalance(String accountId) throws FigoException, IOException
accountId - figo ID of the account to be retrievedFigoExceptionIOExceptionpublic AccountBalance getAccountBalance(Account account) throws FigoException, IOException
account - account whos balance should be retrievedFigoExceptionIOExceptionpublic AccountBalance updateAccountBalance(String accountId, AccountBalance accountBalance) throws FigoException, IOException
accountId - ID of the account to be modifiedaccountBalance - modified AccountBalance object to be savedFigoExceptionIOExceptionpublic AccountBalance updateAccountBalance(Account account, AccountBalance accountBalance) throws FigoException, IOException
account - account to be modifiedaccountBalance - modified AccountBalance object to be savedFigoExceptionIOExceptionpublic List<Transaction> getTransactions() throws FigoException, IOException
FigoExceptionIOExceptionpublic List<Transaction> getTransactions(String accountId) throws FigoException, IOException
accountId - the ID of the account for which to retrieve the transactionsFigoExceptionIOExceptionpublic List<Transaction> getTransactions(Account account) throws FigoException, IOException
account - the account for which to retrieve the transactionsFigoExceptionIOExceptionpublic List<Transaction> getTransactions(Account account, String since, Integer count, Integer offset, Boolean include_pending) throws FigoException, IOException
account - account for which to list the transactionssince - this parameter can either be a transaction ID or a datecount - limit the number of returned transactionsoffset - which offset into the result set should be used to determin the first transaction to return (useful in combination with count)include_pending - this flag indicates whether pending transactions should be included in the response; pending transactions are always included as a complete
set, regardless of the `since` parameterFigoExceptionIOExceptionpublic List<Transaction> getTransactions(String accountId, String since, Integer count, Integer offset, Boolean include_pending) throws FigoException, IOException
accountId - ID of the account for which to list the transactionssince - this parameter can either be a transaction ID or a datecount - limit the number of returned transactionsoffset - which offset into the result set should be used to determin the first transaction to return (useful in combination with count)include_pending - this flag indicates whether pending transactions should be included in the response; pending transactions are always included as a complete
set, regardless of the `since` parameterFigoExceptionIOExceptionpublic Transaction getTransaction(String accountId, String transactionId) throws FigoException, IOException
accountId - ID of the account on which the transaction occuredtransactionId - the figo ID of the specific transactionFigoExceptionIOExceptionpublic Bank getBank(String bankId) throws FigoException, IOException
bankId - ID of the bank to be retrievedFigoExceptionIOExceptionpublic Bank getBank(Account account) throws FigoException, IOException
account - Account for which to return the BankFigoExceptionIOExceptionpublic Bank updateBank(Bank bank) throws FigoException, IOException
bank - modified bank object to be savedFigoExceptionIOExceptionpublic void removeBankPin(String bankId) throws FigoException, IOException
bankId - ID of the bank whose pin should be removedFigoExceptionIOExceptionpublic void removeBankPin(Bank bank) throws FigoException, IOException
bank - bank whose pin should be removedFigoExceptionIOExceptionpublic List<Notification> getNotifications() throws FigoException, IOException
FigoExceptionIOExceptionpublic Notification getNotification(String notificationId) throws FigoException, IOException
notificationId - figo ID for the notification to be retrievedFigoExceptionIOExceptionpublic Notification addNotification(Notification notification) throws FigoException, IOException
notification - Notification which should be registeredFigoExceptionIOExceptionpublic Notification updateNotification(Notification notification) throws FigoException, IOException
notification - Notification with updated valuesFigoExceptionIOExceptionpublic void removeNotification(Notification notification) throws FigoException, IOException
notification - Notification to be removedFigoExceptionIOExceptionpublic List<Payment> getPayments() throws FigoException, IOException
FigoExceptionIOExceptionpublic List<Payment> getPayments(String accountId) throws FigoException, IOException
accountId - the ID of the account for which to retrieve the paymentsFigoExceptionIOExceptionpublic List<Payment> getPayments(Account account) throws FigoException, IOException
account - the account for which to retrieve the paymentsFigoExceptionIOExceptionpublic Payment getPayment(String accountId, String paymentId) throws FigoException, IOException
accountId - ID of the account on which the payment can be foundpaymentId - ID of the payment to be retrievedFigoExceptionIOExceptionpublic Payment getPayment(Account account, String paymentId) throws FigoException, IOException
account - the account on which the payment can be foundpaymentId - ID of the payment to be retrievedFigoExceptionIOExceptionpublic Payment addPayment(Payment payment) throws FigoException, IOException
payment - Payment which should be createdFigoExceptionIOExceptionpublic Payment updatePayment(Payment payment) throws FigoException, IOException
payment - Payment with updated valuesFigoExceptionIOExceptionpublic void removePayment(Payment payment) throws FigoException, IOException
payment - payment to be removedFigoExceptionIOExceptionpublic String submitPayment(Payment payment, String tanSchemeId, String state) throws FigoException, IOException
payment - payment to be submittedtanSchemeId - TAN scheme ID of user-selected TAN schemestate - Any kind of string that will be forwarded in the callback response messageFigoExceptionIOExceptionpublic String submitPayment(Payment payment, String tanSchemeId, String state, String redirectUri) throws FigoException, IOException
payment - payment to be submittedtanSchemeId - TAN scheme ID of user-selected TAN schemestate - Any kind of string that will be forwarded in the callback response messageredirectUri - At the end of the submission process a response will be sent to this callback URLFigoExceptionIOExceptionpublic String getSyncURL(String state, String redirect_url) throws FigoException, IOException
state - String passed on through the complete synchronization process and to the redirect target at the end. It should be used to validated the
authenticity of the call to the redirect URLredirect_url - URI the user is redirected to after the process completesFigoExceptionIOExceptionCopyright © 2014 figo GmbH. All rights reserved.