mt-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +188 -0
  4. data/bin/console +15 -0
  5. data/lib/modern_treasury/api_helper.rb +10 -0
  6. data/lib/modern_treasury/client.rb +275 -0
  7. data/lib/modern_treasury/configuration.rb +206 -0
  8. data/lib/modern_treasury/controllers/account_collection_flow_controller.rb +130 -0
  9. data/lib/modern_treasury/controllers/account_detail_controller.rb +131 -0
  10. data/lib/modern_treasury/controllers/balance_report_controller.rb +76 -0
  11. data/lib/modern_treasury/controllers/base_controller.rb +60 -0
  12. data/lib/modern_treasury/controllers/connection_controller.rb +40 -0
  13. data/lib/modern_treasury/controllers/counterparty_controller.rb +188 -0
  14. data/lib/modern_treasury/controllers/document_controller.rb +285 -0
  15. data/lib/modern_treasury/controllers/event_controller.rb +72 -0
  16. data/lib/modern_treasury/controllers/expected_payment_controller.rb +162 -0
  17. data/lib/modern_treasury/controllers/external_account_controller.rb +202 -0
  18. data/lib/modern_treasury/controllers/incoming_payment_detail_controller.rb +150 -0
  19. data/lib/modern_treasury/controllers/internal_account_controller.rb +134 -0
  20. data/lib/modern_treasury/controllers/invoice_controller.rb +98 -0
  21. data/lib/modern_treasury/controllers/invoice_line_item_controller.rb +136 -0
  22. data/lib/modern_treasury/controllers/ledger_account_category_controller.rb +292 -0
  23. data/lib/modern_treasury/controllers/ledger_account_controller.rb +202 -0
  24. data/lib/modern_treasury/controllers/ledger_account_payout_controller.rb +126 -0
  25. data/lib/modern_treasury/controllers/ledger_account_statement_controller.rb +60 -0
  26. data/lib/modern_treasury/controllers/ledger_controller.rb +152 -0
  27. data/lib/modern_treasury/controllers/ledger_entry_controller.rb +148 -0
  28. data/lib/modern_treasury/controllers/ledger_event_handler_controller.rb +119 -0
  29. data/lib/modern_treasury/controllers/ledger_transaction_controller.rb +328 -0
  30. data/lib/modern_treasury/controllers/ledgerable_event_controller.rb +61 -0
  31. data/lib/modern_treasury/controllers/line_item_controller.rb +107 -0
  32. data/lib/modern_treasury/controllers/paper_item_controller.rb +69 -0
  33. data/lib/modern_treasury/controllers/payment_flow_controller.rb +138 -0
  34. data/lib/modern_treasury/controllers/payment_order_controller.rb +368 -0
  35. data/lib/modern_treasury/controllers/payment_reference_controller.rb +64 -0
  36. data/lib/modern_treasury/controllers/ping_controller.rb +34 -0
  37. data/lib/modern_treasury/controllers/return_controller.rb +105 -0
  38. data/lib/modern_treasury/controllers/reversal_controller.rb +99 -0
  39. data/lib/modern_treasury/controllers/routing_detail_controller.rb +131 -0
  40. data/lib/modern_treasury/controllers/transaction_controller.rb +133 -0
  41. data/lib/modern_treasury/controllers/transaction_line_item_controller.rb +39 -0
  42. data/lib/modern_treasury/controllers/validation_controller.rb +41 -0
  43. data/lib/modern_treasury/controllers/virtual_account_controller.rb +142 -0
  44. data/lib/modern_treasury/exceptions/api_exception.rb +21 -0
  45. data/lib/modern_treasury/exceptions/error_message_exception.rb +46 -0
  46. data/lib/modern_treasury/http/auth/basic_auth.rb +62 -0
  47. data/lib/modern_treasury/http/http_call_back.rb +10 -0
  48. data/lib/modern_treasury/http/http_method_enum.rb +10 -0
  49. data/lib/modern_treasury/http/http_request.rb +10 -0
  50. data/lib/modern_treasury/http/http_response.rb +10 -0
  51. data/lib/modern_treasury/http/proxy_settings.rb +22 -0
  52. data/lib/modern_treasury/models/account.rb +304 -0
  53. data/lib/modern_treasury/models/account1.rb +217 -0
  54. data/lib/modern_treasury/models/account_collection_flow.rb +178 -0
  55. data/lib/modern_treasury/models/account_collection_flow_create_request.rb +70 -0
  56. data/lib/modern_treasury/models/account_collection_flow_update_request.rb +61 -0
  57. data/lib/modern_treasury/models/account_detail.rb +211 -0
  58. data/lib/modern_treasury/models/account_detail1.rb +74 -0
  59. data/lib/modern_treasury/models/account_detail_create_request.rb +75 -0
  60. data/lib/modern_treasury/models/account_number_type2_enum.rb +48 -0
  61. data/lib/modern_treasury/models/account_number_type_enum.rb +49 -0
  62. data/lib/modern_treasury/models/account_type5_enum.rb +56 -0
  63. data/lib/modern_treasury/models/account_type_enum.rb +56 -0
  64. data/lib/modern_treasury/models/accounting.rb +88 -0
  65. data/lib/modern_treasury/models/accounting1.rb +63 -0
  66. data/lib/modern_treasury/models/accounts_type1_enum.rb +26 -0
  67. data/lib/modern_treasury/models/accounts_type_enum.rb +36 -0
  68. data/lib/modern_treasury/models/address.rb +231 -0
  69. data/lib/modern_treasury/models/address_request.rb +118 -0
  70. data/lib/modern_treasury/models/async_response.rb +68 -0
  71. data/lib/modern_treasury/models/balance.rb +164 -0
  72. data/lib/modern_treasury/models/balance_report.rb +178 -0
  73. data/lib/modern_treasury/models/balance_report_type1_enum.rb +44 -0
  74. data/lib/modern_treasury/models/balance_report_type_enum.rb +45 -0
  75. data/lib/modern_treasury/models/balance_type_enum.rb +63 -0
  76. data/lib/modern_treasury/models/balances.rb +71 -0
  77. data/lib/modern_treasury/models/balances1.rb +81 -0
  78. data/lib/modern_treasury/models/balances2.rb +120 -0
  79. data/lib/modern_treasury/models/balances3.rb +130 -0
  80. data/lib/modern_treasury/models/base_model.rb +110 -0
  81. data/lib/modern_treasury/models/charge_bearer_enum.rb +42 -0
  82. data/lib/modern_treasury/models/code1_enum.rb +200 -0
  83. data/lib/modern_treasury/models/code_enum.rb +68 -0
  84. data/lib/modern_treasury/models/connection.rb +209 -0
  85. data/lib/modern_treasury/models/contact_detail.rb +200 -0
  86. data/lib/modern_treasury/models/contact_detail_create_request.rb +75 -0
  87. data/lib/modern_treasury/models/contact_identifier_type_enum.rb +40 -0
  88. data/lib/modern_treasury/models/content_type_enum.rb +36 -0
  89. data/lib/modern_treasury/models/counterparty.rb +200 -0
  90. data/lib/modern_treasury/models/counterparty_billing_address.rb +106 -0
  91. data/lib/modern_treasury/models/counterparty_collect_account_request.rb +104 -0
  92. data/lib/modern_treasury/models/counterparty_collect_account_response.rb +82 -0
  93. data/lib/modern_treasury/models/counterparty_create_request.rb +161 -0
  94. data/lib/modern_treasury/models/counterparty_shipping_address.rb +107 -0
  95. data/lib/modern_treasury/models/counterparty_update_request.rb +107 -0
  96. data/lib/modern_treasury/models/created_at_enum.rb +36 -0
  97. data/lib/modern_treasury/models/currency1_enum.rb +37 -0
  98. data/lib/modern_treasury/models/currency_enum.rb +784 -0
  99. data/lib/modern_treasury/models/direction10_enum.rb +38 -0
  100. data/lib/modern_treasury/models/direction14_enum.rb +36 -0
  101. data/lib/modern_treasury/models/direction15_enum.rb +36 -0
  102. data/lib/modern_treasury/models/direction1_enum.rb +37 -0
  103. data/lib/modern_treasury/models/direction4_enum.rb +36 -0
  104. data/lib/modern_treasury/models/direction5_enum.rb +39 -0
  105. data/lib/modern_treasury/models/direction9_enum.rb +37 -0
  106. data/lib/modern_treasury/models/direction_enum.rb +38 -0
  107. data/lib/modern_treasury/models/document.rb +207 -0
  108. data/lib/modern_treasury/models/document_create_request.rb +92 -0
  109. data/lib/modern_treasury/models/document_detail.rb +154 -0
  110. data/lib/modern_treasury/models/documentable_type1_enum.rb +72 -0
  111. data/lib/modern_treasury/models/documentable_type2_enum.rb +72 -0
  112. data/lib/modern_treasury/models/documentable_type_enum.rb +75 -0
  113. data/lib/modern_treasury/models/effective_at_enum.rb +36 -0
  114. data/lib/modern_treasury/models/errors.rb +81 -0
  115. data/lib/modern_treasury/models/event.rb +162 -0
  116. data/lib/modern_treasury/models/expected_payment.rb +343 -0
  117. data/lib/modern_treasury/models/expected_payment_create_request.rb +254 -0
  118. data/lib/modern_treasury/models/expected_payment_update_request.rb +239 -0
  119. data/lib/modern_treasury/models/external_account.rb +283 -0
  120. data/lib/modern_treasury/models/external_account_complete_verification_request.rb +62 -0
  121. data/lib/modern_treasury/models/external_account_create_request.rb +230 -0
  122. data/lib/modern_treasury/models/external_account_update_request.rb +132 -0
  123. data/lib/modern_treasury/models/external_account_verify_request.rb +83 -0
  124. data/lib/modern_treasury/models/fallback_type_enum.rb +28 -0
  125. data/lib/modern_treasury/models/field_enum.rb +112 -0
  126. data/lib/modern_treasury/models/file.rb +81 -0
  127. data/lib/modern_treasury/models/foreign_exchange_indicator_enum.rb +38 -0
  128. data/lib/modern_treasury/models/incoming_payment_detail.rb +348 -0
  129. data/lib/modern_treasury/models/incoming_payment_detail_create_request.rb +141 -0
  130. data/lib/modern_treasury/models/incoming_payment_detail_update_request.rb +63 -0
  131. data/lib/modern_treasury/models/internal_account.rb +361 -0
  132. data/lib/modern_treasury/models/internal_account_create_request.rb +135 -0
  133. data/lib/modern_treasury/models/internal_account_update_request.rb +95 -0
  134. data/lib/modern_treasury/models/invoice.rb +342 -0
  135. data/lib/modern_treasury/models/invoice_create_request.rb +235 -0
  136. data/lib/modern_treasury/models/invoice_line_item.rb +171 -0
  137. data/lib/modern_treasury/models/invoice_line_item_create_request.rb +104 -0
  138. data/lib/modern_treasury/models/invoice_line_item_update_request.rb +240 -0
  139. data/lib/modern_treasury/models/invoice_update_request.rb +251 -0
  140. data/lib/modern_treasury/models/invoicer_address.rb +106 -0
  141. data/lib/modern_treasury/models/itemizable_type1_enum.rb +36 -0
  142. data/lib/modern_treasury/models/itemizable_type_enum.rb +36 -0
  143. data/lib/modern_treasury/models/ledger.rb +158 -0
  144. data/lib/modern_treasury/models/ledger_account.rb +220 -0
  145. data/lib/modern_treasury/models/ledger_account_category.rb +187 -0
  146. data/lib/modern_treasury/models/ledger_account_category_create_request.rb +125 -0
  147. data/lib/modern_treasury/models/ledger_account_category_update_request.rb +84 -0
  148. data/lib/modern_treasury/models/ledger_account_create_request.rb +150 -0
  149. data/lib/modern_treasury/models/ledger_account_normal_balance_enum.rb +36 -0
  150. data/lib/modern_treasury/models/ledger_account_payout.rb +238 -0
  151. data/lib/modern_treasury/models/ledger_account_payout_create_request.rb +152 -0
  152. data/lib/modern_treasury/models/ledger_account_payout_update_request.rb +85 -0
  153. data/lib/modern_treasury/models/ledger_account_statement.rb +233 -0
  154. data/lib/modern_treasury/models/ledger_account_statement_create_request.rb +122 -0
  155. data/lib/modern_treasury/models/ledger_account_update_request.rb +84 -0
  156. data/lib/modern_treasury/models/ledger_balance.rb +97 -0
  157. data/lib/modern_treasury/models/ledger_balances.rb +81 -0
  158. data/lib/modern_treasury/models/ledger_balances_with_effective_at.rb +123 -0
  159. data/lib/modern_treasury/models/ledger_create_request.rb +83 -0
  160. data/lib/modern_treasury/models/ledger_entry.rb +247 -0
  161. data/lib/modern_treasury/models/ledger_entry_create_request.rb +177 -0
  162. data/lib/modern_treasury/models/ledger_entry_of_transaction_version.rb +214 -0
  163. data/lib/modern_treasury/models/ledger_event_handler.rb +182 -0
  164. data/lib/modern_treasury/models/ledger_event_handler_conditions.rb +78 -0
  165. data/lib/modern_treasury/models/ledger_event_handler_create_request.rb +119 -0
  166. data/lib/modern_treasury/models/ledger_event_handler_ledger_entries.rb +80 -0
  167. data/lib/modern_treasury/models/ledger_event_handler_ledger_transaction_template.rb +103 -0
  168. data/lib/modern_treasury/models/ledger_transaction.rb +259 -0
  169. data/lib/modern_treasury/models/ledger_transaction_create_request.rb +164 -0
  170. data/lib/modern_treasury/models/ledger_transaction_reversal_create_request.rb +142 -0
  171. data/lib/modern_treasury/models/ledger_transaction_update_request.rb +115 -0
  172. data/lib/modern_treasury/models/ledger_transaction_version.rb +254 -0
  173. data/lib/modern_treasury/models/ledger_type_enum.rb +37 -0
  174. data/lib/modern_treasury/models/ledger_update_request.rb +84 -0
  175. data/lib/modern_treasury/models/ledgerable_event.rb +206 -0
  176. data/lib/modern_treasury/models/ledgerable_event_create_request.rb +140 -0
  177. data/lib/modern_treasury/models/ledgerable_type2_enum.rb +71 -0
  178. data/lib/modern_treasury/models/ledgerable_type5_enum.rb +69 -0
  179. data/lib/modern_treasury/models/ledgerable_type6_enum.rb +68 -0
  180. data/lib/modern_treasury/models/ledgerable_type_enum.rb +38 -0
  181. data/lib/modern_treasury/models/legacy_document_create_request.rb +70 -0
  182. data/lib/modern_treasury/models/line_item.rb +200 -0
  183. data/lib/modern_treasury/models/line_item_request.rb +98 -0
  184. data/lib/modern_treasury/models/line_item_update_request.rb +63 -0
  185. data/lib/modern_treasury/models/mreturn.rb +425 -0
  186. data/lib/modern_treasury/models/normal_balance2_enum.rb +36 -0
  187. data/lib/modern_treasury/models/normal_balance_enum.rb +36 -0
  188. data/lib/modern_treasury/models/order_by.rb +72 -0
  189. data/lib/modern_treasury/models/originating_account_number_type_enum.rb +48 -0
  190. data/lib/modern_treasury/models/originating_routing_number_type_enum.rb +68 -0
  191. data/lib/modern_treasury/models/paper_item.rb +249 -0
  192. data/lib/modern_treasury/models/party_address.rb +106 -0
  193. data/lib/modern_treasury/models/party_type5_enum.rb +36 -0
  194. data/lib/modern_treasury/models/party_type_enum.rb +36 -0
  195. data/lib/modern_treasury/models/payment_direction_enum.rb +36 -0
  196. data/lib/modern_treasury/models/payment_flow.rb +230 -0
  197. data/lib/modern_treasury/models/payment_flow_create_request.rb +103 -0
  198. data/lib/modern_treasury/models/payment_flow_update_request.rb +61 -0
  199. data/lib/modern_treasury/models/payment_method1_enum.rb +46 -0
  200. data/lib/modern_treasury/models/payment_method_enum.rb +42 -0
  201. data/lib/modern_treasury/models/payment_order.rb +820 -0
  202. data/lib/modern_treasury/models/payment_order_async_create_request.rb +536 -0
  203. data/lib/modern_treasury/models/payment_order_create_request.rb +556 -0
  204. data/lib/modern_treasury/models/payment_order_update_request.rb +543 -0
  205. data/lib/modern_treasury/models/payment_reference.rb +175 -0
  206. data/lib/modern_treasury/models/payment_reference_object.rb +156 -0
  207. data/lib/modern_treasury/models/payment_type13_enum.rb +96 -0
  208. data/lib/modern_treasury/models/payment_type1_enum.rb +97 -0
  209. data/lib/modern_treasury/models/payment_type2_enum.rb +96 -0
  210. data/lib/modern_treasury/models/payment_type4_enum.rb +96 -0
  211. data/lib/modern_treasury/models/payment_type5_enum.rb +36 -0
  212. data/lib/modern_treasury/models/payment_type6_enum.rb +97 -0
  213. data/lib/modern_treasury/models/payment_type_enum.rb +37 -0
  214. data/lib/modern_treasury/models/ping_response.rb +60 -0
  215. data/lib/modern_treasury/models/priority4_enum.rb +36 -0
  216. data/lib/modern_treasury/models/priority_enum.rb +38 -0
  217. data/lib/modern_treasury/models/reason1_enum.rb +50 -0
  218. data/lib/modern_treasury/models/reason_enum.rb +48 -0
  219. data/lib/modern_treasury/models/receiving_account.rb +304 -0
  220. data/lib/modern_treasury/models/receiving_account1.rb +219 -0
  221. data/lib/modern_treasury/models/receiving_account_type_enum.rb +36 -0
  222. data/lib/modern_treasury/models/reconciliation_method_enum.rb +38 -0
  223. data/lib/modern_treasury/models/reference_number_type1_enum.rb +248 -0
  224. data/lib/modern_treasury/models/reference_number_type_enum.rb +248 -0
  225. data/lib/modern_treasury/models/referenceable_type1_enum.rb +40 -0
  226. data/lib/modern_treasury/models/referenceable_type_enum.rb +41 -0
  227. data/lib/modern_treasury/models/return_create_request.rb +119 -0
  228. data/lib/modern_treasury/models/returnable_type1_enum.rb +48 -0
  229. data/lib/modern_treasury/models/returnable_type_enum.rb +48 -0
  230. data/lib/modern_treasury/models/reversal.rb +151 -0
  231. data/lib/modern_treasury/models/reversal_create_request.rb +86 -0
  232. data/lib/modern_treasury/models/role_enum.rb +36 -0
  233. data/lib/modern_treasury/models/routing_detail.rb +242 -0
  234. data/lib/modern_treasury/models/routing_detail1.rb +83 -0
  235. data/lib/modern_treasury/models/routing_detail_create_request.rb +87 -0
  236. data/lib/modern_treasury/models/routing_number_lookup_request.rb +124 -0
  237. data/lib/modern_treasury/models/routing_number_type1_enum.rb +68 -0
  238. data/lib/modern_treasury/models/routing_number_type7_enum.rb +55 -0
  239. data/lib/modern_treasury/models/routing_number_type8_enum.rb +68 -0
  240. data/lib/modern_treasury/models/routing_number_type_enum.rb +69 -0
  241. data/lib/modern_treasury/models/status11_enum.rb +40 -0
  242. data/lib/modern_treasury/models/status12_enum.rb +40 -0
  243. data/lib/modern_treasury/models/status15_enum.rb +41 -0
  244. data/lib/modern_treasury/models/status16_enum.rb +41 -0
  245. data/lib/modern_treasury/models/status17_enum.rb +45 -0
  246. data/lib/modern_treasury/models/status18_enum.rb +74 -0
  247. data/lib/modern_treasury/models/status19_enum.rb +52 -0
  248. data/lib/modern_treasury/models/status1_enum.rb +40 -0
  249. data/lib/modern_treasury/models/status20_enum.rb +40 -0
  250. data/lib/modern_treasury/models/status21_enum.rb +40 -0
  251. data/lib/modern_treasury/models/status22_enum.rb +40 -0
  252. data/lib/modern_treasury/models/status24_enum.rb +72 -0
  253. data/lib/modern_treasury/models/status2_enum.rb +41 -0
  254. data/lib/modern_treasury/models/status3_enum.rb +72 -0
  255. data/lib/modern_treasury/models/status4_enum.rb +52 -0
  256. data/lib/modern_treasury/models/status5_enum.rb +48 -0
  257. data/lib/modern_treasury/models/status6_enum.rb +49 -0
  258. data/lib/modern_treasury/models/status7_enum.rb +37 -0
  259. data/lib/modern_treasury/models/status8_enum.rb +37 -0
  260. data/lib/modern_treasury/models/status9_enum.rb +41 -0
  261. data/lib/modern_treasury/models/status_enum.rb +45 -0
  262. data/lib/modern_treasury/models/subtype_enum.rb +71 -0
  263. data/lib/modern_treasury/models/supported_payment_type_enum.rb +96 -0
  264. data/lib/modern_treasury/models/transactable_type_enum.rb +53 -0
  265. data/lib/modern_treasury/models/transaction.rb +311 -0
  266. data/lib/modern_treasury/models/transaction_line_item.rb +211 -0
  267. data/lib/modern_treasury/models/type10_enum.rb +64 -0
  268. data/lib/modern_treasury/models/type11_enum.rb +97 -0
  269. data/lib/modern_treasury/models/type12_enum.rb +37 -0
  270. data/lib/modern_treasury/models/type13_enum.rb +96 -0
  271. data/lib/modern_treasury/models/type14_enum.rb +64 -0
  272. data/lib/modern_treasury/models/type16_enum.rb +36 -0
  273. data/lib/modern_treasury/models/type1_enum.rb +97 -0
  274. data/lib/modern_treasury/models/type4_enum.rb +65 -0
  275. data/lib/modern_treasury/models/type5_enum.rb +97 -0
  276. data/lib/modern_treasury/models/type6_enum.rb +77 -0
  277. data/lib/modern_treasury/models/type_enum.rb +37 -0
  278. data/lib/modern_treasury/models/vendor_code_type1_enum.rb +111 -0
  279. data/lib/modern_treasury/models/vendor_code_type_enum.rb +108 -0
  280. data/lib/modern_treasury/models/verification_status1_enum.rb +44 -0
  281. data/lib/modern_treasury/models/verification_status_enum.rb +40 -0
  282. data/lib/modern_treasury/models/virtual_account.rb +247 -0
  283. data/lib/modern_treasury/models/virtual_account_create_request.rb +172 -0
  284. data/lib/modern_treasury/models/virtual_account_update_request.rb +85 -0
  285. data/lib/modern_treasury/utilities/date_time_helper.rb +11 -0
  286. data/lib/modern_treasury/utilities/file_wrapper.rb +28 -0
  287. data/lib/modern_treasury/utilities/union_type_lookup.rb +32 -0
  288. data/lib/modern_treasury.rb +316 -0
  289. data/test/controllers/controller_test_base.rb +23 -0
  290. data/test/controllers/test_account_collection_flow_controller.rb +64 -0
  291. data/test/controllers/test_connection_controller.rb +41 -0
  292. data/test/controllers/test_counterparty_controller.rb +65 -0
  293. data/test/controllers/test_document_controller.rb +41 -0
  294. data/test/controllers/test_event_controller.rb +46 -0
  295. data/test/controllers/test_expected_payment_controller.rb +71 -0
  296. data/test/controllers/test_external_account_controller.rb +63 -0
  297. data/test/controllers/test_incoming_payment_detail_controller.rb +68 -0
  298. data/test/controllers/test_internal_account_controller.rb +65 -0
  299. data/test/controllers/test_invoice_controller.rb +56 -0
  300. data/test/controllers/test_ledger_account_category_controller.rb +67 -0
  301. data/test/controllers/test_ledger_account_controller.rb +70 -0
  302. data/test/controllers/test_ledger_account_payout_controller.rb +62 -0
  303. data/test/controllers/test_ledger_account_statement_controller.rb +36 -0
  304. data/test/controllers/test_ledger_controller.rb +59 -0
  305. data/test/controllers/test_ledger_entry_controller.rb +65 -0
  306. data/test/controllers/test_ledger_event_handler_controller.rb +63 -0
  307. data/test/controllers/test_ledger_transaction_controller.rb +112 -0
  308. data/test/controllers/test_ledgerable_event_controller.rb +36 -0
  309. data/test/controllers/test_paper_item_controller.rb +43 -0
  310. data/test/controllers/test_payment_flow_controller.rb +67 -0
  311. data/test/controllers/test_payment_order_controller.rb +76 -0
  312. data/test/controllers/test_payment_reference_controller.rb +43 -0
  313. data/test/controllers/test_ping_controller.rb +31 -0
  314. data/test/controllers/test_return_controller.rb +64 -0
  315. data/test/controllers/test_transaction_controller.rb +56 -0
  316. data/test/controllers/test_virtual_account_controller.rb +63 -0
  317. data/test/http_response_catcher.rb +19 -0
  318. metadata +429 -0
