plaid 4.1.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +23 -0
- data/.rubocop.yml +18 -0
- data/CHANGELOG.md +7 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile.lock +58 -0
- data/README.md +50 -39
- data/Rakefile +7 -10
- data/lib/plaid.rb +40 -1
- data/lib/plaid/client.rb +72 -63
- data/lib/plaid/errors.rb +46 -41
- data/lib/plaid/middleware.rb +11 -6
- data/lib/plaid/models.rb +683 -0
- data/lib/plaid/products/accounts.rb +38 -35
- data/lib/plaid/products/auth.rb +32 -19
- data/lib/plaid/products/base_product.rb +69 -0
- data/lib/plaid/products/categories.rb +11 -8
- data/lib/plaid/products/credit_details.rb +31 -19
- data/lib/plaid/products/identity.rb +27 -11
- data/lib/plaid/products/income.rb +22 -11
- data/lib/plaid/products/institutions.rb +50 -28
- data/lib/plaid/products/item.rb +251 -136
- data/lib/plaid/products/processor.rb +104 -34
- data/lib/plaid/products/sandbox.rb +21 -20
- data/lib/plaid/products/transactions.rb +50 -45
- data/lib/plaid/version.rb +1 -1
- data/plaid.gemspec +10 -8
- metadata +51 -19
- data/circle.yml +0 -9
data/lib/plaid/errors.rb
CHANGED
@@ -2,78 +2,83 @@ module Plaid
|
|
2
2
|
# Public: Base class for Plaid SDK errors
|
3
3
|
class PlaidError < StandardError; end
|
4
4
|
|
5
|
-
# Public:
|
5
|
+
# Public: Returned on Plaid server or network issues
|
6
6
|
class PlaidServerError < PlaidError; end
|
7
7
|
|
8
8
|
# Public: Base class for any error returned by the API
|
9
9
|
class PlaidAPIError < PlaidError
|
10
|
-
attr_reader :error_type, :error_code, :error_message,
|
10
|
+
attr_reader :error_type, :error_code, :error_message,
|
11
|
+
:display_message, :request_id
|
11
12
|
|
12
|
-
# Internal: Initialize an error with proper attributes
|
13
|
+
# Internal: Initialize an error with proper attributes.
|
13
14
|
#
|
14
|
-
# error_type - A broad categorization of the error
|
15
|
-
# error_code - The particular error code
|
16
|
-
# error_message - A developer-friendly representation of the error
|
17
|
-
#
|
18
|
-
#
|
19
|
-
|
15
|
+
# error_type - A broad categorization of the error.
|
16
|
+
# error_code - The particular error code.
|
17
|
+
# error_message - A developer-friendly representation of the error
|
18
|
+
# message.
|
19
|
+
# display_message - A user-friendly representation of the error message.
|
20
|
+
# request_id - The ID of the request you made, can be used to
|
21
|
+
# escalate problems.
|
22
|
+
def initialize(error_type, error_code, error_message, display_message,
|
23
|
+
request_id)
|
20
24
|
@error_type = error_type
|
21
25
|
@error_code = error_code
|
22
26
|
@error_message = error_message
|
23
27
|
@display_message = display_message
|
24
28
|
@request_id = request_id
|
25
29
|
|
26
|
-
super
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
super <<-TEXT
|
31
|
+
|
32
|
+
Error Type : #{error_type}
|
33
|
+
Error Code : #{error_code}
|
34
|
+
Error Message : #{error_message}
|
35
|
+
Display Message : #{display_message}
|
36
|
+
Request ID : #{request_id}
|
37
|
+
TEXT
|
32
38
|
end
|
33
39
|
end
|
34
40
|
|
35
|
-
# Public:
|
41
|
+
# Public: Returned when the request is malformed and cannot be processed.
|
36
42
|
class InvalidRequestError < PlaidAPIError; end
|
37
43
|
|
38
|
-
# Public:
|
39
|
-
#
|
44
|
+
# Public: Returned when all fields are provided and are in the correct
|
45
|
+
# format, but the values provided are incorrect in some way.
|
40
46
|
class InvalidInputError < PlaidAPIError; end
|
41
47
|
|
42
|
-
# Public:
|
48
|
+
# Public: Returned when the request is valid but has exceeded established
|
49
|
+
# rate limits.
|
43
50
|
class RateLimitExceededError < PlaidAPIError; end
|
44
51
|
|
45
|
-
# Public:
|
46
|
-
#
|
52
|
+
# Public: Returned during planned maintenance windows and in response to API
|
53
|
+
# internal server errors.
|
47
54
|
class APIError < PlaidAPIError; end
|
48
55
|
|
49
|
-
# Public:
|
50
|
-
#
|
56
|
+
# Public: Indicates that information provided for the item (such as
|
57
|
+
# credentials or MFA) may be invalid or that the item is not supported on
|
58
|
+
# Plaid's platform.
|
51
59
|
class ItemError < PlaidAPIError; end
|
52
60
|
|
53
61
|
# Internal: A module that provides utilities for errors.
|
54
62
|
module Error
|
55
|
-
|
63
|
+
ERROR_TYPE_MAP = {
|
64
|
+
'INVALID_REQUEST' => Plaid::InvalidRequestError,
|
65
|
+
'INVALID_INPUT' => Plaid::InvalidInputError,
|
66
|
+
'RATE_LIMIT_EXCEEDED_ERROR' => Plaid::RateLimitExceededError,
|
67
|
+
'API_ERROR' => Plaid::APIError,
|
68
|
+
'ITEM_ERROR' => Plaid::ItemError
|
69
|
+
}.freeze
|
70
|
+
|
71
|
+
# Internal: Map error_type to PlaidAPIError.
|
56
72
|
#
|
57
|
-
# Maps an error_type from an error HTTP response to an actual
|
73
|
+
# Maps an error_type from an error HTTP response to an actual
|
74
|
+
# PlaidAPIError class instance.
|
58
75
|
#
|
59
|
-
# error_type - The type of the error as indicated by the error response
|
76
|
+
# error_type - The type of the error as indicated by the error response
|
77
|
+
# body.
|
60
78
|
#
|
61
|
-
# Returns an error class mapped from error_type
|
79
|
+
# Returns an error class mapped from error_type.
|
62
80
|
def self.error_from_type(error_type)
|
63
|
-
|
64
|
-
when 'INVALID_REQUEST'
|
65
|
-
Plaid::InvalidRequestError
|
66
|
-
when 'INVALID_INPUT'
|
67
|
-
Plaid::InvalidInputError
|
68
|
-
when 'RATE_LIMIT_EXCEEDED_ERROR'
|
69
|
-
Plaid::RateLimitExceededError
|
70
|
-
when 'API_ERROR'
|
71
|
-
Plaid::APIError
|
72
|
-
when 'ITEM_ERROR'
|
73
|
-
Plaid::ItemError
|
74
|
-
else
|
75
|
-
Plaid::PlaidAPIError
|
76
|
-
end
|
81
|
+
ERROR_TYPE_MAP[error_type] || Plaid::PlaidAPIError
|
77
82
|
end
|
78
83
|
end
|
79
84
|
end
|
data/lib/plaid/middleware.rb
CHANGED
@@ -5,6 +5,7 @@ require 'uri'
|
|
5
5
|
require_relative 'version'
|
6
6
|
|
7
7
|
module Plaid
|
8
|
+
# Internal: The Faraday middleware used to catch errors.
|
8
9
|
class Middleware < ::Faraday::Response::Middleware
|
9
10
|
# Internal: Headers used for correct request and SDK tracking.
|
10
11
|
NETWORK_HEADERS = { 'User-Agent' => "Plaid Ruby v#{Plaid::VERSION}",
|
@@ -14,12 +15,16 @@ module Plaid
|
|
14
15
|
NETWORK_TIMEOUT = 600
|
15
16
|
|
16
17
|
def on_complete(env)
|
17
|
-
return unless Faraday::Response::RaiseError::ClientErrorStatuses
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
return unless Faraday::Response::RaiseError::ClientErrorStatuses
|
19
|
+
.include?(env[:status])
|
20
|
+
|
21
|
+
error_class = Plaid::Error.error_from_type(env.body['error_type'])
|
22
|
+
|
23
|
+
raise error_class.new(env.body['error_type'],
|
24
|
+
env.body['error_code'],
|
25
|
+
env.body['error_message'],
|
26
|
+
env.body['display_message'],
|
27
|
+
env.body['request_id'])
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
data/lib/plaid/models.rb
ADDED
@@ -0,0 +1,683 @@
|
|
1
|
+
require 'hashie'
|
2
|
+
|
3
|
+
module Plaid
|
4
|
+
module Models
|
5
|
+
# Internal: Base model for all other models.
|
6
|
+
class BaseModel < Hashie::Dash
|
7
|
+
include Hashie::Extensions::Dash::IndifferentAccess
|
8
|
+
include Hashie::Extensions::Dash::Coercion
|
9
|
+
|
10
|
+
# Internal: Be strict or forgiving depending on Plaid.relaxed_models
|
11
|
+
# value.
|
12
|
+
def assert_property_exists!(property)
|
13
|
+
super unless Plaid.relaxed_models?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# Internal: Base API response.
|
18
|
+
class BaseResponse < BaseModel
|
19
|
+
##
|
20
|
+
# :attr_reader:
|
21
|
+
# Public: The String request ID assigned by the API.
|
22
|
+
property :request_id
|
23
|
+
end
|
24
|
+
|
25
|
+
# Public: A representation of an error.
|
26
|
+
class Error < BaseModel
|
27
|
+
##
|
28
|
+
# :attr_reader:
|
29
|
+
# Public: The String broad categorization of the error. One of:
|
30
|
+
# 'INVALID_REQUEST', 'INVALID_INPUT', 'RATE_LIMIT_EXCEEDED', 'API_ERROR',
|
31
|
+
# or 'ITEM_ERROR'.
|
32
|
+
property :error_type
|
33
|
+
|
34
|
+
##
|
35
|
+
# :attr_reader:
|
36
|
+
# Public: The particular String error code. Each error_type has a
|
37
|
+
# specific set of error_codes.
|
38
|
+
property :error_code
|
39
|
+
|
40
|
+
##
|
41
|
+
# :attr_reader:
|
42
|
+
# Public: A developer-friendly representation of the error message.
|
43
|
+
property :error_message
|
44
|
+
|
45
|
+
##
|
46
|
+
# :attr_reader:
|
47
|
+
# Public: A user-friendly representation of the error message. nil if the
|
48
|
+
# error is not related to user action.
|
49
|
+
property :display_message
|
50
|
+
end
|
51
|
+
|
52
|
+
# Public: A representation of an item.
|
53
|
+
class Item < BaseModel
|
54
|
+
##
|
55
|
+
# :attr_reader:
|
56
|
+
# Public: The Array with String products available for this item
|
57
|
+
# (e.g. ["balance", "auth"]).
|
58
|
+
property :available_products
|
59
|
+
|
60
|
+
##
|
61
|
+
# :attr_reader:
|
62
|
+
# Public: The Array with String products billed for this item
|
63
|
+
# (e.g. ["identity", "transactions"]).
|
64
|
+
property :billed_products
|
65
|
+
|
66
|
+
##
|
67
|
+
# :attr_reader:
|
68
|
+
# Public: The String error related to
|
69
|
+
property :error, coerce: Error
|
70
|
+
|
71
|
+
##
|
72
|
+
# :attr_reader:
|
73
|
+
# Public: The String institution ID for this item.
|
74
|
+
property :institution_id
|
75
|
+
|
76
|
+
##
|
77
|
+
# :attr_reader:
|
78
|
+
# Public: The String item ID.
|
79
|
+
property :item_id
|
80
|
+
|
81
|
+
##
|
82
|
+
# :attr_reader:
|
83
|
+
# Public: The String webhook URL.
|
84
|
+
property :webhook
|
85
|
+
end
|
86
|
+
|
87
|
+
# Public: A representation of account balances.
|
88
|
+
class Balances < BaseModel
|
89
|
+
##
|
90
|
+
# :attr_reader:
|
91
|
+
# Public: The Numeric available balance (or nil).
|
92
|
+
property :available
|
93
|
+
|
94
|
+
##
|
95
|
+
# :attr_reader:
|
96
|
+
# Public: The Numeric current balance (or nil).
|
97
|
+
property :current
|
98
|
+
|
99
|
+
##
|
100
|
+
# :attr_reader:
|
101
|
+
# Public: The Numeric limit (or nil).
|
102
|
+
property :limit
|
103
|
+
end
|
104
|
+
|
105
|
+
# Public: A representation of an account.
|
106
|
+
class Account < BaseModel
|
107
|
+
##
|
108
|
+
# :attr_reader:
|
109
|
+
# Public: The String account ID, e.g.
|
110
|
+
# "QKKzevvp33HxPWpoqn6rI13BxW4awNSjnw4xv".
|
111
|
+
property :account_id
|
112
|
+
|
113
|
+
##
|
114
|
+
# :attr_reader:
|
115
|
+
# Public: Balances for this account.
|
116
|
+
property :balances, coerce: Balances
|
117
|
+
|
118
|
+
##
|
119
|
+
# :attr_reader:
|
120
|
+
# Public: The String mask, e.g. "0000".
|
121
|
+
property :mask
|
122
|
+
|
123
|
+
##
|
124
|
+
# :attr_reader:
|
125
|
+
# Public: The String account name, e.g. "Plaid Checking".
|
126
|
+
property :name
|
127
|
+
|
128
|
+
##
|
129
|
+
# :attr_reader:
|
130
|
+
# Public: The String official account name, e.g. "Plaid Gold Checking".
|
131
|
+
property :official_name
|
132
|
+
|
133
|
+
##
|
134
|
+
# :attr_reader:
|
135
|
+
# Public: The String type, e.g. "depository".
|
136
|
+
property :type
|
137
|
+
|
138
|
+
##
|
139
|
+
# :attr_reader:
|
140
|
+
# Public: The String subtype, e.g. "checking".
|
141
|
+
property :subtype
|
142
|
+
end
|
143
|
+
|
144
|
+
# Public: A representation of an account number.
|
145
|
+
class Number < BaseModel
|
146
|
+
##
|
147
|
+
# :attr_reader:
|
148
|
+
# Public: The String account number. E.g. "1111222233330000".
|
149
|
+
property :account
|
150
|
+
|
151
|
+
##
|
152
|
+
# :attr_reader:
|
153
|
+
# Public: The String account ID. E.g.
|
154
|
+
# "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D".
|
155
|
+
property :account_id
|
156
|
+
|
157
|
+
##
|
158
|
+
# :attr_reader:
|
159
|
+
# Public: The String routing number. E.g. "011401533".
|
160
|
+
property :routing
|
161
|
+
|
162
|
+
##
|
163
|
+
# :attr_reader:
|
164
|
+
# Public: The String wire routing number. E.g. "021000021".
|
165
|
+
property :wire_routing
|
166
|
+
end
|
167
|
+
|
168
|
+
# Public: A representation of a transaction category.
|
169
|
+
class Category < BaseModel
|
170
|
+
##
|
171
|
+
# :attr_reader:
|
172
|
+
# Public: The String category ID. E.g. "10000000".
|
173
|
+
property :category_id
|
174
|
+
|
175
|
+
##
|
176
|
+
# :attr_reader:
|
177
|
+
# Public: The Array of Strings category hierarchy.
|
178
|
+
# E.g. ["Recreation", "Arts & Entertainment", "Circuses and Carnivals"].
|
179
|
+
property :hierarchy
|
180
|
+
|
181
|
+
##
|
182
|
+
# :attr_reader:
|
183
|
+
# Public: The String category group. E.g. "place".
|
184
|
+
property :group
|
185
|
+
end
|
186
|
+
|
187
|
+
# Public: A representation of a single Credit Details APR.
|
188
|
+
class CreditDetailsAPR < BaseModel
|
189
|
+
##
|
190
|
+
# :attr_reader:
|
191
|
+
# Public: The Numeric APR (e.g. 0.125).
|
192
|
+
property :apr
|
193
|
+
|
194
|
+
##
|
195
|
+
# :attr_reader:
|
196
|
+
# Public: The Numeric balance subject to APR (e.g. 1200).
|
197
|
+
property :balance_subject_to_apr
|
198
|
+
|
199
|
+
##
|
200
|
+
# :attr_reader:
|
201
|
+
# Public: The Numeric interest charge amount (e.g. 150).
|
202
|
+
property :interest_charge_amount
|
203
|
+
end
|
204
|
+
|
205
|
+
# Public: A representation of Credit Details APRs data.
|
206
|
+
class CreditDetailsAPRs < BaseModel
|
207
|
+
##
|
208
|
+
# :attr_reader:
|
209
|
+
# Public: Balance transfers APR
|
210
|
+
property :balance_transfers, coerce: CreditDetailsAPR
|
211
|
+
|
212
|
+
##
|
213
|
+
# :attr_reader:
|
214
|
+
# Public: Cash advances APR
|
215
|
+
property :cash_advances, coerce: CreditDetailsAPR
|
216
|
+
|
217
|
+
##
|
218
|
+
# :attr_reader:
|
219
|
+
# Public: Purchases APR
|
220
|
+
property :purchases, coerce: CreditDetailsAPR
|
221
|
+
end
|
222
|
+
|
223
|
+
# Public: A representation of Credit Details data.
|
224
|
+
class CreditDetails < BaseModel
|
225
|
+
##
|
226
|
+
# :attr_reader:
|
227
|
+
# Public: The String account ID. E.g.
|
228
|
+
# "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D".
|
229
|
+
property :account_id
|
230
|
+
|
231
|
+
##
|
232
|
+
# :attr_reader:
|
233
|
+
# Public: The APRs.
|
234
|
+
property :aprs, coerce: CreditDetailsAPRs
|
235
|
+
|
236
|
+
##
|
237
|
+
# :attr_reader:
|
238
|
+
# Public: The Numeric last payment amount (e.g. 875).
|
239
|
+
property :last_payment_amount
|
240
|
+
|
241
|
+
##
|
242
|
+
# :attr_reader:
|
243
|
+
# Public: The String last payment date. E.g. "2016-09-13T00:00:00Z".
|
244
|
+
property :last_payment_date
|
245
|
+
|
246
|
+
##
|
247
|
+
# :attr_reader:
|
248
|
+
# Public: The Numeric last statement balance (e.g. 3450).
|
249
|
+
property :last_statement_balance
|
250
|
+
|
251
|
+
##
|
252
|
+
# :attr_reader:
|
253
|
+
# Public: The String last statement date. E.g. "2016-10-01T00:00:00Z".
|
254
|
+
property :last_statement_date
|
255
|
+
|
256
|
+
##
|
257
|
+
# :attr_reader:
|
258
|
+
# Public: The Numeric minimum payment amount (e.g. 800).
|
259
|
+
property :minimum_payment_amount
|
260
|
+
|
261
|
+
##
|
262
|
+
# :attr_reader:
|
263
|
+
# Public: The String next bill due date. E.g. "2016-10-15T00:00:00Z".
|
264
|
+
property :next_bill_due_date
|
265
|
+
end
|
266
|
+
|
267
|
+
# Public: A representation of Identity address details.
|
268
|
+
class IdentityAddressData < BaseModel
|
269
|
+
##
|
270
|
+
# :attr_reader:
|
271
|
+
# Public: The String street name.
|
272
|
+
property :street
|
273
|
+
|
274
|
+
##
|
275
|
+
# :attr_reader:
|
276
|
+
# Public: The String name.
|
277
|
+
property :city
|
278
|
+
|
279
|
+
##
|
280
|
+
# :attr_reader:
|
281
|
+
# Public: The String state name.
|
282
|
+
property :state
|
283
|
+
|
284
|
+
##
|
285
|
+
# :attr_reader:
|
286
|
+
# Public: The String ZIP code.
|
287
|
+
property :zip
|
288
|
+
end
|
289
|
+
|
290
|
+
# Public: A representation of Identity address data.
|
291
|
+
class IdentityAddress < BaseModel
|
292
|
+
##
|
293
|
+
# :attr_reader:
|
294
|
+
# Public: The Array of String accounts, associated with this address.
|
295
|
+
# E.g. ["Plaid Credit Card 3333"].
|
296
|
+
property :accounts
|
297
|
+
|
298
|
+
##
|
299
|
+
# :attr_reader:
|
300
|
+
# Public: The Boolean primary flag (true if it's the primary address).
|
301
|
+
property :primary
|
302
|
+
|
303
|
+
##
|
304
|
+
# :attr_reader:
|
305
|
+
# Public: The address data.
|
306
|
+
property :data, coerce: IdentityAddressData
|
307
|
+
end
|
308
|
+
|
309
|
+
# Public: A representation of Identity email data.
|
310
|
+
class IdentityEmail < BaseModel
|
311
|
+
##
|
312
|
+
# :attr_reader:
|
313
|
+
# Public: The String data, i.e. the address itself. E.g.
|
314
|
+
# "accountholder0@example.com".
|
315
|
+
property :data
|
316
|
+
|
317
|
+
##
|
318
|
+
# :attr_reader:
|
319
|
+
# Public: The Boolean primary flag.
|
320
|
+
property :primary
|
321
|
+
|
322
|
+
##
|
323
|
+
# :attr_reader:
|
324
|
+
# Public: The String type. E.g. "primary", or "secondary", or "other".
|
325
|
+
property :type
|
326
|
+
end
|
327
|
+
|
328
|
+
# Public: A representation of Identity phone number data.
|
329
|
+
class IdentityPhoneNumber < BaseModel
|
330
|
+
##
|
331
|
+
# :attr_reader:
|
332
|
+
# Public: The String data, i.e. the number itself. E.g.
|
333
|
+
# "4673956022".
|
334
|
+
property :data
|
335
|
+
|
336
|
+
##
|
337
|
+
# :attr_reader:
|
338
|
+
# Public: The Boolean primary flag.
|
339
|
+
property :primary
|
340
|
+
|
341
|
+
##
|
342
|
+
# :attr_reader:
|
343
|
+
# Public: The String type. E.g. "home", or "work", or "mobile1".
|
344
|
+
property :type
|
345
|
+
end
|
346
|
+
|
347
|
+
# Public: A representation of Identity data.
|
348
|
+
class Identity < BaseModel
|
349
|
+
##
|
350
|
+
# :attr_reader:
|
351
|
+
# Public: Addresses: Array of IdentityAddress.
|
352
|
+
property :addresses, coerce: Array[IdentityAddress]
|
353
|
+
|
354
|
+
##
|
355
|
+
# :attr_reader:
|
356
|
+
# Public: Emails: Array of IdentityEmail.
|
357
|
+
property :emails, coerce: Array[IdentityEmail]
|
358
|
+
|
359
|
+
##
|
360
|
+
# :attr_reader:
|
361
|
+
# Public: The Array of String names. E.g. ["John Doe", "Ronald McDonald"].
|
362
|
+
property :names
|
363
|
+
|
364
|
+
##
|
365
|
+
# :attr_reader:
|
366
|
+
# Public: Phone numbers: Array of IdentityPhoneNumber.
|
367
|
+
property :phone_numbers, coerce: Array[IdentityPhoneNumber]
|
368
|
+
end
|
369
|
+
|
370
|
+
# Public: A representation of Income Stream data.
|
371
|
+
class IncomeStream < BaseModel
|
372
|
+
##
|
373
|
+
# :attr_reader:
|
374
|
+
# Public: The Numeric monthly income associated with the income stream.
|
375
|
+
property :monthly_income
|
376
|
+
|
377
|
+
##
|
378
|
+
# :attr_reader:
|
379
|
+
# Public: The Numeric representation of our confidence in the income data
|
380
|
+
# associated with this particular income stream, with 0 being the lowest
|
381
|
+
# confidence and 1 being the highest.
|
382
|
+
property :confidence
|
383
|
+
|
384
|
+
##
|
385
|
+
# :attr_reader:
|
386
|
+
# Public: The Numeric extent of data found for this income stream.
|
387
|
+
property :days
|
388
|
+
|
389
|
+
##
|
390
|
+
# :attr_reader:
|
391
|
+
# Public: The String name of the entity associated with this income
|
392
|
+
# stream.
|
393
|
+
property :name
|
394
|
+
end
|
395
|
+
|
396
|
+
# Public: A representation of Income data.
|
397
|
+
class Income < BaseModel
|
398
|
+
##
|
399
|
+
# :attr_reader:
|
400
|
+
# Public: An Array of IncomeStream with detailed information.
|
401
|
+
property :income_streams, coerce: Array[IncomeStream]
|
402
|
+
|
403
|
+
##
|
404
|
+
# :attr_reader:
|
405
|
+
# Public: The Numeric last year income, i.e. the sum of the Item's
|
406
|
+
# income over the past 365 days. If Plaid has less than 365 days of data
|
407
|
+
# this will be less than a full year's income.
|
408
|
+
property :last_year_income
|
409
|
+
|
410
|
+
##
|
411
|
+
# :attr_reader:
|
412
|
+
# Public: The Numeric last_year_income interpolated to value before
|
413
|
+
# taxes. This is the minimum pre-tax salary that assumes a filing status
|
414
|
+
# of single with zero dependents.
|
415
|
+
property :last_year_income_before_tax
|
416
|
+
|
417
|
+
##
|
418
|
+
# :attr_reader:
|
419
|
+
# Public: The Numeric income extrapolated over a year based on current,
|
420
|
+
# active income streams. Income streams become inactive if they have not
|
421
|
+
# recurred for more than two cycles. For example, if a weekly paycheck
|
422
|
+
# hasn't been seen for the past two weeks, it is no longer active.
|
423
|
+
property :projected_yearly_income
|
424
|
+
|
425
|
+
##
|
426
|
+
# :attr_reader:
|
427
|
+
# Public: The Numeric projected_yearly_income interpolated to value
|
428
|
+
# before taxes. This is the minimum pre-tax salary that assumes a filing
|
429
|
+
# status of single with zero dependents.
|
430
|
+
property :projected_yearly_income_before_tax
|
431
|
+
|
432
|
+
##
|
433
|
+
# :attr_reader:
|
434
|
+
# Public: The Numeric max number of income streams present at the same
|
435
|
+
# time over the past 365 days.
|
436
|
+
property :max_number_of_overlapping_income_streams
|
437
|
+
|
438
|
+
##
|
439
|
+
# :attr_reader:
|
440
|
+
# Public: The Numeric total number of distinct income streams received
|
441
|
+
# over the past 365 days.
|
442
|
+
property :number_of_income_streams
|
443
|
+
end
|
444
|
+
|
445
|
+
# Public: A representation of an institution login credential.
|
446
|
+
class InstitutionCredential < BaseModel
|
447
|
+
##
|
448
|
+
# :attr_reader:
|
449
|
+
# Public: The String label. E.g. "User ID".
|
450
|
+
property :label
|
451
|
+
|
452
|
+
##
|
453
|
+
# :attr_reader:
|
454
|
+
# Public: The String name. E.g. "username".
|
455
|
+
property :name
|
456
|
+
|
457
|
+
##
|
458
|
+
# :attr_reader:
|
459
|
+
# Public: The String type. E.g. "text", or "password".
|
460
|
+
property :type
|
461
|
+
end
|
462
|
+
|
463
|
+
# Public: A representation of Institution.
|
464
|
+
class Institution < BaseModel
|
465
|
+
##
|
466
|
+
# :attr_reader:
|
467
|
+
# Public: The Array of InstitutionCredential, presenting information on
|
468
|
+
# login credentials used for the institution.
|
469
|
+
property :credentials, coerce: Array[InstitutionCredential]
|
470
|
+
|
471
|
+
##
|
472
|
+
# :attr_reader:
|
473
|
+
# Public: The Boolean flag indicating if the institution uses MFA.
|
474
|
+
property :has_mfa
|
475
|
+
|
476
|
+
##
|
477
|
+
# :attr_reader:
|
478
|
+
# Public: The String institution ID (e.g. "ins_109512").
|
479
|
+
property :institution_id
|
480
|
+
|
481
|
+
##
|
482
|
+
# :attr_reader:
|
483
|
+
# Public: The String institution name (e.g. "Houndstooth Bank").
|
484
|
+
property :name
|
485
|
+
|
486
|
+
##
|
487
|
+
# :attr_reader:
|
488
|
+
# Public: The Array of String MFA types.
|
489
|
+
# E.g. ["code", "list", "questions", "selections"].
|
490
|
+
property :mfa
|
491
|
+
|
492
|
+
##
|
493
|
+
# :attr_reader:
|
494
|
+
# Public: The Array of String product names supported by this institution.
|
495
|
+
# E.g. ["auth", "balance", "identity", "transactions"].
|
496
|
+
property :products
|
497
|
+
end
|
498
|
+
|
499
|
+
module MFA
|
500
|
+
# Public: A representation of an MFA device.
|
501
|
+
class Device < BaseModel
|
502
|
+
##
|
503
|
+
# :attr_reader:
|
504
|
+
# Public: The String message related to sending code to the device.
|
505
|
+
property :display_message
|
506
|
+
end
|
507
|
+
|
508
|
+
# Public: A representation of a single element in a device list.
|
509
|
+
class DeviceListElement < BaseModel
|
510
|
+
##
|
511
|
+
# :attr_reader:
|
512
|
+
# Public: The String device ID.
|
513
|
+
property :device_id
|
514
|
+
|
515
|
+
##
|
516
|
+
# :attr_reader:
|
517
|
+
# Public: The String device mask.
|
518
|
+
property :mask
|
519
|
+
|
520
|
+
##
|
521
|
+
# :attr_reader:
|
522
|
+
# Public: The String device type.
|
523
|
+
property :type
|
524
|
+
end
|
525
|
+
|
526
|
+
# Public: A representation of MFA selection.
|
527
|
+
class Selection < BaseModel
|
528
|
+
##
|
529
|
+
# :attr_reader:
|
530
|
+
# Public: The String question.
|
531
|
+
property :question
|
532
|
+
|
533
|
+
##
|
534
|
+
# :attr_reader:
|
535
|
+
# Public: The Array of String answers.
|
536
|
+
property :answers
|
537
|
+
end
|
538
|
+
end
|
539
|
+
|
540
|
+
# Public: A representation of Transaction location.
|
541
|
+
class TransactionLocation < BaseModel
|
542
|
+
##
|
543
|
+
# :attr_reader:
|
544
|
+
# Public: The String address (or nil).
|
545
|
+
property :address
|
546
|
+
|
547
|
+
##
|
548
|
+
# :attr_reader:
|
549
|
+
# Public: The String city name (or nil).
|
550
|
+
property :city
|
551
|
+
|
552
|
+
##
|
553
|
+
# :attr_reader:
|
554
|
+
# Public: The Numeric latitude of the place (or nil).
|
555
|
+
property :lat
|
556
|
+
|
557
|
+
##
|
558
|
+
# :attr_reader:
|
559
|
+
# Public: The Numeric longitude of the place (or nil).
|
560
|
+
property :lon
|
561
|
+
|
562
|
+
##
|
563
|
+
# :attr_reader:
|
564
|
+
# Public: The String state name (or nil).
|
565
|
+
property :state
|
566
|
+
|
567
|
+
##
|
568
|
+
# :attr_reader:
|
569
|
+
# Public: The String store number (or nil).
|
570
|
+
property :store_number
|
571
|
+
|
572
|
+
##
|
573
|
+
# :attr_reader:
|
574
|
+
# Public: The String ZIP code (or nil).
|
575
|
+
property :zip
|
576
|
+
end
|
577
|
+
|
578
|
+
# Public: A representation of Transaction Payment meta information.
|
579
|
+
class TransactionPaymentMeta < BaseModel
|
580
|
+
##
|
581
|
+
# :attr_reader:
|
582
|
+
property :by_order_of
|
583
|
+
##
|
584
|
+
# :attr_reader:
|
585
|
+
property :ppd_id
|
586
|
+
##
|
587
|
+
# :attr_reader:
|
588
|
+
property :payee
|
589
|
+
##
|
590
|
+
# :attr_reader:
|
591
|
+
property :payer
|
592
|
+
##
|
593
|
+
# :attr_reader:
|
594
|
+
property :payment_method
|
595
|
+
##
|
596
|
+
# :attr_reader:
|
597
|
+
property :payment_processor
|
598
|
+
##
|
599
|
+
# :attr_reader:
|
600
|
+
property :reason
|
601
|
+
##
|
602
|
+
# :attr_reader:
|
603
|
+
property :reference_number
|
604
|
+
end
|
605
|
+
|
606
|
+
# Public: A representation of Transaction.
|
607
|
+
class Transaction < BaseModel
|
608
|
+
##
|
609
|
+
# :attr_reader:
|
610
|
+
# Public: The String transaction ID.
|
611
|
+
property :transaction_id
|
612
|
+
|
613
|
+
##
|
614
|
+
# :attr_reader:
|
615
|
+
# Public: The String account ID.
|
616
|
+
property :account_id
|
617
|
+
|
618
|
+
##
|
619
|
+
# :attr_reader:
|
620
|
+
# Public: The String account owner (or nil).
|
621
|
+
property :account_owner
|
622
|
+
|
623
|
+
##
|
624
|
+
# :attr_reader:
|
625
|
+
# Public: The Numeric amount (or nil).
|
626
|
+
property :amount
|
627
|
+
|
628
|
+
##
|
629
|
+
# :attr_reader:
|
630
|
+
# Public: The Array of String category (or nil).
|
631
|
+
# E.g. ["Payment", "Credit Card"].
|
632
|
+
property :category
|
633
|
+
|
634
|
+
##
|
635
|
+
# :attr_reader:
|
636
|
+
# Public: The String category_id (or nil).
|
637
|
+
# E.g. "16001000".
|
638
|
+
property :category_id
|
639
|
+
|
640
|
+
##
|
641
|
+
# :attr_reader:
|
642
|
+
# Public: The String transaction date. E.g. "2017-01-01".
|
643
|
+
property :date
|
644
|
+
|
645
|
+
##
|
646
|
+
# :attr_reader:
|
647
|
+
# Public: The location where transaction occurred (TransactionLocation).
|
648
|
+
property :location, coerce: TransactionLocation
|
649
|
+
|
650
|
+
##
|
651
|
+
# :attr_reader:
|
652
|
+
# Public: The String transaction name (or nil).
|
653
|
+
# E.g. "CREDIT CARD 3333 PAYMENT *//".
|
654
|
+
property :name
|
655
|
+
|
656
|
+
##
|
657
|
+
# :attr_reader:
|
658
|
+
# Public: The String original description (or nil).
|
659
|
+
property :original_description
|
660
|
+
|
661
|
+
##
|
662
|
+
# :attr_reader:
|
663
|
+
# Public: The payment meta information (TransactionPaymentMeta).
|
664
|
+
property :payment_meta, coerce: TransactionPaymentMeta
|
665
|
+
|
666
|
+
##
|
667
|
+
# :attr_reader:
|
668
|
+
# Public: The Boolean pending flag (or nil).
|
669
|
+
property :pending
|
670
|
+
|
671
|
+
##
|
672
|
+
# :attr_reader:
|
673
|
+
# Public: The String pending transaction ID (or nil).
|
674
|
+
property :pending_transaction_id
|
675
|
+
|
676
|
+
##
|
677
|
+
# :attr_reader:
|
678
|
+
# Public: The String transaction type (or nil). E.g. "special", or
|
679
|
+
# "place".
|
680
|
+
property :transaction_type
|
681
|
+
end
|
682
|
+
end
|
683
|
+
end
|