plaid 10.1.0 → 11.0.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/CHANGELOG.md +9 -0
- data/CONTRIBUTING.md +3 -4
- data/Gemfile.lock +1 -1
- data/PUBLISH.md +2 -1
- data/README.md +7 -12
- data/Rakefile +1 -1
- data/lib/plaid.rb +1 -0
- data/lib/plaid/client.rb +6 -13
- data/lib/plaid/models.rb +6 -0
- data/lib/plaid/products/base_product.rb +0 -5
- data/lib/plaid/products/institutions.rb +6 -6
- data/lib/plaid/products/link_token.rb +45 -0
- data/lib/plaid/products/sandbox.rb +5 -5
- data/lib/plaid/version.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9657c1a46f6444a1cd4360595f92a007878401424702b967e3cf9a96c5337fe
|
4
|
+
data.tar.gz: b60e691103b431e9abc6bee0f9b93a9753216995fb0508f28f1ba7644833bc48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04fd20f7ee2e444d83571b1c11bc6c15472337087479d4d6b63a4b8f7ab99491de2d3600463234e758b2725fa76bb7fc6ca0ae7c7d1623cc5c07b44be78ee5b3
|
7
|
+
data.tar.gz: 66ceaf1ffbe114ca48bdc878dc3d4226e8d55aa1521ad3a49383e7908d2a40a54bfa213b3667daf6e7a31db4b962cab47c2d91e41cba045e5479ab7763c72733
|
@@ -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/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# 11.0.0
|
2
|
+
|
3
|
+
- Add `merchant_name` to `Transaction` (#294)
|
4
|
+
|
5
|
+
BREAKING CHANGES:
|
6
|
+
|
7
|
+
- Removes the public key as input to `Client`. The public key is no longer needed by the API. (#287)
|
8
|
+
- Add link/token/create support (#293)
|
9
|
+
|
1
10
|
# 10.1.0
|
2
11
|
|
3
12
|
- 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))
|
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
data/PUBLISH.md
CHANGED
@@ -7,12 +7,13 @@ Prepare release:
|
|
7
7
|
1. update `lib/plaid/version.rb`, and `CHANGELOG.md` files.
|
8
8
|
2. run `bundle` to bump the version in `Gemfile.lock`
|
9
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`
|
10
11
|
|
11
12
|
Publish:
|
12
13
|
|
13
14
|
1. `git checkout master` and `git pull` (makes sure your `HEAD` is up-to-date).
|
14
15
|
2. Check that tests are passing on latest `master` build and (optional) `bundle exec rake test` to run tests locally
|
15
|
-
3. `bundle exec rake release` (builds the gem, creates a tag, pushes the gem to RubyGems and tag to GitHub).
|
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)
|
16
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.)
|
17
18
|
|
18
19
|
[1]: https://rubygems.org/
|
data/README.md
CHANGED
@@ -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
|
@@ -91,8 +90,7 @@ require 'plaid'
|
|
91
90
|
|
92
91
|
client = Plaid::Client.new(env: :sandbox,
|
93
92
|
client_id: '***',
|
94
|
-
secret: '***'
|
95
|
-
public_key: '***')
|
93
|
+
secret: '***')
|
96
94
|
|
97
95
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
98
96
|
access_token = exchange_token_response.access_token
|
@@ -107,8 +105,7 @@ require 'plaid'
|
|
107
105
|
|
108
106
|
client = Plaid::Client.new(env: :sandbox,
|
109
107
|
client_id: '***',
|
110
|
-
secret: '***'
|
111
|
-
public_key: '***')
|
108
|
+
secret: '***')
|
112
109
|
|
113
110
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
114
111
|
access_token = exchange_token_response.access_token
|
@@ -136,8 +133,7 @@ require 'plaid'
|
|
136
133
|
|
137
134
|
client = Plaid::Client.new(env: :sandbox,
|
138
135
|
client_id: '***',
|
139
|
-
secret: '***'
|
140
|
-
public_key: '***')
|
136
|
+
secret: '***')
|
141
137
|
|
142
138
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
143
139
|
access_token = exchange_token_response.access_token
|
@@ -154,8 +150,7 @@ require 'plaid'
|
|
154
150
|
|
155
151
|
client = Plaid::Client.new(env: :sandbox,
|
156
152
|
client_id: '***',
|
157
|
-
secret: '***'
|
158
|
-
public_key: '***')
|
153
|
+
secret: '***')
|
159
154
|
|
160
155
|
exchange_token_response = client.item.public_token.exchange('[Plaid Link public_token]')
|
161
156
|
access_token = exchange_token_response.access_token
|
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/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).
|
@@ -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
|
|
@@ -0,0 +1,45 @@
|
|
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
|
+
end
|
32
|
+
|
33
|
+
# Public: Response for /link/token/create.
|
34
|
+
class CreateResponse < Models::BaseResponse
|
35
|
+
##
|
36
|
+
# :attr_reader:
|
37
|
+
# Public: The String token.
|
38
|
+
property :link_token
|
39
|
+
|
40
|
+
##
|
41
|
+
# :attr_reader:
|
42
|
+
# Public: The String token expiration time.
|
43
|
+
property :expiration
|
44
|
+
end
|
45
|
+
end
|
@@ -102,11 +102,11 @@ module Plaid
|
|
102
102
|
end
|
103
103
|
options_payload = options_payload.merge(options) unless options.nil?
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
105
|
+
post_with_auth 'sandbox/public_token/create',
|
106
|
+
SandboxCreateResponse,
|
107
|
+
institution_id: institution_id,
|
108
|
+
initial_products: initial_products,
|
109
|
+
options: options_payload
|
110
110
|
end
|
111
111
|
|
112
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.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Loo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-20 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
|
@@ -216,7 +218,7 @@ licenses:
|
|
216
218
|
- MIT
|
217
219
|
metadata:
|
218
220
|
allowed_push_host: https://rubygems.org
|
219
|
-
post_install_message:
|
221
|
+
post_install_message:
|
220
222
|
rdoc_options: []
|
221
223
|
require_paths:
|
222
224
|
- lib
|
@@ -232,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
234
|
version: '0'
|
233
235
|
requirements: []
|
234
236
|
rubygems_version: 3.0.3
|
235
|
-
signing_key:
|
237
|
+
signing_key:
|
236
238
|
specification_version: 4
|
237
239
|
summary: Ruby bindings for Plaid
|
238
240
|
test_files: []
|