Class: ThePlaidApi::Type5

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

Overview

The type of the transaction. The supported transaction types that are returned are: ‘BANK_TRANSFER:` a transaction which credits an e-wallet through an external bank transfer. `PAYOUT:` a transaction which debits an e-wallet by disbursing funds to a counterparty. `PIS_PAY_IN:` a payment which credits an e-wallet through Plaid’s Payment Initiation Services (PIS) APIs. For more information see the [Payment Initiation endpoints](plaid.com/docs/api/products/payment-initiation/). ‘REFUND:` a transaction which debits an e-wallet by refunding a previously initiated payment made through Plaid’s [PIS APIs](plaid.com/docs/api/products/payment-initiation/). ‘FUNDS_SWEEP`: an automated transaction which debits funds from an e-wallet to a designated client-owned account. `RETURN`: an automated transaction where a debit transaction was reversed and money moved back to originating account. `RECALL`: a transaction where the sending bank has requested the return of funds due to a fraud claim, technical error, or other issue associated with the payment.

Constant Summary collapse

TYPE5 =
[
  # TODO: Write general description for BANK_TRANSFER
  BANK_TRANSFER = 'BANK_TRANSFER'.freeze,

  # TODO: Write general description for PAYOUT
  PAYOUT = 'PAYOUT'.freeze,

  # TODO: Write general description for PIS_PAY_IN
  PIS_PAY_IN = 'PIS_PAY_IN'.freeze,

  # TODO: Write general description for REFUND
  REFUND = 'REFUND'.freeze,

  # TODO: Write general description for FUNDS_SWEEP
  FUNDS_SWEEP = 'FUNDS_SWEEP'.freeze,

  # TODO: Write general description for RETURN
  RETURN = 'RETURN'.freeze,

  # TODO: Write general description for RECALL
  RECALL = 'RECALL'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BANK_TRANSFER) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/the_plaid_api/models/type5.rb', line 53

def self.from_value(value, default_value = BANK_TRANSFER)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'bank_transfer' then BANK_TRANSFER
  when 'payout' then PAYOUT
  when 'pis_pay_in' then PIS_PAY_IN
  when 'refund' then REFUND
  when 'funds_sweep' then FUNDS_SWEEP
  when 'return' then RETURN
  when 'recall' then RECALL
  else
    default_value
  end
end

.validate(value) ⇒ Object



47
48
49
50
51
# File 'lib/the_plaid_api/models/type5.rb', line 47

def self.validate(value)
  return false if value.nil?

  TYPE5.include?(value)
end