Class: ModernTreasury::Models::Transaction

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/transaction.rb

Overview

Defined Under Namespace

Modules: Type, VendorCodeType

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id: , amount: , as_of_date: , as_of_time: , as_of_timezone: , created_at: , currency: , custom_identifiers: , direction: , discarded_at: , foreign_exchange_rate: , internal_account_id: , live_mode: , metadata: , object: , posted: , reconciled: , type: , updated_at: , vendor_code: , vendor_code_type: , vendor_customer_id: , vendor_id: , details: nil, vendor_description: nil) ⇒ Object

Some parameter documentations has been truncated, see ModernTreasury::Models::Transaction for more details.

Parameters:

  • id (String) (defaults to: )
  • amount (Integer) (defaults to: )

    Value in specified currency’s smallest unit. e.g. $10 would be represented as 10

  • as_of_date (Date, nil) (defaults to: )

    The date on which the transaction occurred.

  • as_of_time (Time, nil) (defaults to: )

    The time on which the transaction occurred. Depending on the granularity of the

  • as_of_timezone (String, nil) (defaults to: )

    The timezone in which the ‘as_of_time` is represented. Can be `null` if the bank

  • created_at (Time) (defaults to: )
  • currency (Symbol, ModernTreasury::Models::Currency) (defaults to: )

    Currency that this transaction is denominated in.

  • custom_identifiers (Hash{Symbol=>String}) (defaults to: )

    An object containing key-value pairs, each with a custom identifier as the key a

  • direction (String) (defaults to: )

    Either ‘credit` or `debit`.

  • discarded_at (Time, nil) (defaults to: )
  • foreign_exchange_rate (ModernTreasury::Models::ForeignExchangeRate, nil) (defaults to: )

    Associated serialized foreign exchange rate information.

  • internal_account_id (String) (defaults to: )

    The ID of the relevant Internal Account.

  • live_mode (Boolean) (defaults to: )

    This field will be true if this object exists in the live environment or false i

  • metadata (Hash{Symbol=>String}) (defaults to: )

    Additional data represented as key-value pairs. Both the key and value must be s

  • object (String) (defaults to: )
  • posted (Boolean) (defaults to: )

    This field will be ‘true` if the transaction has posted to the account.

  • reconciled (Boolean) (defaults to: )

    This field will be ‘true` if a transaction is reconciled by the Modern Treasury

  • type (Symbol, ModernTreasury::Models::Transaction::Type) (defaults to: )

    The type of the transaction. Examples could be ‘card, `ach`, `wire`, `check`, `r

  • updated_at (Time) (defaults to: )
  • vendor_code (String, nil) (defaults to: )

    When applicable, the bank-given code that determines the transaction’s category.

  • vendor_code_type (Symbol, ModernTreasury::Models::Transaction::VendorCodeType, nil) (defaults to: )

    The type of ‘vendor_code` being reported. Can be one of `bai2`, `bankprov`, `bnk

  • vendor_customer_id (String, nil) (defaults to: )

    An identifier given to this transaction by the bank, often ‘null`.

  • vendor_id (String, nil) (defaults to: )

    An identifier given to this transaction by the bank.

  • details (Hash{Symbol=>String}) (defaults to: nil)

    This field contains additional information that the bank provided about the tran

  • vendor_description (String, nil) (defaults to: nil)

    The transaction detail text that often appears in on your bank statement and in



# File 'lib/modern_treasury/models/transaction.rb', line 172

Instance Attribute Details

#amountInteger

Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000.

Returns:

  • (Integer)


17
# File 'lib/modern_treasury/models/transaction.rb', line 17

required :amount, Integer

#as_of_dateDate?

The date on which the transaction occurred.

Returns:

  • (Date, nil)


23
# File 'lib/modern_treasury/models/transaction.rb', line 23

required :as_of_date, Date, nil?: true

#as_of_timeTime?

The time on which the transaction occurred. Depending on the granularity of the timestamp information received from the bank, it may be ‘null`.

Returns:

  • (Time, nil)


30
# File 'lib/modern_treasury/models/transaction.rb', line 30

required :as_of_time, Time, nil?: true

#as_of_timezoneString?

The timezone in which the ‘as_of_time` is represented. Can be `null` if the bank does not provide timezone info.

Returns:

  • (String, nil)


37
# File 'lib/modern_treasury/models/transaction.rb', line 37

required :as_of_timezone, String, nil?: true

#created_atTime

Returns:

  • (Time)


42
# File 'lib/modern_treasury/models/transaction.rb', line 42

required :created_at, Time

#currencySymbol, ModernTreasury::Models::Currency

Currency that this transaction is denominated in.



48
# File 'lib/modern_treasury/models/transaction.rb', line 48

required :currency, enum: -> { ModernTreasury::Currency }

#custom_identifiersHash{Symbol=>String}

An object containing key-value pairs, each with a custom identifier as the key and a string value.

