Class: Finicity::V1::Response::Account

Inherits:
Object
  • Object
show all
Includes:
Saxomattic
Defined in:
lib/finicity/v1/response/accounts.rb

Instance Method Summary collapse

Instance Method Details

#aggregation_attempt_dateObject



34
35
36
# File 'lib/finicity/v1/response/accounts.rb', line 34

def aggregation_attempt_date
  aggreagtionAttemptDate ? ::Time.at(aggregationAttemptDate).utc : nil
end

#aggregation_success_dateObject

Instance Methods



30
31
32
# File 'lib/finicity/v1/response/accounts.rb', line 30

def aggregation_success_date
  aggreagtionSuccessDate ? ::Time.at(aggregationSuccessDate).utc : nil
end

#balance_dateObject



38
39
40
# File 'lib/finicity/v1/response/accounts.rb', line 38

def balance_date
  balanceDate ? ::Time.at(balanceDate).utc : nil
end

#created_dateObject



42
43
44
# File 'lib/finicity/v1/response/accounts.rb', line 42

def created_date
  createdDate ? ::Time.at(createdDate).utc : nil
end

#idObject

Saxomattic Attributes



9
# File 'lib/finicity/v1/response/accounts.rb', line 9

attribute :id

#payment_due_dateObject



46
47
48
# File 'lib/finicity/v1/response/accounts.rb', line 46

def payment_due_date
  paymentDueDate ? ::Time.at(paymentDueDate).utc : nil
end

#statement_end_dateObject



50
51
52
# File 'lib/finicity/v1/response/accounts.rb', line 50

def statement_end_date
  statementEndDate ? ::Time.at(statementEndDate).utc : nil
end

#validate_aggregation_status!Object



54
55
56
57
58
59
60
61
62
63
# File 'lib/finicity/v1/response/accounts.rb', line 54

def validate_aggregation_status!
  case aggregation_status_code
  when 0
    true
  when 103, 108, 109, 185, 187
    fail ::Finicity::InvalidCredentialsError.new(aggregation_status_code)
  else
    fail ::Finicity::FinicityAggregationError.new(aggregation_status_code)
  end
end