Class: Ecertic::API::TokensService

Inherits:
Service
  • Object
show all
Defined in:
lib/ecertic/api/tokens_service.rb

Instance Attribute Summary

Attributes inherited from Service

#client

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Ecertic::API::Service

Instance Method Details

#retrieve(token, options = {}) ⇒ Object



6
7
8
9
10
# File 'lib/ecertic/api/tokens_service.rb', line 6

def retrieve(token, options = {})
  attributes = { token: token }
  response = client.post("/token", attributes, options)
  Resource::Token::Instance.new(response.body)
end

#validate(token, otp, options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/ecertic/api/tokens_service.rb', line 12

def validate(token, otp, options = {})
  attributes = { token: token, otp: otp }
  response = client.post("/validate", attributes, options)
  Resource::Token::Validation.new(response.body)
end