Class: Fintoc::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/fintoc/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key, jws_private_key: nil) ⇒ Client

Returns a new instance of Client.



6
7
8
9
# File 'lib/fintoc/client.rb', line 6

def initialize(api_key, jws_private_key: nil)
  @api_key = api_key
  @jws_private_key = jws_private_key
end

Instance Method Details



28
29
30
# File 'lib/fintoc/client.rb', line 28

def delete_link(link_id)
  @v1.links.delete(link_id)
end

#get_account(link_token, account_id) ⇒ Object



32
33
34
# File 'lib/fintoc/client.rb', line 32

def (link_token, )
  @v1.links.get(link_token).find(id: )
end

These methods are kept for backward compatibility



20
21
22
# File 'lib/fintoc/client.rb', line 20

def get_link(link_token)
  @v1.links.get(link_token)
end


24
25
26
# File 'lib/fintoc/client.rb', line 24

def get_links
  @v1.links.list
end

#to_sObject



36
37
38
# File 'lib/fintoc/client.rb', line 36

def to_s
  "Fintoc::Client(v1: #{@v1}, v2: #{@v2})"
end

#v1Object



11
12
13
# File 'lib/fintoc/client.rb', line 11

def v1
  @v1 ||= Fintoc::V1::Client.new(@api_key)
end

#v2Object



15
16
17
# File 'lib/fintoc/client.rb', line 15

def v2
  @v2 ||= Fintoc::V2::Client.new(@api_key, jws_private_key: @jws_private_key)
end