Module: SantanderChile::ApiClient::Client::Authentication

Included in:
SantanderChile::ApiClient::Client
Defined in:
lib/santander_chile/api_client/client/authentication.rb

Constant Summary collapse

HEADERS =
{
  "app" => "007",
  "canal" => "003",
  "nro_ser" => "",
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tokenObject

Returns the value of attribute token.



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

def token
  @token
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#login(username:, password:, grant_type: "password") ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/santander_chile/api_client/client/authentication.rb', line 14

def (username:, password:, grant_type: "password")
  self.username = username
  self.token = oauth_token(
    grant_type: grant_type,
    client_id: config.client_id,
    scope: "Completa",
    username: username,
    password: password,
  )
  self.token
end