Class: Virgil::SDK::HighLevel::VirgilIdentity::VerificationAttempt

Inherits:
Object
  • Object
show all
Defined in:
lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb

Overview

This class provides an information about identity verification process.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context:, action_id:, identity:, identity_type:, additional_options: nil) ⇒ VerificationAttempt

Initializes a new instance of the Virgil::SDK::HighLevel::VirgilIdentity::VerificationAttempt class



44
45
46
47
48
49
50
# File 'lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb', line 44

def initialize(context:, action_id:, identity:, identity_type:, additional_options: nil)
  @context = context
  @action_id = action_id
  @identity = identity
  @identity_type = identity_type
  @additional_options = additional_options || VerificationOptions.new
end

Instance Attribute Details

#action_idObject (readonly)

Returns the value of attribute action_id



41
42
43
# File 'lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb', line 41

def action_id
  @action_id
end

#additional_optionsObject (readonly)

Returns the value of attribute additional_options



41
42
43
# File 'lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb', line 41

def additional_options
  @additional_options
end

#contextObject (readonly)

Returns the value of attribute context



41
42
43
# File 'lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb', line 41

def context
  @context
end

#identityObject (readonly)

Returns the value of attribute identity



41
42
43
# File 'lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb', line 41

def identity
  @identity
end

#identity_typeObject (readonly)

Returns the value of attribute identity_type



41
42
43
# File 'lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb', line 41

def identity_type
  @identity_type
end

Instance Method Details

#confirm(confirmation) ⇒ ValidationToken

Confirms an identity and generates a validation token that can be used to perform operations like Publish and Revoke global Cards.

Parameters:

  • confirmation (EmailConfirmation)

    confirmation with defined own confirmation code that was received on email box.

Returns:

Raises:



58
59
60
61
62
63
# File 'lib/virgil/sdk/high_level/virgil_identity/verification_attempt.rb', line 58

def confirm(confirmation)
  raise ConfirmationIsNotValid unless confirmation
  token = confirmation.confirm_and_grab_validation_token(self, self.context.client)
  ValidationToken.new(token)

end