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
|
@@ -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`.
|
|
@@ -85,7 +85,7 @@ module ModernTreasury
|
|
|
85
85
|
|
|
86
86
|
# If the external account links to a ledger account in Modern Treasury, the
|
|
87
87
|
# id of the ledger account will be populated here.
|
|
88
|
-
# @return [
|
|
88
|
+
# @return [VerificationStatus]
|
|
89
89
|
attr_accessor :verification_status
|
|
90
90
|
|
|
91
91
|
# A mapping from model property names to API property names.
|
|
@@ -145,12 +145,16 @@ module ModernTreasury
|
|
|
145
145
|
]
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
-
def initialize(id
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
ledger_account_id
|
|
148
|
+
def initialize(id: SKIP, object: SKIP, live_mode: SKIP, created_at: SKIP,
|
|
149
|
+
updated_at: SKIP, discarded_at: SKIP, account_type: SKIP,
|
|
150
|
+
party_type: SKIP, party_address: SKIP, name: SKIP,
|
|
151
|
+
account_details: SKIP, routing_details: SKIP, metadata: SKIP,
|
|
152
|
+
party_name: SKIP, contact_details: SKIP,
|
|
153
|
+
ledger_account_id: SKIP, verification_status: SKIP,
|
|
154
|
+
additional_properties: nil)
|
|
155
|
+
# Add additional model properties to the instance
|
|
156
|
+
additional_properties = {} if additional_properties.nil?
|
|
157
|
+
|
|
154
158
|
@id = id unless id == SKIP
|
|
155
159
|
@object = object unless object == SKIP
|
|
156
160
|
@live_mode = live_mode unless live_mode == SKIP
|
|
@@ -168,6 +172,7 @@ module ModernTreasury
|
|
|
168
172
|
@contact_details = contact_details unless contact_details == SKIP
|
|
169
173
|
@ledger_account_id = ledger_account_id unless ledger_account_id == SKIP
|
|
170
174
|
@verification_status = verification_status unless verification_status == SKIP
|
|
175
|
+
@additional_properties = additional_properties
|
|
171
176
|
end
|
|
172
177
|
|
|
173
178
|
# Creates an instance of the object from a hash.
|
|
@@ -234,24 +239,32 @@ module ModernTreasury
|
|
|
234
239
|
verification_status =
|
|
235
240
|
hash.key?('verification_status') ? hash['verification_status'] : SKIP
|
|
236
241
|
|
|
242
|
+
# Create a new hash for additional properties, removing known properties.
|
|
243
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
244
|
+
|
|
245
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
246
|
+
new_hash, proc { |value| value }
|
|
247
|
+
)
|
|
248
|
+
|
|
237
249
|
# Create object from extracted values.
|
|
238
|
-
ReceivingAccount.new(id,
|
|
239
|
-
object,
|
|
240
|
-
live_mode,
|
|
241
|
-
created_at,
|
|
242
|
-
updated_at,
|
|
243
|
-
discarded_at,
|
|
244
|
-
account_type,
|
|
245
|
-
party_type,
|
|
246
|
-
party_address,
|
|
247
|
-
name,
|
|
248
|
-
account_details,
|
|
249
|
-
routing_details,
|
|
250
|
-
metadata,
|
|
251
|
-
party_name,
|
|
252
|
-
contact_details,
|
|
253
|
-
ledger_account_id,
|
|
254
|
-
verification_status
|
|
250
|
+
ReceivingAccount.new(id: id,
|
|
251
|
+
object: object,
|
|
252
|
+
live_mode: live_mode,
|
|
253
|
+
created_at: created_at,
|
|
254
|
+
updated_at: updated_at,
|
|
255
|
+
discarded_at: discarded_at,
|
|
256
|
+
account_type: account_type,
|
|
257
|
+
party_type: party_type,
|
|
258
|
+
party_address: party_address,
|
|
259
|
+
name: name,
|
|
260
|
+
account_details: account_details,
|
|
261
|
+
routing_details: routing_details,
|
|
262
|
+
metadata: metadata,
|
|
263
|
+
party_name: party_name,
|
|
264
|
+
contact_details: contact_details,
|
|
265
|
+
ledger_account_id: ledger_account_id,
|
|
266
|
+
verification_status: verification_status,
|
|
267
|
+
additional_properties: additional_properties)
|
|
255
268
|
end
|
|
256
269
|
|
|
257
270
|
def to_custom_created_at
|
|
@@ -284,7 +297,8 @@ module ModernTreasury
|
|
|
284
297
|
" #{@account_type}, party_type: #{@party_type}, party_address: #{@party_address}, name:"\
|
|
285
298
|
" #{@name}, account_details: #{@account_details}, routing_details: #{@routing_details},"\
|
|
286
299
|
" metadata: #{@metadata}, party_name: #{@party_name}, contact_details: #{@contact_details},"\
|
|
287
|
-
" ledger_account_id: #{@ledger_account_id}, verification_status: #{@verification_status}
|
|
300
|
+
" ledger_account_id: #{@ledger_account_id}, verification_status: #{@verification_status},"\
|
|
301
|
+
" additional_properties: #{@additional_properties}>"
|
|
288
302
|
end
|
|
289
303
|
|
|
290
304
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -298,7 +312,8 @@ module ModernTreasury
|
|
|
298
312
|
" #{@account_details.inspect}, routing_details: #{@routing_details.inspect}, metadata:"\
|
|
299
313
|
" #{@metadata.inspect}, party_name: #{@party_name.inspect}, contact_details:"\
|
|
300
314
|
" #{@contact_details.inspect}, ledger_account_id: #{@ledger_account_id.inspect},"\
|
|
301
|
-
" verification_status: #{@verification_status.inspect}
|
|
315
|
+
" verification_status: #{@verification_status.inspect}, additional_properties:"\
|
|
316
|
+
" #{@additional_properties}>"
|
|
302
317
|
end
|
|
303
318
|
end
|
|
304
319
|
end
|
|
@@ -12,11 +12,11 @@ module ModernTreasury
|
|
|
12
12
|
private_constant :SKIP
|
|
13
13
|
|
|
14
14
|
# Can be `checking`, `savings` or `other`.
|
|
15
|
-
# @return [
|
|
15
|
+
# @return [AccountType]
|
|
16
16
|
attr_accessor :account_type
|
|
17
17
|
|
|
18
18
|
# Either `individual` or `business`.
|
|
19
|
-
# @return [
|
|
19
|
+
# @return [PartyType]
|
|
20
20
|
attr_accessor :party_type
|
|
21
21
|
|
|
22
22
|
# Either `individual` or `business`.
|
|
@@ -112,11 +112,14 @@ module ModernTreasury
|
|
|
112
112
|
]
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
def initialize(account_type
|
|
116
|
-
name
|
|
117
|
-
metadata
|
|
118
|
-
ledger_account
|
|
119
|
-
contact_details
|
|
115
|
+
def initialize(account_type: SKIP, party_type: SKIP, party_address: SKIP,
|
|
116
|
+
name: SKIP, account_details: SKIP, routing_details: SKIP,
|
|
117
|
+
metadata: SKIP, party_name: SKIP, party_identifier: SKIP,
|
|
118
|
+
ledger_account: SKIP, plaid_processor_token: SKIP,
|
|
119
|
+
contact_details: SKIP, additional_properties: nil)
|
|
120
|
+
# Add additional model properties to the instance
|
|
121
|
+
additional_properties = {} if additional_properties.nil?
|
|
122
|
+
|
|
120
123
|
@account_type = account_type unless account_type == SKIP
|
|
121
124
|
@party_type = party_type unless party_type == SKIP
|
|
122
125
|
@party_address = party_address unless party_address == SKIP
|
|
@@ -129,6 +132,7 @@ module ModernTreasury
|
|
|
129
132
|
@ledger_account = ledger_account unless ledger_account == SKIP
|
|
130
133
|
@plaid_processor_token = plaid_processor_token unless plaid_processor_token == SKIP
|
|
131
134
|
@contact_details = contact_details unless contact_details == SKIP
|
|
135
|
+
@additional_properties = additional_properties
|
|
132
136
|
end
|
|
133
137
|
|
|
134
138
|
# Creates an instance of the object from a hash.
|
|
@@ -179,19 +183,27 @@ module ModernTreasury
|
|
|
179
183
|
|
|
180
184
|
contact_details = SKIP unless hash.key?('contact_details')
|
|
181
185
|
|
|
186
|
+
# Create a new hash for additional properties, removing known properties.
|
|
187
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
188
|
+
|
|
189
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
190
|
+
new_hash, proc { |value| value }
|
|
191
|
+
)
|
|
192
|
+
|
|
182
193
|
# Create object from extracted values.
|
|
183
|
-
ReceivingAccount1.new(account_type,
|
|
184
|
-
party_type,
|
|
185
|
-
party_address,
|
|
186
|
-
name,
|
|
187
|
-
account_details,
|
|
188
|
-
routing_details,
|
|
189
|
-
metadata,
|
|
190
|
-
party_name,
|
|
191
|
-
party_identifier,
|
|
192
|
-
ledger_account,
|
|
193
|
-
plaid_processor_token,
|
|
194
|
-
contact_details
|
|
194
|
+
ReceivingAccount1.new(account_type: account_type,
|
|
195
|
+
party_type: party_type,
|
|
196
|
+
party_address: party_address,
|
|
197
|
+
name: name,
|
|
198
|
+
account_details: account_details,
|
|
199
|
+
routing_details: routing_details,
|
|
200
|
+
metadata: metadata,
|
|
201
|
+
party_name: party_name,
|
|
202
|
+
party_identifier: party_identifier,
|
|
203
|
+
ledger_account: ledger_account,
|
|
204
|
+
plaid_processor_token: plaid_processor_token,
|
|
205
|
+
contact_details: contact_details,
|
|
206
|
+
additional_properties: additional_properties)
|
|
195
207
|
end
|
|
196
208
|
|
|
197
209
|
# Provides a human-readable string representation of the object.
|
|
@@ -201,7 +213,8 @@ module ModernTreasury
|
|
|
201
213
|
" #{@party_address}, name: #{@name}, account_details: #{@account_details}, routing_details:"\
|
|
202
214
|
" #{@routing_details}, metadata: #{@metadata}, party_name: #{@party_name}, party_identifier:"\
|
|
203
215
|
" #{@party_identifier}, ledger_account: #{@ledger_account}, plaid_processor_token:"\
|
|
204
|
-
" #{@plaid_processor_token}, contact_details: #{@contact_details}
|
|
216
|
+
" #{@plaid_processor_token}, contact_details: #{@contact_details}, additional_properties:"\
|
|
217
|
+
" #{@additional_properties}>"
|
|
205
218
|
end
|
|
206
219
|
|
|
207
220
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -213,7 +226,7 @@ module ModernTreasury
|
|
|
213
226
|
" #{@metadata.inspect}, party_name: #{@party_name.inspect}, party_identifier:"\
|
|
214
227
|
" #{@party_identifier.inspect}, ledger_account: #{@ledger_account.inspect},"\
|
|
215
228
|
" plaid_processor_token: #{@plaid_processor_token.inspect}, contact_details:"\
|
|
216
|
-
" #{@contact_details.inspect}>"
|
|
229
|
+
" #{@contact_details.inspect}, additional_properties: #{@additional_properties}>"
|
|
217
230
|
end
|
|
218
231
|
end
|
|
219
232
|
end
|
data/lib/modern_treasury/models/{receiving_account_type_enum.rb → receiving_account_type.rb}
RENAMED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# ReceivingAccountType.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ReceivingAccountType
|
|
9
|
+
RECEIVING_ACCOUNT_TYPE = [
|
|
10
10
|
# TODO: Write general description for INTERNAL_ACCOUNT
|
|
11
11
|
INTERNAL_ACCOUNT = 'internal_account'.freeze,
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ module ModernTreasury
|
|
|
17
17
|
def self.validate(value)
|
|
18
18
|
return false if value.nil?
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
RECEIVING_ACCOUNT_TYPE.include?(value)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.from_value(value, default_value = INTERNAL_ACCOUNT)
|
|
@@ -7,8 +7,8 @@ module ModernTreasury
|
|
|
7
7
|
# One of manual if this expected payment was manually reconciled in the
|
|
8
8
|
# dashboard, automatic if it was automatically reconciled by Modern Treasury,
|
|
9
9
|
# or null if it is unreconciled.
|
|
10
|
-
class
|
|
11
|
-
|
|
10
|
+
class ReconciliationMethod
|
|
11
|
+
RECONCILIATION_METHOD = [
|
|
12
12
|
# TODO: Write general description for AUTOMATIC
|
|
13
13
|
AUTOMATIC = 'automatic'.freeze,
|
|
14
14
|
|
|
@@ -19,7 +19,7 @@ module ModernTreasury
|
|
|
19
19
|
def self.validate(value)
|
|
20
20
|
return false if value.nil?
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
RECONCILIATION_METHOD.include?(value)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def self.from_value(value, default_value = AUTOMATIC)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# The type of the reference number. Referring to the vendor payment id.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ReferenceNumberType
|
|
9
|
+
REFERENCE_NUMBER_TYPE = [
|
|
10
10
|
# TODO: Write general description for ACH_ORIGINAL_TRACE_NUMBER
|
|
11
11
|
ACH_ORIGINAL_TRACE_NUMBER = 'ach_original_trace_number'.freeze,
|
|
12
12
|
|
|
@@ -176,7 +176,7 @@ module ModernTreasury
|
|
|
176
176
|
def self.validate(value)
|
|
177
177
|
return false if value.nil?
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
REFERENCE_NUMBER_TYPE.include?(value)
|
|
180
180
|
end
|
|
181
181
|
|
|
182
182
|
def self.from_value(value, default_value = ACH_ORIGINAL_TRACE_NUMBER)
|
data/lib/modern_treasury/models/{reference_number_type1_enum.rb → reference_number_type1.rb}
RENAMED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# The type of reference number.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ReferenceNumberType1
|
|
9
|
+
REFERENCE_NUMBER_TYPE1 = [
|
|
10
10
|
# TODO: Write general description for ACH_ORIGINAL_TRACE_NUMBER
|
|
11
11
|
ACH_ORIGINAL_TRACE_NUMBER = 'ach_original_trace_number'.freeze,
|
|
12
12
|
|
|
@@ -176,7 +176,7 @@ module ModernTreasury
|
|
|
176
176
|
def self.validate(value)
|
|
177
177
|
return false if value.nil?
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
REFERENCE_NUMBER_TYPE1.include?(value)
|
|
180
180
|
end
|
|
181
181
|
|
|
182
182
|
def self.from_value(value, default_value = ACH_ORIGINAL_TRACE_NUMBER)
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# One of the referenceable types. This must be accompanied by the id of the
|
|
8
8
|
# referenceable or will return an error.
|
|
9
|
-
class
|
|
10
|
-
|
|
9
|
+
class ReferenceableType
|
|
10
|
+
REFERENCEABLE_TYPE = [
|
|
11
11
|
# TODO: Write general description for PAYMENT_ORDER
|
|
12
12
|
PAYMENT_ORDER = 'payment_order'.freeze,
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ module ModernTreasury
|
|
|
21
21
|
def self.validate(value)
|
|
22
22
|
return false if value.nil?
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
REFERENCEABLE_TYPE.include?(value)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def self.from_value(value, default_value = PAYMENT_ORDER)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# referenceable_type1.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ReferenceableType1
|
|
9
|
+
REFERENCEABLE_TYPE1 = [
|
|
10
10
|
# TODO: Write general description for PAYMENT_ORDER
|
|
11
11
|
PAYMENT_ORDER = 'payment_order'.freeze,
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ module ModernTreasury
|
|
|
20
20
|
def self.validate(value)
|
|
21
21
|
return false if value.nil?
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
REFERENCEABLE_TYPE1.include?(value)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def self.from_value(value, default_value = PAYMENT_ORDER)
|
|
@@ -14,7 +14,7 @@ module ModernTreasury
|
|
|
14
14
|
attr_accessor :returnable_id
|
|
15
15
|
|
|
16
16
|
# The return code. For ACH returns, this is the required ACH return code.
|
|
17
|
-
# @return [
|
|
17
|
+
# @return [Code1]
|
|
18
18
|
attr_accessor :code
|
|
19
19
|
|
|
20
20
|
# An optional description of the reason for the return. This is for internal
|
|
@@ -70,14 +70,19 @@ module ModernTreasury
|
|
|
70
70
|
]
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
def initialize(returnable_id
|
|
74
|
-
date_of_death
|
|
73
|
+
def initialize(returnable_id:, code: SKIP, reason: SKIP,
|
|
74
|
+
date_of_death: SKIP, additional_information: SKIP,
|
|
75
|
+
additional_properties: nil)
|
|
76
|
+
# Add additional model properties to the instance
|
|
77
|
+
additional_properties = {} if additional_properties.nil?
|
|
78
|
+
|
|
75
79
|
@returnable_id = returnable_id
|
|
76
80
|
@code = code unless code == SKIP
|
|
77
81
|
@reason = reason unless reason == SKIP
|
|
78
82
|
@date_of_death = date_of_death unless date_of_death == SKIP
|
|
79
83
|
@additional_information = additional_information unless additional_information == SKIP
|
|
80
84
|
@returnable_type = 'incoming_payment_detail'
|
|
85
|
+
@additional_properties = additional_properties
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
# Creates an instance of the object from a hash.
|
|
@@ -92,12 +97,20 @@ module ModernTreasury
|
|
|
92
97
|
additional_information =
|
|
93
98
|
hash.key?('additional_information') ? hash['additional_information'] : SKIP
|
|
94
99
|
|
|
100
|
+
# Create a new hash for additional properties, removing known properties.
|
|
101
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
102
|
+
|
|
103
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
104
|
+
new_hash, proc { |value| value }
|
|
105
|
+
)
|
|
106
|
+
|
|
95
107
|
# Create object from extracted values.
|
|
96
|
-
ReturnCreateRequest.new(returnable_id,
|
|
97
|
-
code,
|
|
98
|
-
reason,
|
|
99
|
-
date_of_death,
|
|
100
|
-
additional_information
|
|
108
|
+
ReturnCreateRequest.new(returnable_id: returnable_id,
|
|
109
|
+
code: code,
|
|
110
|
+
reason: reason,
|
|
111
|
+
date_of_death: date_of_death,
|
|
112
|
+
additional_information: additional_information,
|
|
113
|
+
additional_properties: additional_properties)
|
|
101
114
|
end
|
|
102
115
|
|
|
103
116
|
# Provides a human-readable string representation of the object.
|
|
@@ -105,7 +118,7 @@ module ModernTreasury
|
|
|
105
118
|
class_name = self.class.name.split('::').last
|
|
106
119
|
"<#{class_name} returnable_id: #{@returnable_id}, code: #{@code}, reason: #{@reason},"\
|
|
107
120
|
" date_of_death: #{@date_of_death}, additional_information: #{@additional_information},"\
|
|
108
|
-
" returnable_type: #{@returnable_type}>"
|
|
121
|
+
" returnable_type: #{@returnable_type}, additional_properties: #{@additional_properties}>"
|
|
109
122
|
end
|
|
110
123
|
|
|
111
124
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -113,7 +126,8 @@ module ModernTreasury
|
|
|
113
126
|
class_name = self.class.name.split('::').last
|
|
114
127
|
"<#{class_name} returnable_id: #{@returnable_id.inspect}, code: #{@code.inspect}, reason:"\
|
|
115
128
|
" #{@reason.inspect}, date_of_death: #{@date_of_death.inspect}, additional_information:"\
|
|
116
|
-
" #{@additional_information.inspect}, returnable_type: #{@returnable_type.inspect}
|
|
129
|
+
" #{@additional_information.inspect}, returnable_type: #{@returnable_type.inspect},"\
|
|
130
|
+
" additional_properties: #{@additional_properties}>"
|
|
117
131
|
end
|
|
118
132
|
end
|
|
119
133
|
end
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# The type of object being returned or `null`.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ReturnableType
|
|
9
|
+
RETURNABLE_TYPE = [
|
|
10
10
|
# TODO: Write general description for INCOMING_PAYMENT_DETAIL
|
|
11
11
|
INCOMING_PAYMENT_DETAIL = 'incoming_payment_detail'.freeze,
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ module ModernTreasury
|
|
|
26
26
|
def self.validate(value)
|
|
27
27
|
return false if value.nil?
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
RETURNABLE_TYPE.include?(value)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def self.from_value(value, default_value = INCOMING_PAYMENT_DETAIL)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# returnable_type1.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ReturnableType1
|
|
9
|
+
RETURNABLE_TYPE1 = [
|
|
10
10
|
# TODO: Write general description for INCOMING_PAYMENT_DETAIL
|
|
11
11
|
INCOMING_PAYMENT_DETAIL = 'incoming_payment_detail'.freeze,
|
|
12
12
|
|
|
@@ -26,7 +26,7 @@ module ModernTreasury
|
|
|
26
26
|
def self.validate(value)
|
|
27
27
|
return false if value.nil?
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
RETURNABLE_TYPE1.include?(value)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def self.from_value(value, default_value = INCOMING_PAYMENT_DETAIL)
|
|
@@ -34,7 +34,7 @@ module ModernTreasury
|
|
|
34
34
|
attr_accessor :updated_at
|
|
35
35
|
|
|
36
36
|
# The current status of the reversal.
|
|
37
|
-
# @return [
|
|
37
|
+
# @return [Status19]
|
|
38
38
|
attr_accessor :status
|
|
39
39
|
|
|
40
40
|
# The ID of the relevant Payment Order.
|
|
@@ -47,7 +47,7 @@ module ModernTreasury
|
|
|
47
47
|
attr_accessor :metadata
|
|
48
48
|
|
|
49
49
|
# The reason for the reversal.
|
|
50
|
-
# @return [
|
|
50
|
+
# @return [Reason]
|
|
51
51
|
attr_accessor :reason
|
|
52
52
|
|
|
53
53
|
# A mapping from model property names to API property names.
|
|
@@ -77,9 +77,8 @@ module ModernTreasury
|
|
|
77
77
|
]
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
-
def initialize(id
|
|
81
|
-
|
|
82
|
-
metadata = nil, reason = nil)
|
|
80
|
+
def initialize(id:, object:, live_mode:, created_at:, updated_at:, status:,
|
|
81
|
+
payment_order_id:, metadata:, reason:)
|
|
83
82
|
@id = id
|
|
84
83
|
@object = object
|
|
85
84
|
@live_mode = live_mode
|
|
@@ -112,15 +111,15 @@ module ModernTreasury
|
|
|
112
111
|
reason = hash.key?('reason') ? hash['reason'] : nil
|
|
113
112
|
|
|
114
113
|
# Create object from extracted values.
|
|
115
|
-
Reversal.new(id,
|
|
116
|
-
object,
|
|
117
|
-
live_mode,
|
|
118
|
-
created_at,
|
|
119
|
-
updated_at,
|
|
120
|
-
status,
|
|
121
|
-
payment_order_id,
|
|
122
|
-
metadata,
|
|
123
|
-
reason)
|
|
114
|
+
Reversal.new(id: id,
|
|
115
|
+
object: object,
|
|
116
|
+
live_mode: live_mode,
|
|
117
|
+
created_at: created_at,
|
|
118
|
+
updated_at: updated_at,
|
|
119
|
+
status: status,
|
|
120
|
+
payment_order_id: payment_order_id,
|
|
121
|
+
metadata: metadata,
|
|
122
|
+
reason: reason)
|
|
124
123
|
end
|
|
125
124
|
|
|
126
125
|
def to_custom_created_at
|
|
@@ -12,7 +12,7 @@ module ModernTreasury
|
|
|
12
12
|
# The reason for the reversal. Must be one of `duplicate`,
|
|
13
13
|
# `incorrect_amount`, `incorrect_receiving_account`,
|
|
14
14
|
# `date_earlier_than_intended`, `date_later_than_intended`.
|
|
15
|
-
# @return [
|
|
15
|
+
# @return [Reason1]
|
|
16
16
|
attr_accessor :reason
|
|
17
17
|
|
|
18
18
|
# Additional data represented as key-value pairs. Both the key and value
|
|
@@ -47,10 +47,15 @@ module ModernTreasury
|
|
|
47
47
|
[]
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
def initialize(reason
|
|
50
|
+
def initialize(reason:, metadata: SKIP, ledger_transaction: SKIP,
|
|
51
|
+
additional_properties: nil)
|
|
52
|
+
# Add additional model properties to the instance
|
|
53
|
+
additional_properties = {} if additional_properties.nil?
|
|
54
|
+
|
|
51
55
|
@reason = reason
|
|
52
56
|
@metadata = metadata unless metadata == SKIP
|
|
53
57
|
@ledger_transaction = ledger_transaction unless ledger_transaction == SKIP
|
|
58
|
+
@additional_properties = additional_properties
|
|
54
59
|
end
|
|
55
60
|
|
|
56
61
|
# Creates an instance of the object from a hash.
|
|
@@ -63,24 +68,33 @@ module ModernTreasury
|
|
|
63
68
|
ledger_transaction = LedgerTransactionCreateRequest.from_hash(hash['ledger_transaction']) if
|
|
64
69
|
hash['ledger_transaction']
|
|
65
70
|
|
|
71
|
+
# Create a new hash for additional properties, removing known properties.
|
|
72
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
73
|
+
|
|
74
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
75
|
+
new_hash, proc { |value| value }
|
|
76
|
+
)
|
|
77
|
+
|
|
66
78
|
# Create object from extracted values.
|
|
67
|
-
ReversalCreateRequest.new(reason,
|
|
68
|
-
metadata,
|
|
69
|
-
ledger_transaction
|
|
79
|
+
ReversalCreateRequest.new(reason: reason,
|
|
80
|
+
metadata: metadata,
|
|
81
|
+
ledger_transaction: ledger_transaction,
|
|
82
|
+
additional_properties: additional_properties)
|
|
70
83
|
end
|
|
71
84
|
|
|
72
85
|
# Provides a human-readable string representation of the object.
|
|
73
86
|
def to_s
|
|
74
87
|
class_name = self.class.name.split('::').last
|
|
75
88
|
"<#{class_name} reason: #{@reason}, metadata: #{@metadata}, ledger_transaction:"\
|
|
76
|
-
" #{@ledger_transaction}>"
|
|
89
|
+
" #{@ledger_transaction}, additional_properties: #{@additional_properties}>"
|
|
77
90
|
end
|
|
78
91
|
|
|
79
92
|
# Provides a debugging-friendly string with detailed object information.
|
|
80
93
|
def inspect
|
|
81
94
|
class_name = self.class.name.split('::').last
|
|
82
95
|
"<#{class_name} reason: #{@reason.inspect}, metadata: #{@metadata.inspect},"\
|
|
83
|
-
" ledger_transaction: #{@ledger_transaction.inspect}
|
|
96
|
+
" ledger_transaction: #{@ledger_transaction.inspect}, additional_properties:"\
|
|
97
|
+
" #{@additional_properties}>"
|
|
84
98
|
end
|
|
85
99
|
end
|
|
86
100
|
end
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# The role of the return, can be `originating` or `receiving`.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class Role
|
|
9
|
+
ROLE = [
|
|
10
10
|
# TODO: Write general description for ORIGINATING
|
|
11
11
|
ORIGINATING = 'originating'.freeze,
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ module ModernTreasury
|
|
|
17
17
|
def self.validate(value)
|
|
18
18
|
return false if value.nil?
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
ROLE.include?(value)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.from_value(value, default_value = ORIGINATING)
|