Module: MangoApi::AuthTokenManager

Defined in:
lib/mangopay/api/auth_token_manager.rb

Overview

Manages acquisition and storage of API authorization token.

Constant Summary collapse

LOG =
MangoPay::LogProvider.provide(self)

Class Method Summary collapse

Class Method Details

.tokenObject

Provides a valid authorization token for API calls.



13
14
15
16
# File 'lib/mangopay/api/auth_token_manager.rb', line 13

def token
  client_id = MangoPay.configuration.client_id
  token_valid? && storage.retrieve_for(client_id) || refresh_token
end