Class: ModernTreasury::Models::Transaction

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

Overview

See Also:

  • ModernTreasury::Resources::Transactions#create

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:, amount_string:, 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)
  • amount (Integer)

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

  • amount_string (String)

    The amount of the transaction as a string, preserving full precision for values

  • as_of_date (Date, nil)

    The date on which the transaction occurred.

  • as_of_time (Time, nil)

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

  • as_of_timezone (String, nil)

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

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

    Currency that this transaction is denominated in.

  • custom_identifiers (Hash{Symbol=>String})

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

  • direction (String)

    Either credit or debit.

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

    Associated serialized foreign exchange rate information.

  • internal_account_id (String)

    The ID of the relevant Internal Account.

  • live_mode (Boolean)

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

  • metadata (Hash{Symbol=>String})

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

  • object (String)
  • posted (Boolean)

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

  • reconciled (Boolean)

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

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

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

  • updated_at (Time)
  • vendor_code (String, nil)

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

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

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

  • vendor_customer_id (String, nil)

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

  • vendor_id (String, nil)

    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 179

Instance Attribute Details

#amountInteger

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

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :amount, Integer

#amount_stringString

The amount of the transaction as a string, preserving full precision for values that may exceed safe integer limits in some languages.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :amount_string, String

#as_of_dateDate?

The date on which the transaction occurred.

Parameters:

  • value (Date, nil)

Returns:

  • (Date, nil)


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

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.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :as_of_timezone, String, nil?: true

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#currencySymbol, ModernTreasury::Models::Currency

Currency that this transaction is denominated in.

Parameters:

  • value (ModernTreasury::Models::currency)

Returns:



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

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.

Parameters:

  • value (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String})


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

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.

Parameters:

  • (::Hash[Symbol, String])

Returns:

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


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

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

#directionString

Either credit or debit.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :direction, String

#discarded_atTime?

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


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

required :discarded_at, Time, nil?: true

#foreign_exchange_rateModernTreasury::Models::ForeignExchangeRate?

Associated serialized foreign exchange rate information.



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

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

#idString

Parameters:

  • value (String)

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.

Parameters:

  • value (String)

Returns:

  • (String)


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

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.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

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.

Parameters:

  • value (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String})


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

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

#objectString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :object, String

#postedBoolean

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

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

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.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

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

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

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

Parameters:

  • value (ModernTreasury::Models::Transaction::type_)

Returns:



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

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

#updated_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

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, silvergate, swift, us_bank, or others.

Parameters:

  • value (ModernTreasury::Models::Transaction::vendor_code_type, nil)

Returns:



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

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

#vendor_customer_idString?

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

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :vendor_description, String, nil?: true

#vendor_idString?

An identifier given to this transaction by the bank.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :vendor_id, String, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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

Instance Method Details

#to_hash{

Returns:

  • ({)


117
# File 'sig/modern_treasury/models/transaction.rbs', line 117

def to_hash: -> {