aggcat 0.4.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab0c6e9b22ff49963c78a07302e83aaa846abd8a
4
- data.tar.gz: d9912a2c3d68bc93fe7ef90790eba73340a825ab
3
+ metadata.gz: b7128de0de414d469b30c900737a1454019994b1
4
+ data.tar.gz: f59e147d86ed693e4fcd8d34a9432b9c158543b0
5
5
  SHA512:
6
- metadata.gz: c74e838e70a3b0564cafe8be97e5fbe321d12d7742992bbc9fa36438f79c9cd94f553a3e9084c7df0ca4cbc15569dd03477bfd3a49ad2fbd1d5bb4b5da6b0fe6
7
- data.tar.gz: 9ca6d14fc9a46972c397046a8f66222de4f6a323d2c3b0a2d109a7d49633a17817ab9465106bac5b1024d2384815e34d4fbfd006b1390809554989bdde77fd46
6
+ metadata.gz: 514d0f917da953a9fec391f7f6461014310ba4d15aeac6538ef7d5a308f2550e75cddf417468de5e17b35848623afa6deff352c848285d0df832982088e554c4
7
+ data.tar.gz: dfa5dd47cc3de5d14e437544af3169965d3c5fbc758ac1b52365c2f8d1220e7ced6f7487ccceb9ff1bc5f319e1ec7975656130c5b0a01c03fee9b4ea9c3ab676
@@ -1 +1 @@
1
- ruby-2.2.0
1
+ ruby-2.2.3
@@ -6,7 +6,8 @@ rvm:
6
6
  - 1.9.3
7
7
  - 2.0.0
8
8
  - 2.1.2
9
- - 2.2.0
9
+ - 2.2.4
10
+ - 2.3.0
10
11
  script:
11
12
  - gem build aggcat.gemspec
12
13
  - gem install aggcat-*
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.required_rubygems_version = '>= 1.3.6'
23
23
 
24
24
  spec.add_dependency 'oauth', '>= 0.4'
25
- spec.add_dependency 'xmlhasher'
25
+ spec.add_dependency 'xmlhasher', '>= 1.0.2'
26
26
  spec.add_dependency 'builder', '>= 3.0'
27
27
  spec.add_dependency 'activesupport', '>= 3.2'
28
28
 
@@ -90,6 +90,7 @@ module Aggcat
90
90
 
91
91
  def parse_xml(data)
92
92
  return data if data.nil? || data.to_s.empty?
93
+ $stdout.puts(data) if @verbose
93
94
  @parser ||= XmlHasher::Parser.new(snakecase: true, ignore_namespaces: true)
94
95
  @parser.parse(data)
95
96
  end
@@ -140,7 +140,9 @@ module Aggcat
140
140
 
141
141
  def credentials(institution_id, login_credentials)
142
142
  institution = institution(institution_id)
143
- raise ArgumentError.new("institution_id #{institution_id} is invalid") if institution.nil? || institution[:result].nil? || institution[:result][:institution_detail].nil?
143
+ if institution.nil? || institution[:result].nil? || institution[:result][:institution_detail].nil?
144
+ raise ArgumentError.new(institution[:result][:status][:error_info][:error_message])
145
+ end
144
146
  login_keys = institution[:result][:institution_detail][:keys][:key].select { |key| key[:display_flag] == 'true' }.sort { |a, b| a[:display_order].to_i <=> b[:display_order].to_i }
145
147
  if login_keys.length != login_credentials.length
146
148
  raise ArgumentError.new("institution_id #{institution_id} requires #{login_keys.length} credential fields but was given #{login_credentials.length} to authenticate with.")
@@ -1,3 +1,3 @@
1
1
  module Aggcat
2
- VERSION = '0.4.0'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -318,8 +318,16 @@ class ClientTest < Test::Unit::TestCase
318
318
  account_id = '000000000001'
319
319
  stub_get("/accounts/#{account_id}/positions").to_return(:body => fixture('positions.xml'), :headers => {:content_type => 'application/xml; charset=utf-8'})
320
320
  response = @client.investment_positions(account_id)
321
- assert_equal response[:result][:investment_positions][:position][0][:investment_position_id].to_i , 000000000001
322
- assert_equal response[:result][:investment_positions][:position][1][:investment_position_id].to_i , 000000000002
321
+ assert_equal response[:result][:investment_positions][:position][0][:investment_position_id].to_i, 000000000001
322
+ assert_equal response[:result][:investment_positions][:position][1][:investment_position_id].to_i, 000000000002
323
+ end
324
+
325
+ def test_max_customers_reached
326
+ institution_id = '100000'
327
+ stub_get("/institutions/#{institution_id}").to_return(:body => fixture('max_customers_reached.xml'), :headers => {:content_type => 'application/xml; charset=utf-8'})
328
+ stub_post("/institutions/#{institution_id}/logins").to_return(:body => fixture('max_customers_reached.xml'), :headers => {:content_type => 'application/xml; charset=utf-8'})
329
+ exception = assert_raise(ArgumentError) { @client.discover_and_add_accounts(institution_id, 'username', 'password') }
330
+ assert_equal('The offering has reached the maximum number of customers allowed.', exception.message)
323
331
  end
324
332
 
325
333
  end
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <Status xmlns="http://schema.intuit.com/platform/fdatafeed/common/v1">
3
+ <errorInfo>
4
+ <errorType>APP_ERROR</errorType>
5
+ <errorCode>api.max.customers</errorCode>
6
+ <errorMessage>The offering has reached the maximum number of customers allowed.</errorMessage>
7
+ <correlationId>gw-49b48b84-8962-46af-9116-fdaf4fe5ac9e</correlationId>
8
+ </errorInfo>
9
+ </Status>
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
4
  require 'simplecov'
5
5
  require 'coveralls'
6
6
 
7
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
+ SimpleCov.formatters = [
8
8
  SimpleCov::Formatter::HTMLFormatter,
9
9
  Coveralls::SimpleCov::Formatter
10
10
  ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gene Drabkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-11 00:00:00.000000000 Z
11
+ date: 2016-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.0.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: builder
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +113,7 @@ files:
113
113
  - test/fixtures/institution_three_credentials.xml
114
114
  - test/fixtures/institutions.xml
115
115
  - test/fixtures/login.xml
116
+ - test/fixtures/max_customers_reached.xml
116
117
  - test/fixtures/oauth_token.txt
117
118
  - test/fixtures/positions.xml
118
119
  - test/fixtures/transactions.xml
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
138
  version: 1.3.6
138
139
  requirements: []
139
140
  rubyforge_project:
140
- rubygems_version: 2.4.5
141
+ rubygems_version: 2.4.5.1
141
142
  signing_key:
142
143
  specification_version: 4
143
144
  summary: Ruby client for Intuit Customer Account Data APIs
@@ -154,6 +155,7 @@ test_files:
154
155
  - test/fixtures/institution_three_credentials.xml
155
156
  - test/fixtures/institutions.xml
156
157
  - test/fixtures/login.xml
158
+ - test/fixtures/max_customers_reached.xml
157
159
  - test/fixtures/oauth_token.txt
158
160
  - test/fixtures/positions.xml
159
161
  - test/fixtures/transactions.xml