Class: ModernTreasury::PaymentOrderCreateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::PaymentOrderCreateRequest
- Defined in:
- lib/modern_treasury/models/payment_order_create_request.rb
Overview
PaymentOrderCreateRequest 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.
-
#currency ⇒ Currency
Three-letter ISO currency code.
-
#description ⇒ String
An optional description for internal use.
-
#direction ⇒ Direction5
One of ‘credit`, `debit`.
-
#documents ⇒ Array[DocumentCreateRequest]
An array of documents to be attached to the payment order.
-
#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.
-
#ledger_transaction ⇒ LedgerTransactionCreateRequest
Either ‘receiving_account` or `receiving_account_id` must be present.
-
#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.
-
#subtype ⇒ Subtype
An additional layer of classification for the type of payment order you are doing.
-
#transaction_monitoring_enabled ⇒ TrueClass | FalseClass
A flag that determines whether a payment order should go through transaction monitoring.
-
#type ⇒ Type5
One of ‘ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, `au_becs`, `interac`, `signet`, `provexchange`.
-
#ultimate_originating_party_identifier ⇒ String
Identifier of the ultimate originator of the payment order.
-
#ultimate_originating_party_name ⇒ String
Name of the ultimate originator of the payment order.
-
#ultimate_receiving_party_identifier ⇒ String
Identifier of the ultimate funds recipient.
-
#ultimate_receiving_party_name ⇒ String
Name of the ultimate funds recipient.
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:, amount:, direction:, originating_account_id:, subtype: SKIP, priority: 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, fallback_type: SKIP, receiving_account: SKIP, ledger_transaction: SKIP, line_items: SKIP, transaction_monitoring_enabled: SKIP, documents: SKIP, additional_properties: nil) ⇒ PaymentOrderCreateRequest
constructor
A new instance of PaymentOrderCreateRequest.
-
#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:, amount:, direction:, originating_account_id:, subtype: SKIP, priority: 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, fallback_type: SKIP, receiving_account: SKIP, ledger_transaction: SKIP, line_items: SKIP, transaction_monitoring_enabled: SKIP, documents: SKIP, additional_properties: nil) ⇒ PaymentOrderCreateRequest
Returns a new instance of PaymentOrderCreateRequest.
305 306 307 308 309 310 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 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 305 def initialize(type:, amount:, direction:, originating_account_id:, subtype: SKIP, priority: 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, fallback_type: SKIP, receiving_account: SKIP, ledger_transaction: SKIP, line_items: SKIP, transaction_monitoring_enabled: SKIP, documents: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @type = type @subtype = subtype unless subtype == SKIP @amount = amount @direction = direction @priority = priority unless priority == SKIP @originating_account_id = originating_account_id @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 @fallback_type = fallback_type unless fallback_type == SKIP @receiving_account = receiving_account unless receiving_account == SKIP @ledger_transaction = ledger_transaction unless ledger_transaction == SKIP @line_items = line_items unless line_items == SKIP unless transaction_monitoring_enabled == SKIP @transaction_monitoring_enabled = transaction_monitoring_enabled end @documents = documents unless documents == 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_create_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_create_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_create_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_create_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_create_request.rb', line 115 def charge_bearer @charge_bearer end |
#currency ⇒ Currency
Three-letter ISO currency code.
72 73 74 |
# File 'lib/modern_treasury/models/payment_order_create_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_create_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_create_request.rb', line 36 def direction @direction end |
#documents ⇒ Array[DocumentCreateRequest]
An array of documents to be attached to the payment order. Note that if you attach documents, the request’s content type must be ‘multipart/form-data`.
199 200 201 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 199 def documents @documents 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_create_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.
165 166 167 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 165 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)
171 172 173 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 171 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_create_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_create_request.rb', line 121 def foreign_exchange_indicator @foreign_exchange_indicator end |
#ledger_transaction ⇒ LedgerTransactionCreateRequest
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.
183 184 185 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 183 def ledger_transaction @ledger_transaction end |
#line_items ⇒ Array[LineItemRequest]
An array of line items that must sum up to the amount of the payment order.
188 189 190 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 188 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_create_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_create_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_create_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_create_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_create_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_create_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.
177 178 179 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 177 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_create_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_create_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.
160 161 162 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 160 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_create_request.rb', line 91 def statement_descriptor @statement_descriptor 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_create_request.rb', line 23 def subtype @subtype end |
#transaction_monitoring_enabled ⇒ TrueClass | FalseClass
A flag that determines whether a payment order should go through transaction monitoring.
193 194 195 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 193 def transaction_monitoring_enabled @transaction_monitoring_enabled 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_create_request.rb', line 16 def type @type end |
#ultimate_originating_party_identifier ⇒ String
Identifier of the ultimate originator of the payment order.
147 148 149 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 147 def ultimate_originating_party_identifier @ultimate_originating_party_identifier end |
#ultimate_originating_party_name ⇒ String
Name of the ultimate originator of the payment order.
143 144 145 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 143 def ultimate_originating_party_name @ultimate_originating_party_name end |
#ultimate_receiving_party_identifier ⇒ String
Identifier of the ultimate funds recipient.
155 156 157 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 155 def ultimate_receiving_party_identifier @ultimate_receiving_party_identifier end |
#ultimate_receiving_party_name ⇒ String
Name of the ultimate funds recipient.
151 152 153 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 151 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.
389 390 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 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 389 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash.key?('type') ? hash['type'] : nil amount = hash.key?('amount') ? hash['amount'] : nil direction = hash.key?('direction') ? hash['direction'] : nil originating_account_id = hash.key?('originating_account_id') ? hash['originating_account_id'] : nil subtype = hash.key?('subtype') ? hash['subtype'] : SKIP priority = hash.key?('priority') ? hash['priority'] : 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 fallback_type = hash.key?('fallback_type') ? hash['fallback_type'] : SKIP receiving_account = ReceivingAccount1.from_hash(hash['receiving_account']) if hash['receiving_account'] ledger_transaction = LedgerTransactionCreateRequest.from_hash(hash['ledger_transaction']) if hash['ledger_transaction'] # 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') transaction_monitoring_enabled = hash.key?('transaction_monitoring_enabled') ? hash['transaction_monitoring_enabled'] : SKIP # Parameter is an array, so we need to iterate through it documents = nil unless hash['documents'].nil? documents = [] hash['documents'].each do |structure| documents << (DocumentCreateRequest.from_hash(structure) if structure) end end documents = SKIP unless hash.key?('documents') # 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. PaymentOrderCreateRequest.new(type: type, amount: amount, direction: direction, originating_account_id: originating_account_id, subtype: subtype, priority: priority, 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, fallback_type: fallback_type, receiving_account: receiving_account, ledger_transaction: ledger_transaction, line_items: line_items, transaction_monitoring_enabled: transaction_monitoring_enabled, documents: documents, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
202 203 204 205 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 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 202 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['fallback_type'] = 'fallback_type' @_hash['receiving_account'] = 'receiving_account' @_hash['ledger_transaction'] = 'ledger_transaction' @_hash['line_items'] = 'line_items' @_hash['transaction_monitoring_enabled'] = 'transaction_monitoring_enabled' @_hash['documents'] = 'documents' @_hash end |
.nullables ⇒ Object
An array for nullable fields
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 283 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 ] end |
.optionals ⇒ Object
An array for optional fields
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 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 247 def self.optionals %w[ subtype priority 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 fallback_type receiving_account ledger_transaction line_items transaction_monitoring_enabled documents ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 543 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}, fallback_type: #{@fallback_type.inspect}, receiving_account:"\ " #{@receiving_account.inspect}, ledger_transaction: #{@ledger_transaction.inspect},"\ " line_items: #{@line_items.inspect}, transaction_monitoring_enabled:"\ " #{@transaction_monitoring_enabled.inspect}, documents: #{@documents.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_expires_at ⇒ Object
513 514 515 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 513 def to_custom_expires_at DateTimeHelper.to_rfc3339(expires_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/modern_treasury/models/payment_order_create_request.rb', line 518 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}, fallback_type: #{@fallback_type},"\ " receiving_account: #{@receiving_account}, ledger_transaction: #{@ledger_transaction},"\ " line_items: #{@line_items}, transaction_monitoring_enabled:"\ " #{@transaction_monitoring_enabled}, documents: #{@documents}, additional_properties:"\ " #{@additional_properties}>" end |