Class: ThePlaidApi::TransferAuthorizationProposedTransfer

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

Overview

Details regarding the proposed transfer.

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(funding_account_id:, type:, user:, amount:, network:, origination_account_id:, iso_currency_code:, originator_client_id:, credit_funds_source:, ach_class: SKIP, account_id: SKIP, ledger_id: SKIP, wire_details: SKIP, additional_properties: nil) ⇒ TransferAuthorizationProposedTransfer

Returns a new instance of TransferAuthorizationProposedTransfer.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 137

def initialize(funding_account_id:, type:, user:, amount:, network:,
               origination_account_id:, iso_currency_code:,
               originator_client_id:, credit_funds_source:, ach_class: SKIP,
               account_id: SKIP, ledger_id: SKIP, wire_details: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @ach_class = ach_class unless ach_class == SKIP
  @account_id =  unless  == SKIP
  @funding_account_id = 
  @ledger_id = ledger_id unless ledger_id == SKIP
  @type = type
  @user = user
  @amount = amount
  @network = network
  @wire_details = wire_details unless wire_details == SKIP
  @origination_account_id = 
  @iso_currency_code = iso_currency_code
  @originator_client_id = originator_client_id
  @credit_funds_source = credit_funds_source
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

The Plaid ‘account_id` for the account that will be debited or credited.

Returns:

  • (String)


35
36
37
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 35

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:



31
32
33
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 31

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)


64
65
66
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 64

def amount
  @amount
end

#credit_funds_sourceTransferCreditFundsSource

The Plaid client ID that is the originator of this transfer. Only present if created on behalf of another client as a [Platform customer](plaid.com/docs/transfer/application/#originators-vs-plat forms).



95
96
97
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 95

def credit_funds_source
  @credit_funds_source
end

#funding_account_idString

The id of the associated funding account, available in the Plaid Dashboard. If present, this indicates which of your business checking accounts will be credited or debited.

Returns:

  • (String)


41
42
43
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 41

def 
  @funding_account_id
end

#iso_currency_codeString

The currency of the transfer amount. The default value is “USD”.

Returns:

  • (String)


81
82
83
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 81

def iso_currency_code
  @iso_currency_code
end

#ledger_idString

Plaid’s unique identifier for a Plaid Ledger Balance.

Returns:

  • (String)


45
46
47
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 45

def ledger_id
  @ledger_id
end

#networkString

The network or rails used for the transfer.

Returns:

  • (String)


68
69
70
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 68

def network
  @network
end

#origination_account_idString

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

Returns:

  • (String)


77
78
79
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 77

def 
  @origination_account_id
end

#originator_client_idString

The Plaid client ID that is the originator of this transfer. Only present if created on behalf of another client as a [Platform customer](plaid.com/docs/transfer/application/#originators-vs-plat forms).

Returns:

  • (String)


88
89
90
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 88

def originator_client_id
  @originator_client_id
end

#typeTransferType1

The type of transfer. This will be either ‘debit` or `credit`. A `debit` indicates a transfer of money into the origination account; a `credit` indicates a transfer of money out of the origination account.

Returns:



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

def type
  @type
end

#userTransferUserInResponse

The legal name and other information for the account holder.



55
56
57
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 55

def user
  @user
end

#wire_detailsTransferWireDetails

Information specific to wire transfers.

Returns:



72
73
74
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 72

def wire_details
  @wire_details
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



162
163
164
165
166
167
168
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
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 162

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   =
    hash.key?('funding_account_id') ? hash['funding_account_id'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  user = TransferUserInResponse.from_hash(hash['user']) if hash['user']
  amount = hash.key?('amount') ? hash['amount'] : nil
  network = hash.key?('network') ? hash['network'] : nil
   =
    hash.key?('origination_account_id') ? hash['origination_account_id'] : nil
  iso_currency_code =
    hash.key?('iso_currency_code') ? hash['iso_currency_code'] : nil
  originator_client_id =
    hash.key?('originator_client_id') ? hash['originator_client_id'] : nil
  credit_funds_source =
    hash.key?('credit_funds_source') ? hash['credit_funds_source'] : nil
  ach_class = hash.key?('ach_class') ? hash['ach_class'] : SKIP
   = hash.key?('account_id') ? hash['account_id'] : SKIP
  ledger_id = hash.key?('ledger_id') ? hash['ledger_id'] : SKIP
  wire_details = TransferWireDetails.from_hash(hash['wire_details']) if hash['wire_details']

  # 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.
  TransferAuthorizationProposedTransfer.new(funding_account_id: ,
                                            type: type,
                                            user: user,
                                            amount: amount,
                                            network: network,
                                            origination_account_id: ,
                                            iso_currency_code: iso_currency_code,
                                            originator_client_id: originator_client_id,
                                            credit_funds_source: credit_funds_source,
                                            ach_class: ach_class,
                                            account_id: ,
                                            ledger_id: ledger_id,
                                            wire_details: wire_details,
                                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 98

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ach_class'] = 'ach_class'
  @_hash['account_id'] = 'account_id'
  @_hash['funding_account_id'] = 'funding_account_id'
  @_hash['ledger_id'] = 'ledger_id'
  @_hash['type'] = 'type'
  @_hash['user'] = 'user'
  @_hash['amount'] = 'amount'
  @_hash['network'] = 'network'
  @_hash['wire_details'] = 'wire_details'
  @_hash['origination_account_id'] = 'origination_account_id'
  @_hash['iso_currency_code'] = 'iso_currency_code'
  @_hash['originator_client_id'] = 'originator_client_id'
  @_hash['credit_funds_source'] = 'credit_funds_source'
  @_hash
end

.nullablesObject

An array for nullable fields



127
128
129
130
131
132
133
134
135
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 127

def self.nullables
  %w[
    funding_account_id
    ledger_id
    wire_details
    originator_client_id
    credit_funds_source
  ]
end

.optionalsObject

An array for optional fields



117
118
119
120
121
122
123
124
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 117

def self.optionals
  %w[
    ach_class
    account_id
    ledger_id
    wire_details
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



221
222
223
224
225
226
227
228
229
230
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 221

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ach_class: #{@ach_class.inspect}, account_id: #{@account_id.inspect},"\
  " funding_account_id: #{@funding_account_id.inspect}, ledger_id: #{@ledger_id.inspect},"\
  " type: #{@type.inspect}, user: #{@user.inspect}, amount: #{@amount.inspect}, network:"\
  " #{@network.inspect}, wire_details: #{@wire_details.inspect}, origination_account_id:"\
  " #{@origination_account_id.inspect}, iso_currency_code: #{@iso_currency_code.inspect},"\
  " originator_client_id: #{@originator_client_id.inspect}, credit_funds_source:"\
  " #{@credit_funds_source.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



210
211
212
213
214
215
216
217
218
# File 'lib/the_plaid_api/models/transfer_authorization_proposed_transfer.rb', line 210

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ach_class: #{@ach_class}, account_id: #{@account_id}, funding_account_id:"\
  " #{@funding_account_id}, ledger_id: #{@ledger_id}, type: #{@type}, user: #{@user}, amount:"\
  " #{@amount}, network: #{@network}, wire_details: #{@wire_details}, origination_account_id:"\
  " #{@origination_account_id}, iso_currency_code: #{@iso_currency_code},"\
  " originator_client_id: #{@originator_client_id}, credit_funds_source:"\
  " #{@credit_funds_source}, additional_properties: #{@additional_properties}>"
end