Class: Finicity::V1::Request::DiscoverAccounts
- Inherits:
-
Object
- Object
- Finicity::V1::Request::DiscoverAccounts
- Extended by:
- HTTPClient::IncludeClient
- Includes:
- Logger
- Defined in:
- lib/finicity/v1/request/discover_accounts.rb
Instance Attribute Summary collapse
-
#customer_id ⇒ Object
Attributes.
-
#institution_id ⇒ Object
Attributes.
-
#login_credentials ⇒ Object
Attributes.
-
#token ⇒ Object
Attributes.
Instance Method Summary collapse
- #body ⇒ Object
- #discover_accounts ⇒ Object
- #headers ⇒ Object
-
#initialize(token, customer_id, institution_id, login_credentials) ⇒ DiscoverAccounts
constructor
Instance Methods.
- #url ⇒ Object
Methods included from Logger
Constructor Details
#initialize(token, customer_id, institution_id, login_credentials) ⇒ DiscoverAccounts
Instance Methods
21 22 23 24 25 26 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 21 def initialize(token, customer_id, institution_id, login_credentials) @customer_id = customer_id @institution_id = institution_id @login_credentials = login_credentials @token = token end |
Instance Attribute Details
#customer_id ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 13 def customer_id @customer_id end |
#institution_id ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 13 def institution_id @institution_id end |
#login_credentials ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 13 def login_credentials @login_credentials end |
#token ⇒ Object
Attributes
13 14 15 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 13 def token @token end |
Instance Method Details
#body ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 32 def body builder = ::Nokogiri::XML::Builder.new do |xml| xml.accounts { xml.credentials { login_credentials.each do |login_credential| xml.loginField { xml.id(login_credential[:id]) xml.name(login_credential[:name]) xml.value(login_credential[:value]) } end } } end builder.to_xml end |
#discover_accounts ⇒ Object
28 29 30 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 28 def discover_accounts http_client.post(url, body, headers) end |
#headers ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 50 def headers { 'Finicity-App-Key' => ::Finicity.config.app_key, 'Finicity-App-Token' => token, 'Content-Type' => 'application/xml' } end |
#url ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/finicity/v1/request/discover_accounts.rb', line 58 def url ::URI.join( ::Finicity.config.base_url, 'v1/', 'customers/', "#{customer_id}/", 'institutions/', "#{institution_id}/", 'accounts' ) end |