plaid 12.0.0 → 13.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/.circleci/config.yml +1 -1
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +6 -2
- data/README.md +4 -4
- data/lib/plaid/models.rb +24 -0
- data/lib/plaid/products/item.rb +31 -0
- data/lib/plaid/products/payment_initiation.rb +49 -6
- 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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e1b3a6dd1a43a81dec93cc841fa8272f94fd53e604d6f2826035c221ac0cd1e
|
4
|
+
data.tar.gz: 920032b3617aae75fecbe0e0288e0279ad99ca215103e4e5825322d198560e4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ed91a6d2994ea510d2830e2b002f839098328ef7ece3fe1ed84458e2554f1a5138f5e51b009c32b7367f691b16e3ed94ce0d33497e9adb8eb9d868d2fa278d9
|
7
|
+
data.tar.gz: c2cef50ce789faf7a22d97e0d381f07b3b029ad5406613b3df6bb41cd8402c4552fcf6b852146a8a0c7bf10eceed8460aadc722e292da4cab915ef1af4fd8df5
|
data/.circleci/config.yml
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# 13.0.0
|
2
|
+
- Add support for providing a payment initiation schedule
|
3
|
+
- Add back the (now deprecated) `/item/public_token/create` endpoint
|
4
|
+
- Add back the (now deprecated) `/payment_initiation/payment/token/create` endpoint
|
5
|
+
|
6
|
+
BREAKING CHANGES:
|
7
|
+
|
8
|
+
- Update minimum required Ruby version to 2.4
|
9
|
+
|
1
10
|
# 12.0.0
|
2
11
|
|
3
12
|
- The library has been pinned to the '2020-09-14' API release. Visit the [docs](https://plaid.com/docs/api/versioning/) to see what changed.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
plaid (
|
4
|
+
plaid (13.0.0)
|
5
5
|
faraday
|
6
6
|
faraday_middleware
|
7
7
|
hashie (>= 3.4.3)
|
@@ -11,8 +11,11 @@ GEM
|
|
11
11
|
specs:
|
12
12
|
ast (2.4.0)
|
13
13
|
dotenv (2.4.0)
|
14
|
-
faraday (1.0
|
14
|
+
faraday (1.3.0)
|
15
|
+
faraday-net_http (~> 1.0)
|
15
16
|
multipart-post (>= 1.2, < 3)
|
17
|
+
ruby2_keywords
|
18
|
+
faraday-net_http (1.0.0)
|
16
19
|
faraday_middleware (1.0.0)
|
17
20
|
faraday (~> 1.0)
|
18
21
|
hashie (4.1.0)
|
@@ -35,6 +38,7 @@ GEM
|
|
35
38
|
ruby-progressbar (~> 1.7)
|
36
39
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
37
40
|
ruby-progressbar (1.9.0)
|
41
|
+
ruby2_keywords (0.0.2)
|
38
42
|
sdoc (1.0.0)
|
39
43
|
rdoc (>= 5.0)
|
40
44
|
unicode-display_width (1.3.2)
|
data/README.md
CHANGED
@@ -258,7 +258,7 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
258
258
|
If you're looking for a Ruby client that works with the legacy Plaid API, use the [`plaid-legacy` gem][2].
|
259
259
|
|
260
260
|
[2]: https://github.com/plaid/plaid-ruby-legacy
|
261
|
-
[version-changelog]: https://plaid.com/docs/api
|
262
|
-
[api-version-2018-05-22]: https://plaid.com/docs/api
|
263
|
-
[api-version-2019-05-29]: https://plaid.com/docs/api
|
264
|
-
[api-version-2020-09-14]: https://plaid.com/docs/api
|
261
|
+
[version-changelog]: https://plaid.com/docs/api/versioning/
|
262
|
+
[api-version-2018-05-22]: https://plaid.com/docs/api/versioning/#2018-05-22
|
263
|
+
[api-version-2019-05-29]: https://plaid.com/docs/api/versioning/#2019-05-29
|
264
|
+
[api-version-2020-09-14]: https://plaid.com/docs/api/versioning/#2020-09-14
|
data/lib/plaid/models.rb
CHANGED
@@ -1924,6 +1924,25 @@ module Plaid
|
|
1924
1924
|
property :value
|
1925
1925
|
end
|
1926
1926
|
|
1927
|
+
# Public: A representation of a payment amount.
|
1928
|
+
class PaymentSchedule < BaseModel
|
1929
|
+
##
|
1930
|
+
# :attr_reader:
|
1931
|
+
# Public: Interval for the standing order.
|
1932
|
+
property :interval
|
1933
|
+
|
1934
|
+
##
|
1935
|
+
# :attr_reader:
|
1936
|
+
# Public: Day or the week or day of the month to execute
|
1937
|
+
# the standing order.
|
1938
|
+
property :interval_execution_day
|
1939
|
+
|
1940
|
+
##
|
1941
|
+
# :attr_reader:
|
1942
|
+
# Public: Start date for the standing order.
|
1943
|
+
property :start_date
|
1944
|
+
end
|
1945
|
+
|
1927
1946
|
# Public: A representation of a payment amount.
|
1928
1947
|
class PaymentRecipientAddress < BaseModel
|
1929
1948
|
##
|
@@ -2010,6 +2029,11 @@ module Plaid
|
|
2010
2029
|
# Public: The payment amount.
|
2011
2030
|
property :amount, coerce: PaymentAmount
|
2012
2031
|
|
2032
|
+
##
|
2033
|
+
# :attr_reader:
|
2034
|
+
# Public: The payment schedule.
|
2035
|
+
property :schedule, coerce: PaymentSchedule
|
2036
|
+
|
2013
2037
|
##
|
2014
2038
|
# :attr_reader:
|
2015
2039
|
# Public: The payment's status.
|
data/lib/plaid/products/item.rb
CHANGED
@@ -27,6 +27,37 @@ module Plaid
|
|
27
27
|
|
28
28
|
# Public: Class used to call the PublicToken sub-product
|
29
29
|
class PublicToken < BaseProduct
|
30
|
+
# Public: Creates a public token from an access_token.
|
31
|
+
#
|
32
|
+
# Does a POST /item/public_token/create call which can be used to
|
33
|
+
# initialize Link in update mode.
|
34
|
+
#
|
35
|
+
# access_token - access_token to create a public token for
|
36
|
+
#
|
37
|
+
# Returns a CreateResponse object with a public token and expiration info.
|
38
|
+
def create(access_token)
|
39
|
+
puts 'Warning: this method will be deprecated in a future version. '\
|
40
|
+
'To replace the public_token for initializing Link, look into '\
|
41
|
+
'the link_token at https://plaid.com/docs/api/tokens/#linktokencreate.'
|
42
|
+
|
43
|
+
post_with_auth 'item/public_token/create',
|
44
|
+
CreateResponse,
|
45
|
+
access_token: access_token
|
46
|
+
end
|
47
|
+
|
48
|
+
# Public: Response for /item/public_token/create.
|
49
|
+
class CreateResponse < Models::BaseResponse
|
50
|
+
##
|
51
|
+
# :attr_reader:
|
52
|
+
# Public: The String token.
|
53
|
+
property :public_token
|
54
|
+
|
55
|
+
##
|
56
|
+
# :attr_reader:
|
57
|
+
# Public: The String token expiration time.
|
58
|
+
property :expiration
|
59
|
+
end
|
60
|
+
|
30
61
|
# Public: Exchange a public token for an access_token
|
31
62
|
#
|
32
63
|
# Does a POST /item/public_token/exchange call helps you exchange a public
|
@@ -43,14 +43,39 @@ module Plaid
|
|
43
43
|
# recipient_id - Recipient ID that the payment will be initiated for.
|
44
44
|
# reference - Payment reference.
|
45
45
|
# amount - Payment amount.
|
46
|
+
# schedule - Payment schedule.
|
46
47
|
#
|
47
48
|
# Returns a PaymentCreateResponse object.
|
48
|
-
def create_payment(recipient_id, reference, amount)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
def create_payment(recipient_id, reference, amount, schedule: nil)
|
50
|
+
if schedule.nil?
|
51
|
+
post_with_auth 'payment_initiation/payment/create',
|
52
|
+
PaymentCreateResponse,
|
53
|
+
recipient_id: recipient_id,
|
54
|
+
reference: reference,
|
55
|
+
amount: amount
|
56
|
+
else
|
57
|
+
post_with_auth 'payment_initiation/payment/create',
|
58
|
+
PaymentCreateResponse,
|
59
|
+
recipient_id: recipient_id,
|
60
|
+
reference: reference,
|
61
|
+
amount: amount,
|
62
|
+
schedule: schedule
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Public: Create a payment token.
|
67
|
+
#
|
68
|
+
# payment_id - Payment ID that the token will be created for.
|
69
|
+
#
|
70
|
+
# Returns a PaymentTokenCreateResponse object.
|
71
|
+
def create_payment_token(payment_id)
|
72
|
+
puts 'Warning: this method will be deprecated in a future version. '\
|
73
|
+
'To replace the payment_token, look into the link_token at '\
|
74
|
+
'https://plaid.com/docs/api/tokens/#linktokencreate.'
|
75
|
+
|
76
|
+
post_with_auth 'payment_initiation/payment/token/create',
|
77
|
+
PaymentTokenCreateResponse,
|
78
|
+
payment_id: payment_id
|
54
79
|
end
|
55
80
|
|
56
81
|
# Public: Retrieve a payment.
|
@@ -135,6 +160,19 @@ module Plaid
|
|
135
160
|
property :status
|
136
161
|
end
|
137
162
|
|
163
|
+
# Public: The response wrapper for /payment_initiation/payment/token/create.
|
164
|
+
class PaymentTokenCreateResponse < Models::BaseResponse
|
165
|
+
##
|
166
|
+
# :attr_reader:
|
167
|
+
# Public: The payment token.
|
168
|
+
property :payment_token
|
169
|
+
|
170
|
+
##
|
171
|
+
# :attr_reader:
|
172
|
+
# Public: The payment token's expiration time.
|
173
|
+
property :payment_token_expiration_time
|
174
|
+
end
|
175
|
+
|
138
176
|
# Public: The response wrapper for /payment_initiation/payment/get.
|
139
177
|
class PaymentGetResponse < Models::BaseResponse
|
140
178
|
##
|
@@ -157,6 +195,11 @@ module Plaid
|
|
157
195
|
# Public: The payment amount.
|
158
196
|
property :amount, coerce: Models::PaymentAmount
|
159
197
|
|
198
|
+
##
|
199
|
+
# :attr_reader:
|
200
|
+
# Public: The payment schedule.
|
201
|
+
property :schedule, coerce: Models::PaymentSchedule
|
202
|
+
|
160
203
|
##
|
161
204
|
# :attr_reader:
|
162
205
|
# Public: The payment's status.
|
data/lib/plaid/version.rb
CHANGED
data/plaid.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
33
|
spec.require_paths = ['lib']
|
34
34
|
|
35
|
-
spec.required_ruby_version = '>= 2.
|
35
|
+
spec.required_ruby_version = '>= 2.4.0'
|
36
36
|
|
37
37
|
spec.add_dependency 'faraday'
|
38
38
|
spec.add_dependency 'faraday_middleware'
|
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: 13.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:
|
11
|
+
date: 2021-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -218,7 +218,7 @@ licenses:
|
|
218
218
|
- MIT
|
219
219
|
metadata:
|
220
220
|
allowed_push_host: https://rubygems.org
|
221
|
-
post_install_message:
|
221
|
+
post_install_message:
|
222
222
|
rdoc_options: []
|
223
223
|
require_paths:
|
224
224
|
- lib
|
@@ -226,7 +226,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
226
|
requirements:
|
227
227
|
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 2.
|
229
|
+
version: 2.4.0
|
230
230
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
231
|
requirements:
|
232
232
|
- - ">="
|
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
236
|
rubygems_version: 3.0.3
|
237
|
-
signing_key:
|
237
|
+
signing_key:
|
238
238
|
specification_version: 4
|
239
239
|
summary: Ruby bindings for Plaid
|
240
240
|
test_files: []
|