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