Class: ModernTreasury::Models::Transaction
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- ModernTreasury::Models::Transaction
- Defined in:
- lib/modern_treasury/models/transaction.rb,
sig/modern_treasury/models/transaction.rbs
Overview
Defined Under Namespace
Modules: Type, VendorCodeType
Instance Attribute Summary collapse
-
#amount ⇒ Integer
Value in specified currency's smallest unit.
-
#amount_string ⇒ String
The amount of the transaction as a string, preserving full precision for values that may exceed safe integer limits in some languages.
-
#as_of_date ⇒ Date?
The date on which the transaction occurred.
-
#as_of_time ⇒ Time?
The time on which the transaction occurred.
-
#as_of_timezone ⇒ String?
The timezone in which the
as_of_timeis represented. - #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 and a string value.
-
#details ⇒ Hash{Symbol=>String}?
This field contains additional information that the bank provided about the transaction.
-
#direction ⇒ String
Either
creditordebit. - #discarded_at ⇒ Time?
-
#foreign_exchange_rate ⇒ ModernTreasury::Models::ForeignExchangeRate?
Associated serialized foreign exchange rate information.
- #id ⇒ String
-
#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 if it exists in the test environment.
-
#metadata ⇒ Hash{Symbol=>String}
Additional data represented as key-value pairs.
- #object ⇒ String
-
#posted ⇒ Boolean
This field will be
trueif the transaction has posted to the account. -
#reconciled ⇒ Boolean
This field will be
trueif a transaction is reconciled by the Modern Treasury system. -
#type ⇒ Symbol, ModernTreasury::Models::Transaction::Type
The type of the transaction.
- #updated_at ⇒ Time
-
#vendor_code ⇒ String?
When applicable, the bank-given code that determines the transaction's category.
-
#vendor_code_type ⇒ Symbol, ...
The type of
vendor_codebeing reported. -
#vendor_customer_id ⇒ String?
An identifier given to this transaction by the bank, often
null. -
#vendor_description ⇒ String?
The transaction detail text that often appears in on your bank statement and in your banking portal.
-
#vendor_id ⇒ String?
An identifier given to this transaction by the bank.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
Some parameter documentations has been truncated, see Transaction for more details.
- #to_hash ⇒ {
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.
|
|
# File 'lib/modern_treasury/models/transaction.rb', line 179
|
Instance Attribute Details
#amount ⇒ Integer
Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.
17 |
# File 'lib/modern_treasury/models/transaction.rb', line 17 required :amount, Integer |
#amount_string ⇒ String
The amount of the transaction as a string, preserving full precision for values that may exceed safe integer limits in some languages.
24 |
# File 'lib/modern_treasury/models/transaction.rb', line 24 required :amount_string, String |
#as_of_date ⇒ Date?
The date on which the transaction occurred.
30 |
# File 'lib/modern_treasury/models/transaction.rb', line 30 required :as_of_date, Date, nil?: true |
#as_of_time ⇒ Time?
The time on which the transaction occurred. Depending on the granularity of the
timestamp information received from the bank, it may be null.
37 |
# File 'lib/modern_treasury/models/transaction.rb', line 37 required :as_of_time, Time, nil?: true |
#as_of_timezone ⇒ String?
The timezone in which the as_of_time is represented. Can be null if the bank
does not provide timezone info.
44 |
# File 'lib/modern_treasury/models/transaction.rb', line 44 required :as_of_timezone, String, nil?: true |
#created_at ⇒ Time
49 |
# File 'lib/modern_treasury/models/transaction.rb', line 49 required :created_at, Time |
#currency ⇒ Symbol, ModernTreasury::Models::Currency
Currency that this transaction is denominated in.
55 |
# File 'lib/modern_treasury/models/transaction.rb', line 55 required :currency, enum: -> { ModernTreasury::Currency } |
#custom_identifiers ⇒ Hash{Symbol=>String}
An object containing key-value pairs, each with a custom identifier as the key and a string value.
62 |
# File 'lib/modern_treasury/models/transaction.rb', line 62 required :custom_identifiers, ModernTreasury::Internal::Type::HashOf[String] |
#details ⇒ Hash{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.
170 |
# File 'lib/modern_treasury/models/transaction.rb', line 170 optional :details, ModernTreasury::Internal::Type::HashOf[String] |
#direction ⇒ String
Either credit or debit.
68 |
# File 'lib/modern_treasury/models/transaction.rb', line 68 required :direction, String |
#discarded_at ⇒ Time?
73 |
# File 'lib/modern_treasury/models/transaction.rb', line 73 required :discarded_at, Time, nil?: true |
#foreign_exchange_rate ⇒ ModernTreasury::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 |
#id ⇒ String
10 |
# File 'lib/modern_treasury/models/transaction.rb', line 10 required :id, String |
#internal_account_id ⇒ String
The ID of the relevant Internal Account.
85 |
# File 'lib/modern_treasury/models/transaction.rb', line 85 required :internal_account_id, String |
#live_mode ⇒ Boolean
This field will be true if this object exists in the live environment or false if it exists in the test environment.
92 |
# File 'lib/modern_treasury/models/transaction.rb', line 92 required :live_mode, ModernTreasury::Internal::Type::Boolean |
#metadata ⇒ Hash{Symbol=>String}
Additional data represented as key-value pairs. Both the key and value must be strings.
99 |
# File 'lib/modern_treasury/models/transaction.rb', line 99 required :metadata, ModernTreasury::Internal::Type::HashOf[String] |
#object ⇒ String
104 |
# File 'lib/modern_treasury/models/transaction.rb', line 104 required :object, String |
#posted ⇒ Boolean
This field will be true if the transaction has posted to the account.
110 |
# File 'lib/modern_treasury/models/transaction.rb', line 110 required :posted, ModernTreasury::Internal::Type::Boolean |
#reconciled ⇒ Boolean
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.
118 |
# File 'lib/modern_treasury/models/transaction.rb', line 118 required :reconciled, ModernTreasury::Internal::Type::Boolean |
#type ⇒ Symbol, ModernTreasury::Models::Transaction::Type
The type of the transaction. Examples could be
card, ach, wire, check, rtp, or book`.
125 |
# File 'lib/modern_treasury/models/transaction.rb', line 125 required :type, enum: -> { ModernTreasury::Transaction::Type } |
#updated_at ⇒ Time
130 |
# File 'lib/modern_treasury/models/transaction.rb', line 130 required :updated_at, Time |
#vendor_code ⇒ String?
When applicable, the bank-given code that determines the transaction's category. For most banks this is the BAI2/BTRS transaction code.
137 |
# File 'lib/modern_treasury/models/transaction.rb', line 137 required :vendor_code, String, nil?: true |
#vendor_code_type ⇒ Symbol, ...
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.
146 |
# File 'lib/modern_treasury/models/transaction.rb', line 146 required :vendor_code_type, enum: -> { ModernTreasury::Transaction::VendorCodeType }, nil?: true |
#vendor_customer_id ⇒ String?
An identifier given to this transaction by the bank, often null.
152 |
# File 'lib/modern_treasury/models/transaction.rb', line 152 required :vendor_customer_id, String, nil?: true |
#vendor_description ⇒ String?
The transaction detail text that often appears in on your bank statement and in your banking portal.
177 |
# File 'lib/modern_treasury/models/transaction.rb', line 177 optional :vendor_description, String, nil?: true |
#vendor_id ⇒ String?
An identifier given to this transaction by the bank.
158 |
# File 'lib/modern_treasury/models/transaction.rb', line 158 required :vendor_id, String, nil?: true |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/modern_treasury/models/transaction.rb', line 269
|
Instance Method Details
#to_hash ⇒ {
117 |
# File 'sig/modern_treasury/models/transaction.rbs', line 117
def to_hash: -> {
|