Class: Figo::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/account/model.rb

Overview

Object representing one bank account of the User

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#dump, dump_attributes

Constructor Details

#initialize(session, json) ⇒ Account

Returns a new instance of Account.



7
8
9
# File 'lib/account/model.rb', line 7

def initialize(session, json)
  super(session, json)
end

Instance Attribute Details

#account_idString

Internal figo Connect account ID

Returns:

  • (String)


13
14
15
# File 'lib/account/model.rb', line 13

def 
  @account_id
end

#account_numberString

Account number

Returns:

  • (String)


33
34
35
# File 'lib/account/model.rb', line 33

def 
  @account_number
end

#additional_iconsHash

Account icon URLs for other resolutions

Returns:

  • (Hash)


65
66
67
# File 'lib/account/model.rb', line 65

def additional_icons
  @additional_icons
end

#auto_syncBoolean

This flag indicates whether the account will be automatically synchronized

Returns:

  • (Boolean)


29
30
31
# File 'lib/account/model.rb', line 29

def auto_sync
  @auto_sync
end

#balanceAccountBalance

AccountBalance object

Returns:



77
78
79
# File 'lib/account/model.rb', line 77

def balance
  @balance
end

#bank_codeString

Bank code

Returns:

  • (String)


37
38
39
# File 'lib/account/model.rb', line 37

def bank_code
  @bank_code
end

#bank_idString

Internal figo Connect bank ID

Returns:

  • (String)


17
18
19
# File 'lib/account/model.rb', line 17

def bank_id
  @bank_id
end

#bank_nameString

Bank name

Returns:

  • (String)


41
42
43
# File 'lib/account/model.rb', line 41

def bank_name
  @bank_name
end

#bicString

BIC

Returns:

  • (String)


53
54
55
# File 'lib/account/model.rb', line 53

def bic
  @bic
end

#currencyString

Three-character currency code

Returns:

  • (String)


45
46
47
# File 'lib/account/model.rb', line 45

def currency
  @currency
end

#ibanString

IBAN

Returns:

  • (String)


49
50
51
# File 'lib/account/model.rb', line 49

def iban
  @iban
end

#iconString

Account icon URL

Returns:

  • (String)


61
62
63
# File 'lib/account/model.rb', line 61

def icon
  @icon
end

#in_total_balanceBoolean

This flag indicates whether the balance of this account is added to the total balance of accounts

Returns:

  • (Boolean)


69
70
71
# File 'lib/account/model.rb', line 69

def in_total_balance
  @in_total_balance
end

#nameString

Account name

Returns:

  • (String)


21
22
23
# File 'lib/account/model.rb', line 21

def name
  @name
end

#ownerString

Account owner

Returns:

  • (String)


25
26
27
# File 'lib/account/model.rb', line 25

def owner
  @owner
end

#statusSynchronizationStatus

Synchronization status object



73
74
75
# File 'lib/account/model.rb', line 73

def status
  @status
end

#typeString

Account type

Returns:

  • (String)


57
58
59
# File 'lib/account/model.rb', line 57

def type
  @type
end

Instance Method Details

#bankBank

Retrieve bank of this account

Returns:

  • (Bank)

    ‘Bank` object for the respective bank



118
119
120
# File 'lib/account/model.rb', line 118

def bank
  @session.get_bank @bank_id
end

#get_payment(payment_id) ⇒ Payment

Retrieve specific payment on this account

Parameters:

  • payment_id (String)

    ID of the notification to be retrieved

Returns:

  • (Payment)

    ‘Payment` object for the respective payment



111
112
113
# File 'lib/account/model.rb', line 111

def get_payment(payment_id)
  @session.get_payment @account_id, payment_id
end

#get_transaction(transaction_id) ⇒ Transaction

Request specific transaction.

Parameters:

  • transaction_id (String)

    ID of the transaction to be retrieved

Returns:



96
97
98
# File 'lib/account/model.rb', line 96

def get_transaction(transaction_id)
  @session.get_transaction @acount_id, transaction_id
end

#paymentsPayment

Retrieve list of payments on this account

Returns:

  • (Payment)

    an array of ‘Payment` objects, one for each payment



103
104
105
# File 'lib/account/model.rb', line 103

def payments
  @session.payments @account_id
end

#transactions(since = nil, count = 1000, offset = 0, include_pending = false) ⇒ Array

Request list of transactions of this account

Parameters:

  • since (String, Date) (defaults to: nil)

    this parameter can either be a transaction ID or a date

  • count (Integer) (defaults to: 1000)

    limit the number of returned transactions

  • offset (Integer) (defaults to: 0)

    which offset into the result set should be used to determin the first transaction to return (useful in combination with count)

  • include_pending (Boolean) (defaults to: false)

    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` parameter

Returns:

  • (Array)

    an array of ‘Transaction` objects, one for each transaction of this account



88
89
90
# File 'lib/account/model.rb', line 88

def transactions(since = nil, count = 1000, offset = 0, include_pending = false)
  @session.transactions @account_id, since, count, offset, include_pending
end