Class: ThePlaidApi::TransferLedgerWithdrawRequest

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

Overview

Defines the request schema for ‘/transfer/ledger/withdraw`

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(amount:, idempotency_key:, network:, client_id: SKIP, secret: SKIP, originator_client_id: SKIP, funding_account_id: SKIP, ledger_id: SKIP, description: SKIP, additional_properties: nil) ⇒ TransferLedgerWithdrawRequest

Returns a new instance of TransferLedgerWithdrawRequest.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 135

def initialize(amount:, idempotency_key:, network:, client_id: SKIP,
               secret: SKIP, originator_client_id: SKIP,
               funding_account_id: SKIP, ledger_id: SKIP, description: 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
  @originator_client_id = originator_client_id unless originator_client_id == SKIP
  @funding_account_id =  unless  == SKIP
  @ledger_id = ledger_id unless ledger_id == SKIP
  @amount = amount
  @description = description unless description == SKIP
  @idempotency_key = idempotency_key
  @network = network
  @additional_properties = additional_properties
end

Instance Attribute Details

#amountString

A positive amount of how much will be withdrawn from the ledger balance (decimal string with two digits of precision e.g. “5.50”).

Returns:

  • (String)


50
51
52
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 50

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/transfer_ledger_withdraw_request.rb', line 16

def client_id
  @client_id
end

#descriptionString

The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement.

Returns:

  • (String)


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

def description
  @description
end

#funding_account_idString

Specify which funding account to use. Customers can find a list of ‘funding_account_id`s in the Accounts page of the Plaid Dashboard, under the “Account ID” column. If this field is left blank, the funding account associated with the specified Ledger will be used. If an `originator_client_id` is specified, the `funding_account_id` must belong to the specified originator.

Returns:

  • (String)


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

def 
  @funding_account_id
end

#idempotency_keyString

A unique key provided by the client, per unique ledger withdraw. Maximum of 50 characters. The API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger withdraw fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single withdraw is created.

Returns:

  • (String)


66
67
68
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 66

def idempotency_key
  @idempotency_key
end

#ledger_idString

Specify which ledger balance to withdraw from. Customers can find a list of ‘ledger_id`s in the Accounts page of your Plaid Dashboard. If this field is left blank, this will default to id of the default ledger balance.

Returns:

  • (String)


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

def ledger_id
  @ledger_id
end

#networkTransferNetwork

The network or rails used for the transfer. For transfers submitted as ‘ach` or `same-day-ach`, the Standard ACH cutoff is 8:30 PM Eastern Time. For transfers submitted as `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; this will apply to both legs of the transfer if applicable. The transaction limit for a Same Day ACH transfer is $1,000,000. Authorization requests sent with an amount greater than $1,000,000 will fail. For transfers submitted as `rtp`, Plaid will automatically route between Real Time Payment rail by TCH or FedNow rails as necessary. If a transfer is submitted as `rtp` and the counterparty account is not eligible for RTP, the `/transfer/authorization/create` request will fail with an `INVALID_FIELD` error code. To pre-check to determine whether a counterparty account can support RTP, call `/transfer/capabilities/get` before calling `/transfer/authorization/create`. Wire transfers are currently in early availability. To request access to `wire` as a payment network, contact your Account Manager. For transfers submitted as `wire`, the `type` must be `credit`; wire debits are not supported. The cutoff to submit a wire payment is 6:30 PM Eastern Time on a business day; wires submitted after that time will be processed on the next business day. The transaction limit for a wire is $999,999.99. Authorization requests sent with an amount greater than $999,999.99 will fail.

Returns:



96
97
98
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 96

def network
  @network
end

#originator_client_idString

Client ID of the customer that owns the Ledger balance. This is so Plaid knows which of your customers to payout or collect funds. Only applicable for [Platform customers](plaid.com/docs/transfer/application/#originators-vs-pla tforms). Do not include if you’re paying out to yourself.

Returns:

  • (String)


29
30
31
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 29

def originator_client_id
  @originator_client_id
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/transfer_ledger_withdraw_request.rb', line 21

def secret
  @secret
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



155
156
157
158
159
160
161
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
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 155

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  amount = hash.key?('amount') ? hash['amount'] : nil
  idempotency_key =
    hash.key?('idempotency_key') ? hash['idempotency_key'] : nil
  network = hash.key?('network') ? hash['network'] : nil
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  originator_client_id =
    hash.key?('originator_client_id') ? hash['originator_client_id'] : SKIP
   =
    hash.key?('funding_account_id') ? hash['funding_account_id'] : SKIP
  ledger_id = hash.key?('ledger_id') ? hash['ledger_id'] : SKIP
  description = hash.key?('description') ? hash['description'] : 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.
  TransferLedgerWithdrawRequest.new(amount: amount,
                                    idempotency_key: idempotency_key,
                                    network: network,
                                    client_id: client_id,
                                    secret: secret,
                                    originator_client_id: originator_client_id,
                                    funding_account_id: ,
                                    ledger_id: ledger_id,
                                    description: description,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['originator_client_id'] = 'originator_client_id'
  @_hash['funding_account_id'] = 'funding_account_id'
  @_hash['ledger_id'] = 'ledger_id'
  @_hash['amount'] = 'amount'
  @_hash['description'] = 'description'
  @_hash['idempotency_key'] = 'idempotency_key'
  @_hash['network'] = 'network'
  @_hash
end

.nullablesObject

An array for nullable fields



126
127
128
129
130
131
132
133
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 126

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

.optionalsObject

An array for optional fields



114
115
116
117
118
119
120
121
122
123
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 114

def self.optionals
  %w[
    client_id
    secret
    originator_client_id
    funding_account_id
    ledger_id
    description
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



203
204
205
206
207
208
209
210
211
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 203

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect},"\
  " originator_client_id: #{@originator_client_id.inspect}, funding_account_id:"\
  " #{@funding_account_id.inspect}, ledger_id: #{@ledger_id.inspect}, amount:"\
  " #{@amount.inspect}, description: #{@description.inspect}, idempotency_key:"\
  " #{@idempotency_key.inspect}, network: #{@network.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



193
194
195
196
197
198
199
200
# File 'lib/the_plaid_api/models/transfer_ledger_withdraw_request.rb', line 193

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, originator_client_id:"\
  " #{@originator_client_id}, funding_account_id: #{@funding_account_id}, ledger_id:"\
  " #{@ledger_id}, amount: #{@amount}, description: #{@description}, idempotency_key:"\
  " #{@idempotency_key}, network: #{@network}, additional_properties:"\
  " #{@additional_properties}>"
end