Class: ModernTreasury::Models::PaymentOrder

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

Overview

See Also:

  • ModernTreasury::Resources::PaymentOrders#create

Defined Under Namespace

Modules: ChargeBearer, Direction, ForeignExchangeIndicator, OriginatingAccountType, Priority, ReceivingAccountType, ReconciliationStatus, Status, UltimateOriginatingAccount, UltimateOriginatingAccountType Classes: Accounting, CurrentHold, OriginatingPartyAddress, ReferenceNumber

Constant Summary collapse

ModernTreasury =

Returns:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(country: nil, line1: nil, line2: nil, locality: nil, postal_code: nil, region: nil) ⇒ Object

Some parameter documentations has been truncated, see OriginatingPartyAddress for more details.

If present, this address will override the default originating party address used on the payment order. This works across all payment types.

Parameters:

  • country (String, nil) (defaults to: nil) —

    Country code conforms to [ISO 3166-1 alpha-2]

  • line1 (String, nil) (defaults to: nil)
  • line2 (String, nil) (defaults to: nil)
  • locality (String, nil) (defaults to: nil) —

    Locality or City. Use the full city name rather than an abbreviation (e.g. San F

  • postal_code (String, nil) (defaults to: nil) —

    The postal code of the address.

  • region (String, nil) (defaults to: nil) —

    Region or State. This field is free-form; for US states, we recommend a two-lett



# File 'lib/modern_treasury/models/payment_order.rb', line 379

Instance Attribute Details

#accounting ⇒ ModernTreasury::Models::PaymentOrder::Accounting

Deprecated.

Parameters:

  • value (ModernTreasury::PaymentOrder::Accounting)

Returns:



16
# File 'lib/modern_treasury/models/payment_order.rb', line 16

required :accounting, -> { ModernTreasury::PaymentOrder::Accounting }

#accounting_category_id ⇒ String?

Deprecated.

The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


25
# File 'lib/modern_treasury/models/payment_order.rb', line 25

required :accounting_category_id, String, nil?: true

#accounting_ledger_class_id ⇒ String?

Deprecated.

The ID of one of your accounting ledger classes. Note that these will only be accessible if your accounting system has been connected.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


34
# File 'lib/modern_treasury/models/payment_order.rb', line 34

required :accounting_ledger_class_id, String, nil?: true

#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 $10,000,000.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


41
# File 'lib/modern_treasury/models/payment_order.rb', line 41

required :amount, Integer

#batch_id ⇒ String?

The ID of the batch in which the payment order is included. Only populated after the payment order begins processing.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


48
# File 'lib/modern_treasury/models/payment_order.rb', line 48

required :batch_id, String, nil?: true

#charge_bearer ⇒ Symbol, ...

The party that will pay the fees for the payment order. See https://docs.moderntreasury.com/payments/docs/charge-bearer to understand the differences between the options.

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::charge_bearer, nil)

Returns:



56
# File 'lib/modern_treasury/models/payment_order.rb', line 56

required :charge_bearer, enum: -> { ModernTreasury::PaymentOrder::ChargeBearer }, nil?: true

#counterparty_id ⇒ String?

If the payment order is tied to a specific Counterparty, their id will appear, otherwise null.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


63
# File 'lib/modern_treasury/models/payment_order.rb', line 63

required :counterparty_id, String, nil?: true

#created_at ⇒ Time

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#currency ⇒ Symbol, ModernTreasury::Models::Currency

Defaults to the currency of the originating account.

Parameters:

  • value (ModernTreasury::Models::currency)

Returns:



74
# File 'lib/modern_treasury/models/payment_order.rb', line 74

required :currency, enum: -> { ModernTreasury::Currency }

#current_hold ⇒ ModernTreasury::Models::PaymentOrder::CurrentHold?

If the payment order's status is held, this will include the hold object's data.

Parameters:

  • value (ModernTreasury::PaymentOrder::CurrentHold, nil)

Returns:



