Method: Finicity::Client#activate_accounts_with_mfa
- Defined in:
- lib/finicity/client.rb
#activate_accounts_with_mfa(customer_id, institution_id, accounts, mfa_credentials) ⇒ Object
The accounts parameter is an array of Finicity::V1::Reponse::Account The mfa_credentials parameter is an array of hashes with keys :text, :answer
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/finicity/client.rb', line 41 def activate_accounts_with_mfa(customer_id, institution_id, accounts, mfa_credentials) request = ::Finicity::V1::Request::ActivateAccountsWithMfa.new(token, mfa_session, customer_id, institution_id, accounts, mfa_credentials) request.log_request response = request.activate_accounts_with_mfa log_response(response) if response.status_code == 200 @mfa_session = nil parsed_response = ::Finicity::V1::Response::Accounts.parse(response.body) return parsed_response.accounts elsif response.status_code == 203 @mfa_session = response.headers["MFA-Session"] parsed_response = ::Finicity::V1::Response::Mfa.parse(response.body) return parsed_response.questions else raise_generic_error!(response) end end |