Class: SantanderChile::ApiClient::Client

Inherits:
Object
  • Object
show all
Includes:
Authentication
Defined in:
lib/santander_chile/api_client/client.rb,
lib/santander_chile/api_client/client/connection.rb,
lib/santander_chile/api_client/client/configuration.rb,
lib/santander_chile/api_client/client/authentication.rb

Defined Under Namespace

Modules: Authentication Classes: Configuration, Connection

Constant Summary collapse

AUTH_BASE_URL =
"https://apideveloper.santander.cl/sancl/privado/Cliente/v1/"
BASE_URL =
"https://apiper.santander.cl/appper/facade/"

Constants included from Authentication

Authentication::HEADERS

Instance Attribute Summary collapse

Attributes included from Authentication

#token, #username

Instance Method Summary collapse

Methods included from Authentication

#login

Constructor Details

#initialize {|config| ... } ⇒ Client

Returns a new instance of Client.

Yields:



10
11
12
13
14
# File 'lib/santander_chile/api_client/client.rb', line 10

def initialize
  self.config = Configuration.new
  yield(config) if block_given?
  config.validate!
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



8
9
10
# File 'lib/santander_chile/api_client/client.rb', line 8

def config
  @config
end

Instance Method Details

#connection(host: BASE_URL) ⇒ Object



16
17
18
# File 'lib/santander_chile/api_client/client.rb', line 16

def connection(host: BASE_URL)
  Connection.new(client: self, host: host)
end

#contactsObject



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

def contacts
  PaymentsResource.new(self).contacts.data
end

#movements(account) ⇒ Object



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

def movements()
  MovementsResource.new(self).list()
end

#productsObject



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

def products
  ProductsResource.new(self).list
end