plaid 1.6.2 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/PUBLISHING.md +21 -0
- data/README.md +1 -1
- data/lib/plaid/models/account.rb +1 -1
- data/lib/plaid/models/institution.rb +3 -2
- data/lib/plaid/models/user.rb +1 -1
- data/lib/plaid/version.rb +1 -1
- data/spec/{config_spec.rb → plaid/config_spec.rb} +2 -2
- data/spec/{connection_spec.rb → plaid/connection_spec.rb} +0 -0
- data/spec/{plaid_error_spec.rb → plaid/error_spec.rb} +0 -0
- data/spec/{account_spec.rb → plaid/models/account_spec.rb} +5 -1
- data/spec/{category_spec.rb → plaid/models/category_spec.rb} +1 -1
- data/spec/{institution_spec.rb → plaid/models/institution_spec.rb} +5 -1
- data/spec/{transaction_spec.rb → plaid/models/transaction_spec.rb} +0 -0
- data/spec/{user_spec.rb → plaid/models/user_spec.rb} +3 -3
- data/spec/plaid_spec.rb +10 -11
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d25165794e04320e2ff48da2cd6dd25cfd7785ca
|
4
|
+
data.tar.gz: 6e6d8ba0faba8261f5e4b2376171af77f885b038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d9bca2a99a8dc10859bca3cf7a9bcd0fd79eb9395e5a45001b69d09bdc2a2eaa94eabe931fd13c09ac8ddd2e5f2eace878044493d3d2c10570e7d7204462110
|
7
|
+
data.tar.gz: 1d15b40c36f65d1b765ff67b2a4df978a784e676c7275c204227ed7faaf93fb37a88722b1e65be269c0afb0bfa5205c67a708d25ae1aa83e920f045ded9592ff
|
data/PUBLISHING.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Publishing
|
2
|
+
|
3
|
+
The module is published to the [rubygems.org][1] under the gem name [plaid][2].
|
4
|
+
|
5
|
+
The publishing process is handled by [rake][3].
|
6
|
+
|
7
|
+
After updating the package version, run:
|
8
|
+
|
9
|
+
```console
|
10
|
+
$ rake spec
|
11
|
+
$ rake build
|
12
|
+
$ rake release
|
13
|
+
```
|
14
|
+
|
15
|
+
See the [semantic versioning][4] guidelines to determine what level of release to publish.
|
16
|
+
|
17
|
+
[1]: https://rubygems.org
|
18
|
+
[2]: https://rubygems.org/gems/plaid
|
19
|
+
[3]: https://github.com/ruby/rake
|
20
|
+
[4]: http://semver.org
|
21
|
+
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Ruby bindings for the Plaid API
|
|
6
6
|
|
7
7
|
This version is a beta version that contains failing tests for the new 'info' endpoint. While these have been tested individually on real accounts the tests here will fail with the test accounts supplied. These will be updated soon with test credentials.
|
8
8
|
|
9
|
-
Latest stable version: **1.
|
9
|
+
Latest stable version: **1.7.0**
|
10
10
|
|
11
11
|
This version removes the need to use 'type' in each additional call.
|
12
12
|
|
data/lib/plaid/models/account.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
module Plaid
|
2
2
|
class Institution
|
3
|
-
attr_accessor :id, :
|
3
|
+
attr_accessor :id, :name, :type, :has_mfa, :mfa, :credentials, :products
|
4
4
|
|
5
5
|
def initialize(fields = {})
|
6
6
|
@id = fields['id']
|
7
|
-
@credentials = fields['credentials']
|
8
7
|
@name = fields['name']
|
9
8
|
@type = fields['type']
|
10
9
|
@has_mfa = fields['has_mfa']
|
11
10
|
@mfa = fields['mfa']
|
11
|
+
@credentials = fields['credentials']
|
12
|
+
@products = fields['products']
|
12
13
|
end
|
13
14
|
|
14
15
|
# API: semi-private
|
data/lib/plaid/models/user.rb
CHANGED
data/lib/plaid/version.rb
CHANGED
@@ -56,12 +56,12 @@ describe 'Plaid.config' do
|
|
56
56
|
context 'has invalid dev keys' do
|
57
57
|
let(:secret) { 'test_bad' }
|
58
58
|
let(:environment_location) { dev_url }
|
59
|
-
it { expect { user }.to raise_error }
|
59
|
+
it { expect { user }.to raise_error(Plaid::Unauthorized, 'secret or client_id invalid') }
|
60
60
|
end
|
61
61
|
|
62
62
|
context 'has invalid production keys' do
|
63
63
|
let(:secret) { 'test_bad' }
|
64
64
|
let(:environment_location) { prod_url }
|
65
|
-
it { expect { user }.to raise_error }
|
65
|
+
it { expect { user }.to raise_error(Plaid::Unauthorized, 'secret or client_id invalid') }
|
66
66
|
end
|
67
67
|
end
|
File without changes
|
File without changes
|
@@ -10,7 +10,7 @@ describe Plaid::Account do
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
with_results('name' => 'Name') do it { expect(subject.name).to eql('Name') } end
|
13
|
+
with_results('meta' => {'name' => 'Name'}) do it { expect(subject.name).to eql('Name') } end
|
14
14
|
with_results('_id' => 'ID') do it { expect(subject.id).to eql('ID') } end
|
15
15
|
with_results('type' => 'Type') do it { expect(subject.type).to eql('Type') } end
|
16
16
|
with_results('type' => 'STyp') do it { expect(subject.type).to eql('STyp') } end
|
@@ -29,5 +29,9 @@ describe Plaid::Account do
|
|
29
29
|
with_results('numbers' => {}) do
|
30
30
|
it { expect(subject.numbers).to eql({}) }
|
31
31
|
end
|
32
|
+
|
33
|
+
with_results({}) do
|
34
|
+
it { expect(subject.name).to eq nil } # doesn't blow up if 'meta' is missing
|
35
|
+
end
|
32
36
|
end
|
33
37
|
end
|
@@ -10,7 +10,7 @@ describe Plaid::Category do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
context 'when category is not found' do
|
13
|
-
it { expect { Plaid.category('dumb_cat') }.to raise_error }
|
13
|
+
it { expect { Plaid.category('dumb_cat') }.to raise_error(Plaid::NotFound, 'unable to find category') }
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
@@ -1,7 +1,11 @@
|
|
1
1
|
describe Plaid::Institution do
|
2
2
|
context 'when a single institution is found' do
|
3
3
|
let(:institution) { Plaid.institution('5301a93ac140de84910000e0') }
|
4
|
+
|
4
5
|
it { expect(institution).to be_kind_of(Plaid::Institution) }
|
6
|
+
it { expect(institution.mfa).to be_kind_of(Array) }
|
7
|
+
it { expect(institution.products).to be_kind_of(Array) }
|
8
|
+
it { expect(institution.credentials).to be_kind_of(Hash) }
|
5
9
|
end
|
6
10
|
|
7
11
|
context 'when all institutions are found' do
|
@@ -10,6 +14,6 @@ describe Plaid::Institution do
|
|
10
14
|
end
|
11
15
|
|
12
16
|
context 'when institution is not found' do
|
13
|
-
it { expect { Plaid.institution('dumb_bank') }.to raise_error }
|
17
|
+
it { expect { Plaid.institution('dumb_bank') }.to raise_error(Plaid::NotFound, 'unable to find institution') }
|
14
18
|
end
|
15
19
|
end
|
File without changes
|
@@ -37,7 +37,7 @@ describe Plaid::User do
|
|
37
37
|
context 'enters incorrect credentials for MFA auth' do
|
38
38
|
let(:mfa_user) { user.mfa_authentication('tomato') }
|
39
39
|
let(:mfa_bad) { mfa_user; Plaid.add_user('connect', 'plaid_test', 'plaid_good', 'bofa') }
|
40
|
-
it { expect { mfa_bad.mfa_authentication('bad') }.to raise_error }
|
40
|
+
it { expect { mfa_bad.mfa_authentication('bad') }.to raise_error(Plaid::RequestFailed, 'invalid mfa') }
|
41
41
|
end
|
42
42
|
|
43
43
|
context 'requests list of MFA credentials' do
|
@@ -143,7 +143,7 @@ describe Plaid::User do
|
|
143
143
|
let(:info_user) { Plaid.add_user('info', 'plaid_test', 'plaid_good', 'wells') }
|
144
144
|
|
145
145
|
context 'updates information correctly' do
|
146
|
-
it { expect { subject.get_info }.to raise_error }
|
146
|
+
it { expect { subject.get_info }.to raise_error(Plaid::Unauthorized, 'client_id missing') }
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -167,6 +167,6 @@ describe Plaid::User do
|
|
167
167
|
|
168
168
|
# This stuff needs to be tested and rewritten. Have already
|
169
169
|
# surfaced up a bug in it
|
170
|
-
pending
|
170
|
+
pending '#populate_user'
|
171
171
|
|
172
172
|
end
|
data/spec/plaid_spec.rb
CHANGED
@@ -28,13 +28,12 @@ describe Plaid do
|
|
28
28
|
|
29
29
|
context 'when account is locked' do
|
30
30
|
let(:password) { 'plaid_locked' }
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
|
32
|
+
it 'raises a locked error' do
|
33
|
+
expect { user }.to raise_error(Plaid::RequestFailed) { |error|
|
34
34
|
expect(error.code).to eq(1205)
|
35
35
|
}
|
36
36
|
end
|
37
|
-
|
38
37
|
end
|
39
38
|
|
40
39
|
context 'with connection options' do
|
@@ -90,12 +89,12 @@ describe Plaid do
|
|
90
89
|
|
91
90
|
context 'using incorrect password' do
|
92
91
|
let(:password) { 'plaid_bad' }
|
93
|
-
it { expect { user }.to raise_error }
|
92
|
+
it { expect { user }.to raise_error(Plaid::RequestFailed, 'invalid credentials') }
|
94
93
|
end
|
95
94
|
|
96
95
|
context 'using incorrect username' do
|
97
96
|
let(:username) { 'plaid_bad' }
|
98
|
-
it { expect { user }.to raise_error }
|
97
|
+
it { expect { user }.to raise_error(Plaid::RequestFailed, 'invalid credentials') }
|
99
98
|
end
|
100
99
|
end
|
101
100
|
|
@@ -104,12 +103,12 @@ describe Plaid do
|
|
104
103
|
|
105
104
|
context 'using incorrect password' do
|
106
105
|
let(:password) { 'plaid_bad' }
|
107
|
-
it { expect { user }.to raise_error }
|
106
|
+
it { expect { user }.to raise_error(Plaid::RequestFailed, 'invalid credentials') }
|
108
107
|
end
|
109
108
|
|
110
109
|
context 'using incorrect username' do
|
111
110
|
let(:username) { 'plaid_bad' }
|
112
|
-
it { expect { user }.to raise_error }
|
111
|
+
it { expect { user }.to raise_error(Plaid::RequestFailed, 'invalid credentials') }
|
113
112
|
end
|
114
113
|
end
|
115
114
|
|
@@ -118,12 +117,12 @@ describe Plaid do
|
|
118
117
|
|
119
118
|
context 'using incorrect password' do
|
120
119
|
let(:password) { 'plaid_bad' }
|
121
|
-
it { expect { user }.to raise_error }
|
120
|
+
it { expect { user }.to raise_error(Plaid::RequestFailed, 'invalid credentials') }
|
122
121
|
end
|
123
122
|
|
124
123
|
context 'using incorrect username' do
|
125
124
|
let(:username) { 'plaid_bad' }
|
126
|
-
it { expect { user }.to raise_error }
|
125
|
+
it { expect { user }.to raise_error(Plaid::RequestFailed, 'invalid credentials') }
|
127
126
|
end
|
128
127
|
end
|
129
128
|
end
|
@@ -141,7 +140,7 @@ describe Plaid do
|
|
141
140
|
|
142
141
|
context 'using incorrect PIN' do
|
143
142
|
let(:pin) { '0000' }
|
144
|
-
it { expect { user }.to raise_error }
|
143
|
+
it { expect { user }.to raise_error(Plaid::RequestFailed, 'invalid pin') }
|
145
144
|
end
|
146
145
|
end
|
147
146
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plaid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Crites
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- ".travis.yml"
|
108
108
|
- Gemfile
|
109
109
|
- LICENSE.txt
|
110
|
+
- PUBLISHING.md
|
110
111
|
- README.md
|
111
112
|
- Rakefile
|
112
113
|
- lib/plaid.rb
|
@@ -122,16 +123,16 @@ files:
|
|
122
123
|
- lib/plaid/models/user.rb
|
123
124
|
- lib/plaid/version.rb
|
124
125
|
- plaid.gemspec
|
125
|
-
- spec/
|
126
|
-
- spec/
|
127
|
-
- spec/
|
128
|
-
- spec/
|
129
|
-
- spec/
|
130
|
-
- spec/
|
126
|
+
- spec/plaid/config_spec.rb
|
127
|
+
- spec/plaid/connection_spec.rb
|
128
|
+
- spec/plaid/error_spec.rb
|
129
|
+
- spec/plaid/models/account_spec.rb
|
130
|
+
- spec/plaid/models/category_spec.rb
|
131
|
+
- spec/plaid/models/institution_spec.rb
|
132
|
+
- spec/plaid/models/transaction_spec.rb
|
133
|
+
- spec/plaid/models/user_spec.rb
|
131
134
|
- spec/plaid_spec.rb
|
132
135
|
- spec/spec_helper.rb
|
133
|
-
- spec/transaction_spec.rb
|
134
|
-
- spec/user_spec.rb
|
135
136
|
homepage: https://github.com/plaid/plaid-ruby
|
136
137
|
licenses:
|
137
138
|
- MIT
|
@@ -157,13 +158,13 @@ signing_key:
|
|
157
158
|
specification_version: 4
|
158
159
|
summary: Ruby bindings for Plaid
|
159
160
|
test_files:
|
160
|
-
- spec/
|
161
|
-
- spec/
|
162
|
-
- spec/
|
163
|
-
- spec/
|
164
|
-
- spec/
|
165
|
-
- spec/
|
161
|
+
- spec/plaid/config_spec.rb
|
162
|
+
- spec/plaid/connection_spec.rb
|
163
|
+
- spec/plaid/error_spec.rb
|
164
|
+
- spec/plaid/models/account_spec.rb
|
165
|
+
- spec/plaid/models/category_spec.rb
|
166
|
+
- spec/plaid/models/institution_spec.rb
|
167
|
+
- spec/plaid/models/transaction_spec.rb
|
168
|
+
- spec/plaid/models/user_spec.rb
|
166
169
|
- spec/plaid_spec.rb
|
167
170
|
- spec/spec_helper.rb
|
168
|
-
- spec/transaction_spec.rb
|
169
|
-
- spec/user_spec.rb
|