aggcat 0.4.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -1
- data/aggcat.gemspec +1 -1
- data/lib/aggcat/base.rb +1 -0
- data/lib/aggcat/client.rb +3 -1
- data/lib/aggcat/version.rb +1 -1
- data/test/aggcat/client_test.rb +10 -2
- data/test/fixtures/max_customers_reached.xml +9 -0
- data/test/test_helper.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7128de0de414d469b30c900737a1454019994b1
|
4
|
+
data.tar.gz: f59e147d86ed693e4fcd8d34a9432b9c158543b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 514d0f917da953a9fec391f7f6461014310ba4d15aeac6538ef7d5a308f2550e75cddf417468de5e17b35848623afa6deff352c848285d0df832982088e554c4
|
7
|
+
data.tar.gz: dfa5dd47cc3de5d14e437544af3169965d3c5fbc758ac1b52365c2f8d1220e7ced6f7487ccceb9ff1bc5f319e1ec7975656130c5b0a01c03fee9b4ea9c3ab676
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.2.
|
1
|
+
ruby-2.2.3
|
data/.travis.yml
CHANGED
data/aggcat.gemspec
CHANGED
@@ -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
|
|
data/lib/aggcat/base.rb
CHANGED
data/lib/aggcat/client.rb
CHANGED
@@ -140,7 +140,9 @@ module Aggcat
|
|
140
140
|
|
141
141
|
def credentials(institution_id, login_credentials)
|
142
142
|
institution = institution(institution_id)
|
143
|
-
|
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.")
|
data/lib/aggcat/version.rb
CHANGED
data/test/aggcat/client_test.rb
CHANGED
@@ -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
|
322
|
-
assert_equal response[:result][:investment_positions][:position][1][:investment_position_id].to_i
|
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>
|
data/test/test_helper.rb
CHANGED
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
|
+
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:
|
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:
|
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:
|
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
|