mt-sdk 0.0.1 → 0.0.4
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/client.rb +9 -7
- data/lib/modern_treasury/configuration.rb +18 -47
- data/lib/modern_treasury/controllers/account_collection_flow_controller.rb +17 -11
- data/lib/modern_treasury/controllers/account_detail_controller.rb +23 -9
- data/lib/modern_treasury/controllers/balance_report_controller.rb +9 -4
- data/lib/modern_treasury/controllers/base_controller.rb +8 -1
- data/lib/modern_treasury/controllers/connection_controller.rb +8 -7
- data/lib/modern_treasury/controllers/counterparty_controller.rb +23 -13
- data/lib/modern_treasury/controllers/document_controller.rb +50 -26
- data/lib/modern_treasury/controllers/event_controller.rb +11 -8
- data/lib/modern_treasury/controllers/expected_payment_controller.rb +24 -17
- data/lib/modern_treasury/controllers/external_account_controller.rb +26 -14
- data/lib/modern_treasury/controllers/incoming_payment_detail_controller.rb +20 -14
- data/lib/modern_treasury/controllers/internal_account_controller.rb +19 -13
- data/lib/modern_treasury/controllers/invoice_controller.rb +18 -12
- data/lib/modern_treasury/controllers/invoice_line_item_controller.rb +22 -9
- data/lib/modern_treasury/controllers/ledger_account_category_controller.rb +35 -15
- data/lib/modern_treasury/controllers/ledger_account_controller.rb +19 -11
- data/lib/modern_treasury/controllers/ledger_account_payout_controller.rb +16 -10
- data/lib/modern_treasury/controllers/ledger_account_statement_controller.rb +5 -2
- data/lib/modern_treasury/controllers/ledger_controller.rb +19 -11
- data/lib/modern_treasury/controllers/ledger_entry_controller.rb +15 -13
- data/lib/modern_treasury/controllers/ledger_event_handler_controller.rb +16 -10
- data/lib/modern_treasury/controllers/ledger_transaction_controller.rb +32 -22
- data/lib/modern_treasury/controllers/ledgerable_event_controller.rb +5 -2
- data/lib/modern_treasury/controllers/line_item_controller.rb +18 -7
- data/lib/modern_treasury/controllers/paper_item_controller.rb +10 -7
- data/lib/modern_treasury/controllers/payment_flow_controller.rb +17 -11
- data/lib/modern_treasury/controllers/payment_order_controller.rb +45 -34
- data/lib/modern_treasury/controllers/payment_reference_controller.rb +14 -11
- data/lib/modern_treasury/controllers/ping_controller.rb +2 -1
- data/lib/modern_treasury/controllers/return_controller.rb +14 -10
- data/lib/modern_treasury/controllers/reversal_controller.rb +10 -3
- data/lib/modern_treasury/controllers/routing_detail_controller.rb +23 -9
- data/lib/modern_treasury/controllers/transaction_controller.rb +14 -9
- data/lib/modern_treasury/controllers/transaction_line_item_controller.rb +4 -2
- data/lib/modern_treasury/controllers/validation_controller.rb +8 -5
- data/lib/modern_treasury/controllers/virtual_account_controller.rb +21 -13
- 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 +117 -112
- metadata +116 -170
- 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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '059c2e2d83cb80a450b60ccbd8d7664db19c5a4e97197358b1cab68d07238feb'
|
|
4
|
+
data.tar.gz: d1acf6111a92c7c292724051de5d4ec1bacf1271e2c9e567c0268763192d096f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8c948deb07df07d91192d00d7638d689e527501f093d9d8527a5f158db0eee072f294b342197b0c2775fd3c544688c76306226eab6c5f95766bbd1cd1e10934
|
|
7
|
+
data.tar.gz: 27be300d1359585c5adcda1511dd865253793b86d5575840dd05ffd262577151c7cc292deb49d73c6f96848c1b50354071befe6792dae226c20df24e01cf2380
|
data/README.md
CHANGED
|
@@ -10,16 +10,16 @@ The Modern Treasury REST API. Please see https://docs.moderntreasury.com for mor
|
|
|
10
10
|
Install the gem from the command line:
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
gem install mt-sdk -v 0.0.
|
|
13
|
+
gem install mt-sdk -v 0.0.4
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Or add the gem to your Gemfile and run `bundle`:
|
|
17
17
|
|
|
18
18
|
```ruby
|
|
19
|
-
gem 'mt-sdk', '0.0.
|
|
19
|
+
gem 'mt-sdk', '0.0.4'
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
For additional gem details, see the [RubyGems page for the mt-sdk gem](https://rubygems.org/gems/mt-sdk/versions/0.0.
|
|
22
|
+
For additional gem details, see the [RubyGems page for the mt-sdk gem](https://rubygems.org/gems/mt-sdk/versions/0.0.4).
|
|
23
23
|
|
|
24
24
|
## IRB Console Usage
|
|
25
25
|
|
|
@@ -56,34 +56,27 @@ ruby bin/console
|
|
|
56
56
|
|
|
57
57
|
**_Note:_** This automatically loads the SDK from lib/
|
|
58
58
|
|
|
59
|
-
## Test the SDK
|
|
60
|
-
|
|
61
|
-
To run the tests, navigate to the root directory of the SDK in your terminal and execute the following command:
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
rake
|
|
65
|
-
```
|
|
66
|
-
|
|
67
59
|
## Initialize the API Client
|
|
68
60
|
|
|
69
|
-
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
61
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/client.md)
|
|
70
62
|
|
|
71
63
|
The following parameters are configurable for the API Client:
|
|
72
64
|
|
|
73
65
|
| Parameter | Type | Description |
|
|
74
66
|
| --- | --- | --- |
|
|
75
|
-
| environment | [`Environment`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
67
|
+
| environment | [`Environment`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
|
76
68
|
| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
|
77
69
|
| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
|
78
|
-
| timeout | `Float` | The value to use for connection timeout. <br> **Default:
|
|
70
|
+
| timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
79
71
|
| max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
80
72
|
| retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
|
|
81
73
|
| backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
|
|
82
74
|
| retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
83
75
|
| retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
|
84
76
|
| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
|
85
|
-
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
86
|
-
|
|
|
77
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
78
|
+
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
79
|
+
| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
|
|
87
80
|
|
|
88
81
|
The API client can be initialized as follows:
|
|
89
82
|
|
|
@@ -98,7 +91,16 @@ client = Client.new(
|
|
|
98
91
|
username: 'BasicAuthUserName',
|
|
99
92
|
password: 'BasicAuthPassword'
|
|
100
93
|
),
|
|
101
|
-
environment: Environment::PRODUCTION
|
|
94
|
+
environment: Environment::PRODUCTION,
|
|
95
|
+
logging_configuration: LoggingConfiguration.new(
|
|
96
|
+
log_level: Logger::INFO,
|
|
97
|
+
request_logging_config: RequestLoggingConfiguration.new(
|
|
98
|
+
log_body: true
|
|
99
|
+
),
|
|
100
|
+
response_logging_config: ResponseLoggingConfiguration.new(
|
|
101
|
+
log_headers: true
|
|
102
|
+
)
|
|
103
|
+
)
|
|
102
104
|
)
|
|
103
105
|
```
|
|
104
106
|
|
|
@@ -112,7 +114,7 @@ include ModernTreasury
|
|
|
112
114
|
client = Client.from_env
|
|
113
115
|
```
|
|
114
116
|
|
|
115
|
-
See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
117
|
+
See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/environment-based-client-initialization.md) section for details.
|
|
116
118
|
|
|
117
119
|
## Environments
|
|
118
120
|
|
|
@@ -129,60 +131,65 @@ The SDK can be configured to use a different environment for making API calls. A
|
|
|
129
131
|
|
|
130
132
|
This API uses the following authentication schemes.
|
|
131
133
|
|
|
132
|
-
* [`basic_auth (Basic Authentication)`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
134
|
+
* [`basic_auth (Basic Authentication)`](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/auth/basic-authentication.md)
|
|
133
135
|
|
|
134
136
|
## List of APIs
|
|
135
137
|
|
|
136
|
-
* [Account Detail](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
137
|
-
* [Balance Report](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
138
|
-
* [Connection](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
139
|
-
* [Counterparty](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
140
|
-
* [Document](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
141
|
-
* [Event](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
142
|
-
* [Expected Payment](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
143
|
-
* [External Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
144
|
-
* [Incoming Payment Detail](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
145
|
-
* [Internal Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
146
|
-
* [Invoice Line Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
147
|
-
* [Invoice](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
148
|
-
* [Ledger Account Category](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
149
|
-
* [Ledger Account Payout](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
150
|
-
* [Ledger Account Statement](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
151
|
-
* [Ledger Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
152
|
-
* [Ledger Entry](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
153
|
-
* [Ledger Event Handler](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
154
|
-
* [Ledger Transaction](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
155
|
-
* [Ledgerable Event](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
156
|
-
* [Ledger](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
157
|
-
* [Line Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
158
|
-
* [Paper Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
159
|
-
* [Payment Order](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
160
|
-
* [Payment Reference](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
161
|
-
* [Ping](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
162
|
-
* [Return](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
163
|
-
* [Reversal](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
164
|
-
* [Routing Detail](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
165
|
-
* [Transaction Line Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
166
|
-
* [Transaction](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
167
|
-
* [Validation](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
168
|
-
* [Virtual Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
169
|
-
* [Account Collection Flow](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
170
|
-
* [Payment Flow](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
138
|
+
* [Account Detail](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/account-detail.md)
|
|
139
|
+
* [Balance Report](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/balance-report.md)
|
|
140
|
+
* [Connection](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/connection.md)
|
|
141
|
+
* [Counterparty](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/counterparty.md)
|
|
142
|
+
* [Document](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/document.md)
|
|
143
|
+
* [Event](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/event.md)
|
|
144
|
+
* [Expected Payment](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/expected-payment.md)
|
|
145
|
+
* [External Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/external-account.md)
|
|
146
|
+
* [Incoming Payment Detail](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/incoming-payment-detail.md)
|
|
147
|
+
* [Internal Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/internal-account.md)
|
|
148
|
+
* [Invoice Line Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/invoice-line-item.md)
|
|
149
|
+
* [Invoice](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/invoice.md)
|
|
150
|
+
* [Ledger Account Category](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger-account-category.md)
|
|
151
|
+
* [Ledger Account Payout](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger-account-payout.md)
|
|
152
|
+
* [Ledger Account Statement](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger-account-statement.md)
|
|
153
|
+
* [Ledger Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger-account.md)
|
|
154
|
+
* [Ledger Entry](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger-entry.md)
|
|
155
|
+
* [Ledger Event Handler](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger-event-handler.md)
|
|
156
|
+
* [Ledger Transaction](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger-transaction.md)
|
|
157
|
+
* [Ledgerable Event](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledgerable-event.md)
|
|
158
|
+
* [Ledger](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ledger.md)
|
|
159
|
+
* [Line Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/line-item.md)
|
|
160
|
+
* [Paper Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/paper-item.md)
|
|
161
|
+
* [Payment Order](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/payment-order.md)
|
|
162
|
+
* [Payment Reference](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/payment-reference.md)
|
|
163
|
+
* [Ping](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/ping.md)
|
|
164
|
+
* [Return](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/return.md)
|
|
165
|
+
* [Reversal](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/reversal.md)
|
|
166
|
+
* [Routing Detail](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/routing-detail.md)
|
|
167
|
+
* [Transaction Line Item](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/transaction-line-item.md)
|
|
168
|
+
* [Transaction](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/transaction.md)
|
|
169
|
+
* [Validation](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/validation.md)
|
|
170
|
+
* [Virtual Account](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/virtual-account.md)
|
|
171
|
+
* [Account Collection Flow](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/account-collection-flow.md)
|
|
172
|
+
* [Payment Flow](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/controllers/payment-flow.md)
|
|
171
173
|
|
|
172
174
|
## SDK Infrastructure
|
|
173
175
|
|
|
174
176
|
### Configuration
|
|
175
177
|
|
|
176
|
-
* [ProxySettings](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
177
|
-
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
178
|
+
* [ProxySettings](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/proxy-settings.md)
|
|
179
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/environment-based-client-initialization.md)
|
|
180
|
+
* [AbstractLogger](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/abstract-logger.md)
|
|
181
|
+
* [LoggingConfiguration](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/logging-configuration.md)
|
|
182
|
+
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/request-logging-configuration.md)
|
|
183
|
+
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/response-logging-configuration.md)
|
|
178
184
|
|
|
179
185
|
### HTTP
|
|
180
186
|
|
|
181
|
-
* [HttpResponse](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
182
|
-
* [HttpRequest](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.
|
|
187
|
+
* [HttpResponse](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/http-response.md)
|
|
188
|
+
* [HttpRequest](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/http-request.md)
|
|
183
189
|
|
|
184
190
|
### Utilities
|
|
185
191
|
|
|
186
|
-
* [
|
|
187
|
-
* [
|
|
192
|
+
* [ApiResponse](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/api-response.md)
|
|
193
|
+
* [ApiHelper](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/api-helper.md)
|
|
194
|
+
* [DateTimeHelper](https://www.github.com/sdks-io/mt-ruby-sdk/tree/0.0.4/doc/date-time-helper.md)
|
|
188
195
|
|
|
@@ -224,12 +224,12 @@ module ModernTreasury
|
|
|
224
224
|
end
|
|
225
225
|
|
|
226
226
|
def initialize(
|
|
227
|
-
connection: nil, adapter: :net_http_persistent, timeout:
|
|
227
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
228
228
|
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
229
229
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
230
230
|
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
231
|
-
environment: Environment::PRODUCTION,
|
|
232
|
-
|
|
231
|
+
logging_configuration: nil, environment: Environment::PRODUCTION,
|
|
232
|
+
basic_auth_credentials: nil, config: nil
|
|
233
233
|
)
|
|
234
234
|
@config = if config.nil?
|
|
235
235
|
Configuration.new(
|
|
@@ -238,19 +238,21 @@ module ModernTreasury
|
|
|
238
238
|
backoff_factor: backoff_factor,
|
|
239
239
|
retry_statuses: retry_statuses,
|
|
240
240
|
retry_methods: retry_methods, http_callback: http_callback,
|
|
241
|
-
proxy_settings: proxy_settings,
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
proxy_settings: proxy_settings,
|
|
242
|
+
logging_configuration: logging_configuration,
|
|
243
|
+
environment: environment,
|
|
244
244
|
basic_auth_credentials: basic_auth_credentials
|
|
245
245
|
)
|
|
246
246
|
else
|
|
247
247
|
config
|
|
248
248
|
end
|
|
249
|
+
user_agent_params = BaseController.user_agent_parameters
|
|
249
250
|
|
|
250
251
|
@global_configuration = GlobalConfiguration.new(client_configuration: @config)
|
|
251
252
|
.base_uri_executor(@config.method(:get_base_uri))
|
|
252
253
|
.global_errors(BaseController::GLOBAL_ERRORS)
|
|
253
|
-
.user_agent(BaseController.user_agent
|
|
254
|
+
.user_agent(BaseController.user_agent,
|
|
255
|
+
agent_parameters: user_agent_params)
|
|
254
256
|
|
|
255
257
|
initialize_auth_managers(@global_configuration)
|
|
256
258
|
@global_configuration = @global_configuration.auth_managers(@auth_managers)
|
|
@@ -44,14 +44,6 @@ module ModernTreasury
|
|
|
44
44
|
# All configuration including auth info and base URI for the API access
|
|
45
45
|
# are configured in this class.
|
|
46
46
|
class Configuration < CoreLibrary::HttpClientConfiguration
|
|
47
|
-
def basic_auth_user_name
|
|
48
|
-
@basic_auth_credentials.username
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def basic_auth_password
|
|
52
|
-
@basic_auth_credentials.password
|
|
53
|
-
end
|
|
54
|
-
|
|
55
47
|
# The attribute readers for properties.
|
|
56
48
|
attr_reader :environment, :basic_auth_credentials
|
|
57
49
|
|
|
@@ -60,32 +52,28 @@ module ModernTreasury
|
|
|
60
52
|
end
|
|
61
53
|
|
|
62
54
|
def initialize(
|
|
63
|
-
connection: nil, adapter: :net_http_persistent, timeout:
|
|
55
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
64
56
|
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
65
57
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
66
58
|
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
67
|
-
environment: Environment::PRODUCTION,
|
|
68
|
-
|
|
59
|
+
logging_configuration: nil, environment: Environment::PRODUCTION,
|
|
60
|
+
basic_auth_credentials: nil
|
|
69
61
|
)
|
|
70
62
|
super connection: connection, adapter: adapter, timeout: timeout,
|
|
71
63
|
max_retries: max_retries, retry_interval: retry_interval,
|
|
72
64
|
backoff_factor: backoff_factor, retry_statuses: retry_statuses,
|
|
73
65
|
retry_methods: retry_methods, http_callback: http_callback,
|
|
74
|
-
proxy_settings: proxy_settings
|
|
66
|
+
proxy_settings: proxy_settings,
|
|
67
|
+
logging_configuration: logging_configuration
|
|
75
68
|
|
|
76
69
|
# Current API environment
|
|
77
70
|
@environment = String(environment)
|
|
78
71
|
|
|
79
|
-
# The
|
|
80
|
-
@
|
|
81
|
-
|
|
82
|
-
# The password to use with basic authentication
|
|
83
|
-
@basic_auth_password = basic_auth_password
|
|
72
|
+
# The object holding Basic Authentication credentials
|
|
73
|
+
@basic_auth_credentials = basic_auth_credentials
|
|
84
74
|
|
|
85
75
|
# Initializing Basic Authentication credentials with the provided auth parameters
|
|
86
|
-
@basic_auth_credentials =
|
|
87
|
-
basic_auth_user_name, basic_auth_password, basic_auth_credentials
|
|
88
|
-
)
|
|
76
|
+
@basic_auth_credentials = basic_auth_credentials
|
|
89
77
|
|
|
90
78
|
# The Http Client to use for making requests.
|
|
91
79
|
set_http_client CoreLibrary::FaradayClient.new(self)
|
|
@@ -94,9 +82,8 @@ module ModernTreasury
|
|
|
94
82
|
def clone_with(connection: nil, adapter: nil, timeout: nil,
|
|
95
83
|
max_retries: nil, retry_interval: nil, backoff_factor: nil,
|
|
96
84
|
retry_statuses: nil, retry_methods: nil, http_callback: nil,
|
|
97
|
-
proxy_settings: nil,
|
|
98
|
-
|
|
99
|
-
basic_auth_credentials: nil)
|
|
85
|
+
proxy_settings: nil, logging_configuration: nil,
|
|
86
|
+
environment: nil, basic_auth_credentials: nil)
|
|
100
87
|
connection ||= self.connection
|
|
101
88
|
adapter ||= self.adapter
|
|
102
89
|
timeout ||= self.timeout
|
|
@@ -107,11 +94,9 @@ module ModernTreasury
|
|
|
107
94
|
retry_methods ||= self.retry_methods
|
|
108
95
|
http_callback ||= self.http_callback
|
|
109
96
|
proxy_settings ||= self.proxy_settings
|
|
97
|
+
logging_configuration ||= self.logging_configuration
|
|
110
98
|
environment ||= self.environment
|
|
111
|
-
basic_auth_credentials
|
|
112
|
-
basic_auth_user_name, basic_auth_password,
|
|
113
|
-
basic_auth_credentials || self.basic_auth_credentials
|
|
114
|
-
)
|
|
99
|
+
basic_auth_credentials ||= self.basic_auth_credentials
|
|
115
100
|
|
|
116
101
|
Configuration.new(connection: connection, adapter: adapter,
|
|
117
102
|
timeout: timeout, max_retries: max_retries,
|
|
@@ -121,28 +106,11 @@ module ModernTreasury
|
|
|
121
106
|
retry_methods: retry_methods,
|
|
122
107
|
http_callback: http_callback,
|
|
123
108
|
proxy_settings: proxy_settings,
|
|
109
|
+
logging_configuration: logging_configuration,
|
|
124
110
|
environment: environment,
|
|
125
111
|
basic_auth_credentials: basic_auth_credentials)
|
|
126
112
|
end
|
|
127
113
|
|
|
128
|
-
def create_auth_credentials_object(basic_auth_user_name,
|
|
129
|
-
basic_auth_password,
|
|
130
|
-
basic_auth_credentials)
|
|
131
|
-
return basic_auth_credentials if basic_auth_user_name.nil? && basic_auth_password.nil?
|
|
132
|
-
|
|
133
|
-
warn('The \'basic_auth_user_name\', \'basic_auth_password\' params are d'\
|
|
134
|
-
'eprecated. Use \'basic_auth_credentials\' param instead.')
|
|
135
|
-
|
|
136
|
-
unless basic_auth_credentials.nil?
|
|
137
|
-
return basic_auth_credentials.clone_with(
|
|
138
|
-
username: basic_auth_user_name,
|
|
139
|
-
password: basic_auth_password
|
|
140
|
-
)
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
BasicAuthCredentials.new(username: basic_auth_user_name,
|
|
144
|
-
password: basic_auth_password)
|
|
145
|
-
end
|
|
146
114
|
|
|
147
115
|
# All the environments the SDK can run in.
|
|
148
116
|
ENVIRONMENTS = {
|
|
@@ -166,7 +134,7 @@ module ModernTreasury
|
|
|
166
134
|
def self.build_default_config_from_env
|
|
167
135
|
# === Core environment ===
|
|
168
136
|
environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'production'))
|
|
169
|
-
timeout = (ENV['TIMEOUT'] ||
|
|
137
|
+
timeout = (ENV['TIMEOUT'] || 30).to_f
|
|
170
138
|
max_retries = (ENV['MAX_RETRIES'] || 0).to_i
|
|
171
139
|
retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
|
|
172
140
|
backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
|
|
@@ -189,6 +157,8 @@ module ModernTreasury
|
|
|
189
157
|
|
|
190
158
|
# === Proxy settings ===
|
|
191
159
|
proxy_settings = ProxySettings.from_env
|
|
160
|
+
# === Logging Configuration ===
|
|
161
|
+
logging_configuration = LoggingConfiguration.from_env if LoggingConfiguration.any_logging_configured?
|
|
192
162
|
|
|
193
163
|
Configuration.new(
|
|
194
164
|
environment: environment,
|
|
@@ -199,7 +169,8 @@ module ModernTreasury
|
|
|
199
169
|
retry_statuses: retry_statuses,
|
|
200
170
|
retry_methods: retry_methods,
|
|
201
171
|
basic_auth_credentials: basic_auth_credentials,
|
|
202
|
-
proxy_settings: proxy_settings
|
|
172
|
+
proxy_settings: proxy_settings,
|
|
173
|
+
logging_configuration: logging_configuration
|
|
203
174
|
)
|
|
204
175
|
end
|
|
205
176
|
end
|
|
@@ -7,6 +7,8 @@ module ModernTreasury
|
|
|
7
7
|
# AccountCollectionFlowController
|
|
8
8
|
class AccountCollectionFlowController < BaseController
|
|
9
9
|
# TODO: type endpoint description here
|
|
10
|
+
# @param [String] after_cursor Optional parameter: TODO: type description
|
|
11
|
+
# here
|
|
10
12
|
# @param [Integer] per_page Optional parameter: TODO: type description
|
|
11
13
|
# here
|
|
12
14
|
# @param [String] client_token Optional parameter: TODO: type description
|
|
@@ -16,30 +18,29 @@ module ModernTreasury
|
|
|
16
18
|
# here
|
|
17
19
|
# @param [String] external_account_id Optional parameter: TODO: type
|
|
18
20
|
# description here
|
|
19
|
-
# @
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def list_account_collection_flows(per_page: nil,
|
|
21
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
22
|
+
def list_account_collection_flows(after_cursor: nil,
|
|
23
|
+
per_page: nil,
|
|
23
24
|
client_token: nil,
|
|
24
25
|
status: nil,
|
|
25
26
|
counterparty_id: nil,
|
|
26
|
-
external_account_id: nil
|
|
27
|
-
after_cursor: nil)
|
|
27
|
+
external_account_id: nil)
|
|
28
28
|
@api_call
|
|
29
29
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
30
30
|
'/api/account_collection_flows',
|
|
31
31
|
Server::DEFAULT)
|
|
32
|
+
.query_param(new_parameter(after_cursor, key: 'after_cursor'))
|
|
32
33
|
.query_param(new_parameter(per_page, key: 'per_page'))
|
|
33
34
|
.query_param(new_parameter(client_token, key: 'client_token'))
|
|
34
35
|
.query_param(new_parameter(status, key: 'status'))
|
|
35
36
|
.query_param(new_parameter(counterparty_id, key: 'counterparty_id'))
|
|
36
37
|
.query_param(new_parameter(external_account_id, key: 'external_account_id'))
|
|
37
|
-
.query_param(new_parameter(after_cursor, key: 'after_cursor'))
|
|
38
38
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
39
39
|
.auth(Single.new('basic_auth')))
|
|
40
40
|
.response(new_response_handler
|
|
41
41
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
42
42
|
.deserialize_into(AccountCollectionFlow.method(:from_hash))
|
|
43
|
+
.is_api_response(true)
|
|
43
44
|
.is_response_array(true))
|
|
44
45
|
.execute
|
|
45
46
|
end
|
|
@@ -49,7 +50,7 @@ module ModernTreasury
|
|
|
49
50
|
# something unique, preferably something like an UUID.
|
|
50
51
|
# @param [AccountCollectionFlowCreateRequest] body Optional parameter: TODO:
|
|
51
52
|
# type description here
|
|
52
|
-
# @return [
|
|
53
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
53
54
|
def create_account_collection_flow(idempotency_key: nil,
|
|
54
55
|
body: nil)
|
|
55
56
|
@api_call
|
|
@@ -65,6 +66,7 @@ module ModernTreasury
|
|
|
65
66
|
.response(new_response_handler
|
|
66
67
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
67
68
|
.deserialize_into(AccountCollectionFlow.method(:from_hash))
|
|
69
|
+
.is_api_response(true)
|
|
68
70
|
.local_error('422',
|
|
69
71
|
'unsuccessful',
|
|
70
72
|
ErrorMessageException))
|
|
@@ -75,7 +77,7 @@ module ModernTreasury
|
|
|
75
77
|
# @param [String] id Required parameter: id
|
|
76
78
|
# @param [String] idempotency_key Optional parameter: This key should be
|
|
77
79
|
# something unique, preferably something like an UUID.
|
|
78
|
-
# @return [
|
|
80
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
79
81
|
def get_account_collection_flow(id,
|
|
80
82
|
idempotency_key: nil)
|
|
81
83
|
@api_call
|
|
@@ -83,13 +85,15 @@ module ModernTreasury
|
|
|
83
85
|
'/api/account_collection_flows/{id}',
|
|
84
86
|
Server::DEFAULT)
|
|
85
87
|
.template_param(new_parameter(id, key: 'id')
|
|
88
|
+
.is_required(true)
|
|
86
89
|
.should_encode(true))
|
|
87
90
|
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
88
91
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
89
92
|
.auth(Single.new('basic_auth')))
|
|
90
93
|
.response(new_response_handler
|
|
91
94
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
92
|
-
.deserialize_into(AccountCollectionFlow.method(:from_hash))
|
|
95
|
+
.deserialize_into(AccountCollectionFlow.method(:from_hash))
|
|
96
|
+
.is_api_response(true))
|
|
93
97
|
.execute
|
|
94
98
|
end
|
|
95
99
|
|
|
@@ -99,7 +103,7 @@ module ModernTreasury
|
|
|
99
103
|
# something unique, preferably something like an UUID.
|
|
100
104
|
# @param [AccountCollectionFlowUpdateRequest] body Optional parameter: TODO:
|
|
101
105
|
# type description here
|
|
102
|
-
# @return [
|
|
106
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
103
107
|
def update_account_collection_flow(id,
|
|
104
108
|
idempotency_key: nil,
|
|
105
109
|
body: nil)
|
|
@@ -108,6 +112,7 @@ module ModernTreasury
|
|
|
108
112
|
'/api/account_collection_flows/{id}',
|
|
109
113
|
Server::DEFAULT)
|
|
110
114
|
.template_param(new_parameter(id, key: 'id')
|
|
115
|
+
.is_required(true)
|
|
111
116
|
.should_encode(true))
|
|
112
117
|
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
113
118
|
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
@@ -118,6 +123,7 @@ module ModernTreasury
|
|
|
118
123
|
.response(new_response_handler
|
|
119
124
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
120
125
|
.deserialize_into(AccountCollectionFlow.method(:from_hash))
|
|
126
|
+
.is_api_response(true)
|
|
121
127
|
.local_error('404',
|
|
122
128
|
'not found',
|
|
123
129
|
ErrorMessageException)
|
|
@@ -7,13 +7,13 @@ module ModernTreasury
|
|
|
7
7
|
# AccountDetailController
|
|
8
8
|
class AccountDetailController < BaseController
|
|
9
9
|
# Get a list of account details for a single internal or external account.
|
|
10
|
-
# @param [
|
|
10
|
+
# @param [AccountsType] accounts_type Required parameter: Example:
|
|
11
11
|
# @param [String] account_id Required parameter: The ID of the account.
|
|
12
12
|
# @param [String] after_cursor Optional parameter: TODO: type description
|
|
13
13
|
# here
|
|
14
14
|
# @param [Integer] per_page Optional parameter: TODO: type description
|
|
15
15
|
# here
|
|
16
|
-
# @return [
|
|
16
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
17
17
|
def list_account_details(accounts_type,
|
|
18
18
|
account_id,
|
|
19
19
|
after_cursor: nil,
|
|
@@ -23,8 +23,10 @@ module ModernTreasury
|
|
|
23
23
|
'/api/{accounts_type}/{account_id}/account_details',
|
|
24
24
|
Server::DEFAULT)
|
|
25
25
|
.template_param(new_parameter(accounts_type, key: 'accounts_type')
|
|
26
|
+
.is_required(true)
|
|
26
27
|
.should_encode(true))
|
|
27
28
|
.template_param(new_parameter(account_id, key: 'account_id')
|
|
29
|
+
.is_required(true)
|
|
28
30
|
.should_encode(true))
|
|
29
31
|
.query_param(new_parameter(after_cursor, key: 'after_cursor'))
|
|
30
32
|
.query_param(new_parameter(per_page, key: 'per_page'))
|
|
@@ -33,18 +35,19 @@ module ModernTreasury
|
|
|
33
35
|
.response(new_response_handler
|
|
34
36
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
35
37
|
.deserialize_into(AccountDetail.method(:from_hash))
|
|
38
|
+
.is_api_response(true)
|
|
36
39
|
.is_response_array(true))
|
|
37
40
|
.execute
|
|
38
41
|
end
|
|
39
42
|
|
|
40
43
|
# Create an account detail for an external account.
|
|
41
|
-
# @param [
|
|
44
|
+
# @param [AccountsType1] accounts_type Required parameter: Example:
|
|
42
45
|
# @param [String] account_id Required parameter: The ID of the account.
|
|
43
46
|
# @param [String] idempotency_key Optional parameter: This key should be
|
|
44
47
|
# something unique, preferably something like an UUID.
|
|
45
48
|
# @param [AccountDetailCreateRequest] body Optional parameter: TODO: type
|
|
46
49
|
# description here
|
|
47
|
-
# @return [
|
|
50
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
48
51
|
def create_account_detail(accounts_type,
|
|
49
52
|
account_id,
|
|
50
53
|
idempotency_key: nil,
|
|
@@ -54,8 +57,10 @@ module ModernTreasury
|
|
|
54
57
|
'/api/{accounts_type}/{account_id}/account_details',
|
|
55
58
|
Server::DEFAULT)
|
|
56
59
|
.template_param(new_parameter(accounts_type, key: 'accounts_type')
|
|
60
|
+
.is_required(true)
|
|
57
61
|
.should_encode(true))
|
|
58
62
|
.template_param(new_parameter(account_id, key: 'account_id')
|
|
63
|
+
.is_required(true)
|
|
59
64
|
.should_encode(true))
|
|
60
65
|
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
61
66
|
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
@@ -66,6 +71,7 @@ module ModernTreasury
|
|
|
66
71
|
.response(new_response_handler
|
|
67
72
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
68
73
|
.deserialize_into(AccountDetail.method(:from_hash))
|
|
74
|
+
.is_api_response(true)
|
|
69
75
|
.local_error('404',
|
|
70
76
|
'unsuccessful',
|
|
71
77
|
ErrorMessageException)
|
|
@@ -76,10 +82,10 @@ module ModernTreasury
|
|
|
76
82
|
end
|
|
77
83
|
|
|
78
84
|
# Get a single account detail for a single internal or external account.
|
|
79
|
-
# @param [
|
|
85
|
+
# @param [AccountsType] accounts_type Required parameter: Example:
|
|
80
86
|
# @param [String] account_id Required parameter: The ID of the account.
|
|
81
87
|
# @param [String] id Required parameter: The ID of the account detail.
|
|
82
|
-
# @return [
|
|
88
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
83
89
|
def get_account_detail(accounts_type,
|
|
84
90
|
account_id,
|
|
85
91
|
id)
|
|
@@ -88,16 +94,20 @@ module ModernTreasury
|
|
|
88
94
|
'/api/{accounts_type}/{account_id}/account_details/{id}',
|
|
89
95
|
Server::DEFAULT)
|
|
90
96
|
.template_param(new_parameter(accounts_type, key: 'accounts_type')
|
|
97
|
+
.is_required(true)
|
|
91
98
|
.should_encode(true))
|
|
92
99
|
.template_param(new_parameter(account_id, key: 'account_id')
|
|
100
|
+
.is_required(true)
|
|
93
101
|
.should_encode(true))
|
|
94
102
|
.template_param(new_parameter(id, key: 'id')
|
|
103
|
+
.is_required(true)
|
|
95
104
|
.should_encode(true))
|
|
96
105
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
97
106
|
.auth(Single.new('basic_auth')))
|
|
98
107
|
.response(new_response_handler
|
|
99
108
|
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
100
109
|
.deserialize_into(AccountDetail.method(:from_hash))
|
|
110
|
+
.is_api_response(true)
|
|
101
111
|
.local_error('404',
|
|
102
112
|
'not found',
|
|
103
113
|
ErrorMessageException))
|
|
@@ -105,10 +115,10 @@ module ModernTreasury
|
|
|
105
115
|
end
|
|
106
116
|
|
|
107
117
|
# Delete a single account detail for an external account.
|
|
108
|
-
# @param [
|
|
118
|
+
# @param [AccountsType1] accounts_type Required parameter: Example:
|
|
109
119
|
# @param [String] account_id Required parameter: The ID of the account.
|
|
110
120
|
# @param [String] id Required parameter: The ID of the account detail.
|
|
111
|
-
# @return [
|
|
121
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
112
122
|
def delete_account_detail(accounts_type,
|
|
113
123
|
account_id,
|
|
114
124
|
id)
|
|
@@ -117,14 +127,18 @@ module ModernTreasury
|
|
|
117
127
|
'/api/{accounts_type}/{account_id}/account_details/{id}',
|
|
118
128
|
Server::DEFAULT)
|
|
119
129
|
.template_param(new_parameter(accounts_type, key: 'accounts_type')
|
|
130
|
+
.is_required(true)
|
|
120
131
|
.should_encode(true))
|
|
121
132
|
.template_param(new_parameter(account_id, key: 'account_id')
|
|
133
|
+
.is_required(true)
|
|
122
134
|
.should_encode(true))
|
|
123
135
|
.template_param(new_parameter(id, key: 'id')
|
|
136
|
+
.is_required(true)
|
|
124
137
|
.should_encode(true))
|
|
125
138
|
.auth(Single.new('basic_auth')))
|
|
126
139
|
.response(new_response_handler
|
|
127
|
-
.is_response_void(true)
|
|
140
|
+
.is_response_void(true)
|
|
141
|
+
.is_api_response(true))
|
|
128
142
|
.execute
|
|
129
143
|
end
|
|
130
144
|
end
|