plaid 8.9.0 → 11.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/add_to_project.yml +21 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +38 -0
- data/CONTRIBUTING.md +3 -4
- data/Gemfile.lock +5 -5
- data/PUBLISH.md +12 -6
- data/README.md +32 -13
- data/Rakefile +1 -1
- data/lib/plaid.rb +1 -0
- data/lib/plaid/client.rb +6 -13
- data/lib/plaid/errors.rb +7 -2
- data/lib/plaid/models.rb +145 -0
- data/lib/plaid/products/base_product.rb +0 -5
- data/lib/plaid/products/institutions.rb +6 -6
- data/lib/plaid/products/item.rb +0 -28
- data/lib/plaid/products/link_token.rb +74 -0
- data/lib/plaid/products/payment_initiation.rb +8 -1
- data/lib/plaid/products/sandbox.rb +37 -9
- data/lib/plaid/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 686ab2ca00fca888acdb2df51c73e8c7d69e8392729177b8ffa6fe153b4f12ec
|
4
|
+
data.tar.gz: bf6dcb19a57c770fbe22fe9371236d4e080f1cd536d7a0c433e4dfcfc27f991f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9da4ab04bf3b21192eb8b102d11deff836dc26e3ffdcb8e786de03763a701d466b3a53afb22b262ac17fad5ee8e60aa37e1b0ce2d88e4183b4519dbc1ec3a94
|
7
|
+
data.tar.gz: cd282ef9020162621f103c02c82091b37b79265480284523c04bccee2ffef995127bc94da91b6a3d4468b302ebdffb85c7ba88aeaaac9908ba7ba4c9aead339a
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Auto Assign to CLIB Project
|
2
|
+
|
3
|
+
on:
|
4
|
+
issues:
|
5
|
+
types: [opened]
|
6
|
+
pull_request:
|
7
|
+
types: [opened]
|
8
|
+
env:
|
9
|
+
MY_GITHUB_TOKEN: ${{ secrets.CLIB_AUTOMATION_TOKEN }
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
assign_one_project:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
name: Assign to One Project
|
15
|
+
steps:
|
16
|
+
- name: Assign NEW issues and NEW pull requests to project 1
|
17
|
+
uses: srggrs/assign-one-project-github-action@1.2.0
|
18
|
+
if: github.event.action == 'opened'
|
19
|
+
with:
|
20
|
+
project: 'https://github.com/orgs/plaid/projects/1'
|
21
|
+
column_name: 'Needs Investigation'
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,41 @@
|
|
1
|
+
# 11.1.0
|
2
|
+
|
3
|
+
- Add support for Link Token get endpoint ([#301](https://github.com/plaid/plaid-ruby/pull/301))
|
4
|
+
- `link/token/get`
|
5
|
+
|
6
|
+
# 11.0.0
|
7
|
+
|
8
|
+
- Add `merchant_name` to `Transaction` (#294)
|
9
|
+
|
10
|
+
BREAKING CHANGES:
|
11
|
+
|
12
|
+
- Removes the public key as input to `Client`. The public key is no longer needed by the API. (#287)
|
13
|
+
- Add link/token/create support (#293)
|
14
|
+
|
15
|
+
# 10.1.0
|
16
|
+
|
17
|
+
- Add support for more options (`override_username`, `override_password`) in the `/sandbox/public_token/create` endpoint ([219](https://github.com/plaid/plaid-ruby/pull/219))
|
18
|
+
|
19
|
+
# 10.0.0
|
20
|
+
|
21
|
+
- Add support for optional user fields for `/item/add_token/create` endpoint ([278](https://github.com/plaid/plaid-ruby/pull/278))
|
22
|
+
- Add support for credit card liabilities ([286](https://github.com/plaid/plaid-ruby/pull/286))
|
23
|
+
|
24
|
+
BREAKING CHANGES:
|
25
|
+
|
26
|
+
- `RATE_LIMIT_EXCEEDED` Plaid error types will be correctly mapped to `RateLimitExceededError` ([285](https://github.com/plaid/plaid-ruby/pull/285))
|
27
|
+
- `INSTITUTION_ERROR` Plaid error types will be correctly mapped to `InstitutionError` ([275](https://github.com/plaid/plaid-ruby/pull/275))
|
28
|
+
- Enable payment recipient to be created with BACS ([288](https://github.com/plaid/plaid-ruby/pull/288))
|
29
|
+
|
30
|
+
# 9.0.0
|
31
|
+
|
32
|
+
- Adds support for `/sandbox/item/set_verification_status`
|
33
|
+
- Removes support for deprecated `/item/access_token/update_version` endpoint
|
34
|
+
|
35
|
+
BREAKING CHANGES:
|
36
|
+
|
37
|
+
- Removes `client.item.update_version`
|
38
|
+
|
1
39
|
# 8.9.0 16-Apr-2020
|
2
40
|
|
3
41
|
- Add client_user_id to Item add token endpoint ([#274](https://github.com/plaid/plaid-ruby/pull/274))
|
data/CONTRIBUTING.md
CHANGED
@@ -8,14 +8,13 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
8
8
|
|
9
9
|
The gem test suite can be run in two modes. By default, it runs against the
|
10
10
|
live sandbox environment, creating items on the fly and calling various API
|
11
|
-
endpoints for them. For this to work you'll need real `client_id
|
12
|
-
|
13
|
-
|
11
|
+
endpoints for them. For this to work you'll need real `client_id` and `secret`
|
12
|
+
from your Plaid dashboard. Create a file named `.env` based on `.env.sample`
|
13
|
+
which is provided:
|
14
14
|
|
15
15
|
```text
|
16
16
|
PLAID_RUBY_CLIENT_ID=the_real_client_id
|
17
17
|
PLAID_RUBY_SECRET=the_real_secret
|
18
|
-
PLAID_RUBY_PUBLIC_KEY=the_real_public_key
|
19
18
|
```
|
20
19
|
This file will be loaded during the tests.
|
21
20
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
plaid (
|
4
|
+
plaid (11.1.0)
|
5
5
|
faraday
|
6
6
|
faraday_middleware
|
7
7
|
hashie (>= 3.4.3)
|
@@ -11,11 +11,11 @@ GEM
|
|
11
11
|
specs:
|
12
12
|
ast (2.4.0)
|
13
13
|
dotenv (2.4.0)
|
14
|
-
faraday (0.
|
14
|
+
faraday (1.0.1)
|
15
15
|
multipart-post (>= 1.2, < 3)
|
16
|
-
faraday_middleware (0.
|
17
|
-
faraday (
|
18
|
-
hashie (4.
|
16
|
+
faraday_middleware (1.0.0)
|
17
|
+
faraday (~> 1.0)
|
18
|
+
hashie (4.1.0)
|
19
19
|
minitest (5.11.3)
|
20
20
|
minitest-around (0.4.1)
|
21
21
|
minitest (~> 5.0)
|
data/PUBLISH.md
CHANGED
@@ -2,13 +2,19 @@
|
|
2
2
|
|
3
3
|
The module is published to [RubyGems][1] under the gem name [plaid][2].
|
4
4
|
|
5
|
-
|
5
|
+
Prepare release:
|
6
6
|
|
7
|
-
1.
|
8
|
-
2.
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
1. update `lib/plaid/version.rb`, and `CHANGELOG.md` files.
|
8
|
+
2. run `bundle` to bump the version in `Gemfile.lock`
|
9
|
+
3. create and merge a PR with the changes from 1 and 2.
|
10
|
+
4. authenticate with rubygems with `gem signin` or manually set up your `~/.gem/credentials`
|
11
|
+
|
12
|
+
Publish:
|
13
|
+
|
14
|
+
1. `git checkout master` and `git pull` (makes sure your `HEAD` is up-to-date).
|
15
|
+
2. Check that tests are passing on latest `master` build and (optional) `bundle exec rake test` to run tests locally
|
16
|
+
3. `bundle exec rake release` (builds the gem, creates a tag, pushes the gem to RubyGems and tag to GitHub). **NOTE:** if this step hangs indefinitely, you need to set your MFA settings to "UI Only" [here](https://rubygems.org/profile/edit)
|
17
|
+
4. `bundle exec rake update_github_docs` (generates RDoc files, updates `gh-pages` branch and pushes it to GitHub). (If you run into a `gh-pages` branch error, you may need to manually run `git checkout gh-pages` to ensure the branch is checked out locally.)
|
12
18
|
|
13
19
|
[1]: https://rubygems.org/
|
14
20
|
[2]: https://rubygems.org/gems/plaid
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ Each major version of `plaid-ruby` targets a specific version of the Plaid API:
|
|
26
26
|
|
27
27
|
| API version | plaid-ruby release |
|
28
28
|
| ----------- | ------------------ |
|
29
|
-
| [`2019-05-29`][api-version-2019-05-29] (**latest**) | `8.x.x`, `7.x.x` |
|
29
|
+
| [`2019-05-29`][api-version-2019-05-29] (**latest**) | `9.x.x`, `8.x.x`, `7.x.x` |
|
30
30
|
| [`2018-05-22`][api-version-2018-05-22] | `6.x.x` |
|
31
31
|
| `2017-03-08` | `5.x.x` |
|
32
32
|
|
@@ -41,15 +41,14 @@ The RubyDoc for the gem is available [here](http://plaid.github.io/plaid-ruby/).
|
|
41
41
|
|
42
42
|
### Creating a Plaid client
|
43
43
|
|
44
|
-
Create an instance of the client using the `client_id
|
44
|
+
Create an instance of the client using the `client_id` and `secret` from your Plaid dashboard along with your environment of choice:
|
45
45
|
|
46
46
|
```ruby
|
47
47
|
require 'plaid'
|
48
48
|
|
49
49
|
client = Plaid::Client.new(env: :sandbox,
|
50
50
|
client_id: '***',
|
51
|
-
secret: '***'
|
52
|
-
public_key: '***')
|
51
|
+
secret: '***')
|
53
52
|
```
|
54
53
|
|
55
54
|
The `env` field is the environment which the client will be running in. Your choices for the `env` field include:
|
@@ -63,7 +62,7 @@ The `env` field is the environment which the client will be running in. Your cho
|
|
63
62
|
The gem uses Faraday to wrap HTTPS connections, which allows you to tune certain params:
|
64
63
|
|
65
64
|
```ruby
|
66
|
-
client = Plaid::Client.new(env: :sandbox, client_id: '***', secret: '***'
|
65
|
+
client = Plaid::Client.new(env: :sandbox, client_id: '***', secret: '***') do |builder|
|
67
66
|
Plaid::Client.build_default_connection(builder)
|
68
67
|
|
69
68
|
# Increase network timeout
|
@@ -73,6 +72,27 @@ end
|
|
73
72
|
|
74
73
|
## Examples
|
75
74
|
|
75
|
+
### Create a new link_token
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
# Grab the client_user_id by searching for the current user in your database
|
79
|
+
user = User.find_by!(email: '***')
|
80
|
+
client_user_id = user.id
|
81
|
+
|
82
|
+
# Create the link_token with all of your configurations
|
83
|
+
link_token_response = client.link_token.create(
|
84
|
+
user: { client_user_id: client_user_id.to_s },
|
85
|
+
client_name: 'My app',
|
86
|
+
products: %w[auth transactions],
|
87
|
+
country_codes: ['US'],
|
88
|
+
language: 'en'
|
89
|
+
)
|
90
|
+
|
91
|
+
# Pass the result to your client-side app to initialize Link
|
92
|
+
# and retrieve a public_token
|
93
|
+
link_token = link_token_response.link_token
|
94
|
+
```
|
95
|
+
|
76
96
|
### Exchanging a Link public_token for a Plaid access_token
|
77
97
|
|
78
98
|
If you have a [Link](https://github.com/plaid/link) `public token`, use this function to get an `access_token`: `client.item.public_token.exchange(public_token)`
|
@@ -84,6 +104,7 @@ response = client.item.public_token.exchange(public_token)
|
|
84
104
|
access_token = response.access_token
|
85
105
|
```
|
86
106
|
|
107
|
+
|
87
108
|
### Deleting an item
|
88
109
|
|
89
110
|
```ruby
|
@@ -91,8 +112,7 @@ require 'plaid'
|
|
91
112
|
|
92
113
|
client = Plaid::Client.new(env: :sandbox,
|
93
114
|
client_id: '***',
|
94
|
-
secret: '***'
|
95
|
-
public_key: '***')
|
115
|
+
secret: '***')
|
96
116
|
|
97
117
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
98
118
|
access_token = exchange_token_response.access_token
|
@@ -107,8 +127,7 @@ require 'plaid'
|
|
107
127
|
|
108
128
|
client = Plaid::Client.new(env: :sandbox,
|
109
129
|
client_id: '***',
|
110
|
-
secret: '***'
|
111
|
-
public_key: '***')
|
130
|
+
secret: '***')
|
112
131
|
|
113
132
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
114
133
|
access_token = exchange_token_response.access_token
|
@@ -136,8 +155,7 @@ require 'plaid'
|
|
136
155
|
|
137
156
|
client = Plaid::Client.new(env: :sandbox,
|
138
157
|
client_id: '***',
|
139
|
-
secret: '***'
|
140
|
-
public_key: '***')
|
158
|
+
secret: '***')
|
141
159
|
|
142
160
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
143
161
|
access_token = exchange_token_response.access_token
|
@@ -154,8 +172,7 @@ require 'plaid'
|
|
154
172
|
|
155
173
|
client = Plaid::Client.new(env: :sandbox,
|
156
174
|
client_id: '***',
|
157
|
-
secret: '***'
|
158
|
-
public_key: '***')
|
175
|
+
secret: '***')
|
159
176
|
|
160
177
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
161
178
|
access_token = exchange_token_response.access_token
|
@@ -208,6 +225,8 @@ Any methods making API calls will result in an exception raised unless the respo
|
|
208
225
|
|
209
226
|
`Plaid::ItemError` indicates that information provided for the Item (such as credentials or MFA) may be invalid or that the Item is not supported on Plaid's platform.
|
210
227
|
|
228
|
+
`Plaid::InstitutionError` is returned when there are errors for the requested financial institution.
|
229
|
+
|
211
230
|
Read more about response codes and their meaning in the
|
212
231
|
[Plaid documentation](https://plaid.com/docs/api).
|
213
232
|
|
data/Rakefile
CHANGED
@@ -54,7 +54,7 @@ end
|
|
54
54
|
|
55
55
|
desc 'Hide real credentials in VCR cassettes'
|
56
56
|
task :vcr_hide_credentials do
|
57
|
-
all_creds = %w[PLAID_RUBY_CLIENT_ID PLAID_RUBY_SECRET
|
57
|
+
all_creds = %w[PLAID_RUBY_CLIENT_ID PLAID_RUBY_SECRET]
|
58
58
|
|
59
59
|
all_creds.each do |cred|
|
60
60
|
raise "#{cred} is not set" unless ENV[cred]
|
data/lib/plaid.rb
CHANGED
@@ -21,6 +21,7 @@ require_relative 'plaid/products/sandbox'
|
|
21
21
|
require_relative 'plaid/products/transactions'
|
22
22
|
require_relative 'plaid/products/investments'
|
23
23
|
require_relative 'plaid/products/liabilities'
|
24
|
+
require_relative 'plaid/products/link_token'
|
24
25
|
require_relative 'plaid/products/payment_initiation'
|
25
26
|
require_relative 'plaid/products/webhooks'
|
26
27
|
require_relative 'plaid/client'
|
data/lib/plaid/client.rb
CHANGED
@@ -19,13 +19,11 @@ module Plaid
|
|
19
19
|
# env - The Symbol (:sandbox, :development, :production)
|
20
20
|
# client_id - The String Plaid account client ID to authenticate requests
|
21
21
|
# secret - The String Plaid account secret to authenticate requests
|
22
|
-
|
23
|
-
def initialize(env:, client_id:, secret:, public_key:, &block)
|
22
|
+
def initialize(env:, client_id:, secret:, &block)
|
24
23
|
@env = env.to_sym
|
25
24
|
@api_host = api_host
|
26
25
|
@client_id = client_id
|
27
26
|
@secret = secret
|
28
|
-
@public_key = public_key
|
29
27
|
|
30
28
|
create_connection(&block)
|
31
29
|
end
|
@@ -117,6 +115,11 @@ module Plaid
|
|
117
115
|
# Public: The Plaid::Webhooks endpoint accessor.
|
118
116
|
subproduct :webhooks
|
119
117
|
|
118
|
+
##
|
119
|
+
## :attr_reader:
|
120
|
+
## Public: The Plaid::LinkToken endpoint accessor.
|
121
|
+
subproduct :link_token
|
122
|
+
|
120
123
|
# Public: Make a post request
|
121
124
|
#
|
122
125
|
# path - Path or URL to make the request to
|
@@ -140,16 +143,6 @@ module Plaid
|
|
140
143
|
).body
|
141
144
|
end
|
142
145
|
|
143
|
-
# Public: Make a post request with appended public key field.
|
144
|
-
#
|
145
|
-
# path - Path or URL to make the request to.
|
146
|
-
# payload - The payload or data to post.
|
147
|
-
#
|
148
|
-
# Returns the resulting parsed JSON of the request.
|
149
|
-
def post_with_public_key(path, payload)
|
150
|
-
@connection.post(path, payload.merge(public_key: @public_key)).body
|
151
|
-
end
|
152
|
-
|
153
146
|
# Public: Set Plaid defaults on the Faraday connection.
|
154
147
|
#
|
155
148
|
# builder - The Faraday builder object.
|
data/lib/plaid/errors.rb
CHANGED
@@ -58,14 +58,19 @@ TEXT
|
|
58
58
|
# Plaid's platform.
|
59
59
|
class ItemError < PlaidAPIError; end
|
60
60
|
|
61
|
+
# Public: Returned when there are errors for the requested financial
|
62
|
+
# institution.
|
63
|
+
class InstitutionError < PlaidAPIError; end
|
64
|
+
|
61
65
|
# Internal: A module that provides utilities for errors.
|
62
66
|
module Error
|
63
67
|
ERROR_TYPE_MAP = {
|
64
68
|
'INVALID_REQUEST' => Plaid::InvalidRequestError,
|
65
69
|
'INVALID_INPUT' => Plaid::InvalidInputError,
|
66
|
-
'
|
70
|
+
'RATE_LIMIT_EXCEEDED' => Plaid::RateLimitExceededError,
|
67
71
|
'API_ERROR' => Plaid::APIError,
|
68
|
-
'ITEM_ERROR' => Plaid::ItemError
|
72
|
+
'ITEM_ERROR' => Plaid::ItemError,
|
73
|
+
'INSTITUTION_ERROR' => Plaid::InstitutionError
|
69
74
|
}.freeze
|
70
75
|
|
71
76
|
# Internal: Map error_type to PlaidAPIError.
|
data/lib/plaid/models.rb
CHANGED
@@ -976,6 +976,12 @@ module Plaid
|
|
976
976
|
# Public: The location where transaction occurred (TransactionLocation).
|
977
977
|
property :location, coerce: TransactionLocation
|
978
978
|
|
979
|
+
##
|
980
|
+
# :attr_reader:
|
981
|
+
# Public: The String merchant name (or nil).
|
982
|
+
# E.g. "Burger King".
|
983
|
+
property :merchant_name
|
984
|
+
|
979
985
|
##
|
980
986
|
# :attr_reader:
|
981
987
|
# Public: The String transaction name (or nil).
|
@@ -1812,6 +1818,84 @@ module Plaid
|
|
1812
1818
|
property :ytd_principal_paid
|
1813
1819
|
end
|
1814
1820
|
|
1821
|
+
# Public: A representation of a credit card liability APR
|
1822
|
+
class CreditCardLiabilityAPRs < BaseModel
|
1823
|
+
##
|
1824
|
+
# :attr_reader:
|
1825
|
+
# Public: Annual Percentage Rate applied.
|
1826
|
+
property :apr_percentage
|
1827
|
+
|
1828
|
+
##
|
1829
|
+
# :attr_reader:
|
1830
|
+
# Public: Enumerated response from the following options:
|
1831
|
+
# "balance_transfer_apr", "cash_apr", "purchase_apr", or
|
1832
|
+
# "special".
|
1833
|
+
property :apr_type
|
1834
|
+
|
1835
|
+
##
|
1836
|
+
# :attr_reader:
|
1837
|
+
# Public: Amount of money that is subjected to the APR if a
|
1838
|
+
# balance was carried beyond payment due date. How it is
|
1839
|
+
# calculated can vary by card issuer. It is often calculated as
|
1840
|
+
# an average daily balance.
|
1841
|
+
property :balance_subject_to_apr
|
1842
|
+
|
1843
|
+
##
|
1844
|
+
# :attr_reader:
|
1845
|
+
# Public: Amount of money charged due to interest from last
|
1846
|
+
# statement.
|
1847
|
+
property :interest_charge_amount
|
1848
|
+
end
|
1849
|
+
|
1850
|
+
# Public: A representation of a credit card liability
|
1851
|
+
class CreditCardLiability < BaseModel
|
1852
|
+
##
|
1853
|
+
# :attr_reader:
|
1854
|
+
# Public: The ID of the account that this liability belongs to.
|
1855
|
+
property :account_id
|
1856
|
+
|
1857
|
+
##
|
1858
|
+
# :attr_reader:
|
1859
|
+
# Public: See the APR object schema
|
1860
|
+
property :aprs, coerce: Array[CreditCardLiabilityAPRs]
|
1861
|
+
|
1862
|
+
##
|
1863
|
+
# :attr_reader:
|
1864
|
+
# Public: true if a payment is currently overdue.
|
1865
|
+
property :is_overdue
|
1866
|
+
|
1867
|
+
##
|
1868
|
+
# :attr_reader:
|
1869
|
+
# Public: The amount of the last payment.
|
1870
|
+
property :last_payment_amount
|
1871
|
+
|
1872
|
+
##
|
1873
|
+
# :attr_reader:
|
1874
|
+
# Public: The date of the last payment.
|
1875
|
+
property :last_payment_date
|
1876
|
+
|
1877
|
+
##
|
1878
|
+
# :attr_reader:
|
1879
|
+
# Public: The outstanding balance on the last statement.
|
1880
|
+
property :last_statement_balance
|
1881
|
+
|
1882
|
+
##
|
1883
|
+
# :attr_reader:
|
1884
|
+
# Public: The date of the last statement.
|
1885
|
+
property :last_statement_issue_date
|
1886
|
+
|
1887
|
+
##
|
1888
|
+
# :attr_reader:
|
1889
|
+
# Public: The minimum payment due for the next billing cycle.
|
1890
|
+
property :minimum_payment_amount
|
1891
|
+
|
1892
|
+
##
|
1893
|
+
# :attr_reader:
|
1894
|
+
# Public: The due date for the next payment. The due date is null
|
1895
|
+
# if a payment is not expected.
|
1896
|
+
property :next_payment_due_date
|
1897
|
+
end
|
1898
|
+
|
1815
1899
|
# Public: A representation of someone's liabilities of all types.
|
1816
1900
|
class Liabilities < BaseModel
|
1817
1901
|
include Hashie::Extensions::IgnoreUndeclared
|
@@ -1820,6 +1904,11 @@ module Plaid
|
|
1820
1904
|
# :attr_reader:
|
1821
1905
|
# Public: Student loan liabilities associated with the item.
|
1822
1906
|
property :student, coerce: Array[StudentLoanLiability]
|
1907
|
+
|
1908
|
+
##
|
1909
|
+
# :attr_reader:
|
1910
|
+
# Public: Credit card liabilities associated with the item.
|
1911
|
+
property :credit, coerce: Array[CreditCardLiability]
|
1823
1912
|
end
|
1824
1913
|
|
1825
1914
|
# Public: A representation of a payment amount.
|
@@ -1858,6 +1947,19 @@ module Plaid
|
|
1858
1947
|
property :country
|
1859
1948
|
end
|
1860
1949
|
|
1950
|
+
# Public: A representation of a payment recipient BACS number.
|
1951
|
+
class PaymentRecipientBACS < BaseModel
|
1952
|
+
##
|
1953
|
+
# :attr_reader:
|
1954
|
+
# Public: The String account number. E.g. "66374958".
|
1955
|
+
property :account
|
1956
|
+
|
1957
|
+
##
|
1958
|
+
# :attr_reader:
|
1959
|
+
# Public: The String sort code. E.g. "089999".
|
1960
|
+
property :sort_code
|
1961
|
+
end
|
1962
|
+
|
1861
1963
|
# Public: A representation of a payment recipient.
|
1862
1964
|
class PaymentRecipient < BaseModel
|
1863
1965
|
##
|
@@ -1875,6 +1977,11 @@ module Plaid
|
|
1875
1977
|
# Public: The recipient IBAN.
|
1876
1978
|
property :iban
|
1877
1979
|
|
1980
|
+
##
|
1981
|
+
# :attr_reader:
|
1982
|
+
# Public: The recipient BACS number .
|
1983
|
+
property :bacs, coerce: PaymentRecipientBACS
|
1984
|
+
|
1878
1985
|
##
|
1879
1986
|
# :attr_reader:
|
1880
1987
|
# Public: The recipient address.
|
@@ -1924,6 +2031,44 @@ module Plaid
|
|
1924
2031
|
property :recipient_id
|
1925
2032
|
end
|
1926
2033
|
|
2034
|
+
# Public: Metadata associated with a link token.
|
2035
|
+
class LinkTokenMetadata < BaseModel
|
2036
|
+
##
|
2037
|
+
# :attr_reader:
|
2038
|
+
# Public: List of products associated with the link token.
|
2039
|
+
property :initial_products
|
2040
|
+
|
2041
|
+
##
|
2042
|
+
# :attr_reader:
|
2043
|
+
# Public: The webhook associated with the link token.
|
2044
|
+
property :webhook
|
2045
|
+
|
2046
|
+
##
|
2047
|
+
# :attr_reader:
|
2048
|
+
# Public: The country codes associated with the link token.
|
2049
|
+
property :country_codes
|
2050
|
+
|
2051
|
+
##
|
2052
|
+
# :attr_reader:
|
2053
|
+
# Public: The language associated with the link token.
|
2054
|
+
property :language
|
2055
|
+
|
2056
|
+
##
|
2057
|
+
# :attr_reader:
|
2058
|
+
# Public: The account filters associated with the link token.
|
2059
|
+
property :account_filters
|
2060
|
+
|
2061
|
+
##
|
2062
|
+
# :attr_reader:
|
2063
|
+
# Public: The redirect URI associated with the link token.
|
2064
|
+
property :redirect_uri
|
2065
|
+
|
2066
|
+
##
|
2067
|
+
# :attr_reader:
|
2068
|
+
# Public: The client name associated with the link token.
|
2069
|
+
property :client_name
|
2070
|
+
end
|
2071
|
+
|
1927
2072
|
# Public: A representation of a payment amount.
|
1928
2073
|
class WebhookVerificationKey < BaseModel
|
1929
2074
|
##
|
@@ -60,10 +60,5 @@ module Plaid
|
|
60
60
|
def post_with_auth(path, response_class, payload)
|
61
61
|
response_class.new(client.post_with_auth(path, payload))
|
62
62
|
end
|
63
|
-
|
64
|
-
# Internal: Do a POST to API and capture it into a response object.
|
65
|
-
def post_with_public_key(path, response_class, payload)
|
66
|
-
response_class.new(client.post_with_public_key(path, payload))
|
67
|
-
end
|
68
63
|
end
|
69
64
|
end
|
@@ -35,9 +35,9 @@ module Plaid
|
|
35
35
|
institution_id: institution_id
|
36
36
|
}
|
37
37
|
payload[:options] = options unless options.nil?
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
post_with_auth 'institutions/get_by_id',
|
39
|
+
SingleInstitutionResponse,
|
40
|
+
payload
|
41
41
|
end
|
42
42
|
|
43
43
|
# Public: Get information about all available institutions matching your
|
@@ -59,9 +59,9 @@ module Plaid
|
|
59
59
|
|
60
60
|
payload[:options] = options unless options.nil?
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
post_with_auth 'institutions/search',
|
63
|
+
MultipleInstitutionsResponse,
|
64
|
+
payload
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
data/lib/plaid/products/item.rb
CHANGED
@@ -23,34 +23,6 @@ module Plaid
|
|
23
23
|
# Public: The String new access token.
|
24
24
|
property :new_access_token
|
25
25
|
end
|
26
|
-
|
27
|
-
# Public: Generate a new API access_token for a legacy access_token
|
28
|
-
#
|
29
|
-
# Does a POST /item/access_token/update_version call which will give you
|
30
|
-
# an access_token for the new API.
|
31
|
-
#
|
32
|
-
# access_token_v1 - legacy access_token
|
33
|
-
#
|
34
|
-
# Returns an UpdateVersionResponse object with new access_token and item
|
35
|
-
# ID.
|
36
|
-
def update_version(access_token_v1)
|
37
|
-
post_with_auth 'item/access_token/update_version',
|
38
|
-
UpdateVersionResponse,
|
39
|
-
access_token_v1: access_token_v1
|
40
|
-
end
|
41
|
-
|
42
|
-
# Public: Response for /item/access_token/update_version.
|
43
|
-
class UpdateVersionResponse < Models::BaseResponse
|
44
|
-
##
|
45
|
-
# :attr_reader:
|
46
|
-
# Public: The String new access token for use.
|
47
|
-
property :access_token
|
48
|
-
|
49
|
-
##
|
50
|
-
# :attr_reader:
|
51
|
-
# Public: The String item ID.
|
52
|
-
property :item_id
|
53
|
-
end
|
54
26
|
end
|
55
27
|
|
56
28
|
# Public: Class used to call the AddToken sub-product.
|
@@ -0,0 +1,74 @@
|
|
1
|
+
LINK_TOKEN_FIELD_NAMES = %i[
|
2
|
+
user
|
3
|
+
client_name
|
4
|
+
products
|
5
|
+
country_codes
|
6
|
+
language
|
7
|
+
webhook
|
8
|
+
access_token
|
9
|
+
link_customization_name
|
10
|
+
redirect_uri
|
11
|
+
android_package_name
|
12
|
+
account_filters
|
13
|
+
cross_app_item_add
|
14
|
+
payment_initiation
|
15
|
+
].freeze
|
16
|
+
|
17
|
+
module Plaid
|
18
|
+
# Public: Class used to call the LinkToken sub-product.
|
19
|
+
class LinkToken < BaseProduct
|
20
|
+
def create(configs)
|
21
|
+
body = {}
|
22
|
+
|
23
|
+
LINK_TOKEN_FIELD_NAMES.each do |field|
|
24
|
+
body[field] = configs[field]
|
25
|
+
end
|
26
|
+
|
27
|
+
post_with_auth 'link/token/create',
|
28
|
+
CreateResponse,
|
29
|
+
body
|
30
|
+
end
|
31
|
+
|
32
|
+
def get(link_token)
|
33
|
+
post_with_auth 'link/token/get',
|
34
|
+
GetResponse,
|
35
|
+
link_token: link_token
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Public: Response for /link/token/create.
|
40
|
+
class CreateResponse < Models::BaseResponse
|
41
|
+
##
|
42
|
+
# :attr_reader:
|
43
|
+
# Public: The String token.
|
44
|
+
property :link_token
|
45
|
+
|
46
|
+
##
|
47
|
+
# :attr_reader:
|
48
|
+
# Public: The String token expiration time.
|
49
|
+
property :expiration
|
50
|
+
end
|
51
|
+
|
52
|
+
# Public: Response for /link/token/get.
|
53
|
+
class GetResponse < Models::BaseResponse
|
54
|
+
##
|
55
|
+
# :attr_reader:
|
56
|
+
# Public: The String token.
|
57
|
+
property :link_token
|
58
|
+
|
59
|
+
##
|
60
|
+
# :attr_reader:
|
61
|
+
# Public: The link token expiration time.
|
62
|
+
property :expiration
|
63
|
+
|
64
|
+
##
|
65
|
+
# :attr_reader:
|
66
|
+
# Public: The link token created time.
|
67
|
+
property :created_at
|
68
|
+
|
69
|
+
##
|
70
|
+
# :attr_reader:
|
71
|
+
# Public: The metadata associated with the link token.
|
72
|
+
property :metadata, coerce: Models::LinkTokenMetadata
|
73
|
+
end
|
74
|
+
end
|
@@ -6,13 +6,15 @@ module Plaid
|
|
6
6
|
# name - Recipient name.
|
7
7
|
# iban - Recipient IBAN.
|
8
8
|
# address - Recipient address.
|
9
|
+
# bacs - Recipient BACS (hash with "account" and "sort_code" keys)
|
9
10
|
#
|
10
11
|
# Returns a PaymentRecipientCreateResponse object.
|
11
|
-
def create_recipient(name, iban, address)
|
12
|
+
def create_recipient(name, iban, address, bacs)
|
12
13
|
post_with_auth 'payment_initiation/recipient/create',
|
13
14
|
PaymentRecipientCreateResponse,
|
14
15
|
name: name,
|
15
16
|
iban: iban,
|
17
|
+
bacs: bacs,
|
16
18
|
address: address
|
17
19
|
end
|
18
20
|
|
@@ -112,6 +114,11 @@ module Plaid
|
|
112
114
|
# Public: The recipient IBAN.
|
113
115
|
property :iban
|
114
116
|
|
117
|
+
##
|
118
|
+
# :attr_reader:
|
119
|
+
# Public: The recipient IBAN.
|
120
|
+
property :bacs, coerce: Models::PaymentRecipientBACS
|
121
|
+
|
115
122
|
##
|
116
123
|
# :attr_reader:
|
117
124
|
# Public: The recipient address.
|
@@ -44,6 +44,24 @@ module Plaid
|
|
44
44
|
# Public: The Boolean webhook fired success flag.
|
45
45
|
property :webhook_fired
|
46
46
|
end
|
47
|
+
|
48
|
+
# Public: Sets the verification status for an item
|
49
|
+
# created via automated microdeposits
|
50
|
+
#
|
51
|
+
# Does a POST /sandbox/item/set_verification_status call.
|
52
|
+
#
|
53
|
+
# access_token - access_token of the item
|
54
|
+
# account_id - id of the account to verify
|
55
|
+
# verification_status - status to set
|
56
|
+
#
|
57
|
+
# Returns a Models::BaseResponse object.
|
58
|
+
def set_verification_status(access_token, account_id, verification_status)
|
59
|
+
post_with_auth '/sandbox/item/set_verification_status',
|
60
|
+
Models::BaseResponse,
|
61
|
+
access_token: access_token,
|
62
|
+
account_id: account_id,
|
63
|
+
verification_status: verification_status
|
64
|
+
end
|
47
65
|
end
|
48
66
|
|
49
67
|
# Public: Class used to call the SandboxPublicToken sub-product
|
@@ -54,10 +72,12 @@ module Plaid
|
|
54
72
|
# to generate a public_token given an institution and list of
|
55
73
|
# products.
|
56
74
|
#
|
57
|
-
# institution_id
|
58
|
-
# initial_products
|
59
|
-
# webhook
|
60
|
-
#
|
75
|
+
# institution_id - Specific institution id to generate token for.
|
76
|
+
# initial_products - Products for which generated token is valid for.
|
77
|
+
# webhook - webhook to associate with the item (optional).
|
78
|
+
# override_username - Specific test credential username to use
|
79
|
+
# override_password - Specific test credential password to use
|
80
|
+
# options - Additional options to merge into API request.
|
61
81
|
#
|
62
82
|
# Returns a SandboxCreateResponse object with a public token and item id.
|
63
83
|
def create(institution_id:,
|
@@ -65,6 +85,8 @@ module Plaid
|
|
65
85
|
transactions_start_date: nil,
|
66
86
|
transactions_end_date: nil,
|
67
87
|
webhook: nil,
|
88
|
+
override_username: nil,
|
89
|
+
override_password: nil,
|
68
90
|
options: nil)
|
69
91
|
|
70
92
|
options_payload = {}
|
@@ -72,13 +94,19 @@ module Plaid
|
|
72
94
|
txn_options = transaction_options transactions_start_date,
|
73
95
|
transactions_end_date
|
74
96
|
options_payload[:transactions] = txn_options if txn_options != {}
|
97
|
+
unless override_username.nil?
|
98
|
+
options_payload[:override_username] = override_username
|
99
|
+
end
|
100
|
+
unless override_password.nil?
|
101
|
+
options_payload[:override_password] = override_password
|
102
|
+
end
|
75
103
|
options_payload = options_payload.merge(options) unless options.nil?
|
76
104
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
105
|
+
post_with_auth 'sandbox/public_token/create',
|
106
|
+
SandboxCreateResponse,
|
107
|
+
institution_id: institution_id,
|
108
|
+
initial_products: initial_products,
|
109
|
+
options: options_payload
|
82
110
|
end
|
83
111
|
|
84
112
|
private def transaction_options(start_date, end_date)
|
data/lib/plaid/version.rb
CHANGED
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:
|
4
|
+
version: 11.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Loo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -174,6 +174,7 @@ extra_rdoc_files: []
|
|
174
174
|
files:
|
175
175
|
- ".circleci/config.yml"
|
176
176
|
- ".env.sample"
|
177
|
+
- ".github/workflows/add_to_project.yml"
|
177
178
|
- ".rubocop.yml"
|
178
179
|
- CHANGELOG.md
|
179
180
|
- CONTRIBUTING.md
|
@@ -204,6 +205,7 @@ files:
|
|
204
205
|
- lib/plaid/products/investments.rb
|
205
206
|
- lib/plaid/products/item.rb
|
206
207
|
- lib/plaid/products/liabilities.rb
|
208
|
+
- lib/plaid/products/link_token.rb
|
207
209
|
- lib/plaid/products/payment_initiation.rb
|
208
210
|
- lib/plaid/products/processor.rb
|
209
211
|
- lib/plaid/products/sandbox.rb
|