Class: ThePlaidApi::BankTransfer
- Defined in:
- lib/the_plaid_api/models/bank_transfer.rb
Overview
Represents a bank transfer within the Bank Transfers API.
Instance Attribute Summary collapse
-
#account_id ⇒ String
The account ID that should be credited/debited for this bank transfer.
-
#ach_class ⇒ AchClass
Specifies the use case of the transfer.
-
#amount ⇒ String
The amount of the bank transfer (decimal string with two digits of precision e.g. “10.00”).
-
#cancellable ⇒ TrueClass | FalseClass
When ‘true`, you can still cancel this bank transfer.
-
#created ⇒ DateTime
The datetime when this bank transfer was created.
-
#custom_tag ⇒ String
A string containing the custom tag provided by the client in the create request.
-
#description ⇒ String
The description of the transfer.
-
#direction ⇒ BankTransferDirection
Indicates the direction of the transfer: ‘outbound` for API-initiated transfers, or `inbound` for payments received by the FBO account.
-
#failure_reason ⇒ BankTransferFailure
The failure reason if the type of this transfer is ‘“failed”` or `“reversed”`.
-
#id ⇒ String
Plaid’s unique identifier for a bank transfer.
-
#iso_currency_code ⇒ String
The currency of the transfer amount, e.g.
-
#metadata ⇒ Hash[String, String]
The Metadata object is a mapping of client-provided string fields to any string value.
-
#network ⇒ BankTransferNetwork
The network or rails used for the transfer.
-
#origination_account_id ⇒ String
Plaid’s unique identifier for the origination account that was used for this transfer.
-
#status ⇒ BankTransferStatus
The status of the transfer.
-
#type ⇒ BankTransferType
The type of bank transfer.
-
#user ⇒ BankTransferUser
The legal name and other information for the account holder.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(id:, ach_class:, account_id:, type:, user:, amount:, iso_currency_code:, description:, created:, status:, network:, cancellable:, failure_reason:, custom_tag:, metadata:, origination_account_id:, direction:, additional_properties: nil) ⇒ BankTransfer
constructor
A new instance of BankTransfer.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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:, ach_class:, account_id:, type:, user:, amount:, iso_currency_code:, description:, created:, status:, network:, cancellable:, failure_reason:, custom_tag:, metadata:, origination_account_id:, direction:, additional_properties: nil) ⇒ BankTransfer
Returns a new instance of BankTransfer.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 151 def initialize(id:, ach_class:, account_id:, type:, user:, amount:, iso_currency_code:, description:, created:, status:, network:, cancellable:, failure_reason:, custom_tag:, metadata:, origination_account_id:, direction:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @ach_class = ach_class @account_id = account_id @type = type @user = user @amount = amount @iso_currency_code = iso_currency_code @description = description @created = created @status = status @network = network @cancellable = cancellable @failure_reason = failure_reason @custom_tag = custom_tag @metadata = @origination_account_id = origination_account_id @direction = direction @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
The account ID that should be credited/debited for this bank transfer.
40 41 42 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 40 def account_id @account_id end |
#ach_class ⇒ AchClass
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.
36 37 38 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 36 def ach_class @ach_class end |
#amount ⇒ String
The amount of the bank transfer (decimal string with two digits of precision e.g. “10.00”).
55 56 57 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 55 def amount @amount end |
#cancellable ⇒ TrueClass | FalseClass
When ‘true`, you can still cancel this bank transfer.
81 82 83 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 81 def cancellable @cancellable end |
#created ⇒ DateTime
The datetime when this bank transfer was created. This will be of the form ‘2006-01-02T15:04:05Z`
68 69 70 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 68 def created @created end |
#custom_tag ⇒ String
A string containing the custom tag provided by the client in the create request. Will be null if not provided.
91 92 93 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 91 def custom_tag @custom_tag end |
#description ⇒ String
The description of the transfer.
63 64 65 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 63 def description @description end |
#direction ⇒ BankTransferDirection
Indicates the direction of the transfer: ‘outbound` for API-initiated transfers, or `inbound` for payments received by the FBO account.
111 112 113 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 111 def direction @direction end |
#failure_reason ⇒ BankTransferFailure
The failure reason if the type of this transfer is ‘“failed”` or `“reversed”`. Null value otherwise.
86 87 88 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 86 def failure_reason @failure_reason end |
#id ⇒ String
Plaid’s unique identifier for a bank transfer.
15 16 17 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 15 def id @id end |
#iso_currency_code ⇒ String
The currency of the transfer amount, e.g. “USD”
59 60 61 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 59 def iso_currency_code @iso_currency_code end |
#metadata ⇒ Hash[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
101 102 103 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 101 def @metadata end |
#network ⇒ BankTransferNetwork
The network or rails used for the transfer. Valid options are ‘ach`, `same-day-ach`, or `wire`.
77 78 79 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 77 def network @network end |
#origination_account_id ⇒ String
Plaid’s unique identifier for the origination account that was used for this transfer.
106 107 108 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 106 def origination_account_id @origination_account_id end |
#status ⇒ BankTransferStatus
The status of the transfer.
72 73 74 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 72 def status @status end |
#type ⇒ BankTransferType
The type of bank 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.
46 47 48 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 46 def type @type end |
#user ⇒ BankTransferUser
The legal name and other information for the account holder.
50 51 52 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 50 def user @user end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 180 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil ach_class = hash.key?('ach_class') ? hash['ach_class'] : nil account_id = hash.key?('account_id') ? hash['account_id'] : nil type = hash.key?('type') ? hash['type'] : nil user = BankTransferUser.from_hash(hash['user']) if hash['user'] amount = hash.key?('amount') ? hash['amount'] : nil iso_currency_code = hash.key?('iso_currency_code') ? hash['iso_currency_code'] : nil description = hash.key?('description') ? hash['description'] : nil created = if hash.key?('created') (DateTimeHelper.from_rfc3339(hash['created']) if hash['created']) end status = hash.key?('status') ? hash['status'] : nil network = hash.key?('network') ? hash['network'] : nil cancellable = hash.key?('cancellable') ? hash['cancellable'] : nil failure_reason = BankTransferFailure.from_hash(hash['failure_reason']) if hash['failure_reason'] custom_tag = hash.key?('custom_tag') ? hash['custom_tag'] : nil = hash.key?('metadata') ? hash['metadata'] : nil origination_account_id = hash.key?('origination_account_id') ? hash['origination_account_id'] : nil direction = hash.key?('direction') ? hash['direction'] : nil # 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. BankTransfer.new(id: id, ach_class: ach_class, account_id: account_id, type: type, user: user, amount: amount, iso_currency_code: iso_currency_code, description: description, created: created, status: status, network: network, cancellable: cancellable, failure_reason: failure_reason, custom_tag: custom_tag, metadata: , origination_account_id: origination_account_id, direction: direction, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 114 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['ach_class'] = 'ach_class' @_hash['account_id'] = 'account_id' @_hash['type'] = 'type' @_hash['user'] = 'user' @_hash['amount'] = 'amount' @_hash['iso_currency_code'] = 'iso_currency_code' @_hash['description'] = 'description' @_hash['created'] = 'created' @_hash['status'] = 'status' @_hash['network'] = 'network' @_hash['cancellable'] = 'cancellable' @_hash['failure_reason'] = 'failure_reason' @_hash['custom_tag'] = 'custom_tag' @_hash['metadata'] = 'metadata' @_hash['origination_account_id'] = 'origination_account_id' @_hash['direction'] = 'direction' @_hash end |
.nullables ⇒ Object
An array for nullable fields
142 143 144 145 146 147 148 149 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 142 def self.nullables %w[ failure_reason custom_tag metadata direction ] end |
.optionals ⇒ Object
An array for optional fields
137 138 139 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 137 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 252 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, ach_class: #{@ach_class.inspect}, account_id:"\ " #{@account_id.inspect}, type: #{@type.inspect}, user: #{@user.inspect}, amount:"\ " #{@amount.inspect}, iso_currency_code: #{@iso_currency_code.inspect}, description:"\ " #{@description.inspect}, created: #{@created.inspect}, status: #{@status.inspect},"\ " network: #{@network.inspect}, cancellable: #{@cancellable.inspect}, failure_reason:"\ " #{@failure_reason.inspect}, custom_tag: #{@custom_tag.inspect}, metadata:"\ " #{@metadata.inspect}, origination_account_id: #{@origination_account_id.inspect},"\ " direction: #{@direction.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_created ⇒ Object
235 236 237 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 235 def to_custom_created DateTimeHelper.to_rfc3339(created) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
240 241 242 243 244 245 246 247 248 249 |
# File 'lib/the_plaid_api/models/bank_transfer.rb', line 240 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, ach_class: #{@ach_class}, account_id: #{@account_id}, type:"\ " #{@type}, user: #{@user}, amount: #{@amount}, iso_currency_code: #{@iso_currency_code},"\ " description: #{@description}, created: #{@created}, status: #{@status}, network:"\ " #{@network}, cancellable: #{@cancellable}, failure_reason: #{@failure_reason}, custom_tag:"\ " #{@custom_tag}, metadata: #{@metadata}, origination_account_id:"\ " #{@origination_account_id}, direction: #{@direction}, additional_properties:"\ " #{@additional_properties}>" end |