mt-sdk 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +67 -60
- data/lib/modern_treasury/{controllers/account_collection_flow_controller.rb → apis/account_collection_flow_api.rb} +19 -13
- data/lib/modern_treasury/{controllers/account_detail_controller.rb → apis/account_detail_api.rb} +25 -11
- data/lib/modern_treasury/{controllers/balance_report_controller.rb → apis/balance_report_api.rb} +11 -6
- data/lib/modern_treasury/{controllers/base_controller.rb → apis/base_api.rb} +10 -3
- data/lib/modern_treasury/{controllers/connection_controller.rb → apis/connection_api.rb} +10 -9
- data/lib/modern_treasury/{controllers/counterparty_controller.rb → apis/counterparty_api.rb} +25 -15
- data/lib/modern_treasury/{controllers/document_controller.rb → apis/document_api.rb} +52 -28
- data/lib/modern_treasury/{controllers/event_controller.rb → apis/event_api.rb} +13 -10
- data/lib/modern_treasury/{controllers/expected_payment_controller.rb → apis/expected_payment_api.rb} +26 -19
- data/lib/modern_treasury/{controllers/external_account_controller.rb → apis/external_account_api.rb} +28 -16
- data/lib/modern_treasury/{controllers/incoming_payment_detail_controller.rb → apis/incoming_payment_detail_api.rb} +22 -16
- data/lib/modern_treasury/{controllers/internal_account_controller.rb → apis/internal_account_api.rb} +21 -15
- data/lib/modern_treasury/{controllers/invoice_controller.rb → apis/invoice_api.rb} +20 -14
- data/lib/modern_treasury/{controllers/invoice_line_item_controller.rb → apis/invoice_line_item_api.rb} +24 -11
- data/lib/modern_treasury/{controllers/ledger_account_controller.rb → apis/ledger_account_api.rb} +21 -13
- data/lib/modern_treasury/{controllers/ledger_account_category_controller.rb → apis/ledger_account_category_api.rb} +37 -17
- data/lib/modern_treasury/{controllers/ledger_account_payout_controller.rb → apis/ledger_account_payout_api.rb} +18 -12
- data/lib/modern_treasury/{controllers/ledger_account_statement_controller.rb → apis/ledger_account_statement_api.rb} +7 -4
- data/lib/modern_treasury/{controllers/ledger_controller.rb → apis/ledger_api.rb} +21 -13
- data/lib/modern_treasury/{controllers/ledger_entry_controller.rb → apis/ledger_entry_api.rb} +17 -15
- data/lib/modern_treasury/{controllers/ledger_event_handler_controller.rb → apis/ledger_event_handler_api.rb} +18 -12
- data/lib/modern_treasury/{controllers/ledger_transaction_controller.rb → apis/ledger_transaction_api.rb} +34 -24
- data/lib/modern_treasury/{controllers/ledgerable_event_controller.rb → apis/ledgerable_event_api.rb} +7 -4
- data/lib/modern_treasury/{controllers/line_item_controller.rb → apis/line_item_api.rb} +20 -9
- data/lib/modern_treasury/{controllers/paper_item_controller.rb → apis/paper_item_api.rb} +12 -9
- data/lib/modern_treasury/{controllers/payment_flow_controller.rb → apis/payment_flow_api.rb} +19 -13
- data/lib/modern_treasury/{controllers/payment_order_controller.rb → apis/payment_order_api.rb} +47 -36
- data/lib/modern_treasury/{controllers/payment_reference_controller.rb → apis/payment_reference_api.rb} +16 -13
- data/lib/modern_treasury/{controllers/ping_controller.rb → apis/ping_api.rb} +4 -3
- data/lib/modern_treasury/{controllers/return_controller.rb → apis/return_api.rb} +16 -12
- data/lib/modern_treasury/{controllers/reversal_controller.rb → apis/reversal_api.rb} +12 -5
- data/lib/modern_treasury/{controllers/routing_detail_controller.rb → apis/routing_detail_api.rb} +25 -11
- data/lib/modern_treasury/{controllers/transaction_controller.rb → apis/transaction_api.rb} +16 -11
- data/lib/modern_treasury/{controllers/transaction_line_item_controller.rb → apis/transaction_line_item_api.rb} +6 -4
- data/lib/modern_treasury/{controllers/validation_controller.rb → apis/validation_api.rb} +10 -7
- data/lib/modern_treasury/{controllers/virtual_account_controller.rb → apis/virtual_account_api.rb} +23 -15
- data/lib/modern_treasury/client.rb +80 -78
- data/lib/modern_treasury/configuration.rb +18 -47
- data/lib/modern_treasury/http/api_response.rb +19 -0
- data/lib/modern_treasury/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/modern_treasury/logging/sdk_logger.rb +17 -0
- data/lib/modern_treasury/models/account.rb +26 -26
- data/lib/modern_treasury/models/account1.rb +34 -21
- data/lib/modern_treasury/models/account_collection_flow.rb +15 -16
- data/lib/modern_treasury/models/account_collection_flow_create_request.rb +18 -5
- data/lib/modern_treasury/models/account_collection_flow_update_request.rb +16 -4
- data/lib/modern_treasury/models/account_detail.rb +15 -16
- data/lib/modern_treasury/models/account_detail1.rb +19 -6
- data/lib/modern_treasury/models/account_detail_create_request.rb +19 -6
- data/lib/modern_treasury/models/{account_number_type_enum.rb → account_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{account_number_type2_enum.rb → account_number_type2.rb} +3 -3
- data/lib/modern_treasury/models/{account_type_enum.rb → account_type.rb} +3 -3
- data/lib/modern_treasury/models/{account_type5_enum.rb → account_type5.rb} +3 -3
- data/lib/modern_treasury/models/accounting.rb +19 -5
- data/lib/modern_treasury/models/accounting1.rb +17 -5
- data/lib/modern_treasury/models/{accounts_type_enum.rb → accounts_type.rb} +3 -3
- data/lib/modern_treasury/models/{accounts_type1_enum.rb → accounts_type1.rb} +3 -3
- data/lib/modern_treasury/models/address.rb +13 -14
- data/lib/modern_treasury/models/address_request.rb +23 -10
- data/lib/modern_treasury/models/async_response.rb +3 -3
- data/lib/modern_treasury/models/balance.rb +15 -17
- data/lib/modern_treasury/models/balance_report.rb +14 -15
- data/lib/modern_treasury/models/{balance_report_type_enum.rb → balance_report_type.rb} +3 -3
- data/lib/modern_treasury/models/{balance_report_type1_enum.rb → balance_report_type1.rb} +3 -3
- data/lib/modern_treasury/models/{balance_type_enum.rb → balance_type.rb} +3 -3
- data/lib/modern_treasury/models/balances.rb +2 -2
- data/lib/modern_treasury/models/balances1.rb +3 -3
- data/lib/modern_treasury/models/balances2.rb +7 -7
- data/lib/modern_treasury/models/balances3.rb +8 -8
- data/lib/modern_treasury/models/{charge_bearer_enum.rb → charge_bearer.rb} +3 -3
- data/lib/modern_treasury/models/{code_enum.rb → code.rb} +3 -3
- data/lib/modern_treasury/models/{code1_enum.rb → code1.rb} +3 -3
- data/lib/modern_treasury/models/connection.rb +11 -12
- data/lib/modern_treasury/models/contact_detail.rb +13 -14
- data/lib/modern_treasury/models/contact_detail_create_request.rb +20 -6
- data/lib/modern_treasury/models/{contact_identifier_type_enum.rb → contact_identifier_type.rb} +3 -3
- data/lib/modern_treasury/models/{content_type_enum.rb → content_type.rb} +3 -3
- data/lib/modern_treasury/models/counterparty.rb +16 -17
- data/lib/modern_treasury/models/counterparty_billing_address.rb +23 -10
- data/lib/modern_treasury/models/counterparty_collect_account_request.rb +23 -10
- data/lib/modern_treasury/models/counterparty_collect_account_response.rb +4 -4
- data/lib/modern_treasury/models/counterparty_create_request.rb +31 -17
- data/lib/modern_treasury/models/counterparty_shipping_address.rb +23 -10
- data/lib/modern_treasury/models/counterparty_update_request.rb +23 -9
- data/lib/modern_treasury/models/{created_at_enum.rb → created_at.rb} +3 -3
- data/lib/modern_treasury/models/{currency_enum.rb → currency.rb} +3 -3
- data/lib/modern_treasury/models/{currency1_enum.rb → currency1.rb} +3 -3
- data/lib/modern_treasury/models/{direction_enum.rb → direction.rb} +3 -3
- data/lib/modern_treasury/models/{direction1_enum.rb → direction1.rb} +3 -3
- data/lib/modern_treasury/models/{direction10_enum.rb → direction10.rb} +3 -3
- data/lib/modern_treasury/models/{direction14_enum.rb → direction14.rb} +3 -3
- data/lib/modern_treasury/models/{direction15_enum.rb → direction15.rb} +3 -3
- data/lib/modern_treasury/models/{direction4_enum.rb → direction4.rb} +3 -3
- data/lib/modern_treasury/models/{direction5_enum.rb → direction5.rb} +3 -3
- data/lib/modern_treasury/models/{direction9_enum.rb → direction9.rb} +3 -3
- data/lib/modern_treasury/models/document.rb +16 -17
- data/lib/modern_treasury/models/document_create_request.rb +22 -9
- data/lib/modern_treasury/models/document_detail.rb +11 -11
- data/lib/modern_treasury/models/{documentable_type_enum.rb → documentable_type.rb} +3 -3
- data/lib/modern_treasury/models/{documentable_type1_enum.rb → documentable_type1.rb} +3 -3
- data/lib/modern_treasury/models/{documentable_type2_enum.rb → documentable_type2.rb} +3 -3
- data/lib/modern_treasury/models/{effective_at_enum.rb → effective_at.rb} +3 -3
- data/lib/modern_treasury/models/errors.rb +21 -7
- data/lib/modern_treasury/models/event.rb +12 -13
- data/lib/modern_treasury/models/expected_payment.rb +38 -41
- data/lib/modern_treasury/models/expected_payment_create_request.rb +43 -29
- data/lib/modern_treasury/models/expected_payment_update_request.rb +40 -27
- data/lib/modern_treasury/models/external_account.rb +26 -28
- data/lib/modern_treasury/models/external_account_complete_verification_request.rb +17 -4
- data/lib/modern_treasury/models/external_account_create_request.rb +36 -23
- data/lib/modern_treasury/models/external_account_update_request.rb +27 -14
- data/lib/modern_treasury/models/external_account_verify_request.rb +23 -9
- data/lib/modern_treasury/models/{fallback_type_enum.rb → fallback_type.rb} +3 -3
- data/lib/modern_treasury/models/{field_enum.rb → field.rb} +3 -3
- data/lib/modern_treasury/models/file.rb +4 -4
- data/lib/modern_treasury/models/{foreign_exchange_indicator_enum.rb → foreign_exchange_indicator.rb} +3 -3
- data/lib/modern_treasury/models/incoming_payment_detail.rb +41 -43
- data/lib/modern_treasury/models/incoming_payment_detail_create_request.rb +31 -17
- data/lib/modern_treasury/models/incoming_payment_detail_update_request.rb +17 -4
- data/lib/modern_treasury/models/internal_account.rb +32 -34
- data/lib/modern_treasury/models/internal_account_create_request.rb +28 -15
- data/lib/modern_treasury/models/internal_account_update_request.rb +22 -8
- data/lib/modern_treasury/models/invoice.rb +36 -38
- data/lib/modern_treasury/models/invoice_create_request.rb +38 -25
- data/lib/modern_treasury/models/invoice_line_item.rb +13 -15
- data/lib/modern_treasury/models/invoice_line_item_create_request.rb +22 -9
- data/lib/modern_treasury/models/invoice_line_item_update_request.rb +38 -25
- data/lib/modern_treasury/models/invoice_update_request.rb +40 -26
- data/lib/modern_treasury/models/invoicer_address.rb +23 -10
- data/lib/modern_treasury/models/{itemizable_type_enum.rb → itemizable_type.rb} +3 -3
- data/lib/modern_treasury/models/{itemizable_type1_enum.rb → itemizable_type1.rb} +3 -3
- data/lib/modern_treasury/models/ledger.rb +28 -14
- data/lib/modern_treasury/models/ledger_account.rb +21 -22
- data/lib/modern_treasury/models/ledger_account_category.rb +16 -17
- data/lib/modern_treasury/models/ledger_account_category_create_request.rb +26 -13
- data/lib/modern_treasury/models/ledger_account_category_update_request.rb +20 -6
- data/lib/modern_treasury/models/ledger_account_create_request.rb +30 -17
- data/lib/modern_treasury/models/{ledger_account_normal_balance_enum.rb → ledger_account_normal_balance.rb} +3 -3
- data/lib/modern_treasury/models/ledger_account_payout.rb +22 -24
- data/lib/modern_treasury/models/ledger_account_payout_create_request.rb +29 -14
- data/lib/modern_treasury/models/ledger_account_payout_update_request.rb +21 -7
- data/lib/modern_treasury/models/ledger_account_statement.rb +21 -23
- data/lib/modern_treasury/models/ledger_account_statement_create_request.rb +24 -10
- data/lib/modern_treasury/models/ledger_account_update_request.rb +20 -6
- data/lib/modern_treasury/models/ledger_balance.rb +6 -7
- data/lib/modern_treasury/models/ledger_balances.rb +4 -5
- data/lib/modern_treasury/models/ledger_balances_with_effective_at.rb +7 -8
- data/lib/modern_treasury/models/ledger_create_request.rb +20 -6
- data/lib/modern_treasury/models/ledger_entry.rb +24 -26
- data/lib/modern_treasury/models/ledger_entry_create_request.rb +30 -18
- data/lib/modern_treasury/models/ledger_entry_of_transaction_version.rb +21 -23
- data/lib/modern_treasury/models/ledger_event_handler.rb +14 -15
- data/lib/modern_treasury/models/ledger_event_handler_conditions.rb +4 -4
- data/lib/modern_treasury/models/ledger_event_handler_create_request.rb +23 -11
- data/lib/modern_treasury/models/ledger_event_handler_ledger_entries.rb +4 -4
- data/lib/modern_treasury/models/ledger_event_handler_ledger_transaction_template.rb +5 -6
- data/lib/modern_treasury/models/ledger_transaction.rb +24 -25
- data/lib/modern_treasury/models/ledger_transaction_create_request.rb +29 -17
- data/lib/modern_treasury/models/ledger_transaction_reversal_create_request.rb +27 -14
- data/lib/modern_treasury/models/ledger_transaction_update_request.rb +24 -10
- data/lib/modern_treasury/models/ledger_transaction_version.rb +24 -25
- data/lib/modern_treasury/models/{ledger_type_enum.rb → ledger_type.rb} +3 -3
- data/lib/modern_treasury/models/ledger_update_request.rb +20 -6
- data/lib/modern_treasury/models/ledgerable_event.rb +18 -19
- data/lib/modern_treasury/models/ledgerable_event_create_request.rb +26 -13
- data/lib/modern_treasury/models/{ledgerable_type_enum.rb → ledgerable_type.rb} +3 -3
- data/lib/modern_treasury/models/{ledgerable_type2_enum.rb → ledgerable_type2.rb} +3 -3
- data/lib/modern_treasury/models/{ledgerable_type5_enum.rb → ledgerable_type5.rb} +3 -3
- data/lib/modern_treasury/models/{ledgerable_type6_enum.rb → ledgerable_type6.rb} +3 -3
- data/lib/modern_treasury/models/legacy_document_create_request.rb +19 -5
- data/lib/modern_treasury/models/line_item.rb +18 -19
- data/lib/modern_treasury/models/line_item_request.rb +22 -8
- data/lib/modern_treasury/models/line_item_update_request.rb +17 -4
- data/lib/modern_treasury/models/mreturn.rb +48 -50
- data/lib/modern_treasury/models/{normal_balance_enum.rb → normal_balance.rb} +3 -3
- data/lib/modern_treasury/models/{normal_balance2_enum.rb → normal_balance2.rb} +3 -3
- data/lib/modern_treasury/models/order_by.rb +5 -5
- data/lib/modern_treasury/models/{originating_account_number_type_enum.rb → originating_account_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{originating_routing_number_type_enum.rb → originating_routing_number_type.rb} +3 -3
- data/lib/modern_treasury/models/paper_item.rb +25 -27
- data/lib/modern_treasury/models/party_address.rb +23 -10
- data/lib/modern_treasury/models/{party_type_enum.rb → party_type.rb} +3 -3
- data/lib/modern_treasury/models/{party_type5_enum.rb → party_type5.rb} +3 -3
- data/lib/modern_treasury/models/{payment_direction_enum.rb → payment_direction.rb} +3 -3
- data/lib/modern_treasury/models/payment_flow.rb +21 -22
- data/lib/modern_treasury/models/payment_flow_create_request.rb +24 -10
- data/lib/modern_treasury/models/payment_flow_update_request.rb +16 -4
- data/lib/modern_treasury/models/{payment_method_enum.rb → payment_method.rb} +3 -3
- data/lib/modern_treasury/models/{payment_method1_enum.rb → payment_method1.rb} +3 -3
- data/lib/modern_treasury/models/payment_order.rb +90 -95
- data/lib/modern_treasury/models/payment_order_async_create_request.rb +75 -62
- data/lib/modern_treasury/models/payment_order_create_request.rb +77 -63
- data/lib/modern_treasury/models/payment_order_update_request.rb +77 -62
- data/lib/modern_treasury/models/payment_reference.rb +12 -13
- data/lib/modern_treasury/models/payment_reference_object.rb +14 -15
- data/lib/modern_treasury/models/{payment_type_enum.rb → payment_type.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type1_enum.rb → payment_type1.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type13_enum.rb → payment_type13.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type2_enum.rb → payment_type2.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type4_enum.rb → payment_type4.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type5_enum.rb → payment_type5.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type6_enum.rb → payment_type6.rb} +3 -3
- data/lib/modern_treasury/models/ping_response.rb +2 -2
- data/lib/modern_treasury/models/{priority_enum.rb → priority.rb} +3 -3
- data/lib/modern_treasury/models/{priority4_enum.rb → priority4.rb} +3 -3
- data/lib/modern_treasury/models/{reason_enum.rb → reason.rb} +3 -3
- data/lib/modern_treasury/models/{reason1_enum.rb → reason1.rb} +3 -3
- data/lib/modern_treasury/models/receiving_account.rb +43 -28
- data/lib/modern_treasury/models/receiving_account1.rb +34 -21
- data/lib/modern_treasury/models/{receiving_account_type_enum.rb → receiving_account_type.rb} +3 -3
- data/lib/modern_treasury/models/{reconciliation_method_enum.rb → reconciliation_method.rb} +3 -3
- data/lib/modern_treasury/models/{reference_number_type_enum.rb → reference_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{reference_number_type1_enum.rb → reference_number_type1.rb} +3 -3
- data/lib/modern_treasury/models/{referenceable_type_enum.rb → referenceable_type.rb} +3 -3
- data/lib/modern_treasury/models/{referenceable_type1_enum.rb → referenceable_type1.rb} +3 -3
- data/lib/modern_treasury/models/return_create_request.rb +24 -10
- data/lib/modern_treasury/models/{returnable_type_enum.rb → returnable_type.rb} +3 -3
- data/lib/modern_treasury/models/{returnable_type1_enum.rb → returnable_type1.rb} +3 -3
- data/lib/modern_treasury/models/reversal.rb +13 -14
- data/lib/modern_treasury/models/reversal_create_request.rb +21 -7
- data/lib/modern_treasury/models/{role_enum.rb → role.rb} +3 -3
- data/lib/modern_treasury/models/routing_detail.rb +20 -21
- data/lib/modern_treasury/models/routing_detail1.rb +23 -9
- data/lib/modern_treasury/models/routing_detail_create_request.rb +23 -9
- data/lib/modern_treasury/models/routing_number_lookup_request.rb +11 -11
- data/lib/modern_treasury/models/{routing_number_type_enum.rb → routing_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{routing_number_type1_enum.rb → routing_number_type1.rb} +3 -3
- data/lib/modern_treasury/models/{routing_number_type7_enum.rb → routing_number_type7.rb} +3 -3
- data/lib/modern_treasury/models/{routing_number_type8_enum.rb → routing_number_type8.rb} +3 -3
- data/lib/modern_treasury/models/{status_enum.rb → status.rb} +3 -3
- data/lib/modern_treasury/models/{status1_enum.rb → status1.rb} +3 -3
- data/lib/modern_treasury/models/{status11_enum.rb → status11.rb} +3 -3
- data/lib/modern_treasury/models/{status12_enum.rb → status12.rb} +3 -3
- data/lib/modern_treasury/models/{status15_enum.rb → status15.rb} +3 -3
- data/lib/modern_treasury/models/{status16_enum.rb → status16.rb} +3 -3
- data/lib/modern_treasury/models/{status17_enum.rb → status17.rb} +3 -3
- data/lib/modern_treasury/models/{status18_enum.rb → status18.rb} +3 -3
- data/lib/modern_treasury/models/{status19_enum.rb → status19.rb} +3 -3
- data/lib/modern_treasury/models/{status2_enum.rb → status2.rb} +3 -3
- data/lib/modern_treasury/models/{status20_enum.rb → status20.rb} +3 -3
- data/lib/modern_treasury/models/{status21_enum.rb → status21.rb} +3 -3
- data/lib/modern_treasury/models/{status22_enum.rb → status22.rb} +3 -3
- data/lib/modern_treasury/models/{status24_enum.rb → status24.rb} +3 -3
- data/lib/modern_treasury/models/{status3_enum.rb → status3.rb} +3 -3
- data/lib/modern_treasury/models/{status4_enum.rb → status4.rb} +3 -3
- data/lib/modern_treasury/models/{status5_enum.rb → status5.rb} +3 -3
- data/lib/modern_treasury/models/{status6_enum.rb → status6.rb} +3 -3
- data/lib/modern_treasury/models/{status7_enum.rb → status7.rb} +3 -3
- data/lib/modern_treasury/models/{status8_enum.rb → status8.rb} +3 -3
- data/lib/modern_treasury/models/{status9_enum.rb → status9.rb} +3 -3
- data/lib/modern_treasury/models/{subtype_enum.rb → subtype.rb} +3 -3
- data/lib/modern_treasury/models/{supported_payment_type_enum.rb → supported_payment_type.rb} +3 -3
- data/lib/modern_treasury/models/{transactable_type_enum.rb → transactable_type.rb} +3 -3
- data/lib/modern_treasury/models/transaction.rb +31 -33
- data/lib/modern_treasury/models/transaction_line_item.rb +19 -20
- data/lib/modern_treasury/models/{type_enum.rb → type.rb} +3 -3
- data/lib/modern_treasury/models/{type1_enum.rb → type1.rb} +3 -3
- data/lib/modern_treasury/models/{type10_enum.rb → type10.rb} +3 -3
- data/lib/modern_treasury/models/{type11_enum.rb → type11.rb} +3 -3
- data/lib/modern_treasury/models/{type12_enum.rb → type12.rb} +3 -3
- data/lib/modern_treasury/models/{type13_enum.rb → type13.rb} +3 -3
- data/lib/modern_treasury/models/{type14_enum.rb → type14.rb} +3 -3
- data/lib/modern_treasury/models/{type16_enum.rb → type16.rb} +3 -3
- data/lib/modern_treasury/models/{type4_enum.rb → type4.rb} +3 -3
- data/lib/modern_treasury/models/{type5_enum.rb → type5.rb} +3 -3
- data/lib/modern_treasury/models/{type6_enum.rb → type6.rb} +3 -3
- data/lib/modern_treasury/models/{vendor_code_type_enum.rb → vendor_code_type.rb} +3 -3
- data/lib/modern_treasury/models/{vendor_code_type1_enum.rb → vendor_code_type1.rb} +3 -3
- data/lib/modern_treasury/models/{verification_status_enum.rb → verification_status.rb} +3 -3
- data/lib/modern_treasury/models/{verification_status1_enum.rb → verification_status1.rb} +3 -3
- data/lib/modern_treasury/models/virtual_account.rb +20 -21
- data/lib/modern_treasury/models/virtual_account_create_request.rb +29 -15
- data/lib/modern_treasury/models/virtual_account_update_request.rb +19 -6
- data/lib/modern_treasury.rb +153 -152
- metadata +152 -206
- data/test/controllers/controller_test_base.rb +0 -23
- data/test/controllers/test_account_collection_flow_controller.rb +0 -64
- data/test/controllers/test_connection_controller.rb +0 -41
- data/test/controllers/test_counterparty_controller.rb +0 -65
- data/test/controllers/test_document_controller.rb +0 -41
- data/test/controllers/test_event_controller.rb +0 -46
- data/test/controllers/test_expected_payment_controller.rb +0 -71
- data/test/controllers/test_external_account_controller.rb +0 -63
- data/test/controllers/test_incoming_payment_detail_controller.rb +0 -68
- data/test/controllers/test_internal_account_controller.rb +0 -65
- data/test/controllers/test_invoice_controller.rb +0 -56
- data/test/controllers/test_ledger_account_category_controller.rb +0 -67
- data/test/controllers/test_ledger_account_controller.rb +0 -70
- data/test/controllers/test_ledger_account_payout_controller.rb +0 -62
- data/test/controllers/test_ledger_account_statement_controller.rb +0 -36
- data/test/controllers/test_ledger_controller.rb +0 -59
- data/test/controllers/test_ledger_entry_controller.rb +0 -65
- data/test/controllers/test_ledger_event_handler_controller.rb +0 -63
- data/test/controllers/test_ledger_transaction_controller.rb +0 -112
- data/test/controllers/test_ledgerable_event_controller.rb +0 -36
- data/test/controllers/test_paper_item_controller.rb +0 -43
- data/test/controllers/test_payment_flow_controller.rb +0 -67
- data/test/controllers/test_payment_order_controller.rb +0 -76
- data/test/controllers/test_payment_reference_controller.rb +0 -43
- data/test/controllers/test_ping_controller.rb +0 -31
- data/test/controllers/test_return_controller.rb +0 -64
- data/test/controllers/test_transaction_controller.rb +0 -56
- data/test/controllers/test_virtual_account_controller.rb +0 -63
- data/test/http_response_catcher.rb +0 -19
|
@@ -21,7 +21,7 @@ module ModernTreasury
|
|
|
21
21
|
|
|
22
22
|
# One of credit or debit. When you are receiving money, use credit. When you
|
|
23
23
|
# are being charged, use debit.
|
|
24
|
-
# @return [
|
|
24
|
+
# @return [Direction1]
|
|
25
25
|
attr_accessor :direction
|
|
26
26
|
|
|
27
27
|
# The ID of the Internal Account for the expected payment.
|
|
@@ -30,11 +30,11 @@ module ModernTreasury
|
|
|
30
30
|
|
|
31
31
|
# One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,
|
|
32
32
|
# sen, sepa, signet, wire.
|
|
33
|
-
# @return [
|
|
33
|
+
# @return [Type1]
|
|
34
34
|
attr_accessor :type
|
|
35
35
|
|
|
36
36
|
# Three-letter ISO currency code.
|
|
37
|
-
# @return [
|
|
37
|
+
# @return [Currency]
|
|
38
38
|
attr_accessor :currency
|
|
39
39
|
|
|
40
40
|
# The latest date the payment may come in. Format: yyyy-mm-dd
|
|
@@ -138,14 +138,17 @@ module ModernTreasury
|
|
|
138
138
|
]
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
-
def initialize(amount_upper_bound
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
def initialize(amount_upper_bound:, amount_lower_bound:, direction:,
|
|
142
|
+
internal_account_id:, type: SKIP, currency: SKIP,
|
|
143
|
+
date_upper_bound: SKIP, date_lower_bound: SKIP,
|
|
144
|
+
description: SKIP, statement_descriptor: SKIP,
|
|
145
|
+
metadata: SKIP, counterparty_id: SKIP,
|
|
146
|
+
remittance_information: SKIP, reconciliation_groups: SKIP,
|
|
147
|
+
reconciliation_filters: SKIP, line_items: SKIP,
|
|
148
|
+
additional_properties: nil)
|
|
149
|
+
# Add additional model properties to the instance
|
|
150
|
+
additional_properties = {} if additional_properties.nil?
|
|
151
|
+
|
|
149
152
|
@amount_upper_bound = amount_upper_bound
|
|
150
153
|
@amount_lower_bound = amount_lower_bound
|
|
151
154
|
@direction = direction
|
|
@@ -162,6 +165,7 @@ module ModernTreasury
|
|
|
162
165
|
@reconciliation_groups = reconciliation_groups unless reconciliation_groups == SKIP
|
|
163
166
|
@reconciliation_filters = reconciliation_filters unless reconciliation_filters == SKIP
|
|
164
167
|
@line_items = line_items unless line_items == SKIP
|
|
168
|
+
@additional_properties = additional_properties
|
|
165
169
|
end
|
|
166
170
|
|
|
167
171
|
# Creates an instance of the object from a hash.
|
|
@@ -205,23 +209,31 @@ module ModernTreasury
|
|
|
205
209
|
|
|
206
210
|
line_items = SKIP unless hash.key?('line_items')
|
|
207
211
|
|
|
212
|
+
# Create a new hash for additional properties, removing known properties.
|
|
213
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
214
|
+
|
|
215
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
216
|
+
new_hash, proc { |value| value }
|
|
217
|
+
)
|
|
218
|
+
|
|
208
219
|
# Create object from extracted values.
|
|
209
|
-
ExpectedPaymentCreateRequest.new(amount_upper_bound,
|
|
210
|
-
amount_lower_bound,
|
|
211
|
-
direction,
|
|
212
|
-
internal_account_id,
|
|
213
|
-
type,
|
|
214
|
-
currency,
|
|
215
|
-
date_upper_bound,
|
|
216
|
-
date_lower_bound,
|
|
217
|
-
description,
|
|
218
|
-
statement_descriptor,
|
|
219
|
-
metadata,
|
|
220
|
-
counterparty_id,
|
|
221
|
-
remittance_information,
|
|
222
|
-
reconciliation_groups,
|
|
223
|
-
reconciliation_filters,
|
|
224
|
-
line_items
|
|
220
|
+
ExpectedPaymentCreateRequest.new(amount_upper_bound: amount_upper_bound,
|
|
221
|
+
amount_lower_bound: amount_lower_bound,
|
|
222
|
+
direction: direction,
|
|
223
|
+
internal_account_id: internal_account_id,
|
|
224
|
+
type: type,
|
|
225
|
+
currency: currency,
|
|
226
|
+
date_upper_bound: date_upper_bound,
|
|
227
|
+
date_lower_bound: date_lower_bound,
|
|
228
|
+
description: description,
|
|
229
|
+
statement_descriptor: statement_descriptor,
|
|
230
|
+
metadata: metadata,
|
|
231
|
+
counterparty_id: counterparty_id,
|
|
232
|
+
remittance_information: remittance_information,
|
|
233
|
+
reconciliation_groups: reconciliation_groups,
|
|
234
|
+
reconciliation_filters: reconciliation_filters,
|
|
235
|
+
line_items: line_items,
|
|
236
|
+
additional_properties: additional_properties)
|
|
225
237
|
end
|
|
226
238
|
|
|
227
239
|
# Provides a human-readable string representation of the object.
|
|
@@ -234,7 +246,8 @@ module ModernTreasury
|
|
|
234
246
|
" #{@description}, statement_descriptor: #{@statement_descriptor}, metadata: #{@metadata},"\
|
|
235
247
|
" counterparty_id: #{@counterparty_id}, remittance_information: #{@remittance_information},"\
|
|
236
248
|
" reconciliation_groups: #{@reconciliation_groups}, reconciliation_filters:"\
|
|
237
|
-
" #{@reconciliation_filters}, line_items: #{@line_items}
|
|
249
|
+
" #{@reconciliation_filters}, line_items: #{@line_items}, additional_properties:"\
|
|
250
|
+
" #{@additional_properties}>"
|
|
238
251
|
end
|
|
239
252
|
|
|
240
253
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -248,7 +261,8 @@ module ModernTreasury
|
|
|
248
261
|
" #{@statement_descriptor.inspect}, metadata: #{@metadata.inspect}, counterparty_id:"\
|
|
249
262
|
" #{@counterparty_id.inspect}, remittance_information: #{@remittance_information.inspect},"\
|
|
250
263
|
" reconciliation_groups: #{@reconciliation_groups.inspect}, reconciliation_filters:"\
|
|
251
|
-
" #{@reconciliation_filters.inspect}, line_items: #{@line_items.inspect}
|
|
264
|
+
" #{@reconciliation_filters.inspect}, line_items: #{@line_items.inspect},"\
|
|
265
|
+
" additional_properties: #{@additional_properties}>"
|
|
252
266
|
end
|
|
253
267
|
end
|
|
254
268
|
end
|
|
@@ -21,7 +21,7 @@ module ModernTreasury
|
|
|
21
21
|
|
|
22
22
|
# One of credit or debit. When you are receiving money, use credit. When you
|
|
23
23
|
# are being charged, use debit.
|
|
24
|
-
# @return [
|
|
24
|
+
# @return [Direction1]
|
|
25
25
|
attr_accessor :direction
|
|
26
26
|
|
|
27
27
|
# The ID of the Internal Account for the expected payment.
|
|
@@ -30,11 +30,11 @@ module ModernTreasury
|
|
|
30
30
|
|
|
31
31
|
# One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,
|
|
32
32
|
# sen, sepa, signet, wire.
|
|
33
|
-
# @return [
|
|
33
|
+
# @return [Type1]
|
|
34
34
|
attr_accessor :type
|
|
35
35
|
|
|
36
36
|
# Three-letter ISO currency code.
|
|
37
|
-
# @return [
|
|
37
|
+
# @return [Currency]
|
|
38
38
|
attr_accessor :currency
|
|
39
39
|
|
|
40
40
|
# The latest date the payment may come in. Format: yyyy-mm-dd
|
|
@@ -136,13 +136,17 @@ module ModernTreasury
|
|
|
136
136
|
]
|
|
137
137
|
end
|
|
138
138
|
|
|
139
|
-
def initialize(amount_upper_bound
|
|
140
|
-
direction
|
|
141
|
-
currency
|
|
142
|
-
date_lower_bound
|
|
143
|
-
statement_descriptor
|
|
144
|
-
counterparty_id
|
|
145
|
-
reconciliation_groups
|
|
139
|
+
def initialize(amount_upper_bound: SKIP, amount_lower_bound: SKIP,
|
|
140
|
+
direction: SKIP, internal_account_id: SKIP, type: SKIP,
|
|
141
|
+
currency: SKIP, date_upper_bound: SKIP,
|
|
142
|
+
date_lower_bound: SKIP, description: SKIP,
|
|
143
|
+
statement_descriptor: SKIP, metadata: SKIP,
|
|
144
|
+
counterparty_id: SKIP, remittance_information: SKIP,
|
|
145
|
+
reconciliation_groups: SKIP, reconciliation_filters: SKIP,
|
|
146
|
+
additional_properties: nil)
|
|
147
|
+
# Add additional model properties to the instance
|
|
148
|
+
additional_properties = {} if additional_properties.nil?
|
|
149
|
+
|
|
146
150
|
@amount_upper_bound = amount_upper_bound unless amount_upper_bound == SKIP
|
|
147
151
|
@amount_lower_bound = amount_lower_bound unless amount_lower_bound == SKIP
|
|
148
152
|
@direction = direction unless direction == SKIP
|
|
@@ -158,6 +162,7 @@ module ModernTreasury
|
|
|
158
162
|
@remittance_information = remittance_information unless remittance_information == SKIP
|
|
159
163
|
@reconciliation_groups = reconciliation_groups unless reconciliation_groups == SKIP
|
|
160
164
|
@reconciliation_filters = reconciliation_filters unless reconciliation_filters == SKIP
|
|
165
|
+
@additional_properties = additional_properties
|
|
161
166
|
end
|
|
162
167
|
|
|
163
168
|
# Creates an instance of the object from a hash.
|
|
@@ -191,22 +196,30 @@ module ModernTreasury
|
|
|
191
196
|
reconciliation_filters =
|
|
192
197
|
hash.key?('reconciliation_filters') ? hash['reconciliation_filters'] : SKIP
|
|
193
198
|
|
|
199
|
+
# Create a new hash for additional properties, removing known properties.
|
|
200
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
201
|
+
|
|
202
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
203
|
+
new_hash, proc { |value| value }
|
|
204
|
+
)
|
|
205
|
+
|
|
194
206
|
# Create object from extracted values.
|
|
195
|
-
ExpectedPaymentUpdateRequest.new(amount_upper_bound,
|
|
196
|
-
amount_lower_bound,
|
|
197
|
-
direction,
|
|
198
|
-
internal_account_id,
|
|
199
|
-
type,
|
|
200
|
-
currency,
|
|
201
|
-
date_upper_bound,
|
|
202
|
-
date_lower_bound,
|
|
203
|
-
description,
|
|
204
|
-
statement_descriptor,
|
|
205
|
-
metadata,
|
|
206
|
-
counterparty_id,
|
|
207
|
-
remittance_information,
|
|
208
|
-
reconciliation_groups,
|
|
209
|
-
reconciliation_filters
|
|
207
|
+
ExpectedPaymentUpdateRequest.new(amount_upper_bound: amount_upper_bound,
|
|
208
|
+
amount_lower_bound: amount_lower_bound,
|
|
209
|
+
direction: direction,
|
|
210
|
+
internal_account_id: internal_account_id,
|
|
211
|
+
type: type,
|
|
212
|
+
currency: currency,
|
|
213
|
+
date_upper_bound: date_upper_bound,
|
|
214
|
+
date_lower_bound: date_lower_bound,
|
|
215
|
+
description: description,
|
|
216
|
+
statement_descriptor: statement_descriptor,
|
|
217
|
+
metadata: metadata,
|
|
218
|
+
counterparty_id: counterparty_id,
|
|
219
|
+
remittance_information: remittance_information,
|
|
220
|
+
reconciliation_groups: reconciliation_groups,
|
|
221
|
+
reconciliation_filters: reconciliation_filters,
|
|
222
|
+
additional_properties: additional_properties)
|
|
210
223
|
end
|
|
211
224
|
|
|
212
225
|
# Provides a human-readable string representation of the object.
|
|
@@ -219,7 +232,7 @@ module ModernTreasury
|
|
|
219
232
|
" #{@description}, statement_descriptor: #{@statement_descriptor}, metadata: #{@metadata},"\
|
|
220
233
|
" counterparty_id: #{@counterparty_id}, remittance_information: #{@remittance_information},"\
|
|
221
234
|
" reconciliation_groups: #{@reconciliation_groups}, reconciliation_filters:"\
|
|
222
|
-
" #{@reconciliation_filters}>"
|
|
235
|
+
" #{@reconciliation_filters}, additional_properties: #{@additional_properties}>"
|
|
223
236
|
end
|
|
224
237
|
|
|
225
238
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -233,7 +246,7 @@ module ModernTreasury
|
|
|
233
246
|
" #{@statement_descriptor.inspect}, metadata: #{@metadata.inspect}, counterparty_id:"\
|
|
234
247
|
" #{@counterparty_id.inspect}, remittance_information: #{@remittance_information.inspect},"\
|
|
235
248
|
" reconciliation_groups: #{@reconciliation_groups.inspect}, reconciliation_filters:"\
|
|
236
|
-
" #{@reconciliation_filters.inspect}>"
|
|
249
|
+
" #{@reconciliation_filters.inspect}, additional_properties: #{@additional_properties}>"
|
|
237
250
|
end
|
|
238
251
|
end
|
|
239
252
|
end
|
|
@@ -39,11 +39,11 @@ module ModernTreasury
|
|
|
39
39
|
attr_accessor :discarded_at
|
|
40
40
|
|
|
41
41
|
# Can be `checking`, `savings` or `other`.
|
|
42
|
-
# @return [
|
|
42
|
+
# @return [AccountType]
|
|
43
43
|
attr_accessor :account_type
|
|
44
44
|
|
|
45
45
|
# Either `individual` or `business`.
|
|
46
|
-
# @return [
|
|
46
|
+
# @return [PartyType]
|
|
47
47
|
attr_accessor :party_type
|
|
48
48
|
|
|
49
49
|
# Either `individual` or `business`.
|
|
@@ -90,7 +90,7 @@ module ModernTreasury
|
|
|
90
90
|
|
|
91
91
|
# If the external account links to a ledger account in Modern Treasury, the
|
|
92
92
|
# id of the ledger account will be populated here.
|
|
93
|
-
# @return [
|
|
93
|
+
# @return [VerificationStatus]
|
|
94
94
|
attr_accessor :verification_status
|
|
95
95
|
|
|
96
96
|
# A mapping from model property names to API property names.
|
|
@@ -134,13 +134,11 @@ module ModernTreasury
|
|
|
134
134
|
]
|
|
135
135
|
end
|
|
136
136
|
|
|
137
|
-
def initialize(id
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
contact_details = nil, ledger_account_id = nil,
|
|
143
|
-
verification_status = nil)
|
|
137
|
+
def initialize(id:, object:, live_mode:, created_at:, updated_at:,
|
|
138
|
+
discarded_at:, account_type:, party_type:, party_address:,
|
|
139
|
+
name:, counterparty_id:, account_details:, routing_details:,
|
|
140
|
+
metadata:, party_name:, contact_details:, ledger_account_id:,
|
|
141
|
+
verification_status:)
|
|
144
142
|
@id = id
|
|
145
143
|
@object = object
|
|
146
144
|
@live_mode = live_mode
|
|
@@ -222,24 +220,24 @@ module ModernTreasury
|
|
|
222
220
|
hash.key?('verification_status') ? hash['verification_status'] : nil
|
|
223
221
|
|
|
224
222
|
# Create object from extracted values.
|
|
225
|
-
ExternalAccount.new(id,
|
|
226
|
-
object,
|
|
227
|
-
live_mode,
|
|
228
|
-
created_at,
|
|
229
|
-
updated_at,
|
|
230
|
-
discarded_at,
|
|
231
|
-
account_type,
|
|
232
|
-
party_type,
|
|
233
|
-
party_address,
|
|
234
|
-
name,
|
|
235
|
-
counterparty_id,
|
|
236
|
-
account_details,
|
|
237
|
-
routing_details,
|
|
238
|
-
metadata,
|
|
239
|
-
party_name,
|
|
240
|
-
contact_details,
|
|
241
|
-
ledger_account_id,
|
|
242
|
-
verification_status)
|
|
223
|
+
ExternalAccount.new(id: id,
|
|
224
|
+
object: object,
|
|
225
|
+
live_mode: live_mode,
|
|
226
|
+
created_at: created_at,
|
|
227
|
+
updated_at: updated_at,
|
|
228
|
+
discarded_at: discarded_at,
|
|
229
|
+
account_type: account_type,
|
|
230
|
+
party_type: party_type,
|
|
231
|
+
party_address: party_address,
|
|
232
|
+
name: name,
|
|
233
|
+
counterparty_id: counterparty_id,
|
|
234
|
+
account_details: account_details,
|
|
235
|
+
routing_details: routing_details,
|
|
236
|
+
metadata: metadata,
|
|
237
|
+
party_name: party_name,
|
|
238
|
+
contact_details: contact_details,
|
|
239
|
+
ledger_account_id: ledger_account_id,
|
|
240
|
+
verification_status: verification_status)
|
|
243
241
|
end
|
|
244
242
|
|
|
245
243
|
def to_custom_created_at
|
|
@@ -32,8 +32,12 @@ module ModernTreasury
|
|
|
32
32
|
[]
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
def initialize(amounts
|
|
35
|
+
def initialize(amounts: SKIP, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
36
39
|
@amounts = amounts unless amounts == SKIP
|
|
40
|
+
@additional_properties = additional_properties
|
|
37
41
|
end
|
|
38
42
|
|
|
39
43
|
# Creates an instance of the object from a hash.
|
|
@@ -43,20 +47,29 @@ module ModernTreasury
|
|
|
43
47
|
# Extract variables from the hash.
|
|
44
48
|
amounts = hash.key?('amounts') ? hash['amounts'] : SKIP
|
|
45
49
|
|
|
50
|
+
# Create a new hash for additional properties, removing known properties.
|
|
51
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
52
|
+
|
|
53
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
54
|
+
new_hash, proc { |value| value }
|
|
55
|
+
)
|
|
56
|
+
|
|
46
57
|
# Create object from extracted values.
|
|
47
|
-
ExternalAccountCompleteVerificationRequest.new(amounts
|
|
58
|
+
ExternalAccountCompleteVerificationRequest.new(amounts: amounts,
|
|
59
|
+
additional_properties: additional_properties)
|
|
48
60
|
end
|
|
49
61
|
|
|
50
62
|
# Provides a human-readable string representation of the object.
|
|
51
63
|
def to_s
|
|
52
64
|
class_name = self.class.name.split('::').last
|
|
53
|
-
"<#{class_name} amounts: #{@amounts}>"
|
|
65
|
+
"<#{class_name} amounts: #{@amounts}, additional_properties: #{@additional_properties}>"
|
|
54
66
|
end
|
|
55
67
|
|
|
56
68
|
# Provides a debugging-friendly string with detailed object information.
|
|
57
69
|
def inspect
|
|
58
70
|
class_name = self.class.name.split('::').last
|
|
59
|
-
"<#{class_name} amounts: #{@amounts.inspect}
|
|
71
|
+
"<#{class_name} amounts: #{@amounts.inspect}, additional_properties:"\
|
|
72
|
+
" #{@additional_properties}>"
|
|
60
73
|
end
|
|
61
74
|
end
|
|
62
75
|
end
|
|
@@ -10,11 +10,11 @@ module ModernTreasury
|
|
|
10
10
|
private_constant :SKIP
|
|
11
11
|
|
|
12
12
|
# Can be `checking`, `savings` or `other`.
|
|
13
|
-
# @return [
|
|
13
|
+
# @return [AccountType]
|
|
14
14
|
attr_accessor :account_type
|
|
15
15
|
|
|
16
16
|
# Either `individual` or `business`.
|
|
17
|
-
# @return [
|
|
17
|
+
# @return [PartyType]
|
|
18
18
|
attr_accessor :party_type
|
|
19
19
|
|
|
20
20
|
# Either `individual` or `business`.
|
|
@@ -117,12 +117,15 @@ module ModernTreasury
|
|
|
117
117
|
]
|
|
118
118
|
end
|
|
119
119
|
|
|
120
|
-
def initialize(counterparty_id
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
def initialize(counterparty_id:, account_type: SKIP, party_type: SKIP,
|
|
121
|
+
party_address: SKIP, name: SKIP, account_details: SKIP,
|
|
122
|
+
routing_details: SKIP, metadata: SKIP, party_name: SKIP,
|
|
123
|
+
party_identifier: SKIP, ledger_account: SKIP,
|
|
124
|
+
plaid_processor_token: SKIP, contact_details: SKIP,
|
|
125
|
+
additional_properties: nil)
|
|
126
|
+
# Add additional model properties to the instance
|
|
127
|
+
additional_properties = {} if additional_properties.nil?
|
|
128
|
+
|
|
126
129
|
@account_type = account_type unless account_type == SKIP
|
|
127
130
|
@party_type = party_type unless party_type == SKIP
|
|
128
131
|
@party_address = party_address unless party_address == SKIP
|
|
@@ -136,6 +139,7 @@ module ModernTreasury
|
|
|
136
139
|
@ledger_account = ledger_account unless ledger_account == SKIP
|
|
137
140
|
@plaid_processor_token = plaid_processor_token unless plaid_processor_token == SKIP
|
|
138
141
|
@contact_details = contact_details unless contact_details == SKIP
|
|
142
|
+
@additional_properties = additional_properties
|
|
139
143
|
end
|
|
140
144
|
|
|
141
145
|
# Creates an instance of the object from a hash.
|
|
@@ -188,20 +192,28 @@ module ModernTreasury
|
|
|
188
192
|
|
|
189
193
|
contact_details = SKIP unless hash.key?('contact_details')
|
|
190
194
|
|
|
195
|
+
# Create a new hash for additional properties, removing known properties.
|
|
196
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
197
|
+
|
|
198
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
199
|
+
new_hash, proc { |value| value }
|
|
200
|
+
)
|
|
201
|
+
|
|
191
202
|
# Create object from extracted values.
|
|
192
|
-
ExternalAccountCreateRequest.new(counterparty_id,
|
|
193
|
-
account_type,
|
|
194
|
-
party_type,
|
|
195
|
-
party_address,
|
|
196
|
-
name,
|
|
197
|
-
account_details,
|
|
198
|
-
routing_details,
|
|
199
|
-
metadata,
|
|
200
|
-
party_name,
|
|
201
|
-
party_identifier,
|
|
202
|
-
ledger_account,
|
|
203
|
-
plaid_processor_token,
|
|
204
|
-
contact_details
|
|
203
|
+
ExternalAccountCreateRequest.new(counterparty_id: counterparty_id,
|
|
204
|
+
account_type: account_type,
|
|
205
|
+
party_type: party_type,
|
|
206
|
+
party_address: party_address,
|
|
207
|
+
name: name,
|
|
208
|
+
account_details: account_details,
|
|
209
|
+
routing_details: routing_details,
|
|
210
|
+
metadata: metadata,
|
|
211
|
+
party_name: party_name,
|
|
212
|
+
party_identifier: party_identifier,
|
|
213
|
+
ledger_account: ledger_account,
|
|
214
|
+
plaid_processor_token: plaid_processor_token,
|
|
215
|
+
contact_details: contact_details,
|
|
216
|
+
additional_properties: additional_properties)
|
|
205
217
|
end
|
|
206
218
|
|
|
207
219
|
# Provides a human-readable string representation of the object.
|
|
@@ -212,7 +224,7 @@ module ModernTreasury
|
|
|
212
224
|
" #{@account_details}, routing_details: #{@routing_details}, metadata: #{@metadata},"\
|
|
213
225
|
" party_name: #{@party_name}, party_identifier: #{@party_identifier}, ledger_account:"\
|
|
214
226
|
" #{@ledger_account}, plaid_processor_token: #{@plaid_processor_token}, contact_details:"\
|
|
215
|
-
" #{@contact_details}>"
|
|
227
|
+
" #{@contact_details}, additional_properties: #{@additional_properties}>"
|
|
216
228
|
end
|
|
217
229
|
|
|
218
230
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -224,7 +236,8 @@ module ModernTreasury
|
|
|
224
236
|
" routing_details: #{@routing_details.inspect}, metadata: #{@metadata.inspect}, party_name:"\
|
|
225
237
|
" #{@party_name.inspect}, party_identifier: #{@party_identifier.inspect}, ledger_account:"\
|
|
226
238
|
" #{@ledger_account.inspect}, plaid_processor_token: #{@plaid_processor_token.inspect},"\
|
|
227
|
-
" contact_details: #{@contact_details.inspect}
|
|
239
|
+
" contact_details: #{@contact_details.inspect}, additional_properties:"\
|
|
240
|
+
" #{@additional_properties}>"
|
|
228
241
|
end
|
|
229
242
|
end
|
|
230
243
|
end
|
|
@@ -10,11 +10,11 @@ module ModernTreasury
|
|
|
10
10
|
private_constant :SKIP
|
|
11
11
|
|
|
12
12
|
# Either `individual` or `business`.
|
|
13
|
-
# @return [
|
|
13
|
+
# @return [PartyType]
|
|
14
14
|
attr_accessor :party_type
|
|
15
15
|
|
|
16
16
|
# Can be `checking`, `savings` or `other`.
|
|
17
|
-
# @return [
|
|
17
|
+
# @return [AccountType]
|
|
18
18
|
attr_accessor :account_type
|
|
19
19
|
|
|
20
20
|
# Can be `checking`, `savings` or `other`.
|
|
@@ -76,9 +76,12 @@ module ModernTreasury
|
|
|
76
76
|
]
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
def initialize(party_type
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
def initialize(party_type: SKIP, account_type: SKIP, counterparty_id: SKIP,
|
|
80
|
+
name: SKIP, party_name: SKIP, party_address: SKIP,
|
|
81
|
+
metadata: SKIP, additional_properties: nil)
|
|
82
|
+
# Add additional model properties to the instance
|
|
83
|
+
additional_properties = {} if additional_properties.nil?
|
|
84
|
+
|
|
82
85
|
@party_type = party_type unless party_type == SKIP
|
|
83
86
|
@account_type = account_type unless account_type == SKIP
|
|
84
87
|
@counterparty_id = counterparty_id unless counterparty_id == SKIP
|
|
@@ -86,6 +89,7 @@ module ModernTreasury
|
|
|
86
89
|
@party_name = party_name unless party_name == SKIP
|
|
87
90
|
@party_address = party_address unless party_address == SKIP
|
|
88
91
|
@metadata = metadata unless metadata == SKIP
|
|
92
|
+
@additional_properties = additional_properties
|
|
89
93
|
end
|
|
90
94
|
|
|
91
95
|
# Creates an instance of the object from a hash.
|
|
@@ -102,14 +106,22 @@ module ModernTreasury
|
|
|
102
106
|
party_address = AddressRequest.from_hash(hash['party_address']) if hash['party_address']
|
|
103
107
|
metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
|
|
104
108
|
|
|
109
|
+
# Create a new hash for additional properties, removing known properties.
|
|
110
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
111
|
+
|
|
112
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
113
|
+
new_hash, proc { |value| value }
|
|
114
|
+
)
|
|
115
|
+
|
|
105
116
|
# Create object from extracted values.
|
|
106
|
-
ExternalAccountUpdateRequest.new(party_type,
|
|
107
|
-
account_type,
|
|
108
|
-
counterparty_id,
|
|
109
|
-
name,
|
|
110
|
-
party_name,
|
|
111
|
-
party_address,
|
|
112
|
-
metadata
|
|
117
|
+
ExternalAccountUpdateRequest.new(party_type: party_type,
|
|
118
|
+
account_type: account_type,
|
|
119
|
+
counterparty_id: counterparty_id,
|
|
120
|
+
name: name,
|
|
121
|
+
party_name: party_name,
|
|
122
|
+
party_address: party_address,
|
|
123
|
+
metadata: metadata,
|
|
124
|
+
additional_properties: additional_properties)
|
|
113
125
|
end
|
|
114
126
|
|
|
115
127
|
# Provides a human-readable string representation of the object.
|
|
@@ -117,7 +129,8 @@ module ModernTreasury
|
|
|
117
129
|
class_name = self.class.name.split('::').last
|
|
118
130
|
"<#{class_name} party_type: #{@party_type}, account_type: #{@account_type},"\
|
|
119
131
|
" counterparty_id: #{@counterparty_id}, name: #{@name}, party_name: #{@party_name},"\
|
|
120
|
-
" party_address: #{@party_address}, metadata: #{@metadata}
|
|
132
|
+
" party_address: #{@party_address}, metadata: #{@metadata}, additional_properties:"\
|
|
133
|
+
" #{@additional_properties}>"
|
|
121
134
|
end
|
|
122
135
|
|
|
123
136
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -126,7 +139,7 @@ module ModernTreasury
|
|
|
126
139
|
"<#{class_name} party_type: #{@party_type.inspect}, account_type: #{@account_type.inspect},"\
|
|
127
140
|
" counterparty_id: #{@counterparty_id.inspect}, name: #{@name.inspect}, party_name:"\
|
|
128
141
|
" #{@party_name.inspect}, party_address: #{@party_address.inspect}, metadata:"\
|
|
129
|
-
" #{@metadata.inspect}>"
|
|
142
|
+
" #{@metadata.inspect}, additional_properties: #{@additional_properties}>"
|
|
130
143
|
end
|
|
131
144
|
end
|
|
132
145
|
end
|
|
@@ -15,11 +15,11 @@ module ModernTreasury
|
|
|
15
15
|
attr_accessor :originating_account_id
|
|
16
16
|
|
|
17
17
|
# Both ach and eft are supported payment types.
|
|
18
|
-
# @return [
|
|
18
|
+
# @return [PaymentType4]
|
|
19
19
|
attr_accessor :payment_type
|
|
20
20
|
|
|
21
21
|
# Three-letter ISO currency code.
|
|
22
|
-
# @return [
|
|
22
|
+
# @return [Currency]
|
|
23
23
|
attr_accessor :currency
|
|
24
24
|
|
|
25
25
|
# A mapping from model property names to API property names.
|
|
@@ -43,11 +43,15 @@ module ModernTreasury
|
|
|
43
43
|
[]
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
def initialize(originating_account_id
|
|
47
|
-
|
|
46
|
+
def initialize(originating_account_id:, payment_type:, currency: SKIP,
|
|
47
|
+
additional_properties: nil)
|
|
48
|
+
# Add additional model properties to the instance
|
|
49
|
+
additional_properties = {} if additional_properties.nil?
|
|
50
|
+
|
|
48
51
|
@originating_account_id = originating_account_id
|
|
49
52
|
@payment_type = payment_type
|
|
50
53
|
@currency = currency unless currency == SKIP
|
|
54
|
+
@additional_properties = additional_properties
|
|
51
55
|
end
|
|
52
56
|
|
|
53
57
|
# Creates an instance of the object from a hash.
|
|
@@ -60,24 +64,34 @@ module ModernTreasury
|
|
|
60
64
|
payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil
|
|
61
65
|
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
62
66
|
|
|
67
|
+
# Create a new hash for additional properties, removing known properties.
|
|
68
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
69
|
+
|
|
70
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
71
|
+
new_hash, proc { |value| value }
|
|
72
|
+
)
|
|
73
|
+
|
|
63
74
|
# Create object from extracted values.
|
|
64
|
-
ExternalAccountVerifyRequest.new(originating_account_id,
|
|
65
|
-
payment_type,
|
|
66
|
-
currency
|
|
75
|
+
ExternalAccountVerifyRequest.new(originating_account_id: originating_account_id,
|
|
76
|
+
payment_type: payment_type,
|
|
77
|
+
currency: currency,
|
|
78
|
+
additional_properties: additional_properties)
|
|
67
79
|
end
|
|
68
80
|
|
|
69
81
|
# Provides a human-readable string representation of the object.
|
|
70
82
|
def to_s
|
|
71
83
|
class_name = self.class.name.split('::').last
|
|
72
84
|
"<#{class_name} originating_account_id: #{@originating_account_id}, payment_type:"\
|
|
73
|
-
" #{@payment_type}, currency: #{@currency}
|
|
85
|
+
" #{@payment_type}, currency: #{@currency}, additional_properties:"\
|
|
86
|
+
" #{@additional_properties}>"
|
|
74
87
|
end
|
|
75
88
|
|
|
76
89
|
# Provides a debugging-friendly string with detailed object information.
|
|
77
90
|
def inspect
|
|
78
91
|
class_name = self.class.name.split('::').last
|
|
79
92
|
"<#{class_name} originating_account_id: #{@originating_account_id.inspect}, payment_type:"\
|
|
80
|
-
" #{@payment_type.inspect}, currency: #{@currency.inspect}
|
|
93
|
+
" #{@payment_type.inspect}, currency: #{@currency.inspect}, additional_properties:"\
|
|
94
|
+
" #{@additional_properties}>"
|
|
81
95
|
end
|
|
82
96
|
end
|
|
83
97
|
end
|
|
@@ -7,8 +7,8 @@ module ModernTreasury
|
|
|
7
7
|
# A payment type to fallback to if the original type is not valid for the
|
|
8
8
|
# receiving account. Currently, this only supports falling back from RTP to
|
|
9
9
|
# ACH (type=rtp and fallback_type=ach)
|
|
10
|
-
class
|
|
11
|
-
|
|
10
|
+
class FallbackType
|
|
11
|
+
FALLBACK_TYPE = [
|
|
12
12
|
# TODO: Write general description for ACH
|
|
13
13
|
ACH = 'ach'.freeze
|
|
14
14
|
].freeze
|
|
@@ -16,7 +16,7 @@ module ModernTreasury
|
|
|
16
16
|
def self.validate(value)
|
|
17
17
|
return false if value.nil?
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
FALLBACK_TYPE.include?(value)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def self.from_value(value, default_value = ACH)
|