@@ -0,0 +1,343 @@
1
+ # modern_treasury
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module ModernTreasury
8
+ # ExpectedPayment Model.
9
+ class ExpectedPayment < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [UUID | String]
15
+ attr_accessor :id
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :object
20
+
21
+ # This field will be true if this object exists in the live environment or
22
+ # false if it exists in the test environment.
23
+ # @return [TrueClass | FalseClass]
24
+ attr_accessor :live_mode
25
+
26
+ # This field will be true if this object exists in the live environment or
27
+ # false if it exists in the test environment.
28
+ # @return [DateTime]
29
+ attr_accessor :created_at
30
+
31
+ # This field will be true if this object exists in the live environment or
32
+ # false if it exists in the test environment.
33
+ # @return [DateTime]
34
+ attr_accessor :updated_at
35
+
36
+ # The highest amount this expected payment may be equal to. Value in
37
+ # specified currency's smallest unit. e.g. $10 would be represented as 1000.
38
+ # @return [Integer]
39
+ attr_accessor :amount_upper_bound
40
+
41
+ # The lowest amount this expected payment may be equal to. Value in
42
+ # specified currency's smallest unit. e.g. $10 would be represented as 1000.
43
+ # @return [Integer]
44
+ attr_accessor :amount_lower_bound
45
+
46
+ # One of credit or debit. When you are receiving money, use credit. When you
47
+ # are being charged, use debit.
48
+ # @return [Direction1Enum]
49
+ attr_accessor :direction
50
+
51
+ # The ID of the Internal Account for the expected payment.
52
+ # @return [UUID | String]
53
+ attr_accessor :internal_account_id
54
+
55
+ # One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,
56
+ # sen, sepa, signet, wire.
57
+ # @return [Type1Enum]
58
+ attr_accessor :type
59
+
60
+ # Three-letter ISO currency code.
61
+ # @return [CurrencyEnum]
62
+ attr_accessor :currency
63
+
64
+ # The latest date the payment may come in. Format: yyyy-mm-dd
65
+ # @return [Date]
66
+ attr_accessor :date_upper_bound
67
+
68
+ # The earliest date the payment may come in. Format: yyyy-mm-dd
69
+ # @return [Date]
70
+ attr_accessor :date_lower_bound
71
+
72
+ # An optional description for internal use.
73
+ # @return [String]
74
+ attr_accessor :description
75
+
76
+ # The statement description you expect to see on the transaction. For ACH
77
+ # payments, this will be the full line item passed from the bank. For wire
78
+ # payments, this will be the OBI field on the wire. For check payments, this
79
+ # will be the memo field.
80
+ # @return [String]
81
+ attr_accessor :statement_descriptor
82
+
83
+ # Additional data represented as key-value pairs. Both the key and value
84
+ # must be strings.
85
+ # @return [Hash[String, String]]
86
+ attr_accessor :metadata
87
+
88
+ # The ID of the counterparty you expect for this payment.
89
+ # @return [UUID | String]
90
+ attr_accessor :counterparty_id
91
+
92
+ # For `ach`, this field will be passed through on an addenda record. For
93
+ # `wire` payments the field will be passed through as the "Originator to
94
+ # Beneficiary Information", also known as OBI or Fedwire tag 6000.
95
+ # @return [String]
96
+ attr_accessor :remittance_information
97
+
98
+ # The reconciliation groups you have for this payment.
99
+ # @return [Object]
100
+ attr_accessor :reconciliation_groups
101
+
102
+ # The reconciliation filters you have for this payment.
103
+ # @return [Object]
104
+ attr_accessor :reconciliation_filters
105
+
106
+ # The ID of the Transaction this expected payment object has been matched
107
+ # to.
108
+ # @return [UUID | String]
109
+ attr_accessor :transaction_id
110
+
111
+ # The ID of the Transaction Line Item this expected payment has been matched
112
+ # to.
113
+ # @return [UUID | String]
114
+ attr_accessor :transaction_line_item_id
115
+
116
+ # One of unreconciled, reconciled, or archived.
117
+ # @return [Status1Enum]
118
+ attr_accessor :status
119
+
120
+ # One of manual if this expected payment was manually reconciled in the
121
+ # dashboard, automatic if it was automatically reconciled by Modern
122
+ # Treasury, or null if it is unreconciled.
123
+ # @return [ReconciliationMethodEnum]
124
+ attr_accessor :reconciliation_method
125
+
126
+ # The ID of the ledger transaction linked to the expected payment.
127
+ # @return [UUID | String]
128
+ attr_accessor :ledger_transaction_id
129
+
130
+ # A mapping from model property names to API property names.
131
+ def self.names
132
+ @_hash = {} if @_hash.nil?
133
+ @_hash['id'] = 'id'
134
+ @_hash['object'] = 'object'
135
+ @_hash['live_mode'] = 'live_mode'
136
+ @_hash['created_at'] = 'created_at'
137
+ @_hash['updated_at'] = 'updated_at'
138
+ @_hash['amount_upper_bound'] = 'amount_upper_bound'
139
+ @_hash['amount_lower_bound'] = 'amount_lower_bound'
140
+ @_hash['direction'] = 'direction'
141
+ @_hash['internal_account_id'] = 'internal_account_id'
142
+ @_hash['type'] = 'type'
143
+ @_hash['currency'] = 'currency'
144
+ @_hash['date_upper_bound'] = 'date_upper_bound'
145
+ @_hash['date_lower_bound'] = 'date_lower_bound'
146
+ @_hash['description'] = 'description'
147
+ @_hash['statement_descriptor'] = 'statement_descriptor'
148
+ @_hash['metadata'] = 'metadata'
149
+ @_hash['counterparty_id'] = 'counterparty_id'
150
+ @_hash['remittance_information'] = 'remittance_information'
151
+ @_hash['reconciliation_groups'] = 'reconciliation_groups'
152
+ @_hash['reconciliation_filters'] = 'reconciliation_filters'
153
+ @_hash['transaction_id'] = 'transaction_id'
154
+ @_hash['transaction_line_item_id'] = 'transaction_line_item_id'
155
+ @_hash['status'] = 'status'
156
+ @_hash['reconciliation_method'] = 'reconciliation_method'
157
+ @_hash['ledger_transaction_id'] = 'ledger_transaction_id'
158
+ @_hash
159
+ end
160
+
161
+ # An array for optional fields
162
+ def self.optionals
163
+ []
164
+ end
165
+
166
+ # An array for nullable fields
167
+ def self.nullables
168
+ %w[
169
+ type
170
+ date_upper_bound
171
+ date_lower_bound
172
+ description
173
+ statement_descriptor
174
+ counterparty_id
175
+ remittance_information
176
+ reconciliation_groups
177
+ reconciliation_filters
178
+ transaction_id
179
+ transaction_line_item_id
180
+ reconciliation_method
181
+ ledger_transaction_id
182
+ ]
183
+ end
184
+
185
+ def initialize(id = nil, object = nil, live_mode = nil, created_at = nil,
186
+ updated_at = nil, amount_upper_bound = nil,
187
+ amount_lower_bound = nil, direction = nil,
188
+ internal_account_id = nil, type = nil, currency = nil,
189
+ date_upper_bound = nil, date_lower_bound = nil,
190
+ description = nil, statement_descriptor = nil,
191
+ metadata = nil, counterparty_id = nil,
192
+ remittance_information = nil, reconciliation_groups = nil,
193
+ reconciliation_filters = nil, transaction_id = nil,
194
+ transaction_line_item_id = nil, status = nil,
195
+ reconciliation_method = nil, ledger_transaction_id = nil)
196
+ @id = id
197
+ @object = object
198
+ @live_mode = live_mode
199
+ @created_at = created_at
200
+ @updated_at = updated_at
201
+ @amount_upper_bound = amount_upper_bound
202
+ @amount_lower_bound = amount_lower_bound
203
+ @direction = direction
204
+ @internal_account_id = internal_account_id
205
+ @type = type
206
+ @currency = currency
207
+ @date_upper_bound = date_upper_bound
208
+ @date_lower_bound = date_lower_bound
209
+ @description = description
210
+ @statement_descriptor = statement_descriptor
211
+ @metadata = metadata
212
+ @counterparty_id = counterparty_id
213
+ @remittance_information = remittance_information
214
+ @reconciliation_groups = reconciliation_groups
215
+ @reconciliation_filters = reconciliation_filters
216
+ @transaction_id = transaction_id
217
+ @transaction_line_item_id = transaction_line_item_id
218
+ @status = status
219
+ @reconciliation_method = reconciliation_method
220
+ @ledger_transaction_id = ledger_transaction_id
221
+ end
222
+
223
+ # Creates an instance of the object from a hash.
224
+ def self.from_hash(hash)
225
+ return nil unless hash
226
+
227
+ # Extract variables from the hash.
228
+ id = hash.key?('id') ? hash['id'] : nil
229
+ object = hash.key?('object') ? hash['object'] : nil
230
+ live_mode = hash.key?('live_mode') ? hash['live_mode'] : nil
231
+ created_at = if hash.key?('created_at')
232
+ (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
233
+ end
234
+ updated_at = if hash.key?('updated_at')
235
+ (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
236
+ end
237
+ amount_upper_bound =
238
+ hash.key?('amount_upper_bound') ? hash['amount_upper_bound'] : nil
239
+ amount_lower_bound =
240
+ hash.key?('amount_lower_bound') ? hash['amount_lower_bound'] : nil
241
+ direction = hash.key?('direction') ? hash['direction'] : nil
242
+ internal_account_id =
243
+ hash.key?('internal_account_id') ? hash['internal_account_id'] : nil
244
+ type = hash.key?('type') ? hash['type'] : nil
245
+ currency = hash.key?('currency') ? hash['currency'] : nil
246
+ date_upper_bound =
247
+ hash.key?('date_upper_bound') ? hash['date_upper_bound'] : nil
248
+ date_lower_bound =
249
+ hash.key?('date_lower_bound') ? hash['date_lower_bound'] : nil
250
+ description = hash.key?('description') ? hash['description'] : nil
251
+ statement_descriptor =
252
+ hash.key?('statement_descriptor') ? hash['statement_descriptor'] : nil
253
+ metadata = hash.key?('metadata') ? hash['metadata'] : nil
254
+ counterparty_id =
255
+ hash.key?('counterparty_id') ? hash['counterparty_id'] : nil
256
+ remittance_information =
257
+ hash.key?('remittance_information') ? hash['remittance_information'] : nil
258
+ reconciliation_groups =
259
+ hash.key?('reconciliation_groups') ? hash['reconciliation_groups'] : nil
260
+ reconciliation_filters =
261
+ hash.key?('reconciliation_filters') ? hash['reconciliation_filters'] : nil
262
+ transaction_id =
263
+ hash.key?('transaction_id') ? hash['transaction_id'] : nil
264
+ transaction_line_item_id =
265
+ hash.key?('transaction_line_item_id') ? hash['transaction_line_item_id'] : nil
266
+ status = hash.key?('status') ? hash['status'] : nil
267
+ reconciliation_method =
268
+ hash.key?('reconciliation_method') ? hash['reconciliation_method'] : nil
269
+ ledger_transaction_id =
270
+ hash.key?('ledger_transaction_id') ? hash['ledger_transaction_id'] : nil
271
+
272
+ # Create object from extracted values.
273
+ ExpectedPayment.new(id,
274
+ object,
275
+ live_mode,
276
+ created_at,
277
+ updated_at,
278
+ amount_upper_bound,
279
+ amount_lower_bound,
280
+ direction,
281
+ internal_account_id,
282
+ type,
283
+ currency,
284
+ date_upper_bound,
285
+ date_lower_bound,
286
+ description,
287
+ statement_descriptor,
288
+ metadata,
289
+ counterparty_id,
290
+ remittance_information,
291
+ reconciliation_groups,
292
+ reconciliation_filters,
293
+ transaction_id,
294
+ transaction_line_item_id,
295
+ status,
296
+ reconciliation_method,
297
+ ledger_transaction_id)
298
+ end
299
+
300
+ def to_custom_created_at
301
+ DateTimeHelper.to_rfc3339(created_at)
302
+ end
303
+
304
+ def to_custom_updated_at
305
+ DateTimeHelper.to_rfc3339(updated_at)
306
+ end
307
+
308
+ # Provides a human-readable string representation of the object.
309
+ def to_s
310
+ class_name = self.class.name.split('::').last
311
+ "<#{class_name} id: #{@id}, object: #{@object}, live_mode: #{@live_mode}, created_at:"\
312
+ " #{@created_at}, updated_at: #{@updated_at}, amount_upper_bound: #{@amount_upper_bound},"\
313
+ " amount_lower_bound: #{@amount_lower_bound}, direction: #{@direction}, internal_account_id:"\
314
+ " #{@internal_account_id}, type: #{@type}, currency: #{@currency}, date_upper_bound:"\
315
+ " #{@date_upper_bound}, date_lower_bound: #{@date_lower_bound}, description:"\
316
+ " #{@description}, statement_descriptor: #{@statement_descriptor}, metadata: #{@metadata},"\
317
+ " counterparty_id: #{@counterparty_id}, remittance_information: #{@remittance_information},"\
318
+ " reconciliation_groups: #{@reconciliation_groups}, reconciliation_filters:"\
319
+ " #{@reconciliation_filters}, transaction_id: #{@transaction_id}, transaction_line_item_id:"\
320
+ " #{@transaction_line_item_id}, status: #{@status}, reconciliation_method:"\
321
+ " #{@reconciliation_method}, ledger_transaction_id: #{@ledger_transaction_id}>"
322
+ end
323
+
324
+ # Provides a debugging-friendly string with detailed object information.
325
+ def inspect
326
+ class_name = self.class.name.split('::').last
327
+ "<#{class_name} id: #{@id.inspect}, object: #{@object.inspect}, live_mode:"\
328
+ " #{@live_mode.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
329
+ " #{@updated_at.inspect}, amount_upper_bound: #{@amount_upper_bound.inspect},"\
330
+ " amount_lower_bound: #{@amount_lower_bound.inspect}, direction: #{@direction.inspect},"\
331
+ " internal_account_id: #{@internal_account_id.inspect}, type: #{@type.inspect}, currency:"\
332
+ " #{@currency.inspect}, date_upper_bound: #{@date_upper_bound.inspect}, date_lower_bound:"\
333
+ " #{@date_lower_bound.inspect}, description: #{@description.inspect}, statement_descriptor:"\
334
+ " #{@statement_descriptor.inspect}, metadata: #{@metadata.inspect}, counterparty_id:"\
335
+ " #{@counterparty_id.inspect}, remittance_information: #{@remittance_information.inspect},"\
336
+ " reconciliation_groups: #{@reconciliation_groups.inspect}, reconciliation_filters:"\
337
+ " #{@reconciliation_filters.inspect}, transaction_id: #{@transaction_id.inspect},"\
338
+ " transaction_line_item_id: #{@transaction_line_item_id.inspect}, status:"\
339
+ " #{@status.inspect}, reconciliation_method: #{@reconciliation_method.inspect},"\
340
+ " ledger_transaction_id: #{@ledger_transaction_id.inspect}>"
341
+ end
342
+ end
343
+ end
@@ -0,0 +1,254 @@
1
+ # modern_treasury
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ModernTreasury
7
+ # ExpectedPaymentCreateRequest Model.
8
+ class ExpectedPaymentCreateRequest < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The highest amount this expected payment may be equal to. Value in
13
+ # specified currency's smallest unit. e.g. $10 would be represented as 1000.
14
+ # @return [Integer]
15
+ attr_accessor :amount_upper_bound
16
+
17
+ # The lowest amount this expected payment may be equal to. Value in
18
+ # specified currency's smallest unit. e.g. $10 would be represented as 1000.
19
+ # @return [Integer]
20
+ attr_accessor :amount_lower_bound
21
+
22
+ # One of credit or debit. When you are receiving money, use credit. When you
23
+ # are being charged, use debit.
24
+ # @return [Direction1Enum]
25
+ attr_accessor :direction
26
+
27
+ # The ID of the Internal Account for the expected payment.
28
+ # @return [UUID | String]
29
+ attr_accessor :internal_account_id
30
+
31
+ # One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,
32
+ # sen, sepa, signet, wire.
33
+ # @return [Type1Enum]
34
+ attr_accessor :type
35
+
36
+ # Three-letter ISO currency code.
37
+ # @return [CurrencyEnum]
38
+ attr_accessor :currency
39
+
40
+ # The latest date the payment may come in. Format: yyyy-mm-dd
41
+ # @return [Date]
42
+ attr_accessor :date_upper_bound
43
+
44
+ # The earliest date the payment may come in. Format: yyyy-mm-dd
45
+ # @return [Date]
46
+ attr_accessor :date_lower_bound
47
+
48
+ # An optional description for internal use.
49
+ # @return [String]
50
+ attr_accessor :description
51
+
52
+ # The statement description you expect to see on the transaction. For ACH
53
+ # payments, this will be the full line item passed from the bank. For wire
54
+ # payments, this will be the OBI field on the wire. For check payments, this
55
+ # will be the memo field.
56
+ # @return [String]
57
+ attr_accessor :statement_descriptor
58
+
59
+ # Additional data represented as key-value pairs. Both the key and value
60
+ # must be strings.
61
+ # @return [Hash[String, String]]
62
+ attr_accessor :metadata
63
+
64
+ # The ID of the counterparty you expect for this payment.
65
+ # @return [UUID | String]
66
+ attr_accessor :counterparty_id
67
+
68
+ # For `ach`, this field will be passed through on an addenda record. For
69
+ # `wire` payments the field will be passed through as the "Originator to
70
+ # Beneficiary Information", also known as OBI or Fedwire tag 6000.
71
+ # @return [String]
72
+ attr_accessor :remittance_information
73
+
74
+ # The reconciliation groups you have for this payment.
75
+ # @return [Object]
76
+ attr_accessor :reconciliation_groups
77
+
78
+ # The reconciliation filters you have for this payment.
79
+ # @return [Object]
80
+ attr_accessor :reconciliation_filters
81
+
82
+ # The reconciliation filters you have for this payment.
83
+ # @return [Array[LineItemRequest]]
84
+ attr_accessor :line_items
85
+
86
+ # A mapping from model property names to API property names.
87
+ def self.names
88
+ @_hash = {} if @_hash.nil?
89
+ @_hash['amount_upper_bound'] = 'amount_upper_bound'
90
+ @_hash['amount_lower_bound'] = 'amount_lower_bound'
91
+ @_hash['direction'] = 'direction'
92
+ @_hash['internal_account_id'] = 'internal_account_id'
93
+ @_hash['type'] = 'type'
94
+ @_hash['currency'] = 'currency'
95
+ @_hash['date_upper_bound'] = 'date_upper_bound'
96
+ @_hash['date_lower_bound'] = 'date_lower_bound'
97
+ @_hash['description'] = 'description'
98
+ @_hash['statement_descriptor'] = 'statement_descriptor'
99
+ @_hash['metadata'] = 'metadata'
100
+ @_hash['counterparty_id'] = 'counterparty_id'
101
+ @_hash['remittance_information'] = 'remittance_information'
102
+ @_hash['reconciliation_groups'] = 'reconciliation_groups'
103
+ @_hash['reconciliation_filters'] = 'reconciliation_filters'
104
+ @_hash['line_items'] = 'line_items'
105
+ @_hash
106
+ end
107
+
108
+ # An array for optional fields
109
+ def self.optionals
110
+ %w[
111
+ type
112
+ currency
113
+ date_upper_bound
114
+ date_lower_bound
115
+ description
116
+ statement_descriptor
117
+ metadata
118
+ counterparty_id
119
+ remittance_information
120
+ reconciliation_groups
121
+ reconciliation_filters
122
+ line_items
123
+ ]
124
+ end
125
+
126
+ # An array for nullable fields
127
+ def self.nullables
128
+ %w[
129
+ type
130
+ date_upper_bound
131
+ date_lower_bound
132
+ description
133
+ statement_descriptor
134
+ counterparty_id
135
+ remittance_information
136
+ reconciliation_groups
137
+ reconciliation_filters
138
+ ]
139
+ end
140
+
141
+ def initialize(amount_upper_bound = nil, amount_lower_bound = nil,
142
+ direction = nil, internal_account_id = nil, type = SKIP,
143
+ currency = SKIP, date_upper_bound = SKIP,
144
+ date_lower_bound = SKIP, description = SKIP,
145
+ statement_descriptor = SKIP, metadata = SKIP,
146
+ counterparty_id = SKIP, remittance_information = SKIP,
147
+ reconciliation_groups = SKIP, reconciliation_filters = SKIP,
148
+ line_items = SKIP)
149
+ @amount_upper_bound = amount_upper_bound
150
+ @amount_lower_bound = amount_lower_bound
151
+ @direction = direction
152
+ @internal_account_id = internal_account_id
153
+ @type = type unless type == SKIP
154
+ @currency = currency unless currency == SKIP
155
+ @date_upper_bound = date_upper_bound unless date_upper_bound == SKIP
156
+ @date_lower_bound = date_lower_bound unless date_lower_bound == SKIP
157
+ @description = description unless description == SKIP
158
+ @statement_descriptor = statement_descriptor unless statement_descriptor == SKIP
159
+ @metadata = metadata unless metadata == SKIP
160
+ @counterparty_id = counterparty_id unless counterparty_id == SKIP
161
+ @remittance_information = remittance_information unless remittance_information == SKIP
162
+ @reconciliation_groups = reconciliation_groups unless reconciliation_groups == SKIP
163
+ @reconciliation_filters = reconciliation_filters unless reconciliation_filters == SKIP
164
+ @line_items = line_items unless line_items == SKIP
165
+ end
166
+
167
+ # Creates an instance of the object from a hash.
168
+ def self.from_hash(hash)
169
+ return nil unless hash
170
+
171
+ # Extract variables from the hash.
172
+ amount_upper_bound =
173
+ hash.key?('amount_upper_bound') ? hash['amount_upper_bound'] : nil
174
+ amount_lower_bound =
175
+ hash.key?('amount_lower_bound') ? hash['amount_lower_bound'] : nil
176
+ direction = hash.key?('direction') ? hash['direction'] : nil
177
+ internal_account_id =
178
+ hash.key?('internal_account_id') ? hash['internal_account_id'] : nil
179
+ type = hash.key?('type') ? hash['type'] : SKIP
180
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
181
+ date_upper_bound =
182
+ hash.key?('date_upper_bound') ? hash['date_upper_bound'] : SKIP
183
+ date_lower_bound =
184
+ hash.key?('date_lower_bound') ? hash['date_lower_bound'] : SKIP
185
+ description = hash.key?('description') ? hash['description'] : SKIP
186
+ statement_descriptor =
187
+ hash.key?('statement_descriptor') ? hash['statement_descriptor'] : SKIP
188
+ metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
189
+ counterparty_id =
190
+ hash.key?('counterparty_id') ? hash['counterparty_id'] : SKIP
191
+ remittance_information =
192
+ hash.key?('remittance_information') ? hash['remittance_information'] : SKIP
193
+ reconciliation_groups =
194
+ hash.key?('reconciliation_groups') ? hash['reconciliation_groups'] : SKIP
195
+ reconciliation_filters =
196
+ hash.key?('reconciliation_filters') ? hash['reconciliation_filters'] : SKIP
197
+ # Parameter is an array, so we need to iterate through it
198
+ line_items = nil
199
+ unless hash['line_items'].nil?
200
+ line_items = []
201
+ hash['line_items'].each do |structure|
202
+ line_items << (LineItemRequest.from_hash(structure) if structure)
203
+ end
204
+ end
205
+
206
+ line_items = SKIP unless hash.key?('line_items')
207
+
208
+ # Create object from extracted values.
209
+ ExpectedPaymentCreateRequest.new(amount_upper_bound,
210
+ amount_lower_bound,
211
+ direction,
212
+ internal_account_id,
213
+ type,
214
+ currency,
215
+ date_upper_bound,
216
+ date_lower_bound,
217
+ description,
218
+ statement_descriptor,
219
+ metadata,
220
+ counterparty_id,
221
+ remittance_information,
222
+ reconciliation_groups,
223
+ reconciliation_filters,
224
+ line_items)
225
+ end
226
+
227
+ # Provides a human-readable string representation of the object.
228
+ def to_s
229
+ class_name = self.class.name.split('::').last
230
+ "<#{class_name} amount_upper_bound: #{@amount_upper_bound}, amount_lower_bound:"\
231
+ " #{@amount_lower_bound}, direction: #{@direction}, internal_account_id:"\
232
+ " #{@internal_account_id}, type: #{@type}, currency: #{@currency}, date_upper_bound:"\
233
+ " #{@date_upper_bound}, date_lower_bound: #{@date_lower_bound}, description:"\
234
+ " #{@description}, statement_descriptor: #{@statement_descriptor}, metadata: #{@metadata},"\
235
+ " counterparty_id: #{@counterparty_id}, remittance_information: #{@remittance_information},"\
236
+ " reconciliation_groups: #{@reconciliation_groups}, reconciliation_filters:"\
237
+ " #{@reconciliation_filters}, line_items: #{@line_items}>"
238
+ end
239
+
240
+ # Provides a debugging-friendly string with detailed object information.
241
+ def inspect
242
+ class_name = self.class.name.split('::').last
243
+ "<#{class_name} amount_upper_bound: #{@amount_upper_bound.inspect}, amount_lower_bound:"\
244
+ " #{@amount_lower_bound.inspect}, direction: #{@direction.inspect}, internal_account_id:"\
245
+ " #{@internal_account_id.inspect}, type: #{@type.inspect}, currency: #{@currency.inspect},"\
246
+ " date_upper_bound: #{@date_upper_bound.inspect}, date_lower_bound:"\
247
+ " #{@date_lower_bound.inspect}, description: #{@description.inspect}, statement_descriptor:"\
248
+ " #{@statement_descriptor.inspect}, metadata: #{@metadata.inspect}, counterparty_id:"\
249
+ " #{@counterparty_id.inspect}, remittance_information: #{@remittance_information.inspect},"\
250
+ " reconciliation_groups: #{@reconciliation_groups.inspect}, reconciliation_filters:"\
251
+ " #{@reconciliation_filters.inspect}, line_items: #{@line_items.inspect}>"
252
+ end
253
+ end
254
+ end