Returns:

  • (Hash{Symbol=>String})


55
# File 'lib/modern_treasury/models/transaction.rb', line 55

required :custom_identifiers, ModernTreasury::Internal::Type::HashOf[String]

#detailsHash{Symbol=>String}?

This field contains additional information that the bank provided about the transaction. This is structured data. Some of the data in here might overlap with what is in the ‘vendor_description`. For example, the OBI could be a part of the vendor description, and it would also be included in here. The attributes that are passed through the details field will vary based on your banking partner. Currently, the following keys may be in the details object: `originator_name`, `originator_to_beneficiary_information`.

Returns:

  • (Hash{Symbol=>String}, nil)


163
# File 'lib/modern_treasury/models/transaction.rb', line 163

optional :details, ModernTreasury::Internal::Type::HashOf[String]

#directionString

Either ‘credit` or `debit`.

Returns:

  • (String)


61
# File 'lib/modern_treasury/models/transaction.rb', line 61

required :direction, String

#discarded_atTime?

Returns:

  • (Time, nil)


66
# File 'lib/modern_treasury/models/transaction.rb', line 66

required :discarded_at, Time, nil?: true

#foreign_exchange_rateModernTreasury::Models::ForeignExchangeRate?

Associated serialized foreign exchange rate information.



72
# File 'lib/modern_treasury/models/transaction.rb', line 72

required :foreign_exchange_rate, -> { ModernTreasury::ForeignExchangeRate }, nil?: true

#idString

Returns:

  • (String)


10
# File 'lib/modern_treasury/models/transaction.rb', line 10

required :id, String

#internal_account_idString

The ID of the relevant Internal Account.

Returns:

  • (String)


78
# File 'lib/modern_treasury/models/transaction.rb', line 78

required :internal_account_id, String

#live_modeBoolean

This field will be true if this object exists in the live environment or false if it exists in the test environment.

Returns:

  • (Boolean)


85
# File 'lib/modern_treasury/models/transaction.rb', line 85

required :live_mode, ModernTreasury::Internal::Type::Boolean

#metadataHash{Symbol=>String}

Additional data represented as key-value pairs. Both the key and value must be strings.

Returns:

  • (Hash{Symbol=>String})


92
# File 'lib/modern_treasury/models/transaction.rb', line 92

required :metadata, ModernTreasury::Internal::Type::HashOf[String]

#objectString

Returns:

  • (String)


97
# File 'lib/modern_treasury/models/transaction.rb', line 97

required :object, String

#postedBoolean

This field will be ‘true` if the transaction has posted to the account.

Returns:

  • (Boolean)


103
# File 'lib/modern_treasury/models/transaction.rb', line 103

required :posted, ModernTreasury::Internal::Type::Boolean

#reconciledBoolean

This field will be ‘true` if a transaction is reconciled by the Modern Treasury system. This means that it has transaction line items that sum up to the transaction’s amount.

Returns:

  • (Boolean)


111
# File 'lib/modern_treasury/models/transaction.rb', line 111

required :reconciled, ModernTreasury::Internal::Type::Boolean

#typeSymbol, ModernTreasury::Models::Transaction::Type

The type of the transaction. Examples could be ‘card, `ach`, `wire`, `check`, `rtp`, `book`, or `sen`.



118
# File 'lib/modern_treasury/models/transaction.rb', line 118

required :type, enum: -> { ModernTreasury::Transaction::Type }

#updated_atTime

Returns:

  • (Time)


123
# File 'lib/modern_treasury/models/transaction.rb', line 123

required :updated_at, Time

#vendor_codeString?

When applicable, the bank-given code that determines the transaction’s category. For most banks this is the BAI2/BTRS transaction code.

Returns:

  • (String, nil)


130
# File 'lib/modern_treasury/models/transaction.rb', line 130

required :vendor_code, String, nil?: true

#vendor_code_typeSymbol, ...

The type of ‘vendor_code` being reported. Can be one of `bai2`, `bankprov`, `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`, `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`, `swift`, `us_bank`, or others.



139
# File 'lib/modern_treasury/models/transaction.rb', line 139

required :vendor_code_type, enum: -> { ModernTreasury::Transaction::VendorCodeType }, nil?: true

#vendor_customer_idString?

An identifier given to this transaction by the bank, often ‘null`.

Returns:

  • (String, nil)


145
# File 'lib/modern_treasury/models/transaction.rb', line 145

required :vendor_customer_id, String, nil?: true

#vendor_descriptionString?

The transaction detail text that often appears in on your bank statement and in your banking portal.

Returns:

  • (String, nil)


170
# File 'lib/modern_treasury/models/transaction.rb', line 170

optional :vendor_description, String, nil?: true

#vendor_idString?

An identifier given to this transaction by the bank.

Returns:

  • (String, nil)


151
# File 'lib/modern_treasury/models/transaction.rb', line 151

required :vendor_id, String, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/modern_treasury/models/transaction.rb', line 270