Documentation ¶
Index ¶
- Variables
- type Connection
- func (connection *Connection) CreateSynchronizationTask(accessToken string, syncTask SyncTask) ([]byte, error)
- func (connection *Connection) CreateUser(name string, email string, password string) ([]byte, error)
- func (connection *Connection) CredentialLogin(username string, password string) ([]byte, error)
- func (connection *Connection) DeleteUser(accessToken string) ([]byte, error)
- func (connection *Connection) ReadIndividualCatalogEntry(accessToken string, catalogCategory string, countryCode string, ...) ([]byte, error)
- func (connection *Connection) ReadStandingOrder(accessToken string, options ...TransactionOption) ([]byte, error)
- func (connection *Connection) RemoveBankAccount(accessToken string, bankAccountID string) ([]byte, error)
- func (connection *Connection) RequestForTask(accessToken, taskToken string) ([]byte, error)
- func (connection *Connection) RequestForTaskWithPinChallenge(accessToken, taskToken, pin string, savePin bool) ([]byte, error)
- func (connection *Connection) RetrieveAllBankAccounts(accessToken string, cents bool) ([]byte, error)
- func (connection *Connection) RetrieveSpecificBankAccounts(accessToken, accountID string, cents bool) ([]byte, error)
- func (connection *Connection) RetrieveSpecificTransaction(accessToken string, transactionID string) ([]byte, error)
- func (connection *Connection) RetrieveTransactionsOfAllAccounts(accessToken string, options ...TransactionOption) ([]byte, error)
- func (connection *Connection) RetrieveTransactionsSingleAccount(accessToken, accountid string, options ...TransactionOption) ([]byte, error)
- func (connection *Connection) SetHost(host string)
- func (connection *Connection) SetupNewBankAccount(accessToken string, bankCode string, country string, credentials []string, ...) ([]byte, error)
- type FakeConnection
- func (fakeConnection *FakeConnection) CreateUser(name string, email string, password string) ([]byte, error)
- func (fakeConnection *FakeConnection) CredentialLogin(username string, password string) ([]byte, error)
- func (fakeConnection *FakeConnection) DeleteUser(accessToken string) ([]byte, error)
- func (fakeConnection *FakeConnection) ReadIndividualCatalogEntry(accessToken string, catalogCategory string, countryCode string, ...) ([]byte, error)
- func (fakeConnection *FakeConnection) ReadStandingOrder(accessToken string, options ...TransactionOption) ([]byte, error)
- func (fakeConnection *FakeConnection) RemoveBankAccount(accessToken string, bankAccountID string) ([]byte, error)
- func (fakeConnection *FakeConnection) RequestForTask(accessToken string, taskToken string) ([]byte, error)
- func (fakeConnection *FakeConnection) RequestForTaskWithPinChallenge(accessToken string, taskToken string, pin string, savePin bool) ([]byte, error)
- func (fakeConnection *FakeConnection) RetrieveAllBankAccounts(accessToken string) ([]byte, error)
- func (fakeConnection *FakeConnection) RetrieveSpecificTransaction(accessToken string, transactionID string) ([]byte, error)
- func (fakeConnection *FakeConnection) RetrieveTransactionsOfAllAccounts(accessToken string, options ...TransactionOption) ([]byte, error)
- func (fakeConnection *FakeConnection) SetHost(host string)
- func (fakeConnection *FakeConnection) SetupNewBankAccount(accessToken string, bankCode string, country string, credentials []string) ([]byte, error)
- type IConnection
- type SyncTask
- type TransactionOption
- type TransactionOptionKey
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUserAlreadyExists - code 30002 ErrUserAlreadyExists = errors.New("user already exists") ErrHTTPUnauthorized = errors.New("invalid authorization") )
var ( // ErrCantFindUser means "Cant find user in fake-figo" ErrCantFindUser = errors.New("cant find user") )
Functions ¶
This section is empty.
Types ¶
type Connection ¶
Connection represent a connection to figo
func NewFigoConnection ¶
func NewFigoConnection(clientID string, clientSecret string) *Connection
NewFigoConnection creates a new connection. -> You need a clientID and a clientSecret. (You will get this from figo.io)
func (*Connection) CreateSynchronizationTask ¶
func (connection *Connection) CreateSynchronizationTask(accessToken string, syncTask SyncTask) ([]byte, error)
CreateSynchronizationTask creates a new task to synchronize
func (*Connection) CreateUser ¶
func (connection *Connection) CreateUser(name string, email string, password string) ([]byte, error)
CreateUser creates a new user. Ask User for name, email and a password
func (*Connection) CredentialLogin ¶
func (connection *Connection) CredentialLogin(username string, password string) ([]byte, error)
CredentialLogin create a login. -> First you have to create a user (CreateUser)
func (*Connection) DeleteUser ¶
func (connection *Connection) DeleteUser(accessToken string) ([]byte, error)
DeleteUser deletes an existing user
func (*Connection) ReadIndividualCatalogEntry ¶
func (connection *Connection) ReadIndividualCatalogEntry(accessToken string, catalogCategory string, countryCode string, serviceID string) ([]byte, error)
ReadIndividualCatalogEntry gets all infos for a specific catalog entry. catalogCategory is "banks" or "services" countryCode is "de" or "at" serviceID is something like BLZ
func (*Connection) ReadStandingOrder ¶
func (connection *Connection) ReadStandingOrder(accessToken string, options ...TransactionOption) ([]byte, error)
ReadStandingOrder all standing orders
func (*Connection) RemoveBankAccount ¶
func (connection *Connection) RemoveBankAccount(accessToken string, bankAccountID string) ([]byte, error)
RemoveBankAccount removes a bank account
func (*Connection) RequestForTask ¶
func (connection *Connection) RequestForTask(accessToken, taskToken string) ([]byte, error)
RequestForTask starts a new task or polls it to synchronize real bankAccount and figoAccount
func (*Connection) RequestForTaskWithPinChallenge ¶
func (connection *Connection) RequestForTaskWithPinChallenge(accessToken, taskToken, pin string, savePin bool) ([]byte, error)
RequestForTaskWithPinChallenge can be use to respond to a pin challenge that might occur when syncing
func (*Connection) RetrieveAllBankAccounts ¶
func (connection *Connection) RetrieveAllBankAccounts(accessToken string, cents bool) ([]byte, error)
RetrieveAllBankAccounts retrieves all bankAccounts for an user
func (*Connection) RetrieveSpecificBankAccounts ¶
func (connection *Connection) RetrieveSpecificBankAccounts(accessToken, accountID string, cents bool) ([]byte, error)
RetrieveAllBankAccounts retrieves specific bankAccounts for an user
func (*Connection) RetrieveSpecificTransaction ¶
func (connection *Connection) RetrieveSpecificTransaction(accessToken string, transactionID string) ([]byte, error)
RetrieveSpecificTransaction with accessToken from login-session
func (*Connection) RetrieveTransactionsOfAllAccounts ¶
func (connection *Connection) RetrieveTransactionsOfAllAccounts(accessToken string, options ...TransactionOption) ([]byte, error)
RetrieveTransactionsOfAllAccounts with accessToken from login-session
func (*Connection) RetrieveTransactionsSingleAccount ¶
func (connection *Connection) RetrieveTransactionsSingleAccount(accessToken, accountid string, options ...TransactionOption) ([]byte, error)
func (*Connection) SetHost ¶
func (connection *Connection) SetHost(host string)
SetHost sets a new host
func (*Connection) SetupNewBankAccount ¶
func (connection *Connection) SetupNewBankAccount(accessToken string, bankCode string, country string, credentials []string, savePin bool) ([]byte, error)
SetupNewBankAccount add a new bankAccount to an existing figo-Account
type FakeConnection ¶
type FakeConnection struct {
Users []map[string]interface{}
}
FakeConnection is a fakes the figoAPI
func NewFakeConnection ¶
func NewFakeConnection() *FakeConnection
NewFakeConnection creates a new "fak-Connection" only in memory
func (*FakeConnection) CreateUser ¶
func (fakeConnection *FakeConnection) CreateUser(name string, email string, password string) ([]byte, error)
CreateUser "store" a user in this fake-Connection
func (*FakeConnection) CredentialLogin ¶
func (fakeConnection *FakeConnection) CredentialLogin(username string, password string) ([]byte, error)
CredentialLogin returns a token -> Notice: first add a user via CreateUser!
func (*FakeConnection) DeleteUser ¶
func (fakeConnection *FakeConnection) DeleteUser(accessToken string) ([]byte, error)
DeleteUser deletes a user from fakeConnection Notice: you need an accessToken from CredentialLogin
func (*FakeConnection) ReadIndividualCatalogEntry ¶
func (fakeConnection *FakeConnection) ReadIndividualCatalogEntry(accessToken string, catalogCategory string, countryCode string, serviceID string) ([]byte, error)
ReadIndividualCatalogEntry TODO
func (*FakeConnection) ReadStandingOrder ¶
func (fakeConnection *FakeConnection) ReadStandingOrder(accessToken string, options ...TransactionOption) ([]byte, error)
ReadStandingOrder TODO
func (*FakeConnection) RemoveBankAccount ¶
func (fakeConnection *FakeConnection) RemoveBankAccount(accessToken string, bankAccountID string) ([]byte, error)
RemoveBankAccount removes a bank account TODO
func (*FakeConnection) RequestForTask ¶
func (fakeConnection *FakeConnection) RequestForTask(accessToken string, taskToken string) ([]byte, error)
RequestForTask should generate new transactions TODO
func (*FakeConnection) RequestForTaskWithPinChallenge ¶
func (fakeConnection *FakeConnection) RequestForTaskWithPinChallenge(accessToken string, taskToken string, pin string, savePin bool) ([]byte, error)
RequestForTaskWithPinChallenge should generate new transactions TODO
func (*FakeConnection) RetrieveAllBankAccounts ¶
func (fakeConnection *FakeConnection) RetrieveAllBankAccounts(accessToken string) ([]byte, error)
RetrieveAllBankAccounts TODO
func (*FakeConnection) RetrieveSpecificTransaction ¶
func (fakeConnection *FakeConnection) RetrieveSpecificTransaction(accessToken string, transactionID string) ([]byte, error)
RetrieveSpecificTransaction TODO
func (*FakeConnection) RetrieveTransactionsOfAllAccounts ¶
func (fakeConnection *FakeConnection) RetrieveTransactionsOfAllAccounts(accessToken string, options ...TransactionOption) ([]byte, error)
RetrieveTransactionsOfAllAccounts TODO
func (*FakeConnection) SetHost ¶
func (fakeConnection *FakeConnection) SetHost(host string)
SetHost is not needed
func (*FakeConnection) SetupNewBankAccount ¶
func (fakeConnection *FakeConnection) SetupNewBankAccount(accessToken string, bankCode string, country string, credentials []string) ([]byte, error)
SetupNewBankAccount sets up a new bank account for an existing account. -> Notice: you need an accessToken from CredentialLogin
type IConnection ¶
type IConnection interface { // Set another host SetHost(host string) // http://docs.figo.io/#create-new-figo-user // Ask user for new name, email and password CreateUser(name string, email string, password string) ([]byte, error) // http://docs.figo.io/#credential-login // Login with email (aka username) and password CredentialLogin(username string, password string) ([]byte, error) // http://docs.figo.io/#delete-current-user // Remove user with an accessToken. You get the token after successfully login DeleteUser(accessToken string) ([]byte, error) // http://docs.figo.io/#setup-new-bank-account // Add a BankAccount to figo-Account // -> you get accessToken from the login-response // -> country is something like "de" (for germany) SetupNewBankAccount(accessToken string, bankCode string, country string, credentials []string, savePin bool) ([]byte, error) // http://docs.figo.io/#retrieve-all-bank-accounts // Retrieves all bankAccounts for an user RetrieveAllBankAccounts(accessToken string, cents bool) ([]byte, error) // http://docs.figo.io/#delete-bank-account // Removes a bankAccount from figo-account RemoveBankAccount(accessToken string, bankAccountID string) ([]byte, error) // http://docs.figo.io/#poll-task-state // request a task // -> you need a taskToken. You will get this from SetupNewBankAccount or when triggering a manuel sync RequestForTask(accessToken string, taskToken string) ([]byte, error) // http://docs.figo.io/#poll-task-state // request a task // -> you need a taskToken. You will get this from SetupNewBankAccount or when triggering a manual sync RequestForTaskWithPinChallenge(accessToken string, taskToken string, pin string, savePin bool) ([]byte, error) // http://docs.figo.io/#retrieve-transactions-of-one-or-all-account // Retrieves all Transactions RetrieveTransactionsOfAllAccounts(accessToken string, options ...TransactionOption) ([]byte, error) // Retrieves all Transactions of a single account RetrieveTransactionsSingleAccount(accessToken, accountid string, options ...TransactionOption) ([]byte, error) // http://docs.figo.io/#retrieve-a-transaction // Retrieves a specific Transaction RetrieveSpecificTransaction(accessToken string, transactionID string) ([]byte, error) // http://docs.figo.io/#tag/Catalog // Read individual Catalog Entry ReadIndividualCatalogEntry(accessToken string, catalogCategory string, countryCode string, serviceID string) ([]byte, error) // http://docs.figo.io/#standing-orders-api-calls-read-standing-orders // Read standing orders ReadStandingOrder(accessToken string, options ...TransactionOption) ([]byte, error) }
IConnection represent an interface for connections. This provides to use fakeConnection and a real-figoConnection
type SyncTask ¶
type SyncTask struct { State string `json:"state"` RedirectURI string `json:"redirect_uri,omitempty"` DisableNotifications bool `json:"disable_notifications,omitempty"` IfNotSyncedSince int `json:"if_not_synced_since,omitempty"` AutoContinue bool `json:"auto_continue,omitempty"` AccountIds []string `json:"account_ids,omitempty"` SyncTasks []string `json:"sync_tasks,omitempty"` }
SyncTask represents a synchronization task
type TransactionOption ¶
type TransactionOption struct { Key TransactionOptionKey Value string }
TransactionOption are options for transaction-calls
type TransactionOptionKey ¶
type TransactionOptionKey string
TransactionOptionKey are the type for allowed keys
var ( // Cent if true, the amount of the transactions will be shown in cents. Cent TransactionOptionKey = "cents" )