Class: Yoti::ActivityDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti/activity_details.rb

Overview

Details of an activity between a user and the application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(receipt, decrypted_profile = nil, decrypted_application_profile = nil, extra_data = nil) ⇒ ActivityDetails

Returns a new instance of ActivityDetails.

Parameters:

  • receipt (Hash)

    the receipt from the API request

  • decrypted_profile (Object) (defaults to: nil)

    Protobuf AttributeList decrypted object containing the profile attributes

  • decrypted_application_profile (Object) (defaults to: nil)

    Protobuf AttributeList decrypted object containing profile attributes for the application profile

  • extra_data (Yoti::Share::ExtraData|nil) (defaults to: nil)

    Processed extra data object or nil if absent from the receipt



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/yoti/activity_details.rb', line 101

def initialize(receipt, decrypted_profile = nil, decrypted_application_profile = nil, extra_data = nil)
  @remember_me_id = receipt['remember_me_id']
  @user_id = @remember_me_id
  @receipt_id = receipt['receipt_id']
  @parent_remember_me_id = receipt['parent_remember_me_id']
  @outcome = receipt['sharing_outcome']
  @timestamp = receipt['timestamp'] ? Time.parse(receipt['timestamp']) : nil
   = process_decrypted_profile(decrypted_profile)
  @extended_application_profile = process_decrypted_profile(decrypted_application_profile)
  @extra_data = extra_data
  @user_profile = .map do |name, attribute|
    [name, attribute.value]
  end.to_h
end

Instance Attribute Details

#age_verifiedBoolean (readonly)

Deprecated.

2.0.0 - replaced by:

The age under/over attribute

  • Yoti::Profile#age_verifications

  • Yoti::Profile#find_age_over_verification

  • Yoti::Profile#find_age_under_verification

Returns:

  • (Boolean)


71
72
73
# File 'lib/yoti/activity_details.rb', line 71

def age_verified
  @age_verified
end

#base64_selfie_uriString (readonly)

Base64 encoded selfie image

Returns:

  • (String)


59
60
61
# File 'lib/yoti/activity_details.rb', line 59

def base64_selfie_uri
  @base64_selfie_uri
end

#extra_dataExtraData (readonly)

Extra data

Returns:

  • (ExtraData)


92
93
94
# File 'lib/yoti/activity_details.rb', line 92

def extra_data
  @extra_data
end

#outcomeString (readonly)

The outcome of the profile request, eg: SUCCESS

Returns:

  • (String)


14
15
16
# File 'lib/yoti/activity_details.rb', line 14

def outcome
  @outcome
end

#parent_remember_me_idString (readonly)

Return the Parent Remember Me ID, which is a unique, stable identifier for a user in the context of an organisation.

You can use it to identify returning users. This value is consistent for a given user across different applications belonging to a single organisation.

Returns:

  • (String)


43
44
45
# File 'lib/yoti/activity_details.rb', line 43

def parent_remember_me_id
  @parent_remember_me_id
end

#receipt_idString (readonly)

Receipt ID identifying a completed activity

Returns:

  • (String)


78
79
80
# File 'lib/yoti/activity_details.rb', line 78

def receipt_id
  @receipt_id
end

#remember_me_idString (readonly)

Return the Remember Me ID, which is a unique, stable identifier for a user in the context of an application.

You can use it to identify returning users. This value will be different for the same user in different applications.

Returns:

  • (String)


32
33
34
# File 'lib/yoti/activity_details.rb', line 32

def remember_me_id
  @remember_me_id
end

#timestampTime (readonly)

Time and date of the sharing activity

Returns:

  • (Time)


85
86
87
# File 'lib/yoti/activity_details.rb', line 85

def timestamp
  @timestamp
end

#user_idString (readonly)

Deprecated.

replaced by :remember_me_id

Returns:

  • (String)


21
22
23
# File 'lib/yoti/activity_details.rb', line 21

def user_id
  @user_id
end

#user_profileHash (readonly)

Deprecated.

replaced by :profile

The decoded profile attributes

Returns:

  • (Hash)


52
53
54
# File 'lib/yoti/activity_details.rb', line 52

def 
  @user_profile
end

Instance Method Details

#application_profileApplicationProfile

Profile of an application, with convenience methods to access well-known attributes

Returns:



142
143
144
# File 'lib/yoti/activity_details.rb', line 142

def application_profile
  Yoti::ApplicationProfile.new(@extended_application_profile)
end

#profileProfile

The user profile with shared attributes and anchor information, returned by Yoti if the request was successful

Returns:



133
134
135
# File 'lib/yoti/activity_details.rb', line 133

def profile
  Yoti::Profile.new()
end

#structured_postal_addressHash

Deprecated.

replaced by Yoti::Profile#structured_postal_address

The user’s structured postal address as JSON

Returns:

  • (Hash)


123
124
125
# File 'lib/yoti/activity_details.rb', line 123

def structured_postal_address
  ['structured_postal_address']
end