plaid 2.0.0.alpha.2 → 2.0.0
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +5 -0
- data/lib/plaid/user.rb +18 -3
- data/lib/plaid/version.rb +1 -1
- data/plaid.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1d12271b5f68498843347df5493efca85a54331
|
4
|
+
data.tar.gz: 77bd4a0ef5b50a6ac420a2067484a425d71b5f5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53b474fb7b12fbc2acb335aab4f072dd5d4ad96dcbc07b2a77fae42a73630b9ed7881336c7cab7e24a7b85543b666f07738eb8237df3eac8847a803244c71227
|
7
|
+
data.tar.gz: d9935d472dd1cc6841a94acee6049c637777c5d9c19384b6c43443f867906ffa1631465a5707676628794c84189f4ab90df9adcb6364e208bf861601c711e033
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -89,6 +89,11 @@ With more options:
|
|
89
89
|
user2 = Plaid::User.exchange_token('public_token', account_id: '...', product: :auth)
|
90
90
|
```
|
91
91
|
|
92
|
+
If you want to [move money via Stripe's ACH
|
93
|
+
API](https://plaid.com/docs/link/stripe/#step-4-write-server-side-handler), you
|
94
|
+
ought to specify the `account_id` param. In this case the returned user
|
95
|
+
instance will have the `stripe_bank_account_token` attribute set.
|
96
|
+
|
92
97
|
### Upgrading and changing the current product
|
93
98
|
|
94
99
|
Plaid supports upgrading a user, i.e. adding it to another product:
|
data/lib/plaid/user.rb
CHANGED
@@ -37,6 +37,12 @@ module Plaid
|
|
37
37
|
# { message: 'Code sent to xxx-xxx-5309' }
|
38
38
|
attr_reader :mfa
|
39
39
|
|
40
|
+
# Public: The String stripe bank account token.
|
41
|
+
#
|
42
|
+
# This field is set when you use User.exchange_token to convert Link
|
43
|
+
# public_token into an access token suitable for Plaid API.
|
44
|
+
attr_reader :stripe_bank_account_token
|
45
|
+
|
40
46
|
# Internal: The Plaid::Client instance used to make queries.
|
41
47
|
attr_reader :client
|
42
48
|
|
@@ -107,6 +113,9 @@ module Plaid
|
|
107
113
|
|
108
114
|
# Public: Exchange a Link public_token for an API access_token.
|
109
115
|
#
|
116
|
+
# The account_id parameter is required if you wish to receive a Stripe bank
|
117
|
+
# account token.
|
118
|
+
#
|
110
119
|
# public_token - The String Link public_token.
|
111
120
|
# account_id - The String account ID.
|
112
121
|
# product - The Symbol product name (default: :connect).
|
@@ -114,7 +123,8 @@ module Plaid
|
|
114
123
|
# (default is to use global Plaid client - Plaid.client).
|
115
124
|
#
|
116
125
|
# Returns a new User with access token obtained from Plaid and default
|
117
|
-
# product set to product.
|
126
|
+
# product set to product. User#stripe_bank_account_token for this user
|
127
|
+
# instance will contain the Stripe token.
|
118
128
|
def self.exchange_token(public_token, account_id = nil,
|
119
129
|
product: :connect, client: nil)
|
120
130
|
check_product product
|
@@ -124,7 +134,10 @@ module Plaid
|
|
124
134
|
|
125
135
|
response = Connector.new(:exchange_token, auth: true, client: client)
|
126
136
|
.post(payload)
|
127
|
-
|
137
|
+
|
138
|
+
stripe_token = account_id && response['stripe_bank_account_token']
|
139
|
+
new product, response: response, client: client,
|
140
|
+
stripe_token: stripe_token
|
128
141
|
end
|
129
142
|
|
130
143
|
# Internal: Initialize a User instance.
|
@@ -134,14 +147,16 @@ module Plaid
|
|
134
147
|
# response - The Hash response body to parse.
|
135
148
|
# mfa - The Boolean flag indicating that response body
|
136
149
|
# - contains an MFA response.
|
150
|
+
# stripe_token - The String stripe bank account token.
|
137
151
|
# client - The Plaid::Client instance used to connect to the API
|
138
152
|
# (default is to use global Plaid client - Plaid.client).
|
139
153
|
def initialize(product, access_token: nil, response: nil, mfa: nil,
|
140
|
-
client: nil)
|
154
|
+
stripe_token: nil, client: nil)
|
141
155
|
@product = product
|
142
156
|
@client = client
|
143
157
|
@access_token = access_token if access_token
|
144
158
|
@mfa_required = mfa
|
159
|
+
@stripe_bank_account_token = stripe_token
|
145
160
|
@accounts = @initial_transactions = @info = @risk = @income = nil
|
146
161
|
|
147
162
|
parse_response(response) if response
|
data/lib/plaid/version.rb
CHANGED
data/plaid.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.required_ruby_version = '>= 2.0.0'
|
27
27
|
|
28
|
-
spec.add_dependency 'multi_json', '~> 1.
|
28
|
+
spec.add_dependency 'multi_json', '~> 1.0'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
31
31
|
spec.add_development_dependency 'rake', '~> 10.0'
|
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: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Dashevskii
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,9 +154,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: 2.0.0
|
155
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
162
|
rubygems_version: 2.5.1
|