Method: Figo#transactions

Defined in:
lib/transaction/api_call.rb

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

Retrieve list of transactions (on all or a specific account)

Parameters:

  • account_id (String) (defaults to: nil)

    ID of the account for which to list the transactions

  • 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 the user



13
14
15
16
17
18
# File 'lib/transaction/api_call.rb', line 13

def transactions( = nil, since = nil, count = 1000, offset = 0, include_pending = false)
  data = {"count" => count.to_s, "offset" => offset.to_s, "include_pending" => include_pending ? "1" : "0"}
  data["since"] = ((since.is_a?(Date) ? since.to_s : since) unless since.nil?)

  query_api_object Transaction, (.nil? ? "/rest/transactions?" : "/rest/accounts/#{account_id}/transactions?") + URI.encode_www_form(data), nil, "GET", "transactions"
end