plaid 8.4.0 → 8.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f70479c2504298edafa057a0924b2c2132f20d88d0fa0cbe0ae9bcb56487aa06
4
- data.tar.gz: b0a7b9a3976e543e02ca97c99544cc41745543bbfe77c23d319a1e57053e77d3
3
+ metadata.gz: da09c74c4e425edb5481861ca9be64d5fbb8dbda67b742d34ca707fb90afc088
4
+ data.tar.gz: d43ec775772db6a2a89738654864378f6cbbe037c53d5673c2f93ff8516cf1c6
5
5
  SHA512:
6
- metadata.gz: ceab5477a6a2a2113c9025027a7f80c709d4db419c09e9f43f9a20500c29c7dd3abe28f8cf3ac849ee94a3e3006100846611344e63a34b9fa88f84629f453fa4
7
- data.tar.gz: 8a6bb6cf0a09ee13dec7f8025599f112f891de8dfe899aa231d2467f961f9e4b2519564d791d52c886e2ee34c1eb8a27f7c2a45a0a6aa9fb0d7f8d89374df9f9
6
+ metadata.gz: dbcc0d8ab622c492f5cbf61fb2f32f6d75b52099e7c379524fe6736d9674adca7b9e3f5b302f9571d43667a2f3431818fda9e2806397ab82f9cd74f492f0f569
7
+ data.tar.gz: 4e8f6b22c61ebd8f73e61c72e079900f3bce5356c5d524557163030a5a5313f35379b3c3069fdd6cd3313700025e243605513810c11ea9ebf971becf5222da69
@@ -1,3 +1,9 @@
1
+ # 8.5.0 10-Feb-2020
2
+
3
+ * Add support for deposit switch product ([#251](https://github.com/plaid/plaid-ruby/pull/251))
4
+ * Add support for generic processor token ([#256](https://github.com/plaid/plaid-ruby/pull/256))
5
+ * Add support for webhook verification ([#249](https://github.com/plaid/plaid-ruby/pull/249))
6
+
1
7
  # 8.4.0 23-Jan-2020
2
8
 
3
9
  * Add support for new UK Payment Initiation product ([#246](https://github.com/plaid/plaid-ruby/pull/246))
@@ -55,4 +55,4 @@ DEPENDENCIES
55
55
  vcr (~> 4.0.0)
56
56
 
57
57
  BUNDLED WITH
58
- 1.16.2
58
+ 1.17.2
@@ -11,6 +11,7 @@ require_relative 'plaid/products/asset_report'
11
11
  require_relative 'plaid/products/auth'
12
12
  require_relative 'plaid/products/categories'
13
13
  require_relative 'plaid/products/credit_details'
14
+ require_relative 'plaid/products/deposit_switch'
14
15
  require_relative 'plaid/products/identity'
15
16
  require_relative 'plaid/products/income'
16
17
  require_relative 'plaid/products/institutions'
@@ -21,6 +22,7 @@ require_relative 'plaid/products/transactions'
21
22
  require_relative 'plaid/products/investments'
22
23
  require_relative 'plaid/products/liabilities'
23
24
  require_relative 'plaid/products/payment_initiation'
25
+ require_relative 'plaid/products/webhooks'
24
26
  require_relative 'plaid/client'
25
27
 
26
28
  # Public: The namespace for all the things Plaid.
@@ -57,6 +57,11 @@ module Plaid
57
57
  # Public: The Plaid::CreditDetails product accessor.
58
58
  subproduct :credit_details
59
59
 
60
+ ##
61
+ # :attr_reader:
62
+ # Public: The Plaid::DepositSwitch product accessor.
63
+ subproduct :deposit_switch
64
+
60
65
  ##
61
66
  # :attr_reader:
62
67
  # Public: The Plaid::Identity product accessor.
@@ -107,6 +112,11 @@ module Plaid
107
112
  # Public: The Plaid::PaymentInitiation product accessor.
108
113
  subproduct :payment_initiation
109
114
 
115
+ ##
116
+ # :attr_reader:
117
+ # Public: The Plaid::Webhooks endpoint accessor.
118
+ subproduct :webhooks
119
+
110
120
  # Public: Make a post request
111
121
  #
112
122
  # path - Path or URL to make the request to
@@ -1081,6 +1081,11 @@ module Plaid
1081
1081
  # Public: The String transaction type (or nil). E.g. "buy" or "sell".
1082
1082
  property :type
1083
1083
 
1084
+ ##
1085
+ # :attr_reader:
1086
+ # Public: The String transaction type (or nil). E.g. "buy" or "sell".
1087
+ property :subtype
1088
+
1084
1089
  ##
1085
1090
  # :attr_reader:
1086
1091
  # Public: The ISO currency code of the transaction, either USD or CAD.
@@ -1908,5 +1913,53 @@ module Plaid
1908
1913
  # Public: The recipient ID for payment.
1909
1914
  property :recipient_id
1910
1915
  end
1916
+
1917
+ # Public: A representation of a payment amount.
1918
+ class WebhookVerificationKey < BaseModel
1919
+ ##
1920
+ # :attr_reader:
1921
+ # Public: alg.
1922
+ property :alg
1923
+
1924
+ ##
1925
+ # :attr_reader:
1926
+ # Public: created_at.
1927
+ property :created_at
1928
+
1929
+ ##
1930
+ # :attr_reader:
1931
+ # Public: crv.
1932
+ property :crv
1933
+
1934
+ ##
1935
+ # :attr_reader:
1936
+ # Public: expired_at.
1937
+ property :expired_at
1938
+
1939
+ ##
1940
+ # :attr_reader:
1941
+ # Public: kid.
1942
+ property :kid
1943
+
1944
+ ##
1945
+ # :attr_reader:
1946
+ # Public: kty.
1947
+ property :kty
1948
+
1949
+ ##
1950
+ # :attr_reader:
1951
+ # Public: use.
1952
+ property :use
1953
+
1954
+ ##
1955
+ # :attr_reader:
1956
+ # Public: x.
1957
+ property :x
1958
+
1959
+ ##
1960
+ # :attr_reader:
1961
+ # Public: y.
1962
+ property :y
1963
+ end
1911
1964
  end
1912
1965
  end
@@ -0,0 +1,99 @@
1
+ module Plaid
2
+ # Public: Class used to call the Deposit Switch product.
3
+ class DepositSwitch < BaseProduct
4
+ # Public: Get Deposit Switch information.
5
+ #
6
+ # Does a POST /deposit_switch/get call which fetches deposit switch
7
+ # associated with a deposit switch id.
8
+ #
9
+ # deposit_switch_id - deposit_switch_id to fetch deposit switch
10
+ # Returns the DepositSwitchResponse object with deposit switch data.
11
+ def get(deposit_switch_id)
12
+ post_with_auth 'deposit_switch/get',
13
+ GetResponse,
14
+ deposit_switch_id: deposit_switch_id
15
+ end
16
+
17
+ # Public: Response wrapper for /deposit_switch/get.
18
+ class GetResponse < Models::BaseResponse
19
+ ##
20
+ # :attr_reader:
21
+ # Public: The ID associated with the deposit switch.
22
+ property :deposit_switch_id
23
+
24
+ ##
25
+ # :attr_reader:
26
+ # Public: The ID of the item that the deposit switch was a target to.
27
+ property :target_item_id
28
+
29
+ ##
30
+ # :attr_reader:
31
+ # Public: The ID of the account that the deposit switch was a target to.
32
+ property :target_account_id
33
+
34
+ ##
35
+ # :attr_reader:
36
+ # Public: The state that the deposit switch is in.
37
+ property :state
38
+
39
+ ##
40
+ # :attr_reader:
41
+ # Public: The date on which the deposit switch was created.
42
+ property :date_created
43
+
44
+ ##
45
+ # :attr_reader:
46
+ # Public: The date on which the deposit switch was completed.
47
+ property :date_completed
48
+ end
49
+
50
+ # Public: Create Deposit Switch.
51
+ #
52
+ # Does a POST /deposit_switch/create call which creates a deposit switch
53
+ #
54
+ # target_account_id - ID of the bank account for the deposit switch
55
+ # target_access_token - access token for the switch
56
+ #
57
+ # Returns the DepositSwitchResponse object with deposit switch data.
58
+ def create(target_account_id, target_access_token)
59
+ post_with_auth 'deposit_switch/create',
60
+ CreateResponse,
61
+ target_account_id: target_account_id,
62
+ target_access_token: target_access_token
63
+ end
64
+ # Public: Response wrapper for /deposit_switch/create.
65
+ class CreateResponse < Models::BaseResponse
66
+ ##
67
+ # :attr_reader:
68
+ # Public: The ID associated with the deposit switch
69
+ property :deposit_switch_id
70
+ end
71
+
72
+ # Public: Create Deposit Switch token.
73
+ #
74
+ # Does a POST /deposit_switch/token/create call which creates a deposit
75
+ # switch.
76
+ #
77
+ # deposit_switch_item - ID of the deposit switch
78
+ #
79
+ # Returns the CreateTokenResponse object.
80
+ def create_token(deposit_switch_id)
81
+ post_with_auth 'deposit_switch/token/create',
82
+ CreateTokenResponse,
83
+ deposit_switch_id: deposit_switch_id
84
+ end
85
+
86
+ # Public: Response wrapper for /deposit_switch/create.
87
+ class CreateTokenResponse < Models::BaseResponse
88
+ ##
89
+ # :attr_reader:
90
+ # Public: A deposit switch token for the deposit switch.
91
+ property :deposit_switch_token
92
+
93
+ ##
94
+ # :attr_reader:
95
+ # Public: The expiration time of the deposit switch token
96
+ property :deposit_switch_token_expiration_time
97
+ end
98
+ end
99
+ end
@@ -204,5 +204,30 @@ module Plaid
204
204
  # Public: The Boolean flag meaning successful removal.
205
205
  property :removed
206
206
  end
207
+
208
+ # Public: Import an item.
209
+ #
210
+ # Does a POST /item/import call which imports an item.
211
+ #
212
+ # products - array of products to enable
213
+ # user_auth - hash map of user authentication information
214
+ # options - optional hash map of options
215
+ #
216
+ # Returns an access token for the item.
217
+ def import(products, user_auth, options)
218
+ post_with_auth 'item/import',
219
+ ImportResponse,
220
+ products: products,
221
+ user_auth: user_auth,
222
+ options: options
223
+ end
224
+
225
+ # Public: Response for /item/import.
226
+ class ImportResponse < Models::BaseResponse
227
+ ##
228
+ # :attr_reader:
229
+ # Public: The access token string
230
+ property :access_token
231
+ end
207
232
  end
208
233
  end
@@ -126,6 +126,40 @@ module Plaid
126
126
  subproduct :processor_token, ProcessorToken
127
127
  end
128
128
 
129
+ # Public: Class used to call the generic ProcessorToken sub-product.
130
+ class ProcessorToken < BaseProduct
131
+ # Public: Creates a processor token from an access_token.
132
+ #
133
+ # Does a POST /processor/token/create call which can be used to
134
+ # generate any non-stripe processor token for a given account ID.
135
+ # If the processor is Stripe, the stripe endpoint will be called
136
+ # instead.
137
+ #
138
+ # access_token - access_token to create a public token for.
139
+ # account_id - ID of the account to create a processor token for.
140
+ # processor - name of the processor to create a token for.
141
+ #
142
+ # Returns a ProcessorTokenResponse object containing a processor token.
143
+ def create(access_token, account_id, processor)
144
+ endpoint = 'processor/token/create'
145
+ options = {
146
+ access_token: access_token,
147
+ account_id: account_id,
148
+ processor: processor
149
+ }
150
+
151
+ if processor == 'stripe'
152
+ endpoint = '/processor/stripe/bank_account_token/create'
153
+ options.delete(:processor)
154
+ elsif processor == 'apex'
155
+ endpoint = '/processor/apex/processor_token/create'
156
+ options.delete(:processor)
157
+ end
158
+
159
+ post_with_auth endpoint, ProcessorTokenResponse, **options
160
+ end
161
+ end
162
+
129
163
  # Public: Class used to call the Processor product.
130
164
  class Processor < BaseProduct
131
165
  ##
@@ -147,5 +181,10 @@ module Plaid
147
181
  # :attr_reader:
148
182
  # Public: The Plaid::Ocrolus product accessor.
149
183
  subproduct :ocrolus
184
+
185
+ ##
186
+ # :attr_reader:
187
+ # Public: The Plaid::ProcessorToken product accessor.
188
+ subproduct :processor_token
150
189
  end
151
190
  end
@@ -0,0 +1,23 @@
1
+ module Plaid
2
+ # Public: Class used to call the Webhooks endpoint.
3
+ class Webhooks < BaseProduct
4
+ # Public: Retrieve a webhook verification key.
5
+ #
6
+ # key_id - The key ID from the Plaid-Verification header.
7
+ #
8
+ # Returns a WebhookVerificationKeyGetResponse object.
9
+ def get_verification_key(key_id)
10
+ post_with_auth 'webhook_verification_key/get',
11
+ WebhookVerificationKeyGetResponse,
12
+ key_id: key_id
13
+ end
14
+
15
+ # Public: The response wrapper for /webhook_verification_key/get.
16
+ class WebhookVerificationKeyGetResponse < Models::BaseResponse
17
+ ##
18
+ # :attr_reader:
19
+ # Public: The webhook verification key.
20
+ property :key, coerce: Models::WebhookVerificationKey
21
+ end
22
+ end
23
+ end
@@ -1,4 +1,4 @@
1
1
  module Plaid
2
- VERSION = '8.4.0'.freeze
2
+ VERSION = '8.5.0'.freeze
3
3
  API_VERSION = '2019-05-29'.freeze
4
4
  end
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: 8.4.0
4
+ version: 8.5.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-01-23 00:00:00.000000000 Z
11
+ date: 2020-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -197,6 +197,7 @@ files:
197
197
  - lib/plaid/products/base_product.rb
198
198
  - lib/plaid/products/categories.rb
199
199
  - lib/plaid/products/credit_details.rb
200
+ - lib/plaid/products/deposit_switch.rb
200
201
  - lib/plaid/products/identity.rb
201
202
  - lib/plaid/products/income.rb
202
203
  - lib/plaid/products/institutions.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/plaid/products/processor.rb
208
209
  - lib/plaid/products/sandbox.rb
209
210
  - lib/plaid/products/transactions.rb
211
+ - lib/plaid/products/webhooks.rb
210
212
  - lib/plaid/version.rb
211
213
  - plaid.gemspec
212
214
  homepage: https://plaid.com/
@@ -229,8 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
231
  - !ruby/object:Gem::Version
230
232
  version: '0'
231
233
  requirements: []
232
- rubyforge_project:
233
- rubygems_version: 2.7.7
234
+ rubygems_version: 3.1.2
234
235
  signing_key:
235
236
  specification_version: 4
236
237
  summary: Ruby bindings for Plaid