Sha256: 0ab437628f73e98afd6f49956d7fe4a5a7b8f238bab07cd3bf07039c4859ea98

Contents?: true

Size: 685 Bytes

Versions: 5

Compression:

Stored size: 685 Bytes

Contents

module Yoti
  # Manage the API's profile requests
  class ProfileRequest
    def initialize(encrypted_connect_token)
      @encrypted_connect_token = encrypted_connect_token
      @request = request
    end

    # @return [String] a JSON representation of the profile response receipt
    def receipt
      JSON.parse(@request.body)['receipt']
    end

    private

    def request
      yoti_request = Yoti::Request.new
      yoti_request.add_header('X-Yoti-Auth-Key', Yoti::SSL.auth_key_from_pem)
      yoti_request.encrypted_connect_token = @encrypted_connect_token
      yoti_request.http_method = 'GET'
      yoti_request.endpoint = 'profile'
      yoti_request
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yoti-1.6.4 lib/yoti/http/profile_request.rb
yoti-1.6.3 lib/yoti/http/profile_request.rb
yoti-1.6.2 lib/yoti/http/profile_request.rb
yoti-1.6.1 lib/yoti/http/profile_request.rb
yoti-1.6.0 lib/yoti/http/profile_request.rb