plaid 11.1.0 → 13.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 686ab2ca00fca888acdb2df51c73e8c7d69e8392729177b8ffa6fe153b4f12ec
4
- data.tar.gz: bf6dcb19a57c770fbe22fe9371236d4e080f1cd536d7a0c433e4dfcfc27f991f
3
+ metadata.gz: d4032f5d56f2e441caf24526b827c17248114fdcc986fe9595134b180e3b7386
4
+ data.tar.gz: 1584b89290e96f0ef895e1f3401c51b8914e4391d2c4d9862c76f7b390fe065b
5
5
  SHA512:
6
- metadata.gz: b9da4ab04bf3b21192eb8b102d11deff836dc26e3ffdcb8e786de03763a701d466b3a53afb22b262ac17fad5ee8e60aa37e1b0ce2d88e4183b4519dbc1ec3a94
7
- data.tar.gz: cd282ef9020162621f103c02c82091b37b79265480284523c04bccee2ffef995127bc94da91b6a3d4468b302ebdffb85c7ba88aeaaac9908ba7ba4c9aead339a
6
+ metadata.gz: a24eef51a825719aa30edb6a3165272f8d38db81d23b3130e5b09a8c33571bfda06e661e030c8c8a1bde0efa60f33fa7a60f22b22a8d5686c691b718c71adb01
7
+ data.tar.gz: 4ae990701822770f0098b5e48bac694427a3b6a11ffb626a120cdb281db6caf36daee34fe39aaee4866cca0c30e52ab50c2508630ce929f30368f45ab2bca55a
data/.circleci/config.yml CHANGED
@@ -2,7 +2,7 @@ version: 2
2
2
  jobs:
3
3
  build:
4
4
  docker:
5
- - image: circleci/ruby:2.3
5
+ - image: circleci/ruby:2.4
6
6
  steps:
7
7
  - checkout
8
8
  - run:
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.1
2
+ TargetRubyVersion: 2.4
3
3
 
4
4
  Style/FrozenStringLiteralComment:
5
5
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ## 13.2.0
2
+ - Add support for `options` to `/payment_initiation/payment/create`
3
+
4
+ # 13.1.0
5
+ - Add Standing Orders support to Payment Initiation
6
+
7
+ # 13.0.1
8
+ - Add `update_type` to `Item` model.
9
+
10
+ # 13.0.0
11
+ - Add support for providing a payment initiation schedule
12
+ - Add back the (now deprecated) `/item/public_token/create` endpoint
13
+ - Add back the (now deprecated) `/payment_initiation/payment/token/create` endpoint
14
+
15
+ BREAKING CHANGES:
16
+
17
+ - Update minimum required Ruby version to 2.4
18
+
19
+ # 12.0.0
20
+
21
+ - 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.
22
+ - the `/item/public_token/create` endpoint has been disabled in favor of the /link/token/create
23
+ endpoint
24
+ - The `/item/add_token/create endpoint` has been disabled in favor of the /link/token/create
25
+ - The `/payment_initiation/payment/token/create` endpoint has been disabled in favor of the /link/token/create
26
+ endpoint
27
+ - The `/item/remove` endpoint will no longer return a `removed` boolean.
28
+ - The `/institutions/get`, `/institutions/get_by_id`, and `/institutions/search` now require
29
+ `country_codes` to be passed in.
30
+
1
31
  # 11.1.0
2
32
 
