Class: ThePlaidApi::TransferIntentGet

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/transfer_intent_get.rb

Overview

Represents a transfer intent within Transfer UI.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(id:, created:, status:, transfer_id:, failure_reason:, authorization_decision:, authorization_decision_rationale:, origination_account_id:, funding_account_id:, amount:, mode:, user:, description:, iso_currency_code:, guarantee_decision:, guarantee_decision_rationale:, account_id: SKIP, network: TransferIntentCreateNetwork::SAMEDAYACH, ach_class: SKIP, metadata: SKIP, require_guarantee: SKIP, additional_properties: nil) ⇒ TransferIntentGet

Returns a new instance of TransferIntentGet.



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 222

def initialize(id:, created:, status:, transfer_id:, failure_reason:,
               authorization_decision:, authorization_decision_rationale:,
               origination_account_id:, funding_account_id:, amount:, mode:,
               user:, description:, iso_currency_code:, guarantee_decision:,
               guarantee_decision_rationale:, account_id: SKIP,
               network: TransferIntentCreateNetwork::SAMEDAYACH,
               ach_class: SKIP, metadata: SKIP, require_guarantee: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @created = created
  @status = status
  @transfer_id = transfer_id
  @failure_reason = failure_reason
  @authorization_decision = authorization_decision
  @authorization_decision_rationale = authorization_decision_rationale
  @account_id =  unless  == SKIP
  @origination_account_id = 
  @funding_account_id = 
  @amount = amount
  @mode = mode
  @network = network unless network == SKIP
  @ach_class = ach_class unless ach_class == SKIP
  @user = user
  @description = description
  @metadata =  unless  == SKIP
  @iso_currency_code = iso_currency_code
  @require_guarantee = require_guarantee unless require_guarantee == SKIP
  @guarantee_decision = guarantee_decision
  @guarantee_decision_rationale = guarantee_decision_rationale
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

The Plaid ‘account_id` for the account that will be debited or credited. Returned only if `account_id` was set on intent creation.

Returns:

  • (String)


62
63
64
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 62

def 
  @account_id
end

#ach_classAchClass

Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). Codes supported for credits: ‘ccd`, `ppd` Codes supported for debits: `ccd`, `tel`, `web` `“ccd”` - Corporate Credit or Debit - fund transfer between two corporate bank accounts `“ppd”` - Prearranged Payment or Deposit - The transfer is part of a pre-existing relationship with a consumer. Authorization was obtained in writing either in person or via an electronic document signing, e.g. Docusign, by the consumer. Can be used for credits or debits. `“web”` - Internet-Initiated Entry. The transfer debits a consumer’s bank account. Authorization from the consumer is obtained over the Internet (e.g. a web or mobile application). Can be used for single debits or recurring debits. `“tel”` - Telephone-Initiated Entry. The transfer debits a consumer. Debit authorization has been received orally over the telephone via a recorded call.

Returns:



128
129
130
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 128

def ach_class
  @ach_class
end

#amountString

The amount of the transfer (decimal string with two digits of precision e.g. “10.00”). When calling ‘/transfer/authorization/create`, specify the maximum amount to authorize. When calling `/transfer/create`, specify the exact amount of the transfer, up to a maximum of the amount authorized. If this field is left blank when calling `/transfer/create`, the maximum amount authorized in the `authorization_id` will be sent.

Returns:

  • (String)


82
83
84
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 82

def amount
  @amount
end

#authorization_decisionTransferIntentAuthorizationDecision

A decision regarding the proposed transfer. ‘APPROVED` – The proposed transfer has received the end user’s consent and has been approved for processing by Plaid. The ‘decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended (i.e., use Link in update mode to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). Refer to the `code` field in the `decision_rationale` object for details. `DECLINED` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details.



51
52
53
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 51

def authorization_decision
  @authorization_decision
end

#authorization_decision_rationaleTransferAuthorizationDecisionRationale

The rationale for Plaid’s decision regarding a proposed transfer. It is always set for ‘declined` decisions, and may or may not be null for `approved` decisions.



57
58
59
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 57

def authorization_decision_rationale
  @authorization_decision_rationale
end

#createdDateTime

The datetime the transfer was created. This will be of the form ‘2006-01-02T15:04:05Z`.

Returns:

  • (DateTime)


20
21
22
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 20

def created
  @created
end

#descriptionString

A description for the underlying transfer. Maximum of 8 characters.

Returns:

  • (String)


136
137
138
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 136

def description
  @description
end

#failure_reasonTransferIntentGetFailureReason

The reason for a failed transfer intent. Returned only if the transfer intent status is ‘failed`. Null otherwise.



38
39
40
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 38

def failure_reason
  @failure_reason
end

#funding_account_idString

The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited.

Returns:

  • (String)


73
74
75
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 73

def 
  @funding_account_id
end

#guarantee_decisionTransferAuthorizationGuaranteeDecision

Indicates whether the transfer is guaranteed by Plaid (Guarantee customers only). This field will contain either ‘GUARANTEED` or `NOT_GUARANTEED` indicating whether Plaid will guarantee the transfer.



161
162
163
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 161

def guarantee_decision
  @guarantee_decision
end

#guarantee_decision_rationaleTransferAuthorizationGuaranteeDecisionRationale

The rationale for Plaid’s decision to not guarantee a transfer. Will be ‘null` unless `guarantee_decision` is `NOT_GUARANTEED`.



166
167
168
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 166

def guarantee_decision_rationale
  @guarantee_decision_rationale
end

#idString

Plaid’s unique identifier for a transfer intent object.

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 15

def id
  @id
end

#iso_currency_codeString

The currency of the transfer amount, e.g. “USD”

Returns:

  • (String)


150
151
152
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 150

def iso_currency_code
  @iso_currency_code
end

#metadataHash[String, String]

The Metadata object is a mapping of client-provided string fields to any string value. The following limitations apply: The JSON values must be Strings (no nested JSON objects allowed) Only ASCII characters may be used Maximum of 50 key/value pairs Maximum key length of 40 characters Maximum value length of 500 characters

Returns:

  • (Hash[String, String])


146
147
148
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 146

def 
  @metadata
end

#modeTransferIntentCreateMode

The direction of the flow of transfer funds. ‘PAYMENT`: Transfers funds from an end user’s account to your business account. ‘DISBURSEMENT`: Transfers funds from your business account to an end user’s account.



90
91
92
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 90

def mode
  @mode
end

#networkTransferIntentCreateNetwork

The network or rails used for the transfer. Defaults to ‘same-day-ach`. For transfers submitted using `ach`, the Standard ACH cutoff is 8:30 PM Eastern Time. For transfers submitted using `same-day-ach`, the Same Day ACH cutoff is 3:00 PM Eastern Time. It is recommended to send the request 15 minutes prior to the cutoff to ensure that it will be processed in time for submission before the cutoff. If the transfer is processed after this cutoff but before the Standard ACH cutoff, it will be sent over Standard ACH rails and will not incur same-day charges. For transfers submitted using `rtp`, in the case that the account being credited does not support RTP, the transfer will be sent over ACH as long as an `ach_class` is provided in the request. If RTP isn’t supported by the account and no ‘ach_class` is provided, the transfer will fail to be submitted.



107
108
109
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 107

def network
  @network
end

#origination_account_idString

Plaid’s unique identifier for the origination account used for the transfer.

Returns:

  • (String)


67
68
69
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 67

def 
  @origination_account_id
end

#require_guaranteeTrueClass | FalseClass

When ‘true`, the transfer requires a `GUARANTEED` decision by Plaid to proceed (Guarantee customers only).

Returns:

  • (TrueClass | FalseClass)


155
156
157
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 155

def require_guarantee
  @require_guarantee
end

#statusTransferIntentStatus

The status of the transfer intent. ‘PENDING`: The transfer intent is pending. `SUCCEEDED`: The transfer intent was successfully created. `FAILED`: The transfer intent was unable to be created.



27
28
29
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 27

def status
  @status
end

#transfer_idString

Plaid’s unique identifier for the transfer created through the UI. Returned only if the transfer was successfully created. Null value otherwise.

Returns:

  • (String)


33
34
35
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 33

def transfer_id
  @transfer_id
end

#userTransferUserInResponse

The legal name and other information for the account holder.



132
133
134
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 132

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 258

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  created = if hash.key?('created')
              (DateTimeHelper.from_rfc3339(hash['created']) if hash['created'])
            end
  status = hash.key?('status') ? hash['status'] : nil
  transfer_id = hash.key?('transfer_id') ? hash['transfer_id'] : nil
  failure_reason = TransferIntentGetFailureReason.from_hash(hash['failure_reason']) if
    hash['failure_reason']
  authorization_decision =
    hash.key?('authorization_decision') ? hash['authorization_decision'] : nil
  if hash['authorization_decision_rationale']
    authorization_decision_rationale = TransferAuthorizationDecisionRationale.from_hash(hash['authorization_decision_rationale'])
  end
   =
    hash.key?('origination_account_id') ? hash['origination_account_id'] : nil
   =
    hash.key?('funding_account_id') ? hash['funding_account_id'] : nil
  amount = hash.key?('amount') ? hash['amount'] : nil
  mode = hash.key?('mode') ? hash['mode'] : nil
  user = TransferUserInResponse.from_hash(hash['user']) if hash['user']
  description = hash.key?('description') ? hash['description'] : nil
  iso_currency_code =
    hash.key?('iso_currency_code') ? hash['iso_currency_code'] : nil
  guarantee_decision =
    hash.key?('guarantee_decision') ? hash['guarantee_decision'] : nil
  if hash['guarantee_decision_rationale']
    guarantee_decision_rationale = TransferAuthorizationGuaranteeDecisionRationale.from_hash(hash['guarantee_decision_rationale'])
  end
   = hash.key?('account_id') ? hash['account_id'] : SKIP
  network = hash['network'] ||= TransferIntentCreateNetwork::SAMEDAYACH
  ach_class = hash.key?('ach_class') ? hash['ach_class'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP
  require_guarantee =
    hash.key?('require_guarantee') ? hash['require_guarantee'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  TransferIntentGet.new(id: id,
                        created: created,
                        status: status,
                        transfer_id: transfer_id,
                        failure_reason: failure_reason,
                        authorization_decision: authorization_decision,
                        authorization_decision_rationale: authorization_decision_rationale,
                        origination_account_id: ,
                        funding_account_id: ,
                        amount: amount,
                        mode: mode,
                        user: user,
                        description: description,
                        iso_currency_code: iso_currency_code,
                        guarantee_decision: guarantee_decision,
                        guarantee_decision_rationale: guarantee_decision_rationale,
                        account_id: ,
                        network: network,
                        ach_class: ach_class,
                        metadata: ,
                        require_guarantee: require_guarantee,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 169

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['created'] = 'created'
  @_hash['status'] = 'status'
  @_hash['transfer_id'] = 'transfer_id'
  @_hash['failure_reason'] = 'failure_reason'
  @_hash['authorization_decision'] = 'authorization_decision'
  @_hash['authorization_decision_rationale'] =
    'authorization_decision_rationale'
  @_hash['account_id'] = 'account_id'
  @_hash['origination_account_id'] = 'origination_account_id'
  @_hash['funding_account_id'] = 'funding_account_id'
  @_hash['amount'] = 'amount'
  @_hash['mode'] = 'mode'
  @_hash['network'] = 'network'
  @_hash['ach_class'] = 'ach_class'
  @_hash['user'] = 'user'
  @_hash['description'] = 'description'
  @_hash['metadata'] = 'metadata'
  @_hash['iso_currency_code'] = 'iso_currency_code'
  @_hash['require_guarantee'] = 'require_guarantee'
  @_hash['guarantee_decision'] = 'guarantee_decision'
  @_hash['guarantee_decision_rationale'] = 'guarantee_decision_rationale'
  @_hash
end

.nullablesObject

An array for nullable fields



208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 208

def self.nullables
  %w[
    transfer_id
    failure_reason
    authorization_decision
    authorization_decision_rationale
    account_id
    metadata
    require_guarantee
    guarantee_decision
    guarantee_decision_rationale
  ]
end

.optionalsObject

An array for optional fields



197
198
199
200
201
202
203
204
205
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 197

def self.optionals
  %w[
    account_id
    network
    ach_class
    metadata
    require_guarantee
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 349

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, created: #{@created.inspect}, status:"\
  " #{@status.inspect}, transfer_id: #{@transfer_id.inspect}, failure_reason:"\
  " #{@failure_reason.inspect}, authorization_decision: #{@authorization_decision.inspect},"\
  " authorization_decision_rationale: #{@authorization_decision_rationale.inspect},"\
  " account_id: #{@account_id.inspect}, origination_account_id:"\
  " #{@origination_account_id.inspect}, funding_account_id: #{@funding_account_id.inspect},"\
  " amount: #{@amount.inspect}, mode: #{@mode.inspect}, network: #{@network.inspect},"\
  " ach_class: #{@ach_class.inspect}, user: #{@user.inspect}, description:"\
  " #{@description.inspect}, metadata: #{@metadata.inspect}, iso_currency_code:"\
  " #{@iso_currency_code.inspect}, require_guarantee: #{@require_guarantee.inspect},"\
  " guarantee_decision: #{@guarantee_decision.inspect}, guarantee_decision_rationale:"\
  " #{@guarantee_decision_rationale.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_createdObject



329
330
331
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 329

def to_custom_created
  DateTimeHelper.to_rfc3339(created)
end

#to_sObject

Provides a human-readable string representation of the object.



334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/the_plaid_api/models/transfer_intent_get.rb', line 334

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, created: #{@created}, status: #{@status}, transfer_id:"\
  " #{@transfer_id}, failure_reason: #{@failure_reason}, authorization_decision:"\
  " #{@authorization_decision}, authorization_decision_rationale:"\
  " #{@authorization_decision_rationale}, account_id: #{@account_id}, origination_account_id:"\
  " #{@origination_account_id}, funding_account_id: #{@funding_account_id}, amount:"\
  " #{@amount}, mode: #{@mode}, network: #{@network}, ach_class: #{@ach_class}, user:"\
  " #{@user}, description: #{@description}, metadata: #{@metadata}, iso_currency_code:"\
  " #{@iso_currency_code}, require_guarantee: #{@require_guarantee}, guarantee_decision:"\
  " #{@guarantee_decision}, guarantee_decision_rationale: #{@guarantee_decision_rationale},"\
  " additional_properties: #{@additional_properties}>"
end