plaid-kilt 0.6.0 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +19 -18
- data/VERSION +1 -1
- data/lib/plaid/client/body.rb +22 -4
- data/lib/plaid/client/client.rb +2 -1
- data/lib/plaid/client/connect.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bfd994b225c152783ebb0e738f61b5dc062cb9e
|
4
|
+
data.tar.gz: c9a6c26a1c205cbce6a88deca3a5e1222a17134c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 483aa428fb7013786c91062df373ed07371aa07273bd9f7fa6deea5aff720daeb3588d8120fef4995d978aa800a70289a4c4ebbe2290ecc5aa61c2bf3111bea9
|
7
|
+
data.tar.gz: 5f0c49c18d6ebd8a4238fac819a04dcf15ac94f1c6bbf43a91e09cac087dcefb4e9543b21e3e4cc0d5654920fb6a1a9fab3ef98643c699f95ed934b8287390ef
|
data/README.rdoc
CHANGED
@@ -4,11 +4,11 @@ Accessing the Plaid API using Ruby.
|
|
4
4
|
|
5
5
|
===Notes
|
6
6
|
|
7
|
-
Minimal undergarments. Tests coming.
|
7
|
+
Minimal undergarments. Sporran not included. Tests coming.
|
8
8
|
|
9
9
|
=== Version
|
10
10
|
|
11
|
-
Head is 0.
|
11
|
+
Head is 0.6.0
|
12
12
|
|
13
13
|
=== Install
|
14
14
|
|
@@ -37,7 +37,7 @@ Response objects are initialized when the client gets a valid response from plai
|
|
37
37
|
|
38
38
|
r = client.connect
|
39
39
|
|
40
|
-
* r.raw_response <= the raw HTTPParty response from Plaid
|
40
|
+
* r.raw_response <= the raw HTTPParty-wrapped response from Plaid
|
41
41
|
* r.accounts <= Array of accounts associated with this institution for this user
|
42
42
|
* r.transactions <= Array of transactions associated with the accounts
|
43
43
|
* r.is_mfa? <= false for this request
|
@@ -49,7 +49,7 @@ Accounts and Transactions are objects that follow the JSON from Plaid. Thus you
|
|
49
49
|
r.transactions[66].category_id <= "52544965f71e87d007000119"
|
50
50
|
r.transactions[66].name <= "Online Payment Processed"
|
51
51
|
r.accounts[2].institution_type <= "fake_institution"
|
52
|
-
r.accounts[2].balance["current"] <= 8.98
|
52
|
+
r.accounts[2].balance["current"] <= 8.98
|
53
53
|
|
54
54
|
More explicitly
|
55
55
|
|
@@ -78,10 +78,7 @@ More explicitly
|
|
78
78
|
|
79
79
|
=== MFA
|
80
80
|
|
81
|
-
MFA requires some management of user flow, which is why this gem tries to make the returns / errors from API calls
|
82
|
-
explicit. If it seems heavyweight to you, it is because the MFA process is a heavyweight process. Plaid does a
|
83
|
-
better job managing it than some others, but if you are going to use Plaid extensively,
|
84
|
-
then you are going to have to cope with MFA. See the wiki for more information.
|
81
|
+
MFA requires some management of user flow, which is why this gem tries to make the returns / errors from API calls explicit. If it seems heavyweight to you, it is because the MFA process is a heavyweight process. Plaid does a better job managing it than some others (no names!!), but if you are going to use Plaid extensively, then you are going to have to cope with MFA. See the wiki for more information.
|
85
82
|
|
86
83
|
https://github.com/jkoisch/plaid/wiki/MFA
|
87
84
|
|
@@ -99,21 +96,27 @@ You can, if you would rather, ignore the PlaidResponse objects.
|
|
99
96
|
|
100
97
|
#when you get your responses
|
101
98
|
x = client.connect
|
102
|
-
x.raw_response <= the raw http response to the request. Have fun.
|
99
|
+
x.raw_response <= the raw http-party wrapped response to the request. Have fun.
|
103
100
|
|
104
101
|
=== Thin Client
|
105
102
|
|
106
|
-
The Plaid gem also has a thin_client for some secure followup operations:
|
103
|
+
The Plaid-kilt gem also has a thin_client for some secure followup operations:
|
107
104
|
|
108
|
-
thin_client = Plaid.thin_client "me@example.com", "chase", "
|
105
|
+
thin_client = Plaid.thin_client "me@example.com", "chase", "access_token_test"
|
109
106
|
|
110
|
-
This client can be used
|
111
|
-
the Plaid side of things (for example, after you have retrieved an access_token):
|
107
|
+
This client can be used only after you have retrieved an access_token, but supports followup methods allowed for by Plaid:
|
112
108
|
|
113
109
|
thin_client.followup <= GET operation to get account and transaction information
|
114
110
|
thin_client.get_balance <= GET operation to receive account balances
|
115
111
|
thin_client.get_entity("unique_plaid_entity") <= Entity context information
|
116
112
|
|
113
|
+
== Scaffolding
|
114
|
+
|
115
|
+
Some Plaid methods are accessible via a GET with no additional credentials:
|
116
|
+
|
117
|
+
Plaid.scaffold.institutions <= all of the institutions that Plaid supports
|
118
|
+
Plaid.scaffold.category(id) <= detailed information about the plaid category
|
119
|
+
|
117
120
|
== Configuration
|
118
121
|
|
119
122
|
You need to configure access through your own initializers using the values you receive from Plaid.
|
@@ -126,17 +129,15 @@ You need to configure access through your own initializers using the values you
|
|
126
129
|
config.endpoint = 'https://tartan.plaid.com/'
|
127
130
|
config.certpath = 'ca-bundle.crt'
|
128
131
|
config.headers = {'Content-Type'=>'application/x-www-form-urlencoded'}
|
129
|
-
config.webhook_address = '
|
132
|
+
config.webhook_address = 'https://You.will.need.a/plaid_webhook/'
|
130
133
|
config.save_full_response = false
|
131
134
|
end
|
132
135
|
|
133
136
|
== Additional Client Methods
|
134
137
|
|
135
|
-
The Plaid Client is not-quite-skinny so that it can handle various parts of the returns from the Plaid API. This is to
|
136
|
-
support alternate user flows or user handling in implementation.
|
138
|
+
The Plaid Client is not-quite-skinny so that it can handle various parts of the returns from the Plaid API. This is to support alternate user flows (MFA, etc) or user handling in implementation.
|
137
139
|
|
138
|
-
The Plaid Client supports the following attr_readers
|
139
|
-
management.
|
140
|
+
The Plaid Client supports the following attr_readers
|
140
141
|
|
141
142
|
client.settings
|
142
143
|
client.username
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.3
|
data/lib/plaid/client/body.rb
CHANGED
@@ -25,6 +25,27 @@ module Plaid
|
|
25
25
|
ret.merge(body)
|
26
26
|
end
|
27
27
|
|
28
|
+
# Structure to proxy credentials to Plaid for access to the financial institution
|
29
|
+
def credentials
|
30
|
+
{
|
31
|
+
"username" => self.username,
|
32
|
+
"password" => self.password
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def body_update_credentials
|
37
|
+
ret = Hash.new
|
38
|
+
ret[:access_token] = self.access_token
|
39
|
+
ret[:credentials] = credentials
|
40
|
+
ret.merge(body)
|
41
|
+
end
|
42
|
+
|
43
|
+
def body_delete_user
|
44
|
+
ret = Hash.new
|
45
|
+
ret[:access_token] = self.access_token
|
46
|
+
ret.merge(body)
|
47
|
+
end
|
48
|
+
|
28
49
|
# the fundamental body object used in most calls to Plaid.
|
29
50
|
# * client_id
|
30
51
|
# * secret
|
@@ -35,10 +56,7 @@ module Plaid
|
|
35
56
|
def body_original
|
36
57
|
ret = Hash.new
|
37
58
|
ret[:type] = self.institution
|
38
|
-
ret[:credentials] =
|
39
|
-
"username" => self.username,
|
40
|
-
"password" => self.password
|
41
|
-
}
|
59
|
+
ret[:credentials] = credentials
|
42
60
|
ret[:email] = 'me@example.com'
|
43
61
|
ret[:options] = {"list" => true}
|
44
62
|
ret.merge(body)
|
data/lib/plaid/client/client.rb
CHANGED
@@ -22,11 +22,12 @@ module Plaid
|
|
22
22
|
ssl_version :SSLv3
|
23
23
|
debug_output $stdout
|
24
24
|
|
25
|
-
def initialize(user, e_mail, pass_word, institution)
|
25
|
+
def initialize(user, e_mail, pass_word, institution, access_token=nil)
|
26
26
|
self.username = user
|
27
27
|
self.email = e_mail
|
28
28
|
self.password = pass_word
|
29
29
|
self.institution = institution
|
30
|
+
self.access_token = access_token unless access_token.blank?
|
30
31
|
self.mfa_response ||= []
|
31
32
|
end
|
32
33
|
|
data/lib/plaid/client/connect.rb
CHANGED
@@ -59,6 +59,26 @@ module Plaid
|
|
59
59
|
input your code.") }
|
60
60
|
end
|
61
61
|
|
62
|
+
def connect_update_credentials
|
63
|
+
if self.access_token.present?
|
64
|
+
body = body_update_credentials
|
65
|
+
response = self.class.patch('/connect', :query => body)
|
66
|
+
handle(response) { PlaidResponse.new(response, "Successfully updated credentials")}
|
67
|
+
else
|
68
|
+
PlaidError.new(nil, "Need to initialize the client with an access token")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def connect_delete_user
|
73
|
+
if self.access_token.present?
|
74
|
+
body = body_delete_user
|
75
|
+
response = self.class.delete('/connect', :query => body)
|
76
|
+
handle(response) { PlaidResponse.new(response, "Deleted user")}
|
77
|
+
else
|
78
|
+
PlaidError.new(nil, "Need to initialize the client with an access token so user can be deleted")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
62
82
|
end
|
63
83
|
|
64
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plaid-kilt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Koisch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|