Class: SynapsePayRest::SocialDocument
- Defined in:
- lib/synapse_pay_rest/models/user/social_document.rb
Overview
Represents social documents that can be added to a base document.
Instance Attribute Summary
Attributes inherited from Document
#base_document, #document_value, #id, #last_updated, #meta, #status, #type, #value
Instance Method Summary collapse
-
#verify_2fa(mfa_answer:, value:) ⇒ SynapsePayRest::SocialDocument
Verifies the pin sent via the user’s social doc either EMAIL_2FA or PHONE_NUMBER_2FA status is SUBMITTED|MFA_PENDING before verified.
Methods inherited from Document
#==, create, from_response, #initialize, #to_hash
Constructor Details
This class inherits a constructor from SynapsePayRest::Document
Instance Method Details
#verify_2fa(mfa_answer:, value:) ⇒ SynapsePayRest::SocialDocument
Verifies the pin sent via the user’s social doc either EMAIL_2FA or PHONE_NUMBER_2FA status is SUBMITTED|MFA_PENDING before verified
17 18 19 20 21 22 23 |
# File 'lib/synapse_pay_rest/models/user/social_document.rb', line 17 def verify_2fa(mfa_answer:, value:) user = base_document.user payload = (mfa_answer: mfa_answer, type: type, value: value) response = user.client.users.update(user_id: user.id, payload: payload) user = User.from_response(user.client, response) = base_document..find { |doc| doc.type == type } end |