81
# File 'lib/modern_treasury/models/payment_order.rb', line 81

required :current_hold, -> { ModernTreasury::PaymentOrder::CurrentHold }, nil?: true

#current_return ⇒ ModernTreasury::Models::ReturnObject?

If the payment order's status is returned, this will include the return object's data.

Parameters:

Returns:



88
# File 'lib/modern_treasury/models/payment_order.rb', line 88

required :current_return, -> { ModernTreasury::ReturnObject }, nil?: true

#description ⇒ String?

An optional description for internal use.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


94
# File 'lib/modern_treasury/models/payment_order.rb', line 94

required :description, String, nil?: true

#direction ⇒ Symbol, ModernTreasury::Models::PaymentOrder::Direction

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.

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::direction)

Returns:



103
# File 'lib/modern_treasury/models/payment_order.rb', line 103

required :direction, enum: -> { ModernTreasury::PaymentOrder::Direction }

#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.

Parameters:

  • value (Date)

Returns:

  • (Date)


111
# File 'lib/modern_treasury/models/payment_order.rb', line 111

required :effective_date, Date

#expires_at ⇒ Time?

RFP payments require an expires_at. This value must be past the effective_date.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


117
# File 'lib/modern_treasury/models/payment_order.rb', line 117

required :expires_at, Time, nil?: true

#external_id ⇒ String?

An optional user-defined 180 character unique identifier.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


123
# File 'lib/modern_treasury/models/payment_order.rb', line 123

required :external_id, String, nil?: true

#foreign_exchange_contract ⇒ String?

If present, indicates a specific foreign exchange contract number that has been generated by your financial institution.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :foreign_exchange_contract, String, nil?: true

#foreign_exchange_indicator ⇒ Symbol, ...

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.

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::foreign_exchange_indicator, nil)

Returns:



138
139
140
# File 'lib/modern_treasury/models/payment_order.rb', line 138

required :foreign_exchange_indicator,
enum: -> { ModernTreasury::PaymentOrder::ForeignExchangeIndicator },
nil?: true

#foreign_exchange_rate ⇒ ModernTreasury::Models::ForeignExchangeRate?

Associated serialized foreign exchange rate information.



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

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

#id ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/modern_treasury/models/payment_order.rb', line 10

required :id, String

#ledger_transaction_id ⇒ String?

The ID of the ledger transaction linked to the payment order.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :ledger_transaction_id, String, nil?: true

#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.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


159
# File 'lib/modern_treasury/models/payment_order.rb', line 159

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.

Parameters:

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

Returns:

  • (Hash{Symbol=>String})


166
# File 'lib/modern_treasury/models/payment_order.rb', line 166

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

#nsf_protected ⇒ Boolean

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.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


173
# File 'lib/modern_treasury/models/payment_order.rb', line 173

required :nsf_protected, ModernTreasury::Internal::Type::Boolean

#object ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


178
# File 'lib/modern_treasury/models/payment_order.rb', line 178

required :object, String

#originating_account_id ⇒ String

The ID of one of your organization's internal accounts.

Parameters:

  • value (String)

Returns:

  • (String)


184
# File 'lib/modern_treasury/models/payment_order.rb', line 184

required :originating_account_id, String

#originating_account_type ⇒ Symbol, ModernTreasury::Models::PaymentOrder::OriginatingAccountType

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::originating_account_type)

Returns:



189
# File 'lib/modern_treasury/models/payment_order.rb', line 189

required :originating_account_type, enum: -> { ModernTreasury::PaymentOrder::OriginatingAccountType }

#originating_party_address ⇒ ModernTreasury::Models::PaymentOrder::OriginatingPartyAddress?

If present, this address will override the default originating party address used on the payment order. This works across all payment types.

Parameters:

  • value (ModernTreasury::PaymentOrder::OriginatingPartyAddress, nil)

Returns:



196
197
198
# File 'lib/modern_treasury/models/payment_order.rb', line 196

