plaid 1.4.0 → 1.4.1

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: 186866b9b7d8f2b78d2b6c851713a6d7ac1a9347
4
- data.tar.gz: 75667f9a71954b24ba53568064fdcd99f5b64d30
3
+ metadata.gz: f39ff944ff6e3e21b2fa3262ef463095349c1491
4
+ data.tar.gz: 269f0c0a4e6bed37a2ccd57a27ffbcb8efe61d9f
5
5
  SHA512:
6
- metadata.gz: 95dfd209ad86cde321e151ab521cc6deedbb6dcf59d50b659760fb3fbf7af3b9e9e66b7059d14f50bfe2972db02339e9728a6a21fb5a8db5d38df6c084eb0edb
7
- data.tar.gz: 3c4b4e2d9fb277ed33d881449c14e897425f1c0c6451c65a6e45e0c6d13c25241e7eb6b323c1664bfbe4b0043de86b4083cb7563b0d8b9230fe881a9cc7bd30f
6
+ metadata.gz: 418b1c53390a1eb298a147e6edaae0943f24d11cdcc8b601a1b69a78302d1685778316c53d1c04cd983a364f31fe3bba85d2ef6f47a67bc57e556a40fdfde4d3
7
+ data.tar.gz: f0641d4ee4df67b075c82cf4f61710f31e9ff36a37fc4509a6408637b920768e15df8a4ea5ee4c8c6e9d74c227ff6884d8a17d9d99efbe3add3b79e4ac1133cd
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.4.0**
9
+ Latest stable version: **1.4.1**
10
10
 
11
11
  This version removes the need to use 'type' in each additional call.
12
12
 
data/lib/plaid.rb CHANGED
@@ -24,6 +24,17 @@ module Plaid
24
24
  @user.new(res,api_level)
25
25
  end
26
26
 
27
+ def existing_user(token,api_level=[])
28
+ @user = Plaid::User.new
29
+ @user.access_token = token
30
+ api_level.each { |i|
31
+ @user.get_auth if i == 'auth'
32
+ @user.get_connect if i == 'connect'
33
+ @user.get_info if i == 'info'
34
+ } unless api_level.empty?
35
+ @user
36
+ end
37
+
27
38
  # Builds an institution object and returns when the institution details exist
28
39
  def institution(id=nil)
29
40
  @institution = Plaid::Institution.new
@@ -11,5 +11,13 @@ module Plaid
11
11
  error_handler(e)
12
12
  end
13
13
  end
14
+
15
+ def set_user(token,api_level=[])
16
+ begin
17
+ self.existing_user(token,api_level)
18
+ rescue => e
19
+ error_handler(e)
20
+ end
21
+ end
14
22
  end
15
23
  end
data/lib/plaid/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plaid
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
@@ -105,4 +105,9 @@ describe '.add_user' do
105
105
  user = Plaid.add_user('connect','plaid_test','plaid_good','wells',"{'gte':'05/10/2014' , 'lte':'06/10/2014'}")
106
106
  it{ expect(user.transactions).to be_truthy }
107
107
  end
108
+
109
+ context 'sets a user with an existing access token' do
110
+ user = Plaid.set_user('test')
111
+ it{ expect(user.access_token).to eq('test')}
112
+ end
108
113
  end
data/spec/user_spec.rb CHANGED
@@ -19,6 +19,26 @@ describe '#User' do
19
19
  user = Plaid.add_user('connect','plaid_test','plaid_good','wells')
20
20
  it { expect(user.accounts.first.type).to eq('depository') }
21
21
  end
22
+
23
+ context 'gets a valid user with accounts and transactions' do
24
+ user = Plaid.set_user('test',['connect'])
25
+ it{ expect(user.transactions).to be_truthy}
26
+ end
27
+
28
+ context 'gets a valid user with accounts' do
29
+ user = Plaid.set_user('test',['auth'])
30
+ it{ expect(user.accounts).to be_truthy}
31
+ end
32
+
33
+ context 'gets a valid user with info' do
34
+ user = Plaid.set_user('test',['info'])
35
+ it{ expect(user.accounts).to be_truthy}
36
+ end
37
+
38
+ context 'gets a fully validated user with all access granted' do
39
+ user = Plaid.set_user('test',['connect','info','auth'])
40
+ it{ expect(user.transactions).to be_truthy}
41
+ end
22
42
  end
23
43
 
24
44
  # MFA specs - after user is instantiated,
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.0
4
+ version: 1.4.1
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-03-23 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler