Class: Finicity::V1::Request::InteractiveRefreshAccountWithMfa
- Inherits:
-
Object
- Object
- Finicity::V1::Request::InteractiveRefreshAccountWithMfa
- Extended by:
- HTTPClient::IncludeClient
- Includes:
- Logger
- Defined in:
- lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Attributes.
-
#customer_id ⇒ Object
Attributes.
-
#mfa_credentials ⇒ Object
Attributes.
-
#mfa_session ⇒ Object
Attributes.
-
#token ⇒ Object
Attributes.
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(token, mfa_session, customer_id, account_id, mfa_credentials) ⇒ InteractiveRefreshAccountWithMfa
constructor
Instance Methods.
- #interactive_refresh_account_with_mfa ⇒ Object
- #url ⇒ Object
Methods included from Logger
Constructor Details
#initialize(token, mfa_session, customer_id, account_id, mfa_credentials) ⇒ InteractiveRefreshAccountWithMfa
Instance Methods
22 23 24 25 26 27 28 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 22 def initialize(token, mfa_session, customer_id, account_id, mfa_credentials) @account_id = account_id @customer_id = customer_id @mfa_credentials = mfa_credentials @mfa_session = mfa_session @token = token end |
Instance Attribute Details
#account_id ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 13 def account_id @account_id end |
#customer_id ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 13 def customer_id @customer_id end |
#mfa_credentials ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 13 def mfa_credentials @mfa_credentials end |
#mfa_session ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 13 def mfa_session @mfa_session end |
#token ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 13 def token @token end |
Instance Method Details
#body ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 34 def body builder = ::Nokogiri::XML::Builder.new do |xml| xml.mfaChallenges { xml.questions { mfa_credentials.each do |mfa_credential| xml.question { xml.text_(mfa_credential[:text]) xml.answer(mfa_credential[:answer]) } end } } end builder.to_xml end |
#headers ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 51 def headers { 'Finicity-App-Key' => ::Finicity.config.app_key, 'Finicity-App-Token' => token, 'MFA-Session' => mfa_session, 'Content-Type' => 'application/xml' } end |
#interactive_refresh_account_with_mfa ⇒ Object
30 31 32 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 30 def interactive_refresh_account_with_mfa http_client.post(url, body, headers) end |
#url ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/finicity/v1/request/interactive_refresh_account_with_mfa.rb', line 60 def url ::URI.join( ::Finicity.config.base_url, 'v1/', 'customers/', "#{customer_id}/", 'accounts/', "#{account_id}/", 'mfa' ) end |