aggcat 0.3.1 → 0.3.2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c038f06792cb4ed1aa4a5e29c86f2ed567c5c51e
4
+ data.tar.gz: 0a5cbe8f0e74062cc310bcd45bb85a26bbdcdcd8
5
+ SHA512:
6
+ metadata.gz: d4a1643869ed1a5f2d28513ce89e743d22911caaabbc180b90b9e9e830f1dbcbeaca7f4855e412af554f99c453d453fb1e6f4b8c33242b4926e07ffbd1cc13f5
7
+ data.tar.gz: 003bc37b517bab1103ff352e1d9b07178625e98eae03451b5264c1830cacb831637e0068977bd21e126f3dc2f73d8b927ef557a9e72bf570b573bede8a2e4ae8
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ my_app
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0-p353
data/.travis.yml CHANGED
@@ -3,11 +3,8 @@ bundler_args: "--without development"
3
3
  before_install:
4
4
  - gem install bundler
5
5
  rvm:
6
- - jruby-19mode
7
6
  - 1.9.3
8
7
  - 2.0.0
9
- env:
10
- - JRUBY_OPTS="-Xcext.enabled=true"
11
8
  script:
12
9
  - gem build aggcat.gemspec
13
10
  - gem install aggcat-*
data/README.md CHANGED
@@ -21,7 +21,7 @@ gem 'aggcat'
21
21
 
22
22
  ## Start Guide
23
23
 
