Class: Plaid::TransferCreateRequest
- Defined in:
- lib/plaid/models/transfer_create_request.rb
Overview
Defines the request schema for ‘/transfer/create`
Instance Attribute Summary collapse
-
#access_token ⇒ String
The Plaid ‘access_token` for the account that will be debited or credited.
-
#account_id ⇒ String
The Plaid ‘account_id` for the account that will be debited or credited.
-
#ach_class ⇒ AchClass
Specifies the use case of the transfer.
-
#amount ⇒ String
The amount of the transfer (decimal string with two digits of precision e.g. “10.00”).
-
#authorization_id ⇒ String
Plaid’s unique identifier for a transfer authorization.
-
#client_id ⇒ String
Your Plaid API ‘client_id`.
-
#description ⇒ String
The transfer description.
-
#idempotency_key ⇒ String
A random key provided by the client, per unique transfer.
-
#metadata ⇒ Hash[String, String]
The Metadata object is a mapping of client-provided string fields to any string value.
-
#network ⇒ TransferNetwork
The network or rails used for the transfer.
-
#origination_account_id ⇒ String
Plaid’s unique identifier for the origination account for this transfer.
-
#secret ⇒ String
Your Plaid API ‘secret`.
-
#type ⇒ TransferType1
The type of transfer.
-
#user ⇒ TransferUserInRequest
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(idempotency_key:, access_token:, account_id:, authorization_id:, type:, network:, amount:, description:, ach_class:, user:, client_id: SKIP, secret: SKIP, metadata: SKIP, origination_account_id: SKIP, additional_properties: nil) ⇒ TransferCreateRequest
constructor
A new instance of TransferCreateRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(idempotency_key:, access_token:, account_id:, authorization_id:, type:, network:, amount:, description:, ach_class:, user:, client_id: SKIP, secret: SKIP, metadata: SKIP, origination_account_id: SKIP, additional_properties: nil) ⇒ TransferCreateRequest
Returns a new instance of TransferCreateRequest.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/plaid/models/transfer_create_request.rb', line 145 def initialize(idempotency_key:, access_token:, account_id:, authorization_id:, type:, network:, amount:, description:, ach_class:, user:, client_id: SKIP, secret: SKIP, metadata: SKIP, origination_account_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @client_id = client_id unless client_id == SKIP @secret = secret unless secret == SKIP @idempotency_key = idempotency_key @access_token = access_token @account_id = account_id @authorization_id = @type = type @network = network @amount = amount @description = description @ach_class = ach_class @user = user @metadata = unless == SKIP @origination_account_id = origination_account_id unless origination_account_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#access_token ⇒ String
The Plaid ‘access_token` for the account that will be debited or credited.
35 36 37 |
# File 'lib/plaid/models/transfer_create_request.rb', line 35 def access_token @access_token end |
#account_id ⇒ String
The Plaid ‘account_id` for the account that will be debited or credited.
39 40 41 |
# File 'lib/plaid/models/transfer_create_request.rb', line 39 def account_id @account_id end |
#ach_class ⇒ AchClass
Specifies the use case of the transfer. Required for transfers on an ACH network. ‘“arc”` - Accounts Receivable Entry `“cbr`” - Cross Border Entry `“ccd”` - Corporate Credit or Debit - fund transfer between two corporate bank accounts `“cie”` - Customer Initiated Entry `“cor”` - Automated Notification of Change `“ctx”` - Corporate Trade Exchange `“iat”` - International `“mte”` - Machine Transfer Entry `“pbr”` - Cross Border Entry `“pop”` - Point-of-Purchase Entry `“pos”` - Point-of-Sale Entry `“ppd”` - Prearranged Payment or Deposit - the transfer is part of a pre-existing relationship with a consumer, eg. bill payment `“rck”` - Re-presented Check Entry `“tel”` - Telephone-Initiated Entry `“web”` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet
86 87 88 |
# File 'lib/plaid/models/transfer_create_request.rb', line 86 def ach_class @ach_class end |
#amount ⇒ String
The amount of the transfer (decimal string with two digits of precision e.g. “10.00”).
59 60 61 |
# File 'lib/plaid/models/transfer_create_request.rb', line 59 def amount @amount end |
#authorization_id ⇒ String
Plaid’s unique identifier for a transfer authorization.
43 44 45 |
# File 'lib/plaid/models/transfer_create_request.rb', line 43 def @authorization_id end |
#client_id ⇒ String
Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.
16 17 18 |
# File 'lib/plaid/models/transfer_create_request.rb', line 16 def client_id @client_id end |
#description ⇒ String
The transfer description. Maximum of 10 characters.
63 64 65 |
# File 'lib/plaid/models/transfer_create_request.rb', line 63 def description @description end |
#idempotency_key ⇒ String
A random key provided by the client, per unique transfer. Maximum of 50 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a transfer fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single transfer is created.
31 32 33 |
# File 'lib/plaid/models/transfer_create_request.rb', line 31 def idempotency_key @idempotency_key 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
100 101 102 |
# File 'lib/plaid/models/transfer_create_request.rb', line 100 def @metadata end |
#network ⇒ TransferNetwork
The network or rails used for the transfer. Valid options are ‘ach` or `same-day-ach`.
54 55 56 |
# File 'lib/plaid/models/transfer_create_request.rb', line 54 def network @network end |
#origination_account_id ⇒ String
Plaid’s unique identifier for the origination account for this transfer. If you have more than one origination account, this value must be specified.
106 107 108 |
# File 'lib/plaid/models/transfer_create_request.rb', line 106 def origination_account_id @origination_account_id end |
#secret ⇒ String
Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.
21 22 23 |
# File 'lib/plaid/models/transfer_create_request.rb', line 21 def secret @secret end |
#type ⇒ TransferType1
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.
49 50 51 |
# File 'lib/plaid/models/transfer_create_request.rb', line 49 def type @type end |
#user ⇒ TransferUserInRequest
The legal name and other information for the account holder.
90 91 92 |
# File 'lib/plaid/models/transfer_create_request.rb', line 90 def user @user end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 208 209 210 211 212 213 214 215 216 |
# File 'lib/plaid/models/transfer_create_request.rb', line 171 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. idempotency_key = hash.key?('idempotency_key') ? hash['idempotency_key'] : nil access_token = hash.key?('access_token') ? hash['access_token'] : nil account_id = hash.key?('account_id') ? hash['account_id'] : nil = hash.key?('authorization_id') ? hash['authorization_id'] : nil type = hash.key?('type') ? hash['type'] : nil network = hash.key?('network') ? hash['network'] : nil amount = hash.key?('amount') ? hash['amount'] : nil description = hash.key?('description') ? hash['description'] : nil ach_class = hash.key?('ach_class') ? hash['ach_class'] : nil user = TransferUserInRequest.from_hash(hash['user']) if hash['user'] client_id = hash.key?('client_id') ? hash['client_id'] : SKIP secret = hash.key?('secret') ? hash['secret'] : SKIP = hash.key?('metadata') ? hash['metadata'] : SKIP origination_account_id = hash.key?('origination_account_id') ? hash['origination_account_id'] : 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. TransferCreateRequest.new(idempotency_key: idempotency_key, access_token: access_token, account_id: account_id, authorization_id: , type: type, network: network, amount: amount, description: description, ach_class: ach_class, user: user, client_id: client_id, secret: secret, metadata: , origination_account_id: origination_account_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/plaid/models/transfer_create_request.rb', line 109 def self.names @_hash = {} if @_hash.nil? @_hash['client_id'] = 'client_id' @_hash['secret'] = 'secret' @_hash['idempotency_key'] = 'idempotency_key' @_hash['access_token'] = 'access_token' @_hash['account_id'] = 'account_id' @_hash['authorization_id'] = 'authorization_id' @_hash['type'] = 'type' @_hash['network'] = 'network' @_hash['amount'] = 'amount' @_hash['description'] = 'description' @_hash['ach_class'] = 'ach_class' @_hash['user'] = 'user' @_hash['metadata'] = 'metadata' @_hash['origination_account_id'] = 'origination_account_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
139 140 141 142 143 |
# File 'lib/plaid/models/transfer_create_request.rb', line 139 def self.nullables %w[ origination_account_id ] end |
.optionals ⇒ Object
An array for optional fields
129 130 131 132 133 134 135 136 |
# File 'lib/plaid/models/transfer_create_request.rb', line 129 def self.optionals %w[ client_id secret metadata origination_account_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
230 231 232 233 234 235 236 237 238 239 |
# File 'lib/plaid/models/transfer_create_request.rb', line 230 def inspect class_name = self.class.name.split('::').last "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect},"\ " idempotency_key: #{@idempotency_key.inspect}, access_token: #{@access_token.inspect},"\ " account_id: #{@account_id.inspect}, authorization_id: #{@authorization_id.inspect}, type:"\ " #{@type.inspect}, network: #{@network.inspect}, amount: #{@amount.inspect}, description:"\ " #{@description.inspect}, ach_class: #{@ach_class.inspect}, user: #{@user.inspect},"\ " metadata: #{@metadata.inspect}, origination_account_id:"\ " #{@origination_account_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
219 220 221 222 223 224 225 226 227 |
# File 'lib/plaid/models/transfer_create_request.rb', line 219 def to_s class_name = self.class.name.split('::').last "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, idempotency_key:"\ " #{@idempotency_key}, access_token: #{@access_token}, account_id: #{@account_id},"\ " authorization_id: #{@authorization_id}, type: #{@type}, network: #{@network}, amount:"\ " #{@amount}, description: #{@description}, ach_class: #{@ach_class}, user: #{@user},"\ " metadata: #{@metadata}, origination_account_id: #{@origination_account_id},"\ " additional_properties: #{@additional_properties}>" end |