Class: ModernTreasury::PaymentOrderUpdateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::PaymentOrderUpdateRequest
- Defined in:
- lib/modern_treasury/models/payment_order_update_request.rb
Overview
PaymentOrderUpdateRequest Model.
Instance Attribute Summary collapse
-
#accounting ⇒ Accounting
Either ‘receiving_account` or `receiving_account_id` must be present.
-
#accounting_category_id ⇒ UUID | String
The ID of one of your accounting categories.
-
#accounting_ledger_class_id ⇒ UUID | String
The ID of one of your accounting ledger classes.
-
#amount ⇒ Integer
Value in specified currency’s smallest unit.
-
#charge_bearer ⇒ ChargeBearer
The party that will pay the fees for the payment order.
-
#counterparty_id ⇒ UUID | String
Required when receiving_account_id is passed the ID of an external account.
-
#currency ⇒ Currency
Three-letter ISO currency code.
-
#description ⇒ String
An optional description for internal use.
-
#direction ⇒ Direction5
One of ‘credit`, `debit`.
-
#effective_date ⇒ Date
Date transactions are to be posted to the participants’ account.
-
#expires_at ⇒ DateTime
RFP payments require an expires_at.
-
#fallback_type ⇒ FallbackType
A payment type to fallback to if the original type is not valid for the receiving account.
-
#foreign_exchange_contract ⇒ String
If present, indicates a specific foreign exchange contract number that has been generated by your financial institution.
-
#foreign_exchange_indicator ⇒ ForeignExchangeIndicator
Indicates the type of FX transfer to initiate, can be either ‘variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.
-
#line_items ⇒ Array[LineItemRequest]
An array of line items that must sum up to the amount of the payment order.
-
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs.
-
#nsf_protected ⇒ TrueClass | FalseClass
A boolean to determine if NSF Protection is enabled for this payment order.
-
#originating_account_id ⇒ UUID | String
The ID of one of your organization’s internal accounts.
-
#originating_party_name ⇒ String
If present, this will replace your default company name on receiver’s bank statement.
-
#priority ⇒ Priority
Either ‘normal` or `high`.
-
#purpose ⇒ String
For ‘wire`, this is usually the purpose which is transmitted via the “InstrForDbtrAgt” field in the ISO20022 file.
-
#receiving_account ⇒ ReceivingAccount1
Either ‘receiving_account` or `receiving_account_id` must be present.
-
#receiving_account_id ⇒ UUID | String
Either ‘receiving_account` or `receiving_account_id` must be present.
-
#remittance_information ⇒ String
For ‘ach`, this field will be passed through on an addenda record.
-
#send_remittance_advice ⇒ TrueClass | FalseClass
Send an email to the counterparty when the payment order is sent to the bank.
-
#statement_descriptor ⇒ String
An optional descriptor which will appear in the receiver’s statement.
-
#status ⇒ Status18
To cancel a payment order, use ‘cancelled`.
-
#subtype ⇒ Subtype
An additional layer of classification for the type of payment order you are doing.
-
#type ⇒ Type5
One of ‘ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, `au_becs`, `interac`, `signet`, `provexchange`.
-
#ultimate_originating_party_identifier ⇒ String
This represents the identifier by which the person is known to the receiver when using the CIE subtype for ACH payments.
-
#ultimate_originating_party_name ⇒ String
This represents the name of the person that the payment is on behalf of when using the CIE subtype for ACH payments.
-
#ultimate_receiving_party_identifier ⇒ String
This represents the name of the merchant that the payment is being sent to when using the CIE subtype for ACH payments.
-
#ultimate_receiving_party_name ⇒ String
This represents the identifier by which the merchant is known to the person initiating an ACH payment with CIE subtype.
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(type: SKIP, subtype: SKIP, amount: SKIP, direction: SKIP, priority: SKIP, originating_account_id: SKIP, receiving_account_id: SKIP, accounting: SKIP, accounting_category_id: SKIP, accounting_ledger_class_id: SKIP, currency: SKIP, effective_date: SKIP, description: SKIP, statement_descriptor: SKIP, remittance_information: SKIP, purpose: SKIP, metadata: SKIP, charge_bearer: SKIP, foreign_exchange_indicator: SKIP, foreign_exchange_contract: SKIP, nsf_protected: SKIP, originating_party_name: SKIP, ultimate_originating_party_name: SKIP, ultimate_originating_party_identifier: SKIP, ultimate_receiving_party_name: SKIP, ultimate_receiving_party_identifier: SKIP, send_remittance_advice: SKIP, expires_at: SKIP, status: SKIP, counterparty_id: SKIP, fallback_type: SKIP, receiving_account: SKIP, line_items: SKIP, additional_properties: nil) ⇒ PaymentOrderUpdateRequest
constructor
A new instance of PaymentOrderUpdateRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_expires_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(type: SKIP, subtype: SKIP, amount: SKIP, direction: SKIP, priority: SKIP, originating_account_id: SKIP, receiving_account_id: SKIP, accounting: SKIP, accounting_category_id: SKIP, accounting_ledger_class_id: SKIP, currency: SKIP, effective_date: SKIP, description: SKIP, statement_descriptor: SKIP, remittance_information: SKIP, purpose: SKIP, metadata: SKIP, charge_bearer: SKIP, foreign_exchange_indicator: SKIP, foreign_exchange_contract: SKIP, nsf_protected: SKIP, originating_party_name: SKIP, ultimate_originating_party_name: SKIP, ultimate_originating_party_identifier: SKIP, ultimate_receiving_party_name: SKIP, ultimate_receiving_party_identifier: SKIP, send_remittance_advice: SKIP, expires_at: SKIP, status: SKIP, counterparty_id: SKIP, fallback_type: SKIP, receiving_account: SKIP, line_items: SKIP, additional_properties: nil) ⇒ PaymentOrderUpdateRequest
Returns a new instance of PaymentOrderUpdateRequest.
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 311 def initialize(type: SKIP, subtype: SKIP, amount: SKIP, direction: SKIP, priority: SKIP, originating_account_id: SKIP, receiving_account_id: SKIP, accounting: SKIP, accounting_category_id: SKIP, accounting_ledger_class_id: SKIP, currency: SKIP, effective_date: SKIP, description: SKIP, statement_descriptor: SKIP, remittance_information: SKIP, purpose: SKIP, metadata: SKIP, charge_bearer: SKIP, foreign_exchange_indicator: SKIP, foreign_exchange_contract: SKIP, nsf_protected: SKIP, originating_party_name: SKIP, ultimate_originating_party_name: SKIP, ultimate_originating_party_identifier: SKIP, ultimate_receiving_party_name: SKIP, ultimate_receiving_party_identifier: SKIP, send_remittance_advice: SKIP, expires_at: SKIP, status: SKIP, counterparty_id: SKIP, fallback_type: SKIP, receiving_account: SKIP, line_items: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @type = type unless type == SKIP @subtype = subtype unless subtype == SKIP @amount = amount unless amount == SKIP @direction = direction unless direction == SKIP @priority = priority unless priority == SKIP @originating_account_id = originating_account_id unless originating_account_id == SKIP @receiving_account_id = receiving_account_id unless receiving_account_id == SKIP @accounting = accounting unless accounting == SKIP @accounting_category_id = accounting_category_id unless accounting_category_id == SKIP unless accounting_ledger_class_id == SKIP @accounting_ledger_class_id = accounting_ledger_class_id end @currency = currency unless currency == SKIP @effective_date = effective_date unless effective_date == SKIP @description = description unless description == SKIP @statement_descriptor = statement_descriptor unless statement_descriptor == SKIP @remittance_information = remittance_information unless remittance_information == SKIP @purpose = purpose unless purpose == SKIP @metadata = unless == SKIP @charge_bearer = charge_bearer unless charge_bearer == SKIP unless foreign_exchange_indicator == SKIP @foreign_exchange_indicator = foreign_exchange_indicator end unless foreign_exchange_contract == SKIP @foreign_exchange_contract = foreign_exchange_contract end @nsf_protected = nsf_protected unless nsf_protected == SKIP @originating_party_name = originating_party_name unless originating_party_name == SKIP unless ultimate_originating_party_name == SKIP @ultimate_originating_party_name = ultimate_originating_party_name end unless ultimate_originating_party_identifier == SKIP @ultimate_originating_party_identifier = ultimate_originating_party_identifier end unless ultimate_receiving_party_name == SKIP @ultimate_receiving_party_name = ultimate_receiving_party_name end unless ultimate_receiving_party_identifier == SKIP @ultimate_receiving_party_identifier = ultimate_receiving_party_identifier end @send_remittance_advice = send_remittance_advice unless send_remittance_advice == SKIP @expires_at = expires_at unless expires_at == SKIP @status = status unless status == SKIP @counterparty_id = counterparty_id unless counterparty_id == SKIP @fallback_type = fallback_type unless fallback_type == SKIP @receiving_account = receiving_account unless receiving_account == SKIP @line_items = line_items unless line_items == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#accounting ⇒ Accounting
Either ‘receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.
58 59 60 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 58 def accounting @accounting end |
#accounting_category_id ⇒ UUID | String
The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected.
63 64 65 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 63 def accounting_category_id @accounting_category_id end |
#accounting_ledger_class_id ⇒ UUID | String
The ID of one of your accounting ledger classes. Note that these will only be accessible if your accounting system has been connected.
68 69 70 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 68 def accounting_ledger_class_id @accounting_ledger_class_id end |
#amount ⇒ Integer
Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
29 30 31 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 29 def amount @amount end |
#charge_bearer ⇒ ChargeBearer
The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values ‘SHA`, `OUR`, `BEN`.
115 116 117 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 115 def charge_bearer @charge_bearer end |
#counterparty_id ⇒ UUID | String
Required when receiving_account_id is passed the ID of an external account.
186 187 188 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 186 def counterparty_id @counterparty_id end |
#currency ⇒ Currency
Three-letter ISO currency code.
72 73 74 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 72 def currency @currency end |
#description ⇒ String
An optional description for internal use.
82 83 84 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 82 def description @description end |
#direction ⇒ Direction5
One of ‘credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else’s. A ‘debit` pulls money from someone else’s account to your own. Note that wire, rtp, and check payments will always be ‘credit`.
36 37 38 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 36 def direction @direction end |
#effective_date ⇒ Date
Date transactions are to be posted to the participants’ account. Defaults to the current business day or the next business day if the current day is a bank holiday or weekend. Format: yyyy-mm-dd.
78 79 80 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 78 def effective_date @effective_date end |
#expires_at ⇒ DateTime
RFP payments require an expires_at. This value must be past the effective_date.
175 176 177 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 175 def expires_at @expires_at end |
#fallback_type ⇒ FallbackType
A payment type to fallback to if the original type is not valid for the receiving account. Currently, this only supports falling back from RTP to ACH (type=rtp and fallback_type=ach)
192 193 194 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 192 def fallback_type @fallback_type end |
#foreign_exchange_contract ⇒ String
If present, indicates a specific foreign exchange contract number that has been generated by your financial institution.
126 127 128 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 126 def foreign_exchange_contract @foreign_exchange_contract end |
#foreign_exchange_indicator ⇒ ForeignExchangeIndicator
Indicates the type of FX transfer to initiate, can be either ‘variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order currency matches the originating account currency.
121 122 123 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 121 def foreign_exchange_indicator @foreign_exchange_indicator end |
#line_items ⇒ Array[LineItemRequest]
An array of line items that must sum up to the amount of the payment order.
203 204 205 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 203 def line_items @line_items end |
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs. Both the key and value must be strings.
109 110 111 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 109 def @metadata end |
#nsf_protected ⇒ TrueClass | FalseClass
A boolean to determine if NSF Protection is enabled for this payment order. Note that this setting must also be turned on in your organization settings page.
132 133 134 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 132 def nsf_protected @nsf_protected end |
#originating_account_id ⇒ UUID | String
The ID of one of your organization’s internal accounts.
46 47 48 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 46 def originating_account_id @originating_account_id end |
#originating_party_name ⇒ String
If present, this will replace your default company name on receiver’s bank statement. This field can only be used for ACH payments currently. For ACH, only the first 16 characters of this string will be used. Any additional characters will be truncated.
139 140 141 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 139 def originating_party_name @originating_party_name end |
#priority ⇒ Priority
Either ‘normal` or `high`. For ACH and EFT payments, `high` represents a same-day ACH or EFT transfer, respectively. For check payments, `high` can mean an overnight check rather than standard mail.
42 43 44 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 42 def priority @priority end |
#purpose ⇒ String
For ‘wire`, this is usually the purpose which is transmitted via the “InstrForDbtrAgt” field in the ISO20022 file. If you are using Currencycloud, this is the `payment.purpose_code` field. For `eft`, this field is the 3 digit CPA Code that will be attached to the payment.
104 105 106 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 104 def purpose @purpose end |
#receiving_account ⇒ ReceivingAccount1
Either ‘receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.
198 199 200 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 198 def receiving_account @receiving_account end |
#receiving_account_id ⇒ UUID | String
Either ‘receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.
52 53 54 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 52 def receiving_account_id @receiving_account_id 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.
97 98 99 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 97 def remittance_information @remittance_information end |
#send_remittance_advice ⇒ TrueClass | FalseClass
Send an email to the counterparty when the payment order is sent to the bank. If ‘null`, `send_remittance_advice` on the Counterparty is used.
170 171 172 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 170 def send_remittance_advice @send_remittance_advice end |
#statement_descriptor ⇒ String
An optional descriptor which will appear in the receiver’s statement. For ‘check` payments this field will be used as the memo line. For `ach` the maximum length is 10 characters. Note that for ACH payments, the name on your bank account will be included automatically by the bank, so you can use the characters for other useful information. For `eft` the maximum length is 15 characters.
91 92 93 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 91 def statement_descriptor @statement_descriptor end |
#status ⇒ Status18
To cancel a payment order, use ‘cancelled`. To redraft a returned payment order, use `approved`. To undo approval on a denied or approved payment order, use `needs_approval`.
181 182 183 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 181 def status @status end |
#subtype ⇒ Subtype
An additional layer of classification for the type of payment order you are doing. This field is only used for ‘ach` payment orders currently. For `ach` payment orders, the `subtype` represents the SEC code. We currently support `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
23 24 25 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 23 def subtype @subtype end |
#type ⇒ Type5
One of ‘ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, `au_becs`, `interac`, `signet`, `provexchange`.
16 17 18 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 16 def type @type end |
#ultimate_originating_party_identifier ⇒ String
This represents the identifier by which the person is known to the receiver when using the CIE subtype for ACH payments. Only the first 22 characters of this string will be used. Any additional characters will be truncated.
152 153 154 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 152 def ultimate_originating_party_identifier @ultimate_originating_party_identifier end |
#ultimate_originating_party_name ⇒ String
This represents the name of the person that the payment is on behalf of when using the CIE subtype for ACH payments. Only the first 15 characters of this string will be used. Any additional characters will be truncated.
145 146 147 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 145 def ultimate_originating_party_name @ultimate_originating_party_name end |
#ultimate_receiving_party_identifier ⇒ String
This represents the name of the merchant that the payment is being sent to when using the CIE subtype for ACH payments. Only the first 22 characters of this string will be used. Any additional characters will be truncated.
165 166 167 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 165 def ultimate_receiving_party_identifier @ultimate_receiving_party_identifier end |
#ultimate_receiving_party_name ⇒ String
This represents the identifier by which the merchant is known to the person initiating an ACH payment with CIE subtype. Only the first 15 characters of this string will be used. Any additional characters will be truncated.
159 160 161 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 159 def ultimate_receiving_party_name @ultimate_receiving_party_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 391 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash.key?('type') ? hash['type'] : SKIP subtype = hash.key?('subtype') ? hash['subtype'] : SKIP amount = hash.key?('amount') ? hash['amount'] : SKIP direction = hash.key?('direction') ? hash['direction'] : SKIP priority = hash.key?('priority') ? hash['priority'] : SKIP originating_account_id = hash.key?('originating_account_id') ? hash['originating_account_id'] : SKIP receiving_account_id = hash.key?('receiving_account_id') ? hash['receiving_account_id'] : SKIP accounting = Accounting.from_hash(hash['accounting']) if hash['accounting'] accounting_category_id = hash.key?('accounting_category_id') ? hash['accounting_category_id'] : SKIP accounting_ledger_class_id = hash.key?('accounting_ledger_class_id') ? hash['accounting_ledger_class_id'] : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP effective_date = hash.key?('effective_date') ? hash['effective_date'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP statement_descriptor = hash.key?('statement_descriptor') ? hash['statement_descriptor'] : SKIP remittance_information = hash.key?('remittance_information') ? hash['remittance_information'] : SKIP purpose = hash.key?('purpose') ? hash['purpose'] : SKIP = hash.key?('metadata') ? hash['metadata'] : SKIP charge_bearer = hash.key?('charge_bearer') ? hash['charge_bearer'] : SKIP foreign_exchange_indicator = hash.key?('foreign_exchange_indicator') ? hash['foreign_exchange_indicator'] : SKIP foreign_exchange_contract = hash.key?('foreign_exchange_contract') ? hash['foreign_exchange_contract'] : SKIP nsf_protected = hash.key?('nsf_protected') ? hash['nsf_protected'] : SKIP originating_party_name = hash.key?('originating_party_name') ? hash['originating_party_name'] : SKIP ultimate_originating_party_name = hash.key?('ultimate_originating_party_name') ? hash['ultimate_originating_party_name'] : SKIP ultimate_originating_party_identifier = hash.key?('ultimate_originating_party_identifier') ? hash['ultimate_originating_party_identifier'] : SKIP ultimate_receiving_party_name = hash.key?('ultimate_receiving_party_name') ? hash['ultimate_receiving_party_name'] : SKIP ultimate_receiving_party_identifier = hash.key?('ultimate_receiving_party_identifier') ? hash['ultimate_receiving_party_identifier'] : SKIP send_remittance_advice = hash.key?('send_remittance_advice') ? hash['send_remittance_advice'] : SKIP expires_at = if hash.key?('expires_at') (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at']) else SKIP end status = hash.key?('status') ? hash['status'] : SKIP counterparty_id = hash.key?('counterparty_id') ? hash['counterparty_id'] : SKIP fallback_type = hash.key?('fallback_type') ? hash['fallback_type'] : SKIP receiving_account = ReceivingAccount1.from_hash(hash['receiving_account']) if hash['receiving_account'] # Parameter is an array, so we need to iterate through it line_items = nil unless hash['line_items'].nil? line_items = [] hash['line_items'].each do |structure| line_items << (LineItemRequest.from_hash(structure) if structure) end end line_items = SKIP unless hash.key?('line_items') # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. PaymentOrderUpdateRequest.new(type: type, subtype: subtype, amount: amount, direction: direction, priority: priority, originating_account_id: originating_account_id, receiving_account_id: receiving_account_id, accounting: accounting, accounting_category_id: accounting_category_id, accounting_ledger_class_id: accounting_ledger_class_id, currency: currency, effective_date: effective_date, description: description, statement_descriptor: statement_descriptor, remittance_information: remittance_information, purpose: purpose, metadata: , charge_bearer: charge_bearer, foreign_exchange_indicator: foreign_exchange_indicator, foreign_exchange_contract: foreign_exchange_contract, nsf_protected: nsf_protected, originating_party_name: originating_party_name, ultimate_originating_party_name: ultimate_originating_party_name, ultimate_originating_party_identifier: ultimate_originating_party_identifier, ultimate_receiving_party_name: ultimate_receiving_party_name, ultimate_receiving_party_identifier: ultimate_receiving_party_identifier, send_remittance_advice: send_remittance_advice, expires_at: expires_at, status: status, counterparty_id: counterparty_id, fallback_type: fallback_type, receiving_account: receiving_account, line_items: line_items, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 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 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 206 def self.names @_hash = {} if @_hash.nil? @_hash['type'] = 'type' @_hash['subtype'] = 'subtype' @_hash['amount'] = 'amount' @_hash['direction'] = 'direction' @_hash['priority'] = 'priority' @_hash['originating_account_id'] = 'originating_account_id' @_hash['receiving_account_id'] = 'receiving_account_id' @_hash['accounting'] = 'accounting' @_hash['accounting_category_id'] = 'accounting_category_id' @_hash['accounting_ledger_class_id'] = 'accounting_ledger_class_id' @_hash['currency'] = 'currency' @_hash['effective_date'] = 'effective_date' @_hash['description'] = 'description' @_hash['statement_descriptor'] = 'statement_descriptor' @_hash['remittance_information'] = 'remittance_information' @_hash['purpose'] = 'purpose' @_hash['metadata'] = 'metadata' @_hash['charge_bearer'] = 'charge_bearer' @_hash['foreign_exchange_indicator'] = 'foreign_exchange_indicator' @_hash['foreign_exchange_contract'] = 'foreign_exchange_contract' @_hash['nsf_protected'] = 'nsf_protected' @_hash['originating_party_name'] = 'originating_party_name' @_hash['ultimate_originating_party_name'] = 'ultimate_originating_party_name' @_hash['ultimate_originating_party_identifier'] = 'ultimate_originating_party_identifier' @_hash['ultimate_receiving_party_name'] = 'ultimate_receiving_party_name' @_hash['ultimate_receiving_party_identifier'] = 'ultimate_receiving_party_identifier' @_hash['send_remittance_advice'] = 'send_remittance_advice' @_hash['expires_at'] = 'expires_at' @_hash['status'] = 'status' @_hash['counterparty_id'] = 'counterparty_id' @_hash['fallback_type'] = 'fallback_type' @_hash['receiving_account'] = 'receiving_account' @_hash['line_items'] = 'line_items' @_hash end |
.nullables ⇒ Object
An array for nullable fields
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 288 def self.nullables %w[ subtype accounting_category_id accounting_ledger_class_id description statement_descriptor remittance_information purpose charge_bearer foreign_exchange_indicator foreign_exchange_contract originating_party_name ultimate_originating_party_name ultimate_originating_party_identifier ultimate_receiving_party_name ultimate_receiving_party_identifier send_remittance_advice expires_at counterparty_id ] end |
.optionals ⇒ Object
An array for optional fields
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 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 249 def self.optionals %w[ type subtype amount direction priority originating_account_id receiving_account_id accounting accounting_category_id accounting_ledger_class_id currency effective_date description statement_descriptor remittance_information purpose metadata charge_bearer foreign_exchange_indicator foreign_exchange_contract nsf_protected originating_party_name ultimate_originating_party_name ultimate_originating_party_identifier ultimate_receiving_party_name ultimate_receiving_party_identifier send_remittance_advice expires_at status counterparty_id fallback_type receiving_account line_items ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 532 def inspect class_name = self.class.name.split('::').last "<#{class_name} type: #{@type.inspect}, subtype: #{@subtype.inspect}, amount:"\ " #{@amount.inspect}, direction: #{@direction.inspect}, priority: #{@priority.inspect},"\ " originating_account_id: #{@originating_account_id.inspect}, receiving_account_id:"\ " #{@receiving_account_id.inspect}, accounting: #{@accounting.inspect},"\ " accounting_category_id: #{@accounting_category_id.inspect}, accounting_ledger_class_id:"\ " #{@accounting_ledger_class_id.inspect}, currency: #{@currency.inspect}, effective_date:"\ " #{@effective_date.inspect}, description: #{@description.inspect}, statement_descriptor:"\ " #{@statement_descriptor.inspect}, remittance_information:"\ " #{@remittance_information.inspect}, purpose: #{@purpose.inspect}, metadata:"\ " #{@metadata.inspect}, charge_bearer: #{@charge_bearer.inspect},"\ " foreign_exchange_indicator: #{@foreign_exchange_indicator.inspect},"\ " foreign_exchange_contract: #{@foreign_exchange_contract.inspect}, nsf_protected:"\ " #{@nsf_protected.inspect}, originating_party_name: #{@originating_party_name.inspect},"\ " ultimate_originating_party_name: #{@ultimate_originating_party_name.inspect},"\ " ultimate_originating_party_identifier: #{@ultimate_originating_party_identifier.inspect},"\ " ultimate_receiving_party_name: #{@ultimate_receiving_party_name.inspect},"\ " ultimate_receiving_party_identifier: #{@ultimate_receiving_party_identifier.inspect},"\ " send_remittance_advice: #{@send_remittance_advice.inspect}, expires_at:"\ " #{@expires_at.inspect}, status: #{@status.inspect}, counterparty_id:"\ " #{@counterparty_id.inspect}, fallback_type: #{@fallback_type.inspect}, receiving_account:"\ " #{@receiving_account.inspect}, line_items: #{@line_items.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_expires_at ⇒ Object
503 504 505 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 503 def to_custom_expires_at DateTimeHelper.to_rfc3339(expires_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/modern_treasury/models/payment_order_update_request.rb', line 508 def to_s class_name = self.class.name.split('::').last "<#{class_name} type: #{@type}, subtype: #{@subtype}, amount: #{@amount}, direction:"\ " #{@direction}, priority: #{@priority}, originating_account_id: #{@originating_account_id},"\ " receiving_account_id: #{@receiving_account_id}, accounting: #{@accounting},"\ " accounting_category_id: #{@accounting_category_id}, accounting_ledger_class_id:"\ " #{@accounting_ledger_class_id}, currency: #{@currency}, effective_date:"\ " #{@effective_date}, description: #{@description}, statement_descriptor:"\ " #{@statement_descriptor}, remittance_information: #{@remittance_information}, purpose:"\ " #{@purpose}, metadata: #{@metadata}, charge_bearer: #{@charge_bearer},"\ " foreign_exchange_indicator: #{@foreign_exchange_indicator}, foreign_exchange_contract:"\ " #{@foreign_exchange_contract}, nsf_protected: #{@nsf_protected}, originating_party_name:"\ " #{@originating_party_name}, ultimate_originating_party_name:"\ " #{@ultimate_originating_party_name}, ultimate_originating_party_identifier:"\ " #{@ultimate_originating_party_identifier}, ultimate_receiving_party_name:"\ " #{@ultimate_receiving_party_name}, ultimate_receiving_party_identifier:"\ " #{@ultimate_receiving_party_identifier}, send_remittance_advice:"\ " #{@send_remittance_advice}, expires_at: #{@expires_at}, status: #{@status},"\ " counterparty_id: #{@counterparty_id}, fallback_type: #{@fallback_type}, receiving_account:"\ " #{@receiving_account}, line_items: #{@line_items}, additional_properties:"\ " #{@additional_properties}>" end |