Class: ThePlaidApi::TransferStatus
- Inherits:
-
Object
- Object
- ThePlaidApi::TransferStatus
- Defined in:
- lib/the_plaid_api/models/transfer_status.rb
Overview
The status of the transfer. ‘pending`: A new transfer was created; it is in the pending state. `posted`: The transfer has been successfully submitted to the payment network. `settled`: The transfer was successfully completed by the payment network. Note that funds from received debits are not available to be moved out of the Ledger until the transfer reaches `funds_available` status. For credit transactions, `settled` means the funds have been delivered to the receiving bank account. This is the terminal state of a successful credit transfer. `funds_available`: Funds from the transfer have been released from hold and applied to the ledger’s available balance. (Only applicable to ACH debits.) This is the terminal state of a successful debit transfer. ‘cancelled`: The transfer was cancelled by the client. This is the terminal state of a cancelled transfer. `failed`: The transfer failed, no funds were moved. This is the terminal state of a failed transfer. `returned`: A posted transfer was returned. This is the terminal state of a returned transfer.
Constant Summary collapse
- TRANSFER_STATUS =
[ # TODO: Write general description for PENDING PENDING = 'pending'.freeze, # TODO: Write general description for POSTED POSTED = 'posted'.freeze, # TODO: Write general description for SETTLED SETTLED = 'settled'.freeze, # TODO: Write general description for FUNDS_AVAILABLE FUNDS_AVAILABLE = 'funds_available'.freeze, # TODO: Write general description for CANCELLED CANCELLED = 'cancelled'.freeze, # TODO: Write general description for FAILED FAILED = 'failed'.freeze, # TODO: Write general description for RETURNED RETURNED = 'returned'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = PENDING) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/the_plaid_api/models/transfer_status.rb', line 52 def self.from_value(value, default_value = PENDING) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'pending' then PENDING when 'posted' then POSTED when 'settled' then SETTLED when 'funds_available' then FUNDS_AVAILABLE when 'cancelled' then CANCELLED when 'failed' then FAILED when 'returned' then RETURNED else default_value end end |
.validate(value) ⇒ Object
46 47 48 49 50 |
# File 'lib/the_plaid_api/models/transfer_status.rb', line 46 def self.validate(value) return false if value.nil? TRANSFER_STATUS.include?(value) end |