Class: ThePlaidApi::ProcessorBankTransferCreateRequest

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

Overview

Defines the request schema for ‘/processor/bank_transfer/create`

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(idempotency_key:, processor_token:, type:, network:, amount:, iso_currency_code:, description:, user:, client_id: SKIP, secret: SKIP, ach_class: SKIP, custom_tag: SKIP, metadata: SKIP, origination_account_id: SKIP, additional_properties: nil) ⇒ ProcessorBankTransferCreateRequest

Returns a new instance of ProcessorBankTransferCreateRequest.



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 149

def initialize(idempotency_key:, processor_token:, type:, network:, amount:,
               iso_currency_code:, description:, user:, client_id: SKIP,
               secret: SKIP, ach_class: SKIP, custom_tag: 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
  @processor_token = processor_token
  @type = type
  @network = network
  @amount = amount
  @iso_currency_code = iso_currency_code
  @description = description
  @ach_class = ach_class unless ach_class == SKIP
  @user = user
  @custom_tag = custom_tag unless custom_tag == SKIP
  @metadata =  unless  == SKIP
  @origination_account_id =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#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:



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

def ach_class
  @ach_class
end

#amountString

The amount of the bank transfer (decimal string with two digits of precision e.g. “10.00”).

Returns:

  • (String)


52
53
54
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 52

def amount
  @amount
end

#client_idString

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.

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 16

def client_id
  @client_id
end

#custom_tagString

An arbitrary string provided by the client for storage with the bank transfer. May be up to 100 characters.

Returns:

  • (String)


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

def custom_tag
  @custom_tag
end

#descriptionString

The transfer description. Maximum of 10 characters.

Returns:

  • (String)


60
61
62
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 60

def description
  @description
end

#idempotency_keyString

A random key provided by the client, per unique bank 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 bank transfer fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single bank transfer is created.

Returns:

  • (String)


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

def idempotency_key
  @idempotency_key
end

#iso_currency_codeString

The currency of the transfer amount – should be set to “USD”.

Returns:

  • (String)


56
57
58
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 56

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])


100
101
102
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 100

def 
  @metadata
end

#networkBankTransferNetwork

The network or rails used for the transfer. Valid options are ‘ach`, `same-day-ach`, or `wire`.

Returns:



47
48
49
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 47

def network
  @network
end

#origination_account_idString

Plaid’s unique identifier for the origination account for this transfer. If you have more than one origination account, this value must be specified.

Returns:

  • (String)


106
107
108
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 106

def 
  @origination_account_id
end

#processor_tokenString

The processor token obtained from the Plaid integration partner. Processor tokens are in the format: ‘processor-<environment>-<identifier>`

Returns:

  • (String)


36
37
38
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 36

def processor_token
  @processor_token
end

#secretString

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.

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 21

def secret
  @secret
end

#typeBankTransferType

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.

Returns:



42
43
44
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 42

def type
  @type
end

#userBankTransferUser

The legal name and other information for the account holder.

Returns:



85
86
87
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 85

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
217
218
219
220
221
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 175

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  idempotency_key =
    hash.key?('idempotency_key') ? hash['idempotency_key'] : nil
  processor_token =
    hash.key?('processor_token') ? hash['processor_token'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  network = hash.key?('network') ? hash['network'] : nil
  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
  user = BankTransferUser.from_hash(hash['user']) if hash['user']
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  ach_class = hash.key?('ach_class') ? hash['ach_class'] : SKIP
  custom_tag = hash.key?('custom_tag') ? hash['custom_tag'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP
   =
    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.
  ProcessorBankTransferCreateRequest.new(idempotency_key: idempotency_key,
                                         processor_token: processor_token,
                                         type: type,
                                         network: network,
                                         amount: amount,
                                         iso_currency_code: iso_currency_code,
                                         description: description,
                                         user: user,
                                         client_id: client_id,
                                         secret: secret,
                                         ach_class: ach_class,
                                         custom_tag: custom_tag,
                                         metadata: ,
                                         origination_account_id: ,
                                         additional_properties: additional_properties)
end

.namesObject

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/the_plaid_api/models/processor_bank_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['processor_token'] = 'processor_token'
  @_hash['type'] = 'type'
  @_hash['network'] = 'network'
  @_hash['amount'] = 'amount'
  @_hash['iso_currency_code'] = 'iso_currency_code'
  @_hash['description'] = 'description'
  @_hash['ach_class'] = 'ach_class'
  @_hash['user'] = 'user'
  @_hash['custom_tag'] = 'custom_tag'
  @_hash['metadata'] = 'metadata'
  @_hash['origination_account_id'] = 'origination_account_id'
  @_hash
end

.nullablesObject

An array for nullable fields



141
142
143
144
145
146
147
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 141

def self.nullables
  %w[
    custom_tag
    metadata
    origination_account_id
  ]
end

.optionalsObject

An array for optional fields



129
130
131
132
133
134
135
136
137
138
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 129

def self.optionals
  %w[
    client_id
    secret
    ach_class
    custom_tag
    metadata
    origination_account_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



235
236
237
238
239
240
241
242
243
244
245
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 235

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect},"\
  " idempotency_key: #{@idempotency_key.inspect}, processor_token:"\
  " #{@processor_token.inspect}, type: #{@type.inspect}, network: #{@network.inspect}, amount:"\
  " #{@amount.inspect}, iso_currency_code: #{@iso_currency_code.inspect}, description:"\
  " #{@description.inspect}, ach_class: #{@ach_class.inspect}, user: #{@user.inspect},"\
  " custom_tag: #{@custom_tag.inspect}, metadata: #{@metadata.inspect},"\
  " origination_account_id: #{@origination_account_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



224
225
226
227
228
229
230
231
232
# File 'lib/the_plaid_api/models/processor_bank_transfer_create_request.rb', line 224

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, idempotency_key:"\
  " #{@idempotency_key}, processor_token: #{@processor_token}, type: #{@type}, network:"\
  " #{@network}, amount: #{@amount}, iso_currency_code: #{@iso_currency_code}, description:"\
  " #{@description}, ach_class: #{@ach_class}, user: #{@user}, custom_tag: #{@custom_tag},"\
  " metadata: #{@metadata}, origination_account_id: #{@origination_account_id},"\
  " additional_properties: #{@additional_properties}>"
end