required :originating_party_address,
-> { ModernTreasury::PaymentOrder::OriginatingPartyAddress },
nil?: true

#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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


207
# File 'lib/modern_treasury/models/payment_order.rb', line 207

required :originating_party_name, String, nil?: true

#priority ⇒ Symbol, ModernTreasury::Models::PaymentOrder::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.

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::priority)

Returns:



215
# File 'lib/modern_treasury/models/payment_order.rb', line 215

required :priority, enum: -> { ModernTreasury::PaymentOrder::Priority }

#process_after ⇒ Time?

If present, Modern Treasury will not process the payment until after this time. If process_after is past the cutoff for effective_date, process_after will take precedence and effective_date will automatically update to reflect the earliest possible sending date after process_after. Format is ISO8601 timestamp.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


225
# File 'lib/modern_treasury/models/payment_order.rb', line 225

required :process_after, Time, nil?: true

#purpose ⇒ String?

For wire, this is usually the purpose which is transmitted via the "InstrForDbtrAgt" field in the ISO20022 file. For eft, this field is the 3 digit CPA Code that will be attached to the payment.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


233
# File 'lib/modern_treasury/models/payment_order.rb', line 233

required :purpose, String, nil?: true

#receiving_account_id ⇒ String

The receiving account ID. Can be an external_account or internal_account.

Parameters:

  • value (String)

Returns:

  • (String)


239
# File 'lib/modern_treasury/models/payment_order.rb', line 239

required :receiving_account_id, String

#receiving_account_type ⇒ Symbol, ModernTreasury::Models::PaymentOrder::ReceivingAccountType

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::receiving_account_type)

Returns:



244
# File 'lib/modern_treasury/models/payment_order.rb', line 244

required :receiving_account_type, enum: -> { ModernTreasury::PaymentOrder::ReceivingAccountType }

#reconciliation_status ⇒ Symbol, ModernTreasury::Models::PaymentOrder::ReconciliationStatus

One of unreconciled, tentatively_reconciled or reconciled.

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::reconciliation_status)

Returns:



250
# File 'lib/modern_treasury/models/payment_order.rb', line 250

required :reconciliation_status, enum: -> { ModernTreasury::PaymentOrder::ReconciliationStatus }

#reference_numbers ⇒ Array<ModernTreasury::Models::PaymentOrder::ReferenceNumber>

Parameters:

  • value (::Array[ModernTreasury::PaymentOrder::ReferenceNumber])

Returns:



255
256
# File 'lib/modern_treasury/models/payment_order.rb', line 255

required :reference_numbers,
-> { ModernTreasury::Internal::Type::ArrayOf[ModernTreasury::PaymentOrder::ReferenceNumber] }

#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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


264
# File 'lib/modern_treasury/models/payment_order.rb', line 264

required :remittance_information, String, nil?: true

#send_remittance_advice ⇒ Boolean?

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.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


271
# File 'lib/modern_treasury/models/payment_order.rb', line 271

required :send_remittance_advice, ModernTreasury::Internal::Type::Boolean, nil?: true

#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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


282
# File 'lib/modern_treasury/models/payment_order.rb', line 282

required :statement_descriptor, String, nil?: true

#status ⇒ Symbol, ModernTreasury::Models::PaymentOrder::Status

The current status of the payment order.

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::status)

Returns:



288
# File 'lib/modern_treasury/models/payment_order.rb', line 288

required :status, enum: -> { ModernTreasury::PaymentOrder::Status }

#subtype ⇒ Symbol, ...

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.

Parameters:

  • value (ModernTreasury::Models::payment_order_subtype, nil)

Returns:



297
# File 'lib/modern_treasury/models/payment_order.rb', line 297

required :subtype, enum: -> { ModernTreasury::PaymentOrderSubtype }, nil?: true

#transaction_ids ⇒ Array<String>

The IDs of all the transactions associated to this payment order. Usually, you will only have a single transaction ID. However, if a payment order initially results in a Return, but gets redrafted and is later successfully completed, it can have many transactions.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


306
# File 'lib/modern_treasury/models/payment_order.rb', line 306

required :transaction_ids, ModernTreasury::Internal::Type::ArrayOf[String]

#type ⇒ Symbol, ModernTreasury::Models::PaymentOrderType

One of ach, se_bankgirot, eft, wire, check, book, rtp, sepa, bacs, au_becs, neft, nics, nz_national_clearing_code, sic, zengin.

Parameters:

  • value (ModernTreasury::Models::payment_order_type)

Returns:



313
# File 'lib/modern_treasury/models/payment_order.rb', line 313

required :type, enum: -> { ModernTreasury::PaymentOrderType }

#ultimate_originating_account ⇒ ModernTreasury::Models::VirtualAccount, ...

The account to which the originating of this payment should be attributed to. Can be a virtual_account or internal_account.

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::ultimate_originating_account, nil)

Returns:



320
321
322
# File 'lib/modern_treasury/models/payment_order.rb', line 320

required :ultimate_originating_account,
union: -> { ModernTreasury::PaymentOrder::UltimateOriginatingAccount },
nil?: true

#ultimate_originating_account_id ⇒ String?

The ultimate originating account ID. Can be a virtual_account or internal_account.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


329
# File 'lib/modern_treasury/models/payment_order.rb', line 329

required :ultimate_originating_account_id, String, nil?: true

#ultimate_originating_account_type ⇒ Symbol, ...

Parameters:

  • value (ModernTreasury::Models::PaymentOrder::ultimate_originating_account_type, nil)

Returns:



334
335
336
# File 'lib/modern_treasury/models/payment_order.rb', line 334

required :ultimate_originating_account_type,
enum: -> { ModernTreasury::PaymentOrder::UltimateOriginatingAccountType },
nil?: true

#ultimate_originating_party_identifier ⇒ String?

Identifier of the ultimate originator of the payment order.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


342
# File 'lib/modern_treasury/models/payment_order.rb', line 342

required :ultimate_originating_party_identifier, String, nil?: true

#ultimate_originating_party_name ⇒ String?

Name of the ultimate originator of the payment order.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


348
# File 'lib/modern_treasury/models/payment_order.rb', line 348

required :ultimate_originating_party_name, String, nil?: true

#ultimate_receiving_party_identifier ⇒ String?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


353
# File 'lib/modern_treasury/models/payment_order.rb', line 353

required :ultimate_receiving_party_identifier, String, nil?: true

#ultimate_receiving_party_name ⇒ String?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


358
# File 'lib/modern_treasury/models/payment_order.rb', line 358

required :ultimate_receiving_party_name, String, nil?: true

#updated_at ⇒ Time

Parameters:

  • value (Time)

Returns:

  • (Time)


363
# File 'lib/modern_treasury/models/payment_order.rb', line 363

required :updated_at, Time

#vendor_attributes ⇒ Object?

Additional vendor specific fields for this payment. Data must be represented as key-value pairs.

Parameters:

  • value (top, nil)

Returns:

  • (Object, nil)


370
# File 'lib/modern_treasury/models/payment_order.rb', line 370

required :vendor_attributes, ModernTreasury::Internal::Type::Unknown, nil?: true

#vendor_failure_reason ⇒ String?

This field will be populated if a vendor failure occurs. Logic shouldn't be built on its value as it is free-form.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


377
# File 'lib/modern_treasury/models/payment_order.rb', line 377

required :vendor_failure_reason, String, nil?: true

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/modern_treasury/models/payment_order.rb', line 533

.variants ⇒ Array(ModernTreasury::Models::VirtualAccount, ModernTreasury::Models::InternalAccount)



# File 'lib/modern_treasury/models/payment_order.rb', line 1015

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


223
# File 'sig/modern_treasury/models/payment_order.rbs', line 223

def to_hash: -> {