3
33
  - Add support for Link Token get endpoint ([#301](https://github.com/plaid/plaid-ruby/pull/301))
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plaid (11.1.0)
4
+ plaid (13.2.0)
5
5
  faraday
6
6
  faraday_middleware
7
7
  hashie (>= 3.4.3)
@@ -11,8 +11,15 @@ GEM
11
11
  specs:
12
12
  ast (2.4.0)
13
13
  dotenv (2.4.0)
14
- faraday (1.0.1)
14
+ faraday (1.4.1)
15
+ faraday-excon (~> 1.1)
16
+ faraday-net_http (~> 1.0)
17
+ faraday-net_http_persistent (~> 1.1)
15
18
  multipart-post (>= 1.2, < 3)
19
+ ruby2_keywords (>= 0.0.4)
20
+ faraday-excon (1.1.0)
21
+ faraday-net_http (1.0.1)
22
+ faraday-net_http_persistent (1.1.0)
16
23
  faraday_middleware (1.0.0)
17
24
  faraday (~> 1.0)
18
25
  hashie (4.1.0)
@@ -35,6 +42,7 @@ GEM
35
42
  ruby-progressbar (~> 1.7)
36
43
  unicode-display_width (~> 1.0, >= 1.0.1)
37
44
  ruby-progressbar (1.9.0)
45
+ ruby2_keywords (0.0.4)
38
46
  sdoc (1.0.0)
39
47
  rdoc (>= 5.0)
40
48
  unicode-display_width (1.3.2)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # plaid-ruby [![Circle CI](https://circleci.com/gh/plaid/plaid-ruby.svg?style=svg&circle-token=30ee002ac2021da5b5b5a701d45fe2888af124a5)](https://circleci.com/gh/plaid/plaid-ruby) [![Gem Version](https://badge.fury.io/rb/plaid.svg)](http://badge.fury.io/rb/plaid)
2
2
 
3
+ :warning: After 7/12/21, this major version of the library will only receive critical security patches. Please consider trying out our new [beta version](https://github.com/plaid/plaid-ruby/tree/14.0.0-beta-release).
4
+
3
5
  The official Ruby bindings for the [Plaid API](https://plaid.com/docs).
4
6
 
5
7
  ## Installation
@@ -26,7 +28,8 @@ Each major version of `plaid-ruby` targets a specific version of the Plaid API:
26
28
 
27
29
  | API version | plaid-ruby release |
28
30
  | ----------- | ------------------ |
29
- | [`2019-05-29`][api-version-2019-05-29] (**latest**) | `9.x.x`, `8.x.x`, `7.x.x` |
31
+ | [`2020-09-14`][api-version-2020-09-14] (**latest**) | `12.x.x` |
32
+ | [`2019-05-29`][api-version-2019-05-29] (**latest**) | `11.x.x`, `10.x.x`, `9.x.x`, `8.x.x`, `7.x.x` |
30
33
  | [`2018-05-22`][api-version-2018-05-22] | `6.x.x` |
31
34
  | `2017-03-08` | `5.x.x` |
32
35
 
@@ -257,6 +260,7 @@ The gem is available as open source under the terms of the [MIT License](http://
257
260
  If you're looking for a Ruby client that works with the legacy Plaid API, use the [`plaid-legacy` gem][2].
258
261
 
259
262
  [2]: https://github.com/plaid/plaid-ruby-legacy
260
- [version-changelog]: https://plaid.com/docs/api-upgrades
261
- [api-version-2018-05-22]: https://plaid.com/docs/api-upgrades#2018-05-22
262
- [api-version-2019-05-29]: https://plaid.com/docs/api-upgrades#2019-05-29
263
+ [version-changelog]: https://plaid.com/docs/api/versioning/
264
+ [api-version-2018-05-22]: https://plaid.com/docs/api/versioning/#2018-05-22
265
+ [api-version-2019-05-29]: https://plaid.com/docs/api/versioning/#2019-05-29
266
+ [api-version-2020-09-14]: https://plaid.com/docs/api/versioning/#2020-09-14
data/lib/plaid/models.rb CHANGED
@@ -123,6 +123,11 @@ module Plaid
123
123
  # Public: The String item ID.
124
124
  property :item_id
125
125
 
126
+ ##
127
+ # :attr_reader:
128
+ # Public: The String update type.
129
+ property :update_type
130
+
126
131
  ##
127
132
  # :attr_reader:
128
133
  # Public: The String webhook URL.
@@ -133,6 +138,11 @@ module Plaid
133
138
  # Public: The String consent expiration timestamp (or nil)
134
139
  # (e.g. "2019-04-22T00:00:00Z").
135
140
  property :consent_expiration_time
141
+
142
+ ##
143
+ # :attr_reader:
144
+ # Public: The String update type.
145
+ property :update_type
136
146
  end
137
147
 
138
148
  # Public: A representation of Item webhook status
@@ -734,6 +744,55 @@ module Plaid
734
744
  property :item_logins, coerce: InstitutionStatusItemLogins
735
745
  end
736
746
 
747
+ # Public: A representation of standing order metadata for an institution.
748
+ class StandingOrderMetadata < BaseModel
749
+ ##
750
+ # :attr_reader:
751
+ # Public: The Boolean flag indicating if the institution supports
752
+ # end date for standing orders.
753
+ property :supports_standing_order_end_date
754
+
755
+ ##
756
+ # :attr_reader:
757
+ # Public: The Boolean flag indicating if the institution supports
758
+ # negative execution days for standing orders.
759
+ property :supports_standing_order_negative_execution_days
760
+
761
+ ##
762
+ # :attr_reader:
763
+ # Public: The Array of valid standing order intervals for
764
+ # this institution.
765
+ # E.g. ["WEEKLY", "MONTHLY"].
766
+ property :valid_standing_order_intervals
767
+ end
768
+
769
+ # Public: A representation of an institution's payment initiation metadata.
770
+ class InstitutionPaymentInitiationMetadata < BaseModel
771
+ ##
772
+ # :attr_reader:
773
+ # Public: The map of maximum payment amount per currency for this
774
+ # institution.
775
+ # E.g. {"GBP"=>"1000000"}.
776
+ property :maximum_payment_amount
777
+
778
+ ##
779
+ # :attr_reader:
780
+ # Public: The standing order metadata for this institution.
781
+ property :standing_order_metadata, coerce: StandingOrderMetadata
782
+
783
+ ##
784
+ # :attr_reader:
785
+ # Public: The Boolean flag indicating if the institution supports
786
+ # international payments.
787
+ property :supports_international_payments
788
+
789
+ ##
790
+ # :attr_reader:
791
+ # Public: The Boolean flag indicating if the institution supports
792
+ # refund details.
793
+ property :supports_refund_details
794
+ end
795
+
737
796
  # Public: A representation of Institution.
738
797
  class Institution < BaseModel
739
798
  @ignored_properties = ['input_spec']
@@ -818,6 +877,13 @@ module Plaid
818
877
  # :attr_reader:
819
878
  # Public: Indicates that the institution has an OAuth login flow.
820
879
  property :oauth
880
+
881
+ ##
882
+ # :attr_reader:
883
+ # Public: Specifies metadata related to the payment_initiation product
884
+ # (or nil).
885
+ property :payment_initiation_metadata,
886
+ coerce: InstitutionPaymentInitiationMetadata
821
887
  end
822
888
 
823
889
  module MFA
@@ -1924,6 +1990,25 @@ module Plaid
1924
1990
  property :value
1925
1991
  end
1926
1992
 
1993
+ # Public: A representation of a payment amount.
1994
+ class PaymentSchedule < BaseModel
1995
+ ##
1996
+ # :attr_reader:
1997
+ # Public: Interval for the standing order.
1998
+ property :interval
1999
+
2000
+ ##
2001
+ # :attr_reader:
2002
+ # Public: Day or the week or day of the month to execute
2003
+ # the standing order.
2004
+ property :interval_execution_day
2005
+
2006
+ ##
2007
+ # :attr_reader:
2008
+ # Public: Start date for the standing order.
2009
+ property :start_date
2010
+ end
2011
+
1927
2012
  # Public: A representation of a payment amount.
1928
2013
  class PaymentRecipientAddress < BaseModel
1929
2014
  ##
@@ -2010,6 +2095,11 @@ module Plaid
2010
2095
  # Public: The payment amount.
2011
2096
  property :amount, coerce: PaymentAmount
2012
2097
 
2098
+ ##
2099
+ # :attr_reader:
2100
+ # Public: The payment schedule.
2101
+ property :schedule, coerce: PaymentSchedule
2102
+
2013
2103
  ##
2014
2104
  # :attr_reader:
2015
2105
  # Public: The payment's status.
@@ -2029,6 +2119,17 @@ module Plaid
2029
2119
  # :attr_reader:
2030
2120
  # Public: The recipient ID for payment.
2031
2121
  property :recipient_id
2122
+
2123
+ ##
2124
+ # :attr_reader:
2125
+ # Public: An object containing a BACS account number and sort code
2126
+ # for the payer's account.
2127
+ property :bacs
2128
+
2129
+ ##
2130
+ # :attr_reader:
2131
+ # Public: A string containing the IBAN for the payer's account.
2132
+ property :iban
2032
2133
  end
2033
2134
 
2034
2135
  # Public: Metadata associated with a link token.
@@ -11,9 +11,10 @@ module Plaid
11
11
  # options - Options for filtering institutions.
12
12
  #
13
13
  # Returns a MultipleInstitutionsResponse instance.
14
- def get(count:, offset:, options: nil)
14
+ def get(count:, offset:, country_codes:, options: nil)
15
15
  payload = { count: count,
16
- offset: offset }
16
+ offset: offset,
17
+ country_codes: country_codes }
17
18
  payload[:options] = options unless options.nil?
18
19
 
19
20
  post_with_auth 'institutions/get',
@@ -30,9 +31,10 @@ module Plaid
30
31
  # options - Options for filtering institutions.
31
32
  #
32
33
  # Returns a SingleInstitutionResponse instance.
33
- def get_by_id(institution_id, options: nil)
34
+ def get_by_id(institution_id, country_codes, options: nil)
34
35
  payload = {
35
- institution_id: institution_id
36
+ institution_id: institution_id,
37
+ country_codes: country_codes
36
38
  }
37
39
  payload[:options] = options unless options.nil?
38
40
  post_with_auth 'institutions/get_by_id',
@@ -51,10 +53,11 @@ module Plaid
51
53
  # options - Options for filtering institutions.
52
54
  #
53
55
  # Returns a MultipleInstitutionsResponse instance.
54
- def search(query, products = nil, options: nil)
56
+ def search(query, country_codes, products = nil, options: nil)
55
57
  payload = {
56
58
  query: query,
57
- products: products
59
+ products: products,
60
+ country_codes: country_codes
58
61
  }
59
62
 
60
63
  payload[:options] = options unless options.nil?
@@ -25,28 +25,6 @@ module Plaid
25
25
  end
26
26
  end
27
27
 
28
- # Public: Class used to call the AddToken sub-product.
29
- class AddToken < BaseProduct
30
- def create(user)
31
- post_with_auth 'item/add_token/create',
32
- CreateResponse,
33
- user: user
34
- end
35
-
36
- # Public: Response for /item/add_token/create.
37
- class CreateResponse < Models::BaseResponse
38
- ##
39
- # :attr_reader:
40
- # Public: The String token.
41
- property :add_token
42
-
43
- ##
44
- # :attr_reader:
45
- # Public: The String token expiration time.
46
- property :expiration
47
- end
48
- end
49
-
50
28
  # Public: Class used to call the PublicToken sub-product
51
29
  class PublicToken < BaseProduct
52
30
  # Public: Creates a public token from an access_token.
@@ -58,6 +36,10 @@ module Plaid
58
36
  #
59
37
  # Returns a CreateResponse object with a public token and expiration info.
60
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
+
61
43
  post_with_auth 'item/public_token/create',
62
44
  CreateResponse,
63
45
  access_token: access_token
@@ -146,11 +128,6 @@ module Plaid
146
128
  # Public: The Plaid::PublicToken product accessor.
147
129
  subproduct :public_token
148
130
 
149
- ##
150
- # :attr_reader:
151
- # Public: The Plaid::AddToken product accessor.
152
- subproduct :add_token
153
-
154
131
  ##
155
132
  # :attr_reader:
156
133
  # Public: The Plaid::Webhook product accessor.
@@ -4,9 +4,11 @@ module Plaid
4
4
  # Public: Create a recipient.
5
5
  #
6
6
  # name - Recipient name.
7
- # iban - Recipient IBAN.
8
- # address - Recipient address.
9
- # bacs - Recipient BACS (hash with "account" and "sort_code" keys)
7
+ # iban - Recipient IBAN. Should be nil if using bacs.
8
+ # address - Recipient address (hash with "street", "city", "postal_code"
9
+ # and "country"). Best practice is to set it as nil.
10
+ # bacs - Recipient BACS (hash with "account" and "sort_code" keys).
11
+ # Should be nil if using iban.
10
12
  #
11
13
  # Returns a PaymentRecipientCreateResponse object.
12
14
  def create_recipient(name, iban, address, bacs)
@@ -43,14 +45,25 @@ module Plaid
43
45
  # recipient_id - Recipient ID that the payment will be initiated for.
44
46
  # reference - Payment reference.
45
47
  # amount - Payment amount.
48
+ # schedule - Payment schedule.
49
+ # options - Payment options.
46
50
  #
47
51
  # Returns a PaymentCreateResponse object.
48
- def create_payment(recipient_id, reference, amount)
49
- post_with_auth 'payment_initiation/payment/create',
52
+ def create_payment(
53
+ recipient_id, reference, amount, schedule: nil, options: nil
54
+ )
55
+ create_payment = {
56
+ 'recipient_id': recipient_id,
57
+ 'reference': reference,
58
+ 'amount': amount
59
+ }
60
+
61
+ create_payment['schedule'] = schedule unless schedule.nil?
62
+ create_payment['options'] = options unless options.nil?
63
+
64
+ post_with_auth('payment_initiation/payment/create',
50
65
  PaymentCreateResponse,
51
- recipient_id: recipient_id,
52
- reference: reference,
53
- amount: amount
66
+ create_payment)
54
67
  end
55
68
 
56
69
  # Public: Create a payment token.
@@ -59,6 +72,10 @@ module Plaid
59
72
  #
60
73
  # Returns a PaymentTokenCreateResponse object.
61
74
  def create_payment_token(payment_id)
75
+ puts 'Warning: this method will be deprecated in a future version. '\
76
+ 'To replace the payment_token, look into the link_token at '\
77
+ 'https://plaid.com/docs/api/tokens/#linktokencreate.'
78
+
62
79
  post_with_auth 'payment_initiation/payment/token/create',
63
80
  PaymentTokenCreateResponse,
64
81
  payment_id: payment_id
@@ -181,6 +198,11 @@ module Plaid
181
198
  # Public: The payment amount.
182
199
  property :amount, coerce: Models::PaymentAmount
183
200
 
201
+ ##
202
+ # :attr_reader:
203
+ # Public: The payment schedule.
204
+ property :schedule, coerce: Models::PaymentSchedule
205
+
184
206
  ##
185
207
  # :attr_reader:
186
208
  # Public: The payment's status.
@@ -200,6 +222,17 @@ module Plaid
200
222
  # :attr_reader:
201
223
  # Public: The recipient ID for payment.
202
224
  property :recipient_id
225
+
226
+ ##
227
+ # :attr_reader:
228
+ # Public: An object containing a BACS account number and sort code
229
+ # for the payer's account.
230
+ property :bacs
231
+
232
+ ##
233
+ # :attr_reader:
234
+ # Public: A string containing the IBAN for the payer's account.
235
+ property :iban
203
236
  end
204
237
 
205
238
  # Public: The response wrapper for /payment_initiation/payment/list.
data/lib/plaid/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Plaid
2
- VERSION = '11.1.0'.freeze
3
- API_VERSION = '2019-05-29'.freeze
2
+ VERSION = '13.2.0'.freeze
3
+ API_VERSION = '2020-09-14'.freeze
4
4
  end
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.1.0'
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: 11.1.0
4
+ version: 13.2.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-09-15 00:00:00.000000000 Z
11
+ date: 2021-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -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.1.0
229
+ version: 2.4.0
230
230
  required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - ">="