Class: Finicity::V1::Request::RefreshAccounts

Inherits:
Object
  • Object
show all
Extended by:
HTTPClient::IncludeClient
Includes:
Logger
Defined in:
lib/finicity/v1/request/refresh_accounts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logger

#log_request, #mask_body

Constructor Details

#initialize(token, customer_id) ⇒ RefreshAccounts

Instance Methods



19
20
21
22
# File 'lib/finicity/v1/request/refresh_accounts.rb', line 19

def initialize(token, customer_id)
  @customer_id = customer_id
  @token = token
end

Instance Attribute Details

#customer_idObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/refresh_accounts.rb', line 13

def customer_id
  @customer_id
end

#tokenObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/refresh_accounts.rb', line 13

def token
  @token
end

Instance Method Details

#headersObject



28
29
30
31
32
33
# File 'lib/finicity/v1/request/refresh_accounts.rb', line 28

def headers
  {
    'Finicity-App-Key' => ::Finicity.config.app_key,
    'Finicity-App-Token' => token
  }
end

#refresh_accountsObject



24
25
26
# File 'lib/finicity/v1/request/refresh_accounts.rb', line 24

def refresh_accounts
  http_client.post(url, nil, headers)
end

#urlObject



35
36
37
38
39
40
41
42
43
# File 'lib/finicity/v1/request/refresh_accounts.rb', line 35

def url
  ::URI.join(
    ::Finicity.config.base_url,
    'v1/',
    'customers/',
    "#{customer_id}/",
    'accounts'
  )
end