plaider 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +15 -10
- data/lib/plaider/client.rb +3 -3
- data/lib/plaider/version.rb +1 -1
- data/test/test_helper.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d580ca9d22620a9b9013ffd9ef8a0efd16b3c20d
|
4
|
+
data.tar.gz: 4573253cd4f4505930e40fc01681264cd1c1338a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c67ea7aa96ca28bb546d4eec39598de2d9ee99e56026e1d2608cde31e0378015b8142a508160331baba85423e4bff2d1b5369db3daeaf4220d7bb445d9af2929
|
7
|
+
data.tar.gz: cc9889686d916cb705378db8329629ccc5549986a90cf03320a570ea368b8d2b890dd593725b93d3f0639c19485da91f4d1c40591fea311ec39b456996353166
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
repo_token: yqNJtKwTrCEpDt9f6OlrohXmZ6xRcCO9z
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.1.
|
1
|
+
ruby-2.1.4
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# Plaider
|
2
2
|
[![Build Status](https://travis-ci.org/cloocher/plaider.png)](https://travis-ci.org/cloocher/plaider)
|
3
|
-
[![Coverage Status](https://coveralls.io/repos/cloocher/plaider/badge.png
|
3
|
+
[![Coverage Status](https://coveralls.io/repos/cloocher/plaider/badge.png)](https://coveralls.io/r/cloocher/plaider)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/plaider.png)](http://badge.fury.io/rb/plaider)
|
5
5
|
|
6
|
+
|
6
7
|
Plaid API client
|
7
8
|
|
8
9
|
## Installation
|
@@ -41,40 +42,44 @@ client = Plaider::Client.new(
|
|
41
42
|
access_token: 'scope for all requests'
|
42
43
|
)
|
43
44
|
|
44
|
-
# create an scoped client by
|
45
|
-
client = Aggcat.scope(
|
45
|
+
# create an scoped client by access_token
|
46
|
+
client = Aggcat.scope(access_token)
|
47
|
+
|
48
|
+
# you could use default scope (no access_token) for non-user specific calls
|
49
|
+
client = Aggcat.scope
|
46
50
|
|
47
51
|
# get all supported financial institutions
|
48
52
|
client.institutions
|
49
53
|
|
50
|
-
# get
|
54
|
+
# get Chase Bank details
|
51
55
|
client.institution('5301a99504977c52b60000d0')
|
52
56
|
|
53
57
|
# add new financial account to aggregate from Chase
|
54
|
-
|
58
|
+
intitution_type = 'chase'
|
59
|
+
response = client.add_user(intitution_type, username, password, email)
|
55
60
|
|
56
61
|
# in case MFA is required
|
57
62
|
questions = response[:mfa]
|
58
63
|
answer = 'answer'
|
59
64
|
client.user_confirmation(answer)
|
60
65
|
|
61
|
-
# get already aggregated financial accounts and transactions
|
66
|
+
# get already aggregated financial accounts and transactions for the scoped user
|
62
67
|
client.transactions
|
63
68
|
|
64
|
-
# get all
|
69
|
+
# get all account balances
|
65
70
|
client.balance
|
66
71
|
|
67
|
-
#
|
72
|
+
# filter transactions
|
68
73
|
start_date = Date.today - 30
|
69
74
|
end_date = Date.today # optional
|
70
75
|
pending = true # include pending transactions
|
71
76
|
client.transactions(account_id, start_date, end_date, pending)
|
72
77
|
|
73
78
|
# update user credentials
|
74
|
-
client.update_user(
|
79
|
+
client.update_user(username, new_password)
|
75
80
|
|
76
81
|
# you can set scope inline for any request
|
77
|
-
Aggcat.scope(
|
82
|
+
Aggcat.scope(access_token).transactions
|
78
83
|
|
79
84
|
# delete user
|
80
85
|
client.delete_user
|
data/lib/plaider/client.rb
CHANGED
@@ -89,7 +89,7 @@ module Plaider
|
|
89
89
|
def post(path, params = {})
|
90
90
|
request = Net::HTTP::Post.new(path)
|
91
91
|
params.merge!(credentials)
|
92
|
-
params.merge!(access_token: @access_token)
|
92
|
+
params.merge!(access_token: @access_token) if !!@access_token
|
93
93
|
request.set_form_data(params)
|
94
94
|
process(request)
|
95
95
|
end
|
@@ -97,14 +97,14 @@ module Plaider
|
|
97
97
|
def patch(path, params = {})
|
98
98
|
request = Net::HTTP::Patch.new(path)
|
99
99
|
params.merge!(credentials)
|
100
|
-
params.merge!(access_token: @access_token)
|
100
|
+
params.merge!(access_token: @access_token) if !!@access_token
|
101
101
|
request.set_form_data(params)
|
102
102
|
process(request)
|
103
103
|
end
|
104
104
|
|
105
105
|
def delete(path)
|
106
106
|
request = Net::HTTP::Delete.new(path)
|
107
|
-
request.set_form_data(credentials.merge(access_token: @access_token))
|
107
|
+
request.set_form_data(credentials.merge(access_token: @access_token)) if !!@access_token
|
108
108
|
puts request.inspect
|
109
109
|
process(request)
|
110
110
|
end
|
data/lib/plaider/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -4,6 +4,7 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
4
4
|
require 'simplecov'
|
5
5
|
require 'coveralls'
|
6
6
|
|
7
|
+
Coveralls.wear!
|
7
8
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
8
9
|
SimpleCov::Formatter::HTMLFormatter,
|
9
10
|
Coveralls::SimpleCov::Formatter
|
@@ -14,7 +15,7 @@ require 'webmock/test_unit'
|
|
14
15
|
require 'test/unit'
|
15
16
|
require 'plaider'
|
16
17
|
|
17
|
-
WebMock.disable_net_connect!(:
|
18
|
+
WebMock.disable_net_connect!(allow: 'coveralls.io')
|
18
19
|
|
19
20
|
def stub_delete(path)
|
20
21
|
stub_request(:delete, Plaider::Client::BASE_URL + path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plaider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gene Drabkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -45,6 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- ".coveralls.yml"
|
48
49
|
- ".gitignore"
|
49
50
|
- ".ruby-gemset"
|
50
51
|
- ".ruby-version"
|
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
95
|
version: '0'
|
95
96
|
requirements: []
|
96
97
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.4.2
|
98
99
|
signing_key:
|
99
100
|
specification_version: 4
|
100
101
|
summary: Ruby client for Plaid API
|