24
- Register for [Intuit Customer Account Data](http://developer.intuit.com/agg-cat/index.html).
24
+ Register for [Intuit Customer Account Data](https://developer.intuit.com/docs/0020_customeraccountdata/0005_service_features).
25
25
 
26
26
  Get your OAuth data.
27
27
 
@@ -47,44 +47,59 @@ client = Aggcat::Client.new(
47
47
  customer_id: 'scope for all requests'
48
48
  )
49
49
 
50
- # scope Aggcat client and all subsequent requests by customer id
51
- Aggcat.scope(customer_id)
50
+ # create an scoped client by customer_id
51
+ client = Aggcat.scope(customer_id)
52
52
 
53
53
  # get all supported financial institutions
54
- Aggcat.institutions
54
+ client.institutions
55
55
 
56
56
  # get details for Bank of America
57
- Aggcat.institution(14007)
57
+ client.institution(14007)
58
58
 
59
59
  # add new financial account to aggregate from Bank of America
60
- Aggcat.discover_and_add_accounts(14007, username, password)
60
+ response = client.discover_and_add_accounts(14007, username, password)
61
61
 
62
- # get already aggregated financial account
63
- Aggcat.account(account_id)
62
+ # in case MFA is required
63
+ questions = response[:result][:challenges]
64
+ answers = ['first answer', 'second answer']
65
+ challenge_session_id = response[:challenge_session_id]
66
+ challenge_node_id = response[:challenge_node_id]
67
+ client.account_confirmation(14007, challenge_session_id, challenge_node_id, answers)
64
68
 
65
- # you can set scope inline for any request
66
- Aggcat.scope(customer1).account(account_id)
69
+ # get already aggregated financial account
70
+ client.account(account_id)
67
71
 
68
72
  # get all aggregated accounts
69
- Aggcat.accounts
73
+ client.accounts
74
+
75
+ # get account transactions
76
+ start_date = Date.today - 30
77
+ end_date = Date.today # optional
78
+ client.account_transactions(account_id, start_date, end_date)
70
79
 
71
80
  # update login credentials
72
- Aggcat.update_login(institution_id, login_id, new_username, new_password)
81
+ client.update_login(institution_id, login_id, new_username, new_password)
73
82
 
74
- # delete account
75
- Aggcat.delete_account(account_id)
83
+ # in case MFA is required
84
+ client.update_login_confirmation(institution_id, challenge_session_id, challenge_node_id, answers)
76
85
 
77
- # get account transactions
78
- Aggcat.account_transactions(account_id, start_date, end_date)
86
+ # you can set scope inline for any request
87
+ Aggcat.scope(customer_id).account(account_id)
79
88
 
80
- # delete customer for the current scope
81
- Aggcat.delete_customer
89
+ # delete account
90
+ client.delete_account(account_id)
82
91
 
92
+ # delete customer for the current scope
93
+ client.delete_customer
83
94
  ```
84
95
 
85
96
  ## Documentation
86
97
 
87
- Please make sure to read Intuit's [Account Data API](http://docs.developer.intuit.com/0020_Aggregation_Categorization_Apps/AggCat_API/0020_API_Documentation) docs.
98
+ Please make sure to read Intuit's [Account Data API](http://docs.developer.intuit.com/0020_Aggregation_Categorization_Apps/AggCat_API/0020_API_Documentation).
99
+
100
+ [API Use Cases](https://developer.intuit.com/docs/0020_customeraccountdata/customer_account_data_api/0005_key_concepts).
101
+
102
+ [Testing Calls to the API](https://developer.intuit.com/docs/0020_customeraccountdata/customer_account_data_api/testing_calls_to_the_api).
88
103
 
89
104
  ## Requirements
90
105
 
data/lib/aggcat/client.rb CHANGED
@@ -52,6 +52,11 @@ module Aggcat
52
52
  get(path)
53
53
  end
54
54
 
55
+ def login_accounts(login_id)
56
+ validate(login_id: login_id)
57
+ get("/logins/#{login_id}/accounts")
58
+ end
59
+
55
60
  def update_login(institution_id, login_id, username, password)
56
61
  validate(institution_id: institution_id, login_id: login_id, username: username, password: password)
57
62
  body = credentials(institution_id, username, password)
@@ -1,3 +1,3 @@
1
1
  module Aggcat
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
@@ -150,6 +150,20 @@ class ClientTest < Test::Unit::TestCase
150
150
  assert_nil @client.instance_variable_get('@oauth_token')
151
151
  end
152
152
 
153
+ def test_login_accounts
154
+ login_id = '147630161'
155
+ stub_get("/logins/#{login_id}/accounts").to_return(:body => fixture('accounts.xml'), :headers => {:content_type => 'application/xml; charset=utf-8'})
156
+ response = @client.login_accounts(login_id)
157
+ assert_equal '200', response[:status_code]
158
+ end
159
+
160
+ def test_login_accounts_bad_args
161
+ [nil, ''].each do |arg|
162
+ exception = assert_raise(ArgumentError) { @client.login_accounts(arg) }
163
+ assert_equal('login_id is required', exception.message)
164
+ end
165
+ end
166
+
153
167
  def test_update_login
154
168
  institution_id = '100000'
155
169
  login_id = '12345'
metadata CHANGED
@@ -1,110 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
5
- prerelease:
4
+ version: 0.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gene Drabkin
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-09 00:00:00.000000000 Z
11
+ date: 2013-11-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: oauth
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0.4'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0.4'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: xmlhasher
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: builder
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '3.0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '3.0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: activesupport
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '3.2'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '3.2'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: bundler
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  description: Aggcat wraps Intuit's Customer Account Data API in a simple client
@@ -115,6 +102,8 @@ extensions: []
115
102
  extra_rdoc_files: []
116
103
  files:
117
104
  - .gitignore
105
+ - .ruby-gemset
106
+ - .ruby-version
118
107
  - .travis.yml
119
108
  - Gemfile
120
109
  - LICENSE.md
@@ -142,27 +131,26 @@ files:
142
131
  homepage: https://github.com/cloocher/aggcat
143
132
  licenses:
144
133
  - MIT
134
+ metadata: {}
145
135
  post_install_message:
146
136
  rdoc_options: []
147
137
  require_paths:
148
138
  - lib
149
139
  required_ruby_version: !ruby/object:Gem::Requirement
150
- none: false
151
140
  requirements:
152
- - - ! '>='
141
+ - - '>='
153
142
  - !ruby/object:Gem::Version
154
143
  version: 1.9.3
155
144
  required_rubygems_version: !ruby/object:Gem::Requirement
156
- none: false
157
145
  requirements:
158
- - - ! '>='
146
+ - - '>='
159
147
  - !ruby/object:Gem::Version
160
148
  version: 1.3.6
161
149
  requirements: []
162
150
  rubyforge_project:
163
- rubygems_version: 1.8.25
151
+ rubygems_version: 2.1.11
164
152
  signing_key:
165
- specification_version: 3
153
+ specification_version: 4
166
154
  summary: Ruby client for Intuit Customer Account Data APIs
167
155
  test_files:
168
156
  - test/aggcat/aggcat_test.rb