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
|
@@ -14,222 +14,222 @@ module ModernTreasury
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
# Access to account_detail controller.
|
|
17
|
-
# @return [
|
|
17
|
+
# @return [AccountDetailApi] Returns the controller instance.
|
|
18
18
|
def account_detail
|
|
19
|
-
@account_detail ||=
|
|
19
|
+
@account_detail ||= AccountDetailApi.new @global_configuration
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Access to balance_report controller.
|
|
23
|
-
# @return [
|
|
23
|
+
# @return [BalanceReportApi] Returns the controller instance.
|
|
24
24
|
def balance_report
|
|
25
|
-
@balance_report ||=
|
|
25
|
+
@balance_report ||= BalanceReportApi.new @global_configuration
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# Access to connection controller.
|
|
29
|
-
# @return [
|
|
29
|
+
# @return [ConnectionApi] Returns the controller instance.
|
|
30
30
|
def connection
|
|
31
|
-
@connection ||=
|
|
31
|
+
@connection ||= ConnectionApi.new @global_configuration
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Access to counterparty controller.
|
|
35
|
-
# @return [
|
|
35
|
+
# @return [CounterpartyApi] Returns the controller instance.
|
|
36
36
|
def counterparty
|
|
37
|
-
@counterparty ||=
|
|
37
|
+
@counterparty ||= CounterpartyApi.new @global_configuration
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
# Access to document controller.
|
|
41
|
-
# @return [
|
|
41
|
+
# @return [DocumentApi] Returns the controller instance.
|
|
42
42
|
def document
|
|
43
|
-
@document ||=
|
|
43
|
+
@document ||= DocumentApi.new @global_configuration
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
# Access to event controller.
|
|
47
|
-
# @return [
|
|
47
|
+
# @return [EventApi] Returns the controller instance.
|
|
48
48
|
def event
|
|
49
|
-
@event ||=
|
|
49
|
+
@event ||= EventApi.new @global_configuration
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
# Access to expected_payment controller.
|
|
53
|
-
# @return [
|
|
53
|
+
# @return [ExpectedPaymentApi] Returns the controller instance.
|
|
54
54
|
def expected_payment
|
|
55
|
-
@expected_payment ||=
|
|
55
|
+
@expected_payment ||= ExpectedPaymentApi.new @global_configuration
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
# Access to external_account controller.
|
|
59
|
-
# @return [
|
|
59
|
+
# @return [ExternalAccountApi] Returns the controller instance.
|
|
60
60
|
def external_account
|
|
61
|
-
@external_account ||=
|
|
61
|
+
@external_account ||= ExternalAccountApi.new @global_configuration
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
# Access to incoming_payment_detail controller.
|
|
65
|
-
# @return [
|
|
65
|
+
# @return [IncomingPaymentDetailApi] Returns the controller instance.
|
|
66
66
|
def incoming_payment_detail
|
|
67
|
-
@incoming_payment_detail ||=
|
|
67
|
+
@incoming_payment_detail ||= IncomingPaymentDetailApi.new @global_configuration
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
# Access to internal_account controller.
|
|
71
|
-
# @return [
|
|
71
|
+
# @return [InternalAccountApi] Returns the controller instance.
|
|
72
72
|
def internal_account
|
|
73
|
-
@internal_account ||=
|
|
73
|
+
@internal_account ||= InternalAccountApi.new @global_configuration
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# Access to invoice_line_item controller.
|
|
77
|
-
# @return [
|
|
77
|
+
# @return [InvoiceLineItemApi] Returns the controller instance.
|
|
78
78
|
def invoice_line_item
|
|
79
|
-
@invoice_line_item ||=
|
|
79
|
+
@invoice_line_item ||= InvoiceLineItemApi.new @global_configuration
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
# Access to invoice controller.
|
|
83
|
-
# @return [
|
|
83
|
+
# @return [InvoiceApi] Returns the controller instance.
|
|
84
84
|
def invoice
|
|
85
|
-
@invoice ||=
|
|
85
|
+
@invoice ||= InvoiceApi.new @global_configuration
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
# Access to ledger_account_category controller.
|
|
89
|
-
# @return [
|
|
89
|
+
# @return [LedgerAccountCategoryApi] Returns the controller instance.
|
|
90
90
|
def ledger_account_category
|
|
91
|
-
@ledger_account_category ||=
|
|
91
|
+
@ledger_account_category ||= LedgerAccountCategoryApi.new @global_configuration
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
# Access to ledger_account_payout controller.
|
|
95
|
-
# @return [
|
|
95
|
+
# @return [LedgerAccountPayoutApi] Returns the controller instance.
|
|
96
96
|
def ledger_account_payout
|
|
97
|
-
@ledger_account_payout ||=
|
|
97
|
+
@ledger_account_payout ||= LedgerAccountPayoutApi.new @global_configuration
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
# Access to ledger_account_statement controller.
|
|
101
|
-
# @return [
|
|
101
|
+
# @return [LedgerAccountStatementApi] Returns the controller instance.
|
|
102
102
|
def ledger_account_statement
|
|
103
|
-
@ledger_account_statement ||=
|
|
103
|
+
@ledger_account_statement ||= LedgerAccountStatementApi.new @global_configuration
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
# Access to ledger_account controller.
|
|
107
|
-
# @return [
|
|
107
|
+
# @return [LedgerAccountApi] Returns the controller instance.
|
|
108
108
|
def ledger_account
|
|
109
|
-
@ledger_account ||=
|
|
109
|
+
@ledger_account ||= LedgerAccountApi.new @global_configuration
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
# Access to ledger_entry controller.
|
|
113
|
-
# @return [
|
|
113
|
+
# @return [LedgerEntryApi] Returns the controller instance.
|
|
114
114
|
def ledger_entry
|
|
115
|
-
@ledger_entry ||=
|
|
115
|
+
@ledger_entry ||= LedgerEntryApi.new @global_configuration
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
# Access to ledger_event_handler controller.
|
|
119
|
-
# @return [
|
|
119
|
+
# @return [LedgerEventHandlerApi] Returns the controller instance.
|
|
120
120
|
def ledger_event_handler
|
|
121
|
-
@ledger_event_handler ||=
|
|
121
|
+
@ledger_event_handler ||= LedgerEventHandlerApi.new @global_configuration
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
# Access to ledger_transaction controller.
|
|
125
|
-
# @return [
|
|
125
|
+
# @return [LedgerTransactionApi] Returns the controller instance.
|
|
126
126
|
def ledger_transaction
|
|
127
|
-
@ledger_transaction ||=
|
|
127
|
+
@ledger_transaction ||= LedgerTransactionApi.new @global_configuration
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
# Access to ledgerable_event controller.
|
|
131
|
-
# @return [
|
|
131
|
+
# @return [LedgerableEventApi] Returns the controller instance.
|
|
132
132
|
def ledgerable_event
|
|
133
|
-
@ledgerable_event ||=
|
|
133
|
+
@ledgerable_event ||= LedgerableEventApi.new @global_configuration
|
|
134
134
|
end
|
|
135
135
|
|
|
136
136
|
# Access to ledger controller.
|
|
137
|
-
# @return [
|
|
137
|
+
# @return [LedgerApi] Returns the controller instance.
|
|
138
138
|
def ledger
|
|
139
|
-
@ledger ||=
|
|
139
|
+
@ledger ||= LedgerApi.new @global_configuration
|
|
140
140
|
end
|
|
141
141
|
|
|
142
142
|
# Access to line_item controller.
|
|
143
|
-
# @return [
|
|
143
|
+
# @return [LineItemApi] Returns the controller instance.
|
|
144
144
|
def line_item
|
|
145
|
-
@line_item ||=
|
|
145
|
+
@line_item ||= LineItemApi.new @global_configuration
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
# Access to paper_item controller.
|
|
149
|
-
# @return [
|
|
149
|
+
# @return [PaperItemApi] Returns the controller instance.
|
|
150
150
|
def paper_item
|
|
151
|
-
@paper_item ||=
|
|
151
|
+
@paper_item ||= PaperItemApi.new @global_configuration
|
|
152
152
|
end
|
|
153
153
|
|
|
154
154
|
# Access to payment_order controller.
|
|
155
|
-
# @return [
|
|
155
|
+
# @return [PaymentOrderApi] Returns the controller instance.
|
|
156
156
|
def payment_order
|
|
157
|
-
@payment_order ||=
|
|
157
|
+
@payment_order ||= PaymentOrderApi.new @global_configuration
|
|
158
158
|
end
|
|
159
159
|
|
|
160
160
|
# Access to payment_reference controller.
|
|
161
|
-
# @return [
|
|
161
|
+
# @return [PaymentReferenceApi] Returns the controller instance.
|
|
162
162
|
def payment_reference
|
|
163
|
-
@payment_reference ||=
|
|
163
|
+
@payment_reference ||= PaymentReferenceApi.new @global_configuration
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
# Access to ping controller.
|
|
167
|
-
# @return [
|
|
167
|
+
# @return [PingApi] Returns the controller instance.
|
|
168
168
|
def ping
|
|
169
|
-
@ping ||=
|
|
169
|
+
@ping ||= PingApi.new @global_configuration
|
|
170
170
|
end
|
|
171
171
|
|
|
172
172
|
# Access to mreturn controller.
|
|
173
|
-
# @return [
|
|
173
|
+
# @return [ReturnApi] Returns the controller instance.
|
|
174
174
|
def mreturn
|
|
175
|
-
@mreturn ||=
|
|
175
|
+
@mreturn ||= ReturnApi.new @global_configuration
|
|
176
176
|
end
|
|
177
177
|
|
|
178
178
|
# Access to reversal controller.
|
|
179
|
-
# @return [
|
|
179
|
+
# @return [ReversalApi] Returns the controller instance.
|
|
180
180
|
def reversal
|
|
181
|
-
@reversal ||=
|
|
181
|
+
@reversal ||= ReversalApi.new @global_configuration
|
|
182
182
|
end
|
|
183
183
|
|
|
184
184
|
# Access to routing_detail controller.
|
|
185
|
-
# @return [
|
|
185
|
+
# @return [RoutingDetailApi] Returns the controller instance.
|
|
186
186
|
def routing_detail
|
|
187
|
-
@routing_detail ||=
|
|
187
|
+
@routing_detail ||= RoutingDetailApi.new @global_configuration
|
|
188
188
|
end
|
|
189
189
|
|
|
190
190
|
# Access to transaction_line_item controller.
|
|
191
|
-
# @return [
|
|
191
|
+
# @return [TransactionLineItemApi] Returns the controller instance.
|
|
192
192
|
def transaction_line_item
|
|
193
|
-
@transaction_line_item ||=
|
|
193
|
+
@transaction_line_item ||= TransactionLineItemApi.new @global_configuration
|
|
194
194
|
end
|
|
195
195
|
|
|
196
196
|
# Access to transaction controller.
|
|
197
|
-
# @return [
|
|
197
|
+
# @return [TransactionApi] Returns the controller instance.
|
|
198
198
|
def transaction
|
|
199
|
-
@transaction ||=
|
|
199
|
+
@transaction ||= TransactionApi.new @global_configuration
|
|
200
200
|
end
|
|
201
201
|
|
|
202
202
|
# Access to validation controller.
|
|
203
|
-
# @return [
|
|
203
|
+
# @return [ValidationApi] Returns the controller instance.
|
|
204
204
|
def validation
|
|
205
|
-
@validation ||=
|
|
205
|
+
@validation ||= ValidationApi.new @global_configuration
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
# Access to virtual_account controller.
|
|
209
|
-
# @return [
|
|
209
|
+
# @return [VirtualAccountApi] Returns the controller instance.
|
|
210
210
|
def virtual_account
|
|
211
|
-
@virtual_account ||=
|
|
211
|
+
@virtual_account ||= VirtualAccountApi.new @global_configuration
|
|
212
212
|
end
|
|
213
213
|
|
|
214
214
|
# Access to account_collection_flow controller.
|
|
215
|
-
# @return [
|
|
215
|
+
# @return [AccountCollectionFlowApi] Returns the controller instance.
|
|
216
216
|
def account_collection_flow
|
|
217
|
-
@account_collection_flow ||=
|
|
217
|
+
@account_collection_flow ||= AccountCollectionFlowApi.new @global_configuration
|
|
218
218
|
end
|
|
219
219
|
|
|
220
220
|
# Access to payment_flow controller.
|
|
221
|
-
# @return [
|
|
221
|
+
# @return [PaymentFlowApi] Returns the controller instance.
|
|
222
222
|
def payment_flow
|
|
223
|
-
@payment_flow ||=
|
|
223
|
+
@payment_flow ||= PaymentFlowApi.new @global_configuration
|
|
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 = BaseApi.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
|
-
.global_errors(
|
|
253
|
-
.user_agent(
|
|
253
|
+
.global_errors(BaseApi::GLOBAL_ERRORS)
|
|
254
|
+
.user_agent(BaseApi.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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# modern_treasury
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ModernTreasury
|
|
7
|
+
# Http response received.
|
|
8
|
+
class ApiResponse < CoreLibrary::ApiResponse
|
|
9
|
+
# The constructor
|
|
10
|
+
# @param [HttpResponse] http_response The original, raw response from the api.
|
|
11
|
+
# @param [Object] data The data field specified for the response.
|
|
12
|
+
# @param [Array<String>] errors Any errors returned by the server.
|
|
13
|
+
def initialize(http_response,
|
|
14
|
+
data: nil,
|
|
15
|
+
errors: nil)
|
|
16
|
+
super
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# modern_treasury
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ModernTreasury
|
|
7
|
+
# Initializes a new instance of RequestLoggingConfiguration.
|
|
8
|
+
class RequestLoggingConfiguration < CoreLibrary::ApiRequestLoggingConfiguration
|
|
9
|
+
# @param log_body [Boolean] Indicates whether the message body should be logged. Default is false.
|
|
10
|
+
# @param log_headers [Boolean] Indicates whether the message headers should be logged. Default is false.
|
|
11
|
+
# @param headers_to_exclude [Array<String>] Array of headers not displayed in logging. Default is an empty array.
|
|
12
|
+
# @param headers_to_include [Array<String>] Array of headers to be displayed in logging. Default is an empty array.
|
|
13
|
+
# @param headers_to_unmask [Array<String>] Array of headers which values are non-sensitive to display in logging.
|
|
14
|
+
# Default is an empty array.
|
|
15
|
+
def initialize(log_body: false, log_headers: false, headers_to_include: nil,
|
|
16
|
+
headers_to_exclude: nil, headers_to_unmask: nil,
|
|
17
|
+
include_query_in_path: false)
|
|
18
|
+
super(
|
|
19
|
+
log_body,
|
|
20
|
+
log_headers,
|
|
21
|
+
headers_to_exclude,
|
|
22
|
+
headers_to_include,
|
|
23
|
+
headers_to_unmask,
|
|
24
|
+
include_query_in_path
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
|
|
29
|
+
headers_to_exclude: nil, headers_to_unmask: nil, include_query_in_path: nil)
|
|
30
|
+
log_body ||= self.log_body
|
|
31
|
+
log_headers ||= self.log_headers
|
|
32
|
+
headers_to_include ||= self.headers_to_include
|
|
33
|
+
headers_to_exclude ||= self.headers_to_exclude
|
|
34
|
+
headers_to_unmask ||= self.headers_to_unmask
|
|
35
|
+
include_query_in_path ||= self.include_query_in_path
|
|
36
|
+
|
|
37
|
+
RequestLoggingConfiguration.new(
|
|
38
|
+
log_body: log_body,
|
|
39
|
+
log_headers: log_headers,
|
|
40
|
+
headers_to_include: headers_to_include,
|
|
41
|
+
headers_to_exclude: headers_to_exclude,
|
|
42
|
+
headers_to_unmask: headers_to_unmask,
|
|
43
|
+
include_query_in_path: include_query_in_path
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def self.from_env
|
|
48
|
+
log_body = ENV['REQUEST_LOG_BODY']
|
|
49
|
+
log_headers = ENV['REQUEST_LOG_HEADERS']
|
|
50
|
+
headers_to_include = ENV['REQUEST_HEADERS_TO_INCLUDE']
|
|
51
|
+
headers_to_exclude = ENV['REQUEST_HEADERS_TO_EXCLUDE']
|
|
52
|
+
headers_to_unmask = ENV['REQUEST_HEADERS_TO_UNMASK']
|
|
53
|
+
include_query_in_path = ENV['REQUEST_INCLUDE_QUERY_IN_PATH']
|
|
54
|
+
|
|
55
|
+
new(
|
|
56
|
+
log_body: log_body,
|
|
57
|
+
log_headers: log_headers,
|
|
58
|
+
headers_to_include: headers_to_include,
|
|
59
|
+
headers_to_exclude: headers_to_exclude,
|
|
60
|
+
headers_to_unmask: headers_to_unmask,
|
|
61
|
+
include_query_in_path: include_query_in_path
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.any_logging_configured?
|
|
66
|
+
%w[
|
|
67
|
+
REQUEST_LOG_BODY
|
|
68
|
+
REQUEST_LOG_HEADERS
|
|
69
|
+
REQUEST_HEADERS_TO_INCLUDE
|
|
70
|
+
REQUEST_HEADERS_TO_EXCLUDE
|
|
71
|
+
REQUEST_HEADERS_TO_UNMASK
|
|
72
|
+
REQUEST_INCLUDE_QUERY_IN_PATH
|
|
73
|
+
].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Initializes a new instance of ResponseLoggingConfiguration.
|
|
78
|
+
class ResponseLoggingConfiguration < CoreLibrary::ApiResponseLoggingConfiguration
|
|
79
|
+
def initialize(log_body: false, log_headers: false, headers_to_include: nil,
|
|
80
|
+
headers_to_exclude: nil, headers_to_unmask: nil)
|
|
81
|
+
super(
|
|
82
|
+
log_body,
|
|
83
|
+
log_headers,
|
|
84
|
+
headers_to_exclude,
|
|
85
|
+
headers_to_include,
|
|
86
|
+
headers_to_unmask
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
|
|
91
|
+
headers_to_exclude: nil, headers_to_unmask: nil)
|
|
92
|
+
log_body ||= self.log_body
|
|
93
|
+
log_headers ||= self.log_headers
|
|
94
|
+
headers_to_include ||= self.headers_to_include
|
|
95
|
+
headers_to_exclude ||= self.headers_to_exclude
|
|
96
|
+
headers_to_unmask ||= self.headers_to_unmask
|
|
97
|
+
|
|
98
|
+
ResponseLoggingConfiguration.new(
|
|
99
|
+
log_body: log_body,
|
|
100
|
+
log_headers: log_headers,
|
|
101
|
+
headers_to_include: headers_to_include,
|
|
102
|
+
headers_to_exclude: headers_to_exclude,
|
|
103
|
+
headers_to_unmask: headers_to_unmask
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def self.from_env
|
|
108
|
+
log_body = ENV['RESPONSE_LOG_BODY']
|
|
109
|
+
log_headers = ENV['RESPONSE_LOG_HEADERS']
|
|
110
|
+
headers_to_include = ENV['RESPONSE_HEADERS_TO_INCLUDE']
|
|
111
|
+
headers_to_exclude = ENV['RESPONSE_HEADERS_TO_EXCLUDE']
|
|
112
|
+
headers_to_unmask = ENV['RESPONSE_HEADERS_TO_UNMASK']
|
|
113
|
+
|
|
114
|
+
new(
|
|
115
|
+
log_body: log_body,
|
|
116
|
+
log_headers: log_headers,
|
|
117
|
+
headers_to_include: headers_to_include,
|
|
118
|
+
headers_to_exclude: headers_to_exclude,
|
|
119
|
+
headers_to_unmask: headers_to_unmask
|
|
120
|
+
)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def self.any_logging_configured?
|
|
124
|
+
%w[
|
|
125
|
+
RESPONSE_LOG_BODY
|
|
126
|
+
RESPONSE_LOG_HEADERS
|
|
127
|
+
RESPONSE_HEADERS_TO_INCLUDE
|
|
128
|
+
RESPONSE_HEADERS_TO_EXCLUDE
|
|
129
|
+
RESPONSE_HEADERS_TO_UNMASK
|
|
130
|
+
].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Initializes a new instance of LoggingConfiguration.
|
|
135
|
+
class LoggingConfiguration < CoreLibrary::ApiLoggingConfiguration
|
|
136
|
+
def initialize(logger: nil, log_level: nil, mask_sensitive_headers: true,
|
|
137
|
+
request_logging_config: nil,
|
|
138
|
+
response_logging_config: nil)
|
|
139
|
+
request_logging_config ||= RequestLoggingConfiguration.new
|
|
140
|
+
response_logging_config ||= ResponseLoggingConfiguration.new
|
|
141
|
+
super(
|
|
142
|
+
logger,
|
|
143
|
+
log_level,
|
|
144
|
+
request_logging_config,
|
|
145
|
+
response_logging_config,
|
|
146
|
+
mask_sensitive_headers
|
|
147
|
+
)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def clone_with(logger: nil, log_level: nil, mask_sensitive_headers: nil,
|
|
151
|
+
request_logging_config: nil, response_logging_config: nil)
|
|
152
|
+
logger ||= self.logger
|
|
153
|
+
log_level ||= self.log_level
|
|
154
|
+
mask_sensitive_headers ||= self.mask_sensitive_headers
|
|
155
|
+
request_logging_config ||= self.request_logging_config.clone
|
|
156
|
+
response_logging_config ||= self.response_logging_config.clone
|
|
157
|
+
|
|
158
|
+
LoggingConfiguration.new(
|
|
159
|
+
logger: logger,
|
|
160
|
+
log_level: log_level,
|
|
161
|
+
mask_sensitive_headers: mask_sensitive_headers,
|
|
162
|
+
request_logging_config: request_logging_config,
|
|
163
|
+
response_logging_config: response_logging_config
|
|
164
|
+
)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def self.from_env
|
|
168
|
+
log_level = ENV['LOG_LEVEL']
|
|
169
|
+
mask_sensitive_headers = ENV['MASK_SENSITIVE_HEADERS']
|
|
170
|
+
|
|
171
|
+
new(
|
|
172
|
+
log_level: log_level,
|
|
173
|
+
mask_sensitive_headers: mask_sensitive_headers,
|
|
174
|
+
request_logging_config: RequestLoggingConfiguration.from_env,
|
|
175
|
+
response_logging_config: ResponseLoggingConfiguration.from_env
|
|
176
|
+
)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def self.any_logging_configured?
|
|
180
|
+
RequestLoggingConfiguration.any_logging_configured? ||
|
|
181
|
+
ResponseLoggingConfiguration.any_logging_configured? ||
|
|
182
|
+
ENV.key?('LOG_LEVEL') ||
|
|
183
|
+
ENV.key?('MASK_SENSITIVE_HEADERS')
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|