Class: ModernTreasury::ExpectedPayment
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::ExpectedPayment
- Defined in:
- lib/modern_treasury/models/expected_payment.rb
Overview
ExpectedPayment Model.
Instance Attribute Summary collapse
-
#amount_lower_bound ⇒ Integer
The lowest amount this expected payment may be equal to.
-
#amount_upper_bound ⇒ Integer
The highest amount this expected payment may be equal to.
-
#counterparty_id ⇒ UUID | String
The ID of the counterparty you expect for this payment.
-
#created_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
-
#currency ⇒ Currency
Three-letter ISO currency code.
-
#date_lower_bound ⇒ Date
The earliest date the payment may come in.
-
#date_upper_bound ⇒ Date
The latest date the payment may come in.
-
#description ⇒ String
An optional description for internal use.
-
#direction ⇒ Direction1
One of credit or debit.
-
#id ⇒ UUID | String
TODO: Write general description for this method.
-
#internal_account_id ⇒ UUID | String
The ID of the Internal Account for the expected payment.
-
#ledger_transaction_id ⇒ UUID | String
The ID of the ledger transaction linked to the expected payment.
-
#live_mode ⇒ TrueClass | FalseClass
This field will be true if this object exists in the live environment or false if it exists in the test environment.
-
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs.
-
#object ⇒ String
TODO: Write general description for this method.
-
#reconciliation_filters ⇒ Object
The reconciliation filters you have for this payment.
-
#reconciliation_groups ⇒ Object
The reconciliation groups you have for this payment.
-
#reconciliation_method ⇒ ReconciliationMethod
One of manual if this expected payment was manually reconciled in the dashboard, automatic if it was automatically reconciled by Modern Treasury, or null if it is unreconciled.
-
#remittance_information ⇒ String
For ‘ach`, this field will be passed through on an addenda record.
-
#statement_descriptor ⇒ String
The statement description you expect to see on the transaction.
-
#status ⇒ Status1
One of unreconciled, reconciled, or archived.
-
#transaction_id ⇒ UUID | String
The ID of the Transaction this expected payment object has been matched to.
-
#transaction_line_item_id ⇒ UUID | String
The ID of the Transaction Line Item this expected payment has been matched to.
-
#type ⇒ Type1
One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen, sepa, signet, wire.
-
#updated_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(id:, object:, live_mode:, created_at:, updated_at:, amount_upper_bound:, amount_lower_bound:, direction:, internal_account_id:, type:, currency:, date_upper_bound:, date_lower_bound:, description:, statement_descriptor:, metadata:, counterparty_id:, remittance_information:, reconciliation_groups:, reconciliation_filters:, transaction_id:, transaction_line_item_id:, status:, reconciliation_method:, ledger_transaction_id:) ⇒ ExpectedPayment
constructor
A new instance of ExpectedPayment.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_updated_at ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(id:, object:, live_mode:, created_at:, updated_at:, amount_upper_bound:, amount_lower_bound:, direction:, internal_account_id:, type:, currency:, date_upper_bound:, date_lower_bound:, description:, statement_descriptor:, metadata:, counterparty_id:, remittance_information:, reconciliation_groups:, reconciliation_filters:, transaction_id:, transaction_line_item_id:, status:, reconciliation_method:, ledger_transaction_id:) ⇒ ExpectedPayment
Returns a new instance of ExpectedPayment.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 185 def initialize(id:, object:, live_mode:, created_at:, updated_at:, amount_upper_bound:, amount_lower_bound:, direction:, internal_account_id:, type:, currency:, date_upper_bound:, date_lower_bound:, description:, statement_descriptor:, metadata:, counterparty_id:, remittance_information:, reconciliation_groups:, reconciliation_filters:, transaction_id:, transaction_line_item_id:, status:, reconciliation_method:, ledger_transaction_id:) @id = id @object = object @live_mode = live_mode @created_at = created_at @updated_at = updated_at @amount_upper_bound = amount_upper_bound @amount_lower_bound = amount_lower_bound @direction = direction @internal_account_id = internal_account_id @type = type @currency = currency @date_upper_bound = date_upper_bound @date_lower_bound = date_lower_bound @description = description @statement_descriptor = statement_descriptor @metadata = @counterparty_id = counterparty_id @remittance_information = remittance_information @reconciliation_groups = reconciliation_groups @reconciliation_filters = reconciliation_filters @transaction_id = transaction_id @transaction_line_item_id = transaction_line_item_id @status = status @reconciliation_method = reconciliation_method @ledger_transaction_id = ledger_transaction_id end |
Instance Attribute Details
#amount_lower_bound ⇒ Integer
The lowest amount this expected payment may be equal to. Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000.
44 45 46 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 44 def amount_lower_bound @amount_lower_bound end |
#amount_upper_bound ⇒ Integer
The highest amount this expected payment may be equal to. Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000.
39 40 41 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 39 def amount_upper_bound @amount_upper_bound end |
#counterparty_id ⇒ UUID | String
The ID of the counterparty you expect for this payment.
90 91 92 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 90 def counterparty_id @counterparty_id end |
#created_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
29 30 31 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 29 def created_at @created_at end |
#currency ⇒ Currency
Three-letter ISO currency code.
62 63 64 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 62 def currency @currency end |
#date_lower_bound ⇒ Date
The earliest date the payment may come in. Format: yyyy-mm-dd
70 71 72 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 70 def date_lower_bound @date_lower_bound end |
#date_upper_bound ⇒ Date
The latest date the payment may come in. Format: yyyy-mm-dd
66 67 68 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 66 def date_upper_bound @date_upper_bound end |
#description ⇒ String
An optional description for internal use.
74 75 76 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 74 def description @description end |
#direction ⇒ Direction1
One of credit or debit. When you are receiving money, use credit. When you are being charged, use debit.
49 50 51 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 49 def direction @direction end |
#id ⇒ UUID | String
TODO: Write general description for this method
15 16 17 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 15 def id @id end |
#internal_account_id ⇒ UUID | String
The ID of the Internal Account for the expected payment.
53 54 55 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 53 def internal_account_id @internal_account_id end |
#ledger_transaction_id ⇒ UUID | String
The ID of the ledger transaction linked to the expected payment.
128 129 130 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 128 def ledger_transaction_id @ledger_transaction_id end |
#live_mode ⇒ TrueClass | FalseClass
This field will be true if this object exists in the live environment or false if it exists in the test environment.
24 25 26 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 24 def live_mode @live_mode end |
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs. Both the key and value must be strings.
86 87 88 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 86 def @metadata end |
#object ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 19 def object @object end |
#reconciliation_filters ⇒ Object
The reconciliation filters you have for this payment.
104 105 106 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 104 def reconciliation_filters @reconciliation_filters end |
#reconciliation_groups ⇒ Object
The reconciliation groups you have for this payment.
100 101 102 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 100 def reconciliation_groups @reconciliation_groups end |
#reconciliation_method ⇒ ReconciliationMethod
One of manual if this expected payment was manually reconciled in the dashboard, automatic if it was automatically reconciled by Modern Treasury, or null if it is unreconciled.
124 125 126 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 124 def reconciliation_method @reconciliation_method end |
#remittance_information ⇒ String
For ‘ach`, this field will be passed through on an addenda record. For `wire` payments the field will be passed through as the “Originator to Beneficiary Information”, also known as OBI or Fedwire tag 6000.
96 97 98 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 96 def remittance_information @remittance_information end |
#statement_descriptor ⇒ String
The statement description you expect to see on the transaction. For ACH payments, this will be the full line item passed from the bank. For wire payments, this will be the OBI field on the wire. For check payments, this will be the memo field.
81 82 83 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 81 def statement_descriptor @statement_descriptor end |
#status ⇒ Status1
One of unreconciled, reconciled, or archived.
118 119 120 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 118 def status @status end |
#transaction_id ⇒ UUID | String
The ID of the Transaction this expected payment object has been matched to.
109 110 111 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 109 def transaction_id @transaction_id end |
#transaction_line_item_id ⇒ UUID | String
The ID of the Transaction Line Item this expected payment has been matched to.
114 115 116 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 114 def transaction_line_item_id @transaction_line_item_id end |
#type ⇒ Type1
One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp, sen, sepa, signet, wire.
58 59 60 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 58 def type @type end |
#updated_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
34 35 36 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 34 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 221 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil object = hash.key?('object') ? hash['object'] : nil live_mode = hash.key?('live_mode') ? hash['live_mode'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end updated_at = if hash.key?('updated_at') (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) end amount_upper_bound = hash.key?('amount_upper_bound') ? hash['amount_upper_bound'] : nil amount_lower_bound = hash.key?('amount_lower_bound') ? hash['amount_lower_bound'] : nil direction = hash.key?('direction') ? hash['direction'] : nil internal_account_id = hash.key?('internal_account_id') ? hash['internal_account_id'] : nil type = hash.key?('type') ? hash['type'] : nil currency = hash.key?('currency') ? hash['currency'] : nil date_upper_bound = hash.key?('date_upper_bound') ? hash['date_upper_bound'] : nil date_lower_bound = hash.key?('date_lower_bound') ? hash['date_lower_bound'] : nil description = hash.key?('description') ? hash['description'] : nil statement_descriptor = hash.key?('statement_descriptor') ? hash['statement_descriptor'] : nil = hash.key?('metadata') ? hash['metadata'] : nil counterparty_id = hash.key?('counterparty_id') ? hash['counterparty_id'] : nil remittance_information = hash.key?('remittance_information') ? hash['remittance_information'] : nil reconciliation_groups = hash.key?('reconciliation_groups') ? hash['reconciliation_groups'] : nil reconciliation_filters = hash.key?('reconciliation_filters') ? hash['reconciliation_filters'] : nil transaction_id = hash.key?('transaction_id') ? hash['transaction_id'] : nil transaction_line_item_id = hash.key?('transaction_line_item_id') ? hash['transaction_line_item_id'] : nil status = hash.key?('status') ? hash['status'] : nil reconciliation_method = hash.key?('reconciliation_method') ? hash['reconciliation_method'] : nil ledger_transaction_id = hash.key?('ledger_transaction_id') ? hash['ledger_transaction_id'] : nil # Create object from extracted values. ExpectedPayment.new(id: id, object: object, live_mode: live_mode, created_at: created_at, updated_at: updated_at, amount_upper_bound: amount_upper_bound, amount_lower_bound: amount_lower_bound, direction: direction, internal_account_id: internal_account_id, type: type, currency: currency, date_upper_bound: date_upper_bound, date_lower_bound: date_lower_bound, description: description, statement_descriptor: statement_descriptor, metadata: , counterparty_id: counterparty_id, remittance_information: remittance_information, reconciliation_groups: reconciliation_groups, reconciliation_filters: reconciliation_filters, transaction_id: transaction_id, transaction_line_item_id: transaction_line_item_id, status: status, reconciliation_method: reconciliation_method, ledger_transaction_id: ledger_transaction_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 131 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['object'] = 'object' @_hash['live_mode'] = 'live_mode' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['amount_upper_bound'] = 'amount_upper_bound' @_hash['amount_lower_bound'] = 'amount_lower_bound' @_hash['direction'] = 'direction' @_hash['internal_account_id'] = 'internal_account_id' @_hash['type'] = 'type' @_hash['currency'] = 'currency' @_hash['date_upper_bound'] = 'date_upper_bound' @_hash['date_lower_bound'] = 'date_lower_bound' @_hash['description'] = 'description' @_hash['statement_descriptor'] = 'statement_descriptor' @_hash['metadata'] = 'metadata' @_hash['counterparty_id'] = 'counterparty_id' @_hash['remittance_information'] = 'remittance_information' @_hash['reconciliation_groups'] = 'reconciliation_groups' @_hash['reconciliation_filters'] = 'reconciliation_filters' @_hash['transaction_id'] = 'transaction_id' @_hash['transaction_line_item_id'] = 'transaction_line_item_id' @_hash['status'] = 'status' @_hash['reconciliation_method'] = 'reconciliation_method' @_hash['ledger_transaction_id'] = 'ledger_transaction_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 167 def self.nullables %w[ type date_upper_bound date_lower_bound description statement_descriptor counterparty_id remittance_information reconciliation_groups reconciliation_filters transaction_id transaction_line_item_id reconciliation_method ledger_transaction_id ] end |
.optionals ⇒ Object
An array for optional fields
162 163 164 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 162 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 322 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, object: #{@object.inspect}, live_mode:"\ " #{@live_mode.inspect}, created_at: #{@created_at.inspect}, updated_at:"\ " #{@updated_at.inspect}, amount_upper_bound: #{@amount_upper_bound.inspect},"\ " amount_lower_bound: #{@amount_lower_bound.inspect}, direction: #{@direction.inspect},"\ " internal_account_id: #{@internal_account_id.inspect}, type: #{@type.inspect}, currency:"\ " #{@currency.inspect}, date_upper_bound: #{@date_upper_bound.inspect}, date_lower_bound:"\ " #{@date_lower_bound.inspect}, description: #{@description.inspect}, statement_descriptor:"\ " #{@statement_descriptor.inspect}, metadata: #{@metadata.inspect}, counterparty_id:"\ " #{@counterparty_id.inspect}, remittance_information: #{@remittance_information.inspect},"\ " reconciliation_groups: #{@reconciliation_groups.inspect}, reconciliation_filters:"\ " #{@reconciliation_filters.inspect}, transaction_id: #{@transaction_id.inspect},"\ " transaction_line_item_id: #{@transaction_line_item_id.inspect}, status:"\ " #{@status.inspect}, reconciliation_method: #{@reconciliation_method.inspect},"\ " ledger_transaction_id: #{@ledger_transaction_id.inspect}>" end |
#to_custom_created_at ⇒ Object
297 298 299 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 297 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_updated_at ⇒ Object
301 302 303 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 301 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/modern_treasury/models/expected_payment.rb', line 306 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, object: #{@object}, live_mode: #{@live_mode}, created_at:"\ " #{@created_at}, updated_at: #{@updated_at}, amount_upper_bound: #{@amount_upper_bound},"\ " amount_lower_bound: #{@amount_lower_bound}, direction: #{@direction}, internal_account_id:"\ " #{@internal_account_id}, type: #{@type}, currency: #{@currency}, date_upper_bound:"\ " #{@date_upper_bound}, date_lower_bound: #{@date_lower_bound}, description:"\ " #{@description}, statement_descriptor: #{@statement_descriptor}, metadata: #{@metadata},"\ " counterparty_id: #{@counterparty_id}, remittance_information: #{@remittance_information},"\ " reconciliation_groups: #{@reconciliation_groups}, reconciliation_filters:"\ " #{@reconciliation_filters}, transaction_id: #{@transaction_id}, transaction_line_item_id:"\ " #{@transaction_line_item_id}, status: #{@status}, reconciliation_method:"\ " #{@reconciliation_method}, ledger_transaction_id: #{@ledger_transaction_id}>" end |