Method: Finicity::Client#interactive_refresh_account_with_mfa

Defined in:
lib/finicity/client.rb

#interactive_refresh_account_with_mfa(customer_id, account_id, mfa_credentials) ⇒ Object

The mfa_credentials parameter is an array of hashes with keys :text, :answer



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/finicity/client.rb', line 292

def (customer_id, , mfa_credentials)
  request = ::Finicity::V1::Request::InteractiveRefreshAccountWithMfa.new(token, mfa_session, customer_id, , mfa_credentials)
  request.log_request
  response = request.
  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