mt-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +188 -0
- data/bin/console +15 -0
- data/lib/modern_treasury/api_helper.rb +10 -0
- data/lib/modern_treasury/client.rb +275 -0
- data/lib/modern_treasury/configuration.rb +206 -0
- data/lib/modern_treasury/controllers/account_collection_flow_controller.rb +130 -0
- data/lib/modern_treasury/controllers/account_detail_controller.rb +131 -0
- data/lib/modern_treasury/controllers/balance_report_controller.rb +76 -0
- data/lib/modern_treasury/controllers/base_controller.rb +60 -0
- data/lib/modern_treasury/controllers/connection_controller.rb +40 -0
- data/lib/modern_treasury/controllers/counterparty_controller.rb +188 -0
- data/lib/modern_treasury/controllers/document_controller.rb +285 -0
- data/lib/modern_treasury/controllers/event_controller.rb +72 -0
- data/lib/modern_treasury/controllers/expected_payment_controller.rb +162 -0
- data/lib/modern_treasury/controllers/external_account_controller.rb +202 -0
- data/lib/modern_treasury/controllers/incoming_payment_detail_controller.rb +150 -0
- data/lib/modern_treasury/controllers/internal_account_controller.rb +134 -0
- data/lib/modern_treasury/controllers/invoice_controller.rb +98 -0
- data/lib/modern_treasury/controllers/invoice_line_item_controller.rb +136 -0
- data/lib/modern_treasury/controllers/ledger_account_category_controller.rb +292 -0
- data/lib/modern_treasury/controllers/ledger_account_controller.rb +202 -0
- data/lib/modern_treasury/controllers/ledger_account_payout_controller.rb +126 -0
- data/lib/modern_treasury/controllers/ledger_account_statement_controller.rb +60 -0
- data/lib/modern_treasury/controllers/ledger_controller.rb +152 -0
- data/lib/modern_treasury/controllers/ledger_entry_controller.rb +148 -0
- data/lib/modern_treasury/controllers/ledger_event_handler_controller.rb +119 -0
- data/lib/modern_treasury/controllers/ledger_transaction_controller.rb +328 -0
- data/lib/modern_treasury/controllers/ledgerable_event_controller.rb +61 -0
- data/lib/modern_treasury/controllers/line_item_controller.rb +107 -0
- data/lib/modern_treasury/controllers/paper_item_controller.rb +69 -0
- data/lib/modern_treasury/controllers/payment_flow_controller.rb +138 -0
- data/lib/modern_treasury/controllers/payment_order_controller.rb +368 -0
- data/lib/modern_treasury/controllers/payment_reference_controller.rb +64 -0
- data/lib/modern_treasury/controllers/ping_controller.rb +34 -0
- data/lib/modern_treasury/controllers/return_controller.rb +105 -0
- data/lib/modern_treasury/controllers/reversal_controller.rb +99 -0
- data/lib/modern_treasury/controllers/routing_detail_controller.rb +131 -0
- data/lib/modern_treasury/controllers/transaction_controller.rb +133 -0
- data/lib/modern_treasury/controllers/transaction_line_item_controller.rb +39 -0
- data/lib/modern_treasury/controllers/validation_controller.rb +41 -0
- data/lib/modern_treasury/controllers/virtual_account_controller.rb +142 -0
- data/lib/modern_treasury/exceptions/api_exception.rb +21 -0
- data/lib/modern_treasury/exceptions/error_message_exception.rb +46 -0
- data/lib/modern_treasury/http/auth/basic_auth.rb +62 -0
- data/lib/modern_treasury/http/http_call_back.rb +10 -0
- data/lib/modern_treasury/http/http_method_enum.rb +10 -0
- data/lib/modern_treasury/http/http_request.rb +10 -0
- data/lib/modern_treasury/http/http_response.rb +10 -0
- data/lib/modern_treasury/http/proxy_settings.rb +22 -0
- data/lib/modern_treasury/models/account.rb +304 -0
- data/lib/modern_treasury/models/account1.rb +217 -0
- data/lib/modern_treasury/models/account_collection_flow.rb +178 -0
- data/lib/modern_treasury/models/account_collection_flow_create_request.rb +70 -0
- data/lib/modern_treasury/models/account_collection_flow_update_request.rb +61 -0
- data/lib/modern_treasury/models/account_detail.rb +211 -0
- data/lib/modern_treasury/models/account_detail1.rb +74 -0
- data/lib/modern_treasury/models/account_detail_create_request.rb +75 -0
- data/lib/modern_treasury/models/account_number_type2_enum.rb +48 -0
- data/lib/modern_treasury/models/account_number_type_enum.rb +49 -0
- data/lib/modern_treasury/models/account_type5_enum.rb +56 -0
- data/lib/modern_treasury/models/account_type_enum.rb +56 -0
- data/lib/modern_treasury/models/accounting.rb +88 -0
- data/lib/modern_treasury/models/accounting1.rb +63 -0
- data/lib/modern_treasury/models/accounts_type1_enum.rb +26 -0
- data/lib/modern_treasury/models/accounts_type_enum.rb +36 -0
- data/lib/modern_treasury/models/address.rb +231 -0
- data/lib/modern_treasury/models/address_request.rb +118 -0
- data/lib/modern_treasury/models/async_response.rb +68 -0
- data/lib/modern_treasury/models/balance.rb +164 -0
- data/lib/modern_treasury/models/balance_report.rb +178 -0
- data/lib/modern_treasury/models/balance_report_type1_enum.rb +44 -0
- data/lib/modern_treasury/models/balance_report_type_enum.rb +45 -0
- data/lib/modern_treasury/models/balance_type_enum.rb +63 -0
- data/lib/modern_treasury/models/balances.rb +71 -0
- data/lib/modern_treasury/models/balances1.rb +81 -0
- data/lib/modern_treasury/models/balances2.rb +120 -0
- data/lib/modern_treasury/models/balances3.rb +130 -0
- data/lib/modern_treasury/models/base_model.rb +110 -0
- data/lib/modern_treasury/models/charge_bearer_enum.rb +42 -0
- data/lib/modern_treasury/models/code1_enum.rb +200 -0
- data/lib/modern_treasury/models/code_enum.rb +68 -0
- data/lib/modern_treasury/models/connection.rb +209 -0
- data/lib/modern_treasury/models/contact_detail.rb +200 -0
- data/lib/modern_treasury/models/contact_detail_create_request.rb +75 -0
- data/lib/modern_treasury/models/contact_identifier_type_enum.rb +40 -0
- data/lib/modern_treasury/models/content_type_enum.rb +36 -0
- data/lib/modern_treasury/models/counterparty.rb +200 -0
- data/lib/modern_treasury/models/counterparty_billing_address.rb +106 -0
- data/lib/modern_treasury/models/counterparty_collect_account_request.rb +104 -0
- data/lib/modern_treasury/models/counterparty_collect_account_response.rb +82 -0
- data/lib/modern_treasury/models/counterparty_create_request.rb +161 -0
- data/lib/modern_treasury/models/counterparty_shipping_address.rb +107 -0
- data/lib/modern_treasury/models/counterparty_update_request.rb +107 -0
- data/lib/modern_treasury/models/created_at_enum.rb +36 -0
- data/lib/modern_treasury/models/currency1_enum.rb +37 -0
- data/lib/modern_treasury/models/currency_enum.rb +784 -0
- data/lib/modern_treasury/models/direction10_enum.rb +38 -0
- data/lib/modern_treasury/models/direction14_enum.rb +36 -0
- data/lib/modern_treasury/models/direction15_enum.rb +36 -0
- data/lib/modern_treasury/models/direction1_enum.rb +37 -0
- data/lib/modern_treasury/models/direction4_enum.rb +36 -0
- data/lib/modern_treasury/models/direction5_enum.rb +39 -0
- data/lib/modern_treasury/models/direction9_enum.rb +37 -0
- data/lib/modern_treasury/models/direction_enum.rb +38 -0
- data/lib/modern_treasury/models/document.rb +207 -0
- data/lib/modern_treasury/models/document_create_request.rb +92 -0
- data/lib/modern_treasury/models/document_detail.rb +154 -0
- data/lib/modern_treasury/models/documentable_type1_enum.rb +72 -0
- data/lib/modern_treasury/models/documentable_type2_enum.rb +72 -0
- data/lib/modern_treasury/models/documentable_type_enum.rb +75 -0
- data/lib/modern_treasury/models/effective_at_enum.rb +36 -0
- data/lib/modern_treasury/models/errors.rb +81 -0
- data/lib/modern_treasury/models/event.rb +162 -0
- data/lib/modern_treasury/models/expected_payment.rb +343 -0
- data/lib/modern_treasury/models/expected_payment_create_request.rb +254 -0
- data/lib/modern_treasury/models/expected_payment_update_request.rb +239 -0
- data/lib/modern_treasury/models/external_account.rb +283 -0
- data/lib/modern_treasury/models/external_account_complete_verification_request.rb +62 -0
- data/lib/modern_treasury/models/external_account_create_request.rb +230 -0
- data/lib/modern_treasury/models/external_account_update_request.rb +132 -0
- data/lib/modern_treasury/models/external_account_verify_request.rb +83 -0
- data/lib/modern_treasury/models/fallback_type_enum.rb +28 -0
- data/lib/modern_treasury/models/field_enum.rb +112 -0
- data/lib/modern_treasury/models/file.rb +81 -0
- data/lib/modern_treasury/models/foreign_exchange_indicator_enum.rb +38 -0
- data/lib/modern_treasury/models/incoming_payment_detail.rb +348 -0
- data/lib/modern_treasury/models/incoming_payment_detail_create_request.rb +141 -0
- data/lib/modern_treasury/models/incoming_payment_detail_update_request.rb +63 -0
- data/lib/modern_treasury/models/internal_account.rb +361 -0
- data/lib/modern_treasury/models/internal_account_create_request.rb +135 -0
- data/lib/modern_treasury/models/internal_account_update_request.rb +95 -0
- data/lib/modern_treasury/models/invoice.rb +342 -0
- data/lib/modern_treasury/models/invoice_create_request.rb +235 -0
- data/lib/modern_treasury/models/invoice_line_item.rb +171 -0
- data/lib/modern_treasury/models/invoice_line_item_create_request.rb +104 -0
- data/lib/modern_treasury/models/invoice_line_item_update_request.rb +240 -0
- data/lib/modern_treasury/models/invoice_update_request.rb +251 -0
- data/lib/modern_treasury/models/invoicer_address.rb +106 -0
- data/lib/modern_treasury/models/itemizable_type1_enum.rb +36 -0
- data/lib/modern_treasury/models/itemizable_type_enum.rb +36 -0
- data/lib/modern_treasury/models/ledger.rb +158 -0
- data/lib/modern_treasury/models/ledger_account.rb +220 -0
- data/lib/modern_treasury/models/ledger_account_category.rb +187 -0
- data/lib/modern_treasury/models/ledger_account_category_create_request.rb +125 -0
- data/lib/modern_treasury/models/ledger_account_category_update_request.rb +84 -0
- data/lib/modern_treasury/models/ledger_account_create_request.rb +150 -0
- data/lib/modern_treasury/models/ledger_account_normal_balance_enum.rb +36 -0
- data/lib/modern_treasury/models/ledger_account_payout.rb +238 -0
- data/lib/modern_treasury/models/ledger_account_payout_create_request.rb +152 -0
- data/lib/modern_treasury/models/ledger_account_payout_update_request.rb +85 -0
- data/lib/modern_treasury/models/ledger_account_statement.rb +233 -0
- data/lib/modern_treasury/models/ledger_account_statement_create_request.rb +122 -0
- data/lib/modern_treasury/models/ledger_account_update_request.rb +84 -0
- data/lib/modern_treasury/models/ledger_balance.rb +97 -0
- data/lib/modern_treasury/models/ledger_balances.rb +81 -0
- data/lib/modern_treasury/models/ledger_balances_with_effective_at.rb +123 -0
- data/lib/modern_treasury/models/ledger_create_request.rb +83 -0
- data/lib/modern_treasury/models/ledger_entry.rb +247 -0
- data/lib/modern_treasury/models/ledger_entry_create_request.rb +177 -0
- data/lib/modern_treasury/models/ledger_entry_of_transaction_version.rb +214 -0
- data/lib/modern_treasury/models/ledger_event_handler.rb +182 -0
- data/lib/modern_treasury/models/ledger_event_handler_conditions.rb +78 -0
- data/lib/modern_treasury/models/ledger_event_handler_create_request.rb +119 -0
- data/lib/modern_treasury/models/ledger_event_handler_ledger_entries.rb +80 -0
- data/lib/modern_treasury/models/ledger_event_handler_ledger_transaction_template.rb +103 -0
- data/lib/modern_treasury/models/ledger_transaction.rb +259 -0
- data/lib/modern_treasury/models/ledger_transaction_create_request.rb +164 -0
- data/lib/modern_treasury/models/ledger_transaction_reversal_create_request.rb +142 -0
- data/lib/modern_treasury/models/ledger_transaction_update_request.rb +115 -0
- data/lib/modern_treasury/models/ledger_transaction_version.rb +254 -0
- data/lib/modern_treasury/models/ledger_type_enum.rb +37 -0
- data/lib/modern_treasury/models/ledger_update_request.rb +84 -0
- data/lib/modern_treasury/models/ledgerable_event.rb +206 -0
- data/lib/modern_treasury/models/ledgerable_event_create_request.rb +140 -0
- data/lib/modern_treasury/models/ledgerable_type2_enum.rb +71 -0
- data/lib/modern_treasury/models/ledgerable_type5_enum.rb +69 -0
- data/lib/modern_treasury/models/ledgerable_type6_enum.rb +68 -0
- data/lib/modern_treasury/models/ledgerable_type_enum.rb +38 -0
- data/lib/modern_treasury/models/legacy_document_create_request.rb +70 -0
- data/lib/modern_treasury/models/line_item.rb +200 -0
- data/lib/modern_treasury/models/line_item_request.rb +98 -0
- data/lib/modern_treasury/models/line_item_update_request.rb +63 -0
- data/lib/modern_treasury/models/mreturn.rb +425 -0
- data/lib/modern_treasury/models/normal_balance2_enum.rb +36 -0
- data/lib/modern_treasury/models/normal_balance_enum.rb +36 -0
- data/lib/modern_treasury/models/order_by.rb +72 -0
- data/lib/modern_treasury/models/originating_account_number_type_enum.rb +48 -0
- data/lib/modern_treasury/models/originating_routing_number_type_enum.rb +68 -0
- data/lib/modern_treasury/models/paper_item.rb +249 -0
- data/lib/modern_treasury/models/party_address.rb +106 -0
- data/lib/modern_treasury/models/party_type5_enum.rb +36 -0
- data/lib/modern_treasury/models/party_type_enum.rb +36 -0
- data/lib/modern_treasury/models/payment_direction_enum.rb +36 -0
- data/lib/modern_treasury/models/payment_flow.rb +230 -0
- data/lib/modern_treasury/models/payment_flow_create_request.rb +103 -0
- data/lib/modern_treasury/models/payment_flow_update_request.rb +61 -0
- data/lib/modern_treasury/models/payment_method1_enum.rb +46 -0
- data/lib/modern_treasury/models/payment_method_enum.rb +42 -0
- data/lib/modern_treasury/models/payment_order.rb +820 -0
- data/lib/modern_treasury/models/payment_order_async_create_request.rb +536 -0
- data/lib/modern_treasury/models/payment_order_create_request.rb +556 -0
- data/lib/modern_treasury/models/payment_order_update_request.rb +543 -0
- data/lib/modern_treasury/models/payment_reference.rb +175 -0
- data/lib/modern_treasury/models/payment_reference_object.rb +156 -0
- data/lib/modern_treasury/models/payment_type13_enum.rb +96 -0
- data/lib/modern_treasury/models/payment_type1_enum.rb +97 -0
- data/lib/modern_treasury/models/payment_type2_enum.rb +96 -0
- data/lib/modern_treasury/models/payment_type4_enum.rb +96 -0
- data/lib/modern_treasury/models/payment_type5_enum.rb +36 -0
- data/lib/modern_treasury/models/payment_type6_enum.rb +97 -0
- data/lib/modern_treasury/models/payment_type_enum.rb +37 -0
- data/lib/modern_treasury/models/ping_response.rb +60 -0
- data/lib/modern_treasury/models/priority4_enum.rb +36 -0
- data/lib/modern_treasury/models/priority_enum.rb +38 -0
- data/lib/modern_treasury/models/reason1_enum.rb +50 -0
- data/lib/modern_treasury/models/reason_enum.rb +48 -0
- data/lib/modern_treasury/models/receiving_account.rb +304 -0
- data/lib/modern_treasury/models/receiving_account1.rb +219 -0
- data/lib/modern_treasury/models/receiving_account_type_enum.rb +36 -0
- data/lib/modern_treasury/models/reconciliation_method_enum.rb +38 -0
- data/lib/modern_treasury/models/reference_number_type1_enum.rb +248 -0
- data/lib/modern_treasury/models/reference_number_type_enum.rb +248 -0
- data/lib/modern_treasury/models/referenceable_type1_enum.rb +40 -0
- data/lib/modern_treasury/models/referenceable_type_enum.rb +41 -0
- data/lib/modern_treasury/models/return_create_request.rb +119 -0
- data/lib/modern_treasury/models/returnable_type1_enum.rb +48 -0
- data/lib/modern_treasury/models/returnable_type_enum.rb +48 -0
- data/lib/modern_treasury/models/reversal.rb +151 -0
- data/lib/modern_treasury/models/reversal_create_request.rb +86 -0
- data/lib/modern_treasury/models/role_enum.rb +36 -0
- data/lib/modern_treasury/models/routing_detail.rb +242 -0
- data/lib/modern_treasury/models/routing_detail1.rb +83 -0
- data/lib/modern_treasury/models/routing_detail_create_request.rb +87 -0
- data/lib/modern_treasury/models/routing_number_lookup_request.rb +124 -0
- data/lib/modern_treasury/models/routing_number_type1_enum.rb +68 -0
- data/lib/modern_treasury/models/routing_number_type7_enum.rb +55 -0
- data/lib/modern_treasury/models/routing_number_type8_enum.rb +68 -0
- data/lib/modern_treasury/models/routing_number_type_enum.rb +69 -0
- data/lib/modern_treasury/models/status11_enum.rb +40 -0
- data/lib/modern_treasury/models/status12_enum.rb +40 -0
- data/lib/modern_treasury/models/status15_enum.rb +41 -0
- data/lib/modern_treasury/models/status16_enum.rb +41 -0
- data/lib/modern_treasury/models/status17_enum.rb +45 -0
- data/lib/modern_treasury/models/status18_enum.rb +74 -0
- data/lib/modern_treasury/models/status19_enum.rb +52 -0
- data/lib/modern_treasury/models/status1_enum.rb +40 -0
- data/lib/modern_treasury/models/status20_enum.rb +40 -0
- data/lib/modern_treasury/models/status21_enum.rb +40 -0
- data/lib/modern_treasury/models/status22_enum.rb +40 -0
- data/lib/modern_treasury/models/status24_enum.rb +72 -0
- data/lib/modern_treasury/models/status2_enum.rb +41 -0
- data/lib/modern_treasury/models/status3_enum.rb +72 -0
- data/lib/modern_treasury/models/status4_enum.rb +52 -0
- data/lib/modern_treasury/models/status5_enum.rb +48 -0
- data/lib/modern_treasury/models/status6_enum.rb +49 -0
- data/lib/modern_treasury/models/status7_enum.rb +37 -0
- data/lib/modern_treasury/models/status8_enum.rb +37 -0
- data/lib/modern_treasury/models/status9_enum.rb +41 -0
- data/lib/modern_treasury/models/status_enum.rb +45 -0
- data/lib/modern_treasury/models/subtype_enum.rb +71 -0
- data/lib/modern_treasury/models/supported_payment_type_enum.rb +96 -0
- data/lib/modern_treasury/models/transactable_type_enum.rb +53 -0
- data/lib/modern_treasury/models/transaction.rb +311 -0
- data/lib/modern_treasury/models/transaction_line_item.rb +211 -0
- data/lib/modern_treasury/models/type10_enum.rb +64 -0
- data/lib/modern_treasury/models/type11_enum.rb +97 -0
- data/lib/modern_treasury/models/type12_enum.rb +37 -0
- data/lib/modern_treasury/models/type13_enum.rb +96 -0
- data/lib/modern_treasury/models/type14_enum.rb +64 -0
- data/lib/modern_treasury/models/type16_enum.rb +36 -0
- data/lib/modern_treasury/models/type1_enum.rb +97 -0
- data/lib/modern_treasury/models/type4_enum.rb +65 -0
- data/lib/modern_treasury/models/type5_enum.rb +97 -0
- data/lib/modern_treasury/models/type6_enum.rb +77 -0
- data/lib/modern_treasury/models/type_enum.rb +37 -0
- data/lib/modern_treasury/models/vendor_code_type1_enum.rb +111 -0
- data/lib/modern_treasury/models/vendor_code_type_enum.rb +108 -0
- data/lib/modern_treasury/models/verification_status1_enum.rb +44 -0
- data/lib/modern_treasury/models/verification_status_enum.rb +40 -0
- data/lib/modern_treasury/models/virtual_account.rb +247 -0
- data/lib/modern_treasury/models/virtual_account_create_request.rb +172 -0
- data/lib/modern_treasury/models/virtual_account_update_request.rb +85 -0
- data/lib/modern_treasury/utilities/date_time_helper.rb +11 -0
- data/lib/modern_treasury/utilities/file_wrapper.rb +28 -0
- data/lib/modern_treasury/utilities/union_type_lookup.rb +32 -0
- data/lib/modern_treasury.rb +316 -0
- data/test/controllers/controller_test_base.rb +23 -0
- data/test/controllers/test_account_collection_flow_controller.rb +64 -0
- data/test/controllers/test_connection_controller.rb +41 -0
- data/test/controllers/test_counterparty_controller.rb +65 -0
- data/test/controllers/test_document_controller.rb +41 -0
- data/test/controllers/test_event_controller.rb +46 -0
- data/test/controllers/test_expected_payment_controller.rb +71 -0
- data/test/controllers/test_external_account_controller.rb +63 -0
- data/test/controllers/test_incoming_payment_detail_controller.rb +68 -0
- data/test/controllers/test_internal_account_controller.rb +65 -0
- data/test/controllers/test_invoice_controller.rb +56 -0
- data/test/controllers/test_ledger_account_category_controller.rb +67 -0
- data/test/controllers/test_ledger_account_controller.rb +70 -0
- data/test/controllers/test_ledger_account_payout_controller.rb +62 -0
- data/test/controllers/test_ledger_account_statement_controller.rb +36 -0
- data/test/controllers/test_ledger_controller.rb +59 -0
- data/test/controllers/test_ledger_entry_controller.rb +65 -0
- data/test/controllers/test_ledger_event_handler_controller.rb +63 -0
- data/test/controllers/test_ledger_transaction_controller.rb +112 -0
- data/test/controllers/test_ledgerable_event_controller.rb +36 -0
- data/test/controllers/test_paper_item_controller.rb +43 -0
- data/test/controllers/test_payment_flow_controller.rb +67 -0
- data/test/controllers/test_payment_order_controller.rb +76 -0
- data/test/controllers/test_payment_reference_controller.rb +43 -0
- data/test/controllers/test_ping_controller.rb +31 -0
- data/test/controllers/test_return_controller.rb +64 -0
- data/test/controllers/test_transaction_controller.rb +56 -0
- data/test/controllers/test_virtual_account_controller.rb +63 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +429 -0
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
# modern_treasury
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module ModernTreasury
|
|
8
|
+
# PaymentOrderAsyncCreateRequest Model.
|
|
9
|
+
class PaymentOrderAsyncCreateRequest < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
|
|
14
|
+
# `bacs`, `au_becs`, `interac`, `signet`, `provexchange`.
|
|
15
|
+
# @return [Type5Enum]
|
|
16
|
+
attr_accessor :type
|
|
17
|
+
|
|
18
|
+
# An additional layer of classification for the type of payment order you
|
|
19
|
+
# are doing. This field is only used for `ach` payment orders currently. For
|
|
20
|
+
# `ach` payment orders, the `subtype` represents the SEC code. We
|
|
21
|
+
# currently support `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
|
|
22
|
+
# @return [SubtypeEnum]
|
|
23
|
+
attr_accessor :subtype
|
|
24
|
+
|
|
25
|
+
# Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
26
|
+
# as 1000 (cents). For RTP, the maximum amount allowed by the network is
|
|
27
|
+
# $100,000.
|
|
28
|
+
# @return [Integer]
|
|
29
|
+
attr_accessor :amount
|
|
30
|
+
|
|
31
|
+
# One of `credit`, `debit`. Describes the direction money is flowing in the
|
|
32
|
+
# transaction. A `credit` moves money from your account to someone else's. A
|
|
33
|
+
# `debit` pulls money from someone else's account to your own. Note that
|
|
34
|
+
# wire, rtp, and check payments will always be `credit`.
|
|
35
|
+
# @return [Direction5Enum]
|
|
36
|
+
attr_accessor :direction
|
|
37
|
+
|
|
38
|
+
# Either `normal` or `high`. For ACH and EFT payments, `high` represents a
|
|
39
|
+
# same-day ACH or EFT transfer, respectively. For check payments, `high` can
|
|
40
|
+
# mean an overnight check rather than standard mail.
|
|
41
|
+
# @return [PriorityEnum]
|
|
42
|
+
attr_accessor :priority
|
|
43
|
+
|
|
44
|
+
# The ID of one of your organization's internal accounts.
|
|
45
|
+
# @return [UUID | String]
|
|
46
|
+
attr_accessor :originating_account_id
|
|
47
|
+
|
|
48
|
+
# Either `receiving_account` or `receiving_account_id` must be present. When
|
|
49
|
+
# using `receiving_account_id`, you may pass the id of an external account
|
|
50
|
+
# or an internal account.
|
|
51
|
+
# @return [UUID | String]
|
|
52
|
+
attr_accessor :receiving_account_id
|
|
53
|
+
|
|
54
|
+
# Either `receiving_account` or `receiving_account_id` must be present. When
|
|
55
|
+
# using `receiving_account_id`, you may pass the id of an external account
|
|
56
|
+
# or an internal account.
|
|
57
|
+
# @return [Accounting]
|
|
58
|
+
attr_accessor :accounting
|
|
59
|
+
|
|
60
|
+
# The ID of one of your accounting categories. Note that these will only be
|
|
61
|
+
# accessible if your accounting system has been connected.
|
|
62
|
+
# @return [UUID | String]
|
|
63
|
+
attr_accessor :accounting_category_id
|
|
64
|
+
|
|
65
|
+
# The ID of one of your accounting ledger classes. Note that these will only
|
|
66
|
+
# be accessible if your accounting system has been connected.
|
|
67
|
+
# @return [UUID | String]
|
|
68
|
+
attr_accessor :accounting_ledger_class_id
|
|
69
|
+
|
|
70
|
+
# Three-letter ISO currency code.
|
|
71
|
+
# @return [CurrencyEnum]
|
|
72
|
+
attr_accessor :currency
|
|
73
|
+
|
|
74
|
+
# Date transactions are to be posted to the participants' account. Defaults
|
|
75
|
+
# to the current business day or the next business day if the current day is
|
|
76
|
+
# a bank holiday or weekend. Format: yyyy-mm-dd.
|
|
77
|
+
# @return [Date]
|
|
78
|
+
attr_accessor :effective_date
|
|
79
|
+
|
|
80
|
+
# An optional description for internal use.
|
|
81
|
+
# @return [String]
|
|
82
|
+
attr_accessor :description
|
|
83
|
+
|
|
84
|
+
# An optional descriptor which will appear in the receiver's statement. For
|
|
85
|
+
# `check` payments this field will be used as the memo line. For `ach` the
|
|
86
|
+
# maximum length is 10 characters. Note that for ACH payments, the name on
|
|
87
|
+
# your bank account will be included automatically by the bank, so you can
|
|
88
|
+
# use the characters for other useful information. For `eft` the maximum
|
|
89
|
+
# length is 15 characters.
|
|
90
|
+
# @return [String]
|
|
91
|
+
attr_accessor :statement_descriptor
|
|
92
|
+
|
|
93
|
+
# For `ach`, this field will be passed through on an addenda record. For
|
|
94
|
+
# `wire` payments the field will be passed through as the "Originator to
|
|
95
|
+
# Beneficiary Information", also known as OBI or Fedwire tag 6000.
|
|
96
|
+
# @return [String]
|
|
97
|
+
attr_accessor :remittance_information
|
|
98
|
+
|
|
99
|
+
# For `wire`, this is usually the purpose which is transmitted via the
|
|
100
|
+
# "InstrForDbtrAgt" field in the ISO20022 file. If you are using
|
|
101
|
+
# Currencycloud, this is the `payment.purpose_code` field. For `eft`, this
|
|
102
|
+
# field is the 3 digit CPA Code that will be attached to the payment.
|
|
103
|
+
# @return [String]
|
|
104
|
+
attr_accessor :purpose
|
|
105
|
+
|
|
106
|
+
# Additional data represented as key-value pairs. Both the key and value
|
|
107
|
+
# must be strings.
|
|
108
|
+
# @return [Hash[String, String]]
|
|
109
|
+
attr_accessor :metadata
|
|
110
|
+
|
|
111
|
+
# The party that will pay the fees for the payment order. Only applies to
|
|
112
|
+
# wire payment orders. Can be one of shared, sender, or receiver, which
|
|
113
|
+
# correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
|
|
114
|
+
# @return [ChargeBearerEnum]
|
|
115
|
+
attr_accessor :charge_bearer
|
|
116
|
+
|
|
117
|
+
# Indicates the type of FX transfer to initiate, can be either
|
|
118
|
+
# `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
|
|
119
|
+
# currency matches the originating account currency.
|
|
120
|
+
# @return [ForeignExchangeIndicatorEnum]
|
|
121
|
+
attr_accessor :foreign_exchange_indicator
|
|
122
|
+
|
|
123
|
+
# If present, indicates a specific foreign exchange contract number that has
|
|
124
|
+
# been generated by your financial institution.
|
|
125
|
+
# @return [String]
|
|
126
|
+
attr_accessor :foreign_exchange_contract
|
|
127
|
+
|
|
128
|
+
# A boolean to determine if NSF Protection is enabled for this payment
|
|
129
|
+
# order. Note that this setting must also be turned on in your organization
|
|
130
|
+
# settings page.
|
|
131
|
+
# @return [TrueClass | FalseClass]
|
|
132
|
+
attr_accessor :nsf_protected
|
|
133
|
+
|
|
134
|
+
# If present, this will replace your default company name on receiver's bank
|
|
135
|
+
# statement. This field can only be used for ACH payments currently. For
|
|
136
|
+
# ACH, only the first 16 characters of this string will be used. Any
|
|
137
|
+
# additional characters will be truncated.
|
|
138
|
+
# @return [String]
|
|
139
|
+
attr_accessor :originating_party_name
|
|
140
|
+
|
|
141
|
+
# Name of the ultimate originator of the payment order.
|
|
142
|
+
# @return [String]
|
|
143
|
+
attr_accessor :ultimate_originating_party_name
|
|
144
|
+
|
|
145
|
+
# Identifier of the ultimate originator of the payment order.
|
|
146
|
+
# @return [String]
|
|
147
|
+
attr_accessor :ultimate_originating_party_identifier
|
|
148
|
+
|
|
149
|
+
# Name of the ultimate funds recipient.
|
|
150
|
+
# @return [String]
|
|
151
|
+
attr_accessor :ultimate_receiving_party_name
|
|
152
|
+
|
|
153
|
+
# Identifier of the ultimate funds recipient.
|
|
154
|
+
# @return [String]
|
|
155
|
+
attr_accessor :ultimate_receiving_party_identifier
|
|
156
|
+
|
|
157
|
+
# Send an email to the counterparty when the payment order is sent to the
|
|
158
|
+
# bank. If `null`, `send_remittance_advice` on the Counterparty is used.
|
|
159
|
+
# @return [TrueClass | FalseClass]
|
|
160
|
+
attr_accessor :send_remittance_advice
|
|
161
|
+
|
|
162
|
+
# RFP payments require an expires_at. This value must be past the
|
|
163
|
+
# effective_date.
|
|
164
|
+
# @return [DateTime]
|
|
165
|
+
attr_accessor :expires_at
|
|
166
|
+
|
|
167
|
+
# A payment type to fallback to if the original type is not valid for the
|
|
168
|
+
# receiving account. Currently, this only supports falling back from RTP to
|
|
169
|
+
# ACH (type=rtp and fallback_type=ach)
|
|
170
|
+
# @return [FallbackTypeEnum]
|
|
171
|
+
attr_accessor :fallback_type
|
|
172
|
+
|
|
173
|
+
# Either `receiving_account` or `receiving_account_id` must be present. When
|
|
174
|
+
# using `receiving_account_id`, you may pass the id of an external account
|
|
175
|
+
# or an internal account.
|
|
176
|
+
# @return [ReceivingAccount1]
|
|
177
|
+
attr_accessor :receiving_account
|
|
178
|
+
|
|
179
|
+
# Either `receiving_account` or `receiving_account_id` must be present. When
|
|
180
|
+
# using `receiving_account_id`, you may pass the id of an external account
|
|
181
|
+
# or an internal account.
|
|
182
|
+
# @return [LedgerTransactionCreateRequest]
|
|
183
|
+
attr_accessor :ledger_transaction
|
|
184
|
+
|
|
185
|
+
# An array of line items that must sum up to the amount of the payment
|
|
186
|
+
# order.
|
|
187
|
+
# @return [Array[LineItemRequest]]
|
|
188
|
+
attr_accessor :line_items
|
|
189
|
+
|
|
190
|
+
# A flag that determines whether a payment order should go through
|
|
191
|
+
# transaction monitoring.
|
|
192
|
+
# @return [TrueClass | FalseClass]
|
|
193
|
+
attr_accessor :transaction_monitoring_enabled
|
|
194
|
+
|
|
195
|
+
# A mapping from model property names to API property names.
|
|
196
|
+
def self.names
|
|
197
|
+
@_hash = {} if @_hash.nil?
|
|
198
|
+
@_hash['type'] = 'type'
|
|
199
|
+
@_hash['subtype'] = 'subtype'
|
|
200
|
+
@_hash['amount'] = 'amount'
|
|
201
|
+
@_hash['direction'] = 'direction'
|
|
202
|
+
@_hash['priority'] = 'priority'
|
|
203
|
+
@_hash['originating_account_id'] = 'originating_account_id'
|
|
204
|
+
@_hash['receiving_account_id'] = 'receiving_account_id'
|
|
205
|
+
@_hash['accounting'] = 'accounting'
|
|
206
|
+
@_hash['accounting_category_id'] = 'accounting_category_id'
|
|
207
|
+
@_hash['accounting_ledger_class_id'] = 'accounting_ledger_class_id'
|
|
208
|
+
@_hash['currency'] = 'currency'
|
|
209
|
+
@_hash['effective_date'] = 'effective_date'
|
|
210
|
+
@_hash['description'] = 'description'
|
|
211
|
+
@_hash['statement_descriptor'] = 'statement_descriptor'
|
|
212
|
+
@_hash['remittance_information'] = 'remittance_information'
|
|
213
|
+
@_hash['purpose'] = 'purpose'
|
|
214
|
+
@_hash['metadata'] = 'metadata'
|
|
215
|
+
@_hash['charge_bearer'] = 'charge_bearer'
|
|
216
|
+
@_hash['foreign_exchange_indicator'] = 'foreign_exchange_indicator'
|
|
217
|
+
@_hash['foreign_exchange_contract'] = 'foreign_exchange_contract'
|
|
218
|
+
@_hash['nsf_protected'] = 'nsf_protected'
|
|
219
|
+
@_hash['originating_party_name'] = 'originating_party_name'
|
|
220
|
+
@_hash['ultimate_originating_party_name'] =
|
|
221
|
+
'ultimate_originating_party_name'
|
|
222
|
+
@_hash['ultimate_originating_party_identifier'] =
|
|
223
|
+
'ultimate_originating_party_identifier'
|
|
224
|
+
@_hash['ultimate_receiving_party_name'] =
|
|
225
|
+
'ultimate_receiving_party_name'
|
|
226
|
+
@_hash['ultimate_receiving_party_identifier'] =
|
|
227
|
+
'ultimate_receiving_party_identifier'
|
|
228
|
+
@_hash['send_remittance_advice'] = 'send_remittance_advice'
|
|
229
|
+
@_hash['expires_at'] = 'expires_at'
|
|
230
|
+
@_hash['fallback_type'] = 'fallback_type'
|
|
231
|
+
@_hash['receiving_account'] = 'receiving_account'
|
|
232
|
+
@_hash['ledger_transaction'] = 'ledger_transaction'
|
|
233
|
+
@_hash['line_items'] = 'line_items'
|
|
234
|
+
@_hash['transaction_monitoring_enabled'] =
|
|
235
|
+
'transaction_monitoring_enabled'
|
|
236
|
+
@_hash
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# An array for optional fields
|
|
240
|
+
def self.optionals
|
|
241
|
+
%w[
|
|
242
|
+
subtype
|
|
243
|
+
priority
|
|
244
|
+
receiving_account_id
|
|
245
|
+
accounting
|
|
246
|
+
accounting_category_id
|
|
247
|
+
accounting_ledger_class_id
|
|
248
|
+
currency
|
|
249
|
+
effective_date
|
|
250
|
+
description
|
|
251
|
+
statement_descriptor
|
|
252
|
+
remittance_information
|
|
253
|
+
purpose
|
|
254
|
+
metadata
|
|
255
|
+
charge_bearer
|
|
256
|
+
foreign_exchange_indicator
|
|
257
|
+
foreign_exchange_contract
|
|
258
|
+
nsf_protected
|
|
259
|
+
originating_party_name
|
|
260
|
+
ultimate_originating_party_name
|
|
261
|
+
ultimate_originating_party_identifier
|
|
262
|
+
ultimate_receiving_party_name
|
|
263
|
+
ultimate_receiving_party_identifier
|
|
264
|
+
send_remittance_advice
|
|
265
|
+
expires_at
|
|
266
|
+
fallback_type
|
|
267
|
+
receiving_account
|
|
268
|
+
ledger_transaction
|
|
269
|
+
line_items
|
|
270
|
+
transaction_monitoring_enabled
|
|
271
|
+
]
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# An array for nullable fields
|
|
275
|
+
def self.nullables
|
|
276
|
+
%w[
|
|
277
|
+
subtype
|
|
278
|
+
accounting_category_id
|
|
279
|
+
accounting_ledger_class_id
|
|
280
|
+
description
|
|
281
|
+
statement_descriptor
|
|
282
|
+
remittance_information
|
|
283
|
+
purpose
|
|
284
|
+
charge_bearer
|
|
285
|
+
foreign_exchange_indicator
|
|
286
|
+
foreign_exchange_contract
|
|
287
|
+
originating_party_name
|
|
288
|
+
ultimate_originating_party_name
|
|
289
|
+
ultimate_originating_party_identifier
|
|
290
|
+
ultimate_receiving_party_name
|
|
291
|
+
ultimate_receiving_party_identifier
|
|
292
|
+
send_remittance_advice
|
|
293
|
+
expires_at
|
|
294
|
+
]
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
def initialize(type = nil, amount = nil, direction = nil,
|
|
298
|
+
originating_account_id = nil, subtype = SKIP,
|
|
299
|
+
priority = SKIP, receiving_account_id = SKIP,
|
|
300
|
+
accounting = SKIP, accounting_category_id = SKIP,
|
|
301
|
+
accounting_ledger_class_id = SKIP, currency = SKIP,
|
|
302
|
+
effective_date = SKIP, description = SKIP,
|
|
303
|
+
statement_descriptor = SKIP, remittance_information = SKIP,
|
|
304
|
+
purpose = SKIP, metadata = SKIP, charge_bearer = SKIP,
|
|
305
|
+
foreign_exchange_indicator = SKIP,
|
|
306
|
+
foreign_exchange_contract = SKIP, nsf_protected = SKIP,
|
|
307
|
+
originating_party_name = SKIP,
|
|
308
|
+
ultimate_originating_party_name = SKIP,
|
|
309
|
+
ultimate_originating_party_identifier = SKIP,
|
|
310
|
+
ultimate_receiving_party_name = SKIP,
|
|
311
|
+
ultimate_receiving_party_identifier = SKIP,
|
|
312
|
+
send_remittance_advice = SKIP, expires_at = SKIP,
|
|
313
|
+
fallback_type = SKIP, receiving_account = SKIP,
|
|
314
|
+
ledger_transaction = SKIP, line_items = SKIP,
|
|
315
|
+
transaction_monitoring_enabled = SKIP)
|
|
316
|
+
@type = type
|
|
317
|
+
@subtype = subtype unless subtype == SKIP
|
|
318
|
+
@amount = amount
|
|
319
|
+
@direction = direction
|
|
320
|
+
@priority = priority unless priority == SKIP
|
|
321
|
+
@originating_account_id = originating_account_id
|
|
322
|
+
@receiving_account_id = receiving_account_id unless receiving_account_id == SKIP
|
|
323
|
+
@accounting = accounting unless accounting == SKIP
|
|
324
|
+
@accounting_category_id = accounting_category_id unless accounting_category_id == SKIP
|
|
325
|
+
unless accounting_ledger_class_id == SKIP
|
|
326
|
+
@accounting_ledger_class_id =
|
|
327
|
+
accounting_ledger_class_id
|
|
328
|
+
end
|
|
329
|
+
@currency = currency unless currency == SKIP
|
|
330
|
+
@effective_date = effective_date unless effective_date == SKIP
|
|
331
|
+
@description = description unless description == SKIP
|
|
332
|
+
@statement_descriptor = statement_descriptor unless statement_descriptor == SKIP
|
|
333
|
+
@remittance_information = remittance_information unless remittance_information == SKIP
|
|
334
|
+
@purpose = purpose unless purpose == SKIP
|
|
335
|
+
@metadata = metadata unless metadata == SKIP
|
|
336
|
+
@charge_bearer = charge_bearer unless charge_bearer == SKIP
|
|
337
|
+
unless foreign_exchange_indicator == SKIP
|
|
338
|
+
@foreign_exchange_indicator =
|
|
339
|
+
foreign_exchange_indicator
|
|
340
|
+
end
|
|
341
|
+
unless foreign_exchange_contract == SKIP
|
|
342
|
+
@foreign_exchange_contract =
|
|
343
|
+
foreign_exchange_contract
|
|
344
|
+
end
|
|
345
|
+
@nsf_protected = nsf_protected unless nsf_protected == SKIP
|
|
346
|
+
@originating_party_name = originating_party_name unless originating_party_name == SKIP
|
|
347
|
+
unless ultimate_originating_party_name == SKIP
|
|
348
|
+
@ultimate_originating_party_name =
|
|
349
|
+
ultimate_originating_party_name
|
|
350
|
+
end
|
|
351
|
+
unless ultimate_originating_party_identifier == SKIP
|
|
352
|
+
@ultimate_originating_party_identifier =
|
|
353
|
+
ultimate_originating_party_identifier
|
|
354
|
+
end
|
|
355
|
+
unless ultimate_receiving_party_name == SKIP
|
|
356
|
+
@ultimate_receiving_party_name =
|
|
357
|
+
ultimate_receiving_party_name
|
|
358
|
+
end
|
|
359
|
+
unless ultimate_receiving_party_identifier == SKIP
|
|
360
|
+
@ultimate_receiving_party_identifier =
|
|
361
|
+
ultimate_receiving_party_identifier
|
|
362
|
+
end
|
|
363
|
+
@send_remittance_advice = send_remittance_advice unless send_remittance_advice == SKIP
|
|
364
|
+
@expires_at = expires_at unless expires_at == SKIP
|
|
365
|
+
@fallback_type = fallback_type unless fallback_type == SKIP
|
|
366
|
+
@receiving_account = receiving_account unless receiving_account == SKIP
|
|
367
|
+
@ledger_transaction = ledger_transaction unless ledger_transaction == SKIP
|
|
368
|
+
@line_items = line_items unless line_items == SKIP
|
|
369
|
+
unless transaction_monitoring_enabled == SKIP
|
|
370
|
+
@transaction_monitoring_enabled =
|
|
371
|
+
transaction_monitoring_enabled
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
# Creates an instance of the object from a hash.
|
|
376
|
+
def self.from_hash(hash)
|
|
377
|
+
return nil unless hash
|
|
378
|
+
|
|
379
|
+
# Extract variables from the hash.
|
|
380
|
+
type = hash.key?('type') ? hash['type'] : nil
|
|
381
|
+
amount = hash.key?('amount') ? hash['amount'] : nil
|
|
382
|
+
direction = hash.key?('direction') ? hash['direction'] : nil
|
|
383
|
+
originating_account_id =
|
|
384
|
+
hash.key?('originating_account_id') ? hash['originating_account_id'] : nil
|
|
385
|
+
subtype = hash.key?('subtype') ? hash['subtype'] : SKIP
|
|
386
|
+
priority = hash.key?('priority') ? hash['priority'] : SKIP
|
|
387
|
+
receiving_account_id =
|
|
388
|
+
hash.key?('receiving_account_id') ? hash['receiving_account_id'] : SKIP
|
|
389
|
+
accounting = Accounting.from_hash(hash['accounting']) if hash['accounting']
|
|
390
|
+
accounting_category_id =
|
|
391
|
+
hash.key?('accounting_category_id') ? hash['accounting_category_id'] : SKIP
|
|
392
|
+
accounting_ledger_class_id =
|
|
393
|
+
hash.key?('accounting_ledger_class_id') ? hash['accounting_ledger_class_id'] : SKIP
|
|
394
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
395
|
+
effective_date =
|
|
396
|
+
hash.key?('effective_date') ? hash['effective_date'] : SKIP
|
|
397
|
+
description = hash.key?('description') ? hash['description'] : SKIP
|
|
398
|
+
statement_descriptor =
|
|
399
|
+
hash.key?('statement_descriptor') ? hash['statement_descriptor'] : SKIP
|
|
400
|
+
remittance_information =
|
|
401
|
+
hash.key?('remittance_information') ? hash['remittance_information'] : SKIP
|
|
402
|
+
purpose = hash.key?('purpose') ? hash['purpose'] : SKIP
|
|
403
|
+
metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
|
|
404
|
+
charge_bearer = hash.key?('charge_bearer') ? hash['charge_bearer'] : SKIP
|
|
405
|
+
foreign_exchange_indicator =
|
|
406
|
+
hash.key?('foreign_exchange_indicator') ? hash['foreign_exchange_indicator'] : SKIP
|
|
407
|
+
foreign_exchange_contract =
|
|
408
|
+
hash.key?('foreign_exchange_contract') ? hash['foreign_exchange_contract'] : SKIP
|
|
409
|
+
nsf_protected = hash.key?('nsf_protected') ? hash['nsf_protected'] : SKIP
|
|
410
|
+
originating_party_name =
|
|
411
|
+
hash.key?('originating_party_name') ? hash['originating_party_name'] : SKIP
|
|
412
|
+
ultimate_originating_party_name =
|
|
413
|
+
hash.key?('ultimate_originating_party_name') ? hash['ultimate_originating_party_name'] : SKIP
|
|
414
|
+
ultimate_originating_party_identifier =
|
|
415
|
+
hash.key?('ultimate_originating_party_identifier') ? hash['ultimate_originating_party_identifier'] : SKIP
|
|
416
|
+
ultimate_receiving_party_name =
|
|
417
|
+
hash.key?('ultimate_receiving_party_name') ? hash['ultimate_receiving_party_name'] : SKIP
|
|
418
|
+
ultimate_receiving_party_identifier =
|
|
419
|
+
hash.key?('ultimate_receiving_party_identifier') ? hash['ultimate_receiving_party_identifier'] : SKIP
|
|
420
|
+
send_remittance_advice =
|
|
421
|
+
hash.key?('send_remittance_advice') ? hash['send_remittance_advice'] : SKIP
|
|
422
|
+
expires_at = if hash.key?('expires_at')
|
|
423
|
+
(DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at'])
|
|
424
|
+
else
|
|
425
|
+
SKIP
|
|
426
|
+
end
|
|
427
|
+
fallback_type = hash.key?('fallback_type') ? hash['fallback_type'] : SKIP
|
|
428
|
+
receiving_account = ReceivingAccount1.from_hash(hash['receiving_account']) if
|
|
429
|
+
hash['receiving_account']
|
|
430
|
+
ledger_transaction = LedgerTransactionCreateRequest.from_hash(hash['ledger_transaction']) if
|
|
431
|
+
hash['ledger_transaction']
|
|
432
|
+
# Parameter is an array, so we need to iterate through it
|
|
433
|
+
line_items = nil
|
|
434
|
+
unless hash['line_items'].nil?
|
|
435
|
+
line_items = []
|
|
436
|
+
hash['line_items'].each do |structure|
|
|
437
|
+
line_items << (LineItemRequest.from_hash(structure) if structure)
|
|
438
|
+
end
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
line_items = SKIP unless hash.key?('line_items')
|
|
442
|
+
transaction_monitoring_enabled =
|
|
443
|
+
hash.key?('transaction_monitoring_enabled') ? hash['transaction_monitoring_enabled'] : SKIP
|
|
444
|
+
|
|
445
|
+
# Create object from extracted values.
|
|
446
|
+
PaymentOrderAsyncCreateRequest.new(type,
|
|
447
|
+
amount,
|
|
448
|
+
direction,
|
|
449
|
+
originating_account_id,
|
|
450
|
+
subtype,
|
|
451
|
+
priority,
|
|
452
|
+
receiving_account_id,
|
|
453
|
+
accounting,
|
|
454
|
+
accounting_category_id,
|
|
455
|
+
accounting_ledger_class_id,
|
|
456
|
+
currency,
|
|
457
|
+
effective_date,
|
|
458
|
+
description,
|
|
459
|
+
statement_descriptor,
|
|
460
|
+
remittance_information,
|
|
461
|
+
purpose,
|
|
462
|
+
metadata,
|
|
463
|
+
charge_bearer,
|
|
464
|
+
foreign_exchange_indicator,
|
|
465
|
+
foreign_exchange_contract,
|
|
466
|
+
nsf_protected,
|
|
467
|
+
originating_party_name,
|
|
468
|
+
ultimate_originating_party_name,
|
|
469
|
+
ultimate_originating_party_identifier,
|
|
470
|
+
ultimate_receiving_party_name,
|
|
471
|
+
ultimate_receiving_party_identifier,
|
|
472
|
+
send_remittance_advice,
|
|
473
|
+
expires_at,
|
|
474
|
+
fallback_type,
|
|
475
|
+
receiving_account,
|
|
476
|
+
ledger_transaction,
|
|
477
|
+
line_items,
|
|
478
|
+
transaction_monitoring_enabled)
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
def to_custom_expires_at
|
|
482
|
+
DateTimeHelper.to_rfc3339(expires_at)
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
# Provides a human-readable string representation of the object.
|
|
486
|
+
def to_s
|
|
487
|
+
class_name = self.class.name.split('::').last
|
|
488
|
+
"<#{class_name} type: #{@type}, subtype: #{@subtype}, amount: #{@amount}, direction:"\
|
|
489
|
+
" #{@direction}, priority: #{@priority}, originating_account_id: #{@originating_account_id},"\
|
|
490
|
+
" receiving_account_id: #{@receiving_account_id}, accounting: #{@accounting},"\
|
|
491
|
+
" accounting_category_id: #{@accounting_category_id}, accounting_ledger_class_id:"\
|
|
492
|
+
" #{@accounting_ledger_class_id}, currency: #{@currency}, effective_date:"\
|
|
493
|
+
" #{@effective_date}, description: #{@description}, statement_descriptor:"\
|
|
494
|
+
" #{@statement_descriptor}, remittance_information: #{@remittance_information}, purpose:"\
|
|
495
|
+
" #{@purpose}, metadata: #{@metadata}, charge_bearer: #{@charge_bearer},"\
|
|
496
|
+
" foreign_exchange_indicator: #{@foreign_exchange_indicator}, foreign_exchange_contract:"\
|
|
497
|
+
" #{@foreign_exchange_contract}, nsf_protected: #{@nsf_protected}, originating_party_name:"\
|
|
498
|
+
" #{@originating_party_name}, ultimate_originating_party_name:"\
|
|
499
|
+
" #{@ultimate_originating_party_name}, ultimate_originating_party_identifier:"\
|
|
500
|
+
" #{@ultimate_originating_party_identifier}, ultimate_receiving_party_name:"\
|
|
501
|
+
" #{@ultimate_receiving_party_name}, ultimate_receiving_party_identifier:"\
|
|
502
|
+
" #{@ultimate_receiving_party_identifier}, send_remittance_advice:"\
|
|
503
|
+
" #{@send_remittance_advice}, expires_at: #{@expires_at}, fallback_type: #{@fallback_type},"\
|
|
504
|
+
" receiving_account: #{@receiving_account}, ledger_transaction: #{@ledger_transaction},"\
|
|
505
|
+
" line_items: #{@line_items}, transaction_monitoring_enabled:"\
|
|
506
|
+
" #{@transaction_monitoring_enabled}>"
|
|
507
|
+
end
|
|
508
|
+
|
|
509
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
510
|
+
def inspect
|
|
511
|
+
class_name = self.class.name.split('::').last
|
|
512
|
+
"<#{class_name} type: #{@type.inspect}, subtype: #{@subtype.inspect}, amount:"\
|
|
513
|
+
" #{@amount.inspect}, direction: #{@direction.inspect}, priority: #{@priority.inspect},"\
|
|
514
|
+
" originating_account_id: #{@originating_account_id.inspect}, receiving_account_id:"\
|
|
515
|
+
" #{@receiving_account_id.inspect}, accounting: #{@accounting.inspect},"\
|
|
516
|
+
" accounting_category_id: #{@accounting_category_id.inspect}, accounting_ledger_class_id:"\
|
|
517
|
+
" #{@accounting_ledger_class_id.inspect}, currency: #{@currency.inspect}, effective_date:"\
|
|
518
|
+
" #{@effective_date.inspect}, description: #{@description.inspect}, statement_descriptor:"\
|
|
519
|
+
" #{@statement_descriptor.inspect}, remittance_information:"\
|
|
520
|
+
" #{@remittance_information.inspect}, purpose: #{@purpose.inspect}, metadata:"\
|
|
521
|
+
" #{@metadata.inspect}, charge_bearer: #{@charge_bearer.inspect},"\
|
|
522
|
+
" foreign_exchange_indicator: #{@foreign_exchange_indicator.inspect},"\
|
|
523
|
+
" foreign_exchange_contract: #{@foreign_exchange_contract.inspect}, nsf_protected:"\
|
|
524
|
+
" #{@nsf_protected.inspect}, originating_party_name: #{@originating_party_name.inspect},"\
|
|
525
|
+
" ultimate_originating_party_name: #{@ultimate_originating_party_name.inspect},"\
|
|
526
|
+
" ultimate_originating_party_identifier: #{@ultimate_originating_party_identifier.inspect},"\
|
|
527
|
+
" ultimate_receiving_party_name: #{@ultimate_receiving_party_name.inspect},"\
|
|
528
|
+
" ultimate_receiving_party_identifier: #{@ultimate_receiving_party_identifier.inspect},"\
|
|
529
|
+
" send_remittance_advice: #{@send_remittance_advice.inspect}, expires_at:"\
|
|
530
|
+
" #{@expires_at.inspect}, fallback_type: #{@fallback_type.inspect}, receiving_account:"\
|
|
531
|
+
" #{@receiving_account.inspect}, ledger_transaction: #{@ledger_transaction.inspect},"\
|
|
532
|
+
" line_items: #{@line_items.inspect}, transaction_monitoring_enabled:"\
|
|
533
|
+
" #{@transaction_monitoring_enabled.inspect}>"
|
|
534
|
+
end
|
|
535
|
+
end
|
|
536
|
+
end
|