velopayments 2.14.90.pre.1 → 2.17.8.beta1

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 (394) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/Makefile +41 -9
  4. data/README.md +61 -23
  5. data/docs/AuthApi.md +8 -9
  6. data/docs/AuthResponse.md +3 -1
  7. data/docs/CompanyResponse.md +19 -0
  8. data/docs/{Company.md → CompanyV1.md} +2 -2
  9. data/docs/CreateIndividual.md +1 -1
  10. data/docs/CreateIndividual2.md +21 -0
  11. data/docs/CreatePayee.md +3 -3
  12. data/docs/CreatePayee2.md +37 -0
  13. data/docs/CreatePayeeAddress.md +1 -1
  14. data/docs/CreatePayeeAddress2.md +31 -0
  15. data/docs/CreatePayeesCSVRequest.md +1 -1
  16. data/docs/CreatePayeesCSVRequest2.md +73 -0
  17. data/docs/CreatePayeesCSVResponse2.md +19 -0
  18. data/docs/CreatePayeesRequest2.md +19 -0
  19. data/docs/CreatePaymentChannel2.md +29 -0
  20. data/docs/CreatePayoutRequest.md +6 -2
  21. data/docs/Error.md +23 -0
  22. data/docs/ErrorResponse.md +19 -0
  23. data/docs/FundingAudit.md +3 -1
  24. data/docs/FundingDelta.md +23 -0
  25. data/docs/FundingDeltaResponse.md +21 -0
  26. data/docs/FundingDeltaResponseLinks.md +19 -0
  27. data/docs/FundingEvent.md +3 -1
  28. data/docs/FundingManagerApi.md +33 -26
  29. data/docs/GetFundingsResponse.md +1 -1
  30. data/docs/GetFundingsResponseAllOf.md +1 -1
  31. data/docs/GetPaymentsForPayoutResponseV4.md +2 -2
  32. data/docs/GetPaymentsForPayoutResponseV4Summary.md +16 -0
  33. data/docs/GetPayoutsResponseV4.md +3 -3
  34. data/docs/IndividualResponse.md +17 -0
  35. data/docs/{Individual.md → IndividualV1.md} +5 -5
  36. data/docs/{IndividualName.md → IndividualV1Name.md} +2 -2
  37. data/docs/PagedPayeeInvitationStatusResponse.md +2 -2
  38. data/docs/PagedPayeeResponse.md +23 -0
  39. data/docs/PagedPayeeResponse2.md +23 -0
  40. data/docs/PagedPayeeResponse2Summary.md +25 -0
  41. data/docs/{PayeeResponseLinks.md → PagedPayeeResponseLinks.md} +2 -2
  42. data/docs/{PayeeResponsePage.md → PagedPayeeResponsePage.md} +2 -2
  43. data/docs/{PayeeResponseSummary.md → PagedPayeeResponseSummary.md} +2 -2
  44. data/docs/Payee.md +9 -9
  45. data/docs/{Address.md → PayeeAddress.md} +2 -2
  46. data/docs/PayeeDelta.md +1 -1
  47. data/docs/PayeeInvitationApi.md +109 -3
  48. data/docs/{PaymentChannel.md → PayeePaymentChannel.md} +2 -2
  49. data/docs/{PayorRef.md → PayeePayorRef.md} +2 -2
  50. data/docs/PayeePayorRef2.md +21 -0
  51. data/docs/PayeeResponse.md +40 -8
  52. data/docs/PayeeResponse2.md +55 -0
  53. data/docs/PayeesApi.md +133 -4
  54. data/docs/PaymentAuditServiceApi.md +70 -7
  55. data/docs/PaymentDelta.md +31 -0
  56. data/docs/PaymentDeltaResponse.md +21 -0
  57. data/docs/PaymentResponseV4.md +4 -2
  58. data/docs/PaymentResponseV4Payout.md +19 -0
  59. data/docs/PaymentStatus.md +16 -0
  60. data/docs/PayorAddress.md +31 -0
  61. data/docs/PayorAddressV2.md +31 -0
  62. data/docs/PayorV1.md +9 -7
  63. data/docs/PayorV2.md +9 -7
  64. data/docs/PayorsApi.md +8 -6
  65. data/docs/PayoutPayorV4.md +25 -0
  66. data/docs/PayoutPrincipalV4.md +19 -0
  67. data/docs/PayoutSummaryAuditV4.md +5 -3
  68. data/docs/PayoutTypeV4.md +16 -0
  69. data/docs/QuoteFxSummary.md +2 -2
  70. data/docs/UpdateRemoteIdRequest.md +19 -0
  71. data/docs/WatchlistStatus.md +16 -0
  72. data/lib/velopayments.rb +41 -12
  73. data/lib/velopayments/api/auth_api.rb +9 -16
  74. data/lib/velopayments/api/countries_api.rb +2 -2
  75. data/lib/velopayments/api/currencies_api.rb +2 -2
  76. data/lib/velopayments/api/funding_manager_api.rb +63 -55
  77. data/lib/velopayments/api/get_payout_api.rb +3 -3
  78. data/lib/velopayments/api/instruct_payout_api.rb +3 -3
  79. data/lib/velopayments/api/payee_invitation_api.rb +134 -8
  80. data/lib/velopayments/api/payees_api.rb +177 -9
  81. data/lib/velopayments/api/payment_audit_service_api.rb +95 -12
  82. data/lib/velopayments/api/payor_applications_api.rb +4 -4
  83. data/lib/velopayments/api/payors_api.rb +18 -19
  84. data/lib/velopayments/api/payout_history_api.rb +4 -4
  85. data/lib/velopayments/api/quote_payout_api.rb +3 -3
  86. data/lib/velopayments/api/submit_payout_api.rb +2 -2
  87. data/lib/velopayments/api/withdraw_payout_api.rb +3 -3
  88. data/lib/velopayments/api_client.rb +30 -30
  89. data/lib/velopayments/api_error.rb +2 -2
  90. data/lib/velopayments/configuration.rb +9 -2
  91. data/lib/velopayments/models/auth_response.rb +28 -7
  92. data/lib/velopayments/models/auto_top_up_config.rb +15 -3
  93. data/lib/velopayments/models/challenge.rb +13 -3
  94. data/lib/velopayments/models/company_response.rb +273 -0
  95. data/lib/velopayments/models/{company.rb → company_v1.rb} +18 -6
  96. data/lib/velopayments/models/create_individual.rb +14 -4
  97. data/lib/velopayments/models/create_individual2.rb +259 -0
  98. data/lib/velopayments/models/create_payee.rb +17 -5
  99. data/lib/velopayments/models/{payor_funding_bank_details_update.rb → create_payee2.rb} +153 -93
  100. data/lib/velopayments/models/create_payee_address.rb +19 -3
  101. data/lib/velopayments/models/create_payee_address2.rb +510 -0
  102. data/lib/velopayments/models/create_payees_csv_request.rb +14 -3
  103. data/lib/velopayments/models/create_payees_csv_request2.rb +1142 -0
  104. data/lib/velopayments/models/create_payees_csv_response.rb +13 -3
  105. data/lib/velopayments/models/create_payees_csv_response2.rb +217 -0
  106. data/lib/velopayments/models/create_payees_request.rb +13 -3
  107. data/lib/velopayments/models/create_payees_request2.rb +227 -0
  108. data/lib/velopayments/models/create_payment_channel.rb +13 -3
  109. data/lib/velopayments/models/create_payment_channel2.rb +418 -0
  110. data/lib/velopayments/models/create_payout_request.rb +36 -9
  111. data/lib/velopayments/models/error.rb +271 -0
  112. data/lib/velopayments/models/error_response.rb +222 -0
  113. data/lib/velopayments/models/failed_submission.rb +13 -3
  114. data/lib/velopayments/models/funding_audit.rb +38 -7
  115. data/lib/velopayments/models/funding_delta.rb +298 -0
  116. data/lib/velopayments/models/funding_delta_response.rb +229 -0
  117. data/lib/velopayments/models/funding_delta_response_links.rb +215 -0
  118. data/lib/velopayments/models/funding_event.rb +26 -7
  119. data/lib/velopayments/models/funding_event_type.rb +2 -2
  120. data/lib/velopayments/models/funding_request_v1.rb +13 -3
  121. data/lib/velopayments/models/funding_request_v2.rb +13 -3
  122. data/lib/velopayments/models/fx_summary_v3.rb +13 -3
  123. data/lib/velopayments/models/fx_summary_v4.rb +13 -3
  124. data/lib/velopayments/models/get_fundings_response.rb +17 -5
  125. data/lib/velopayments/models/get_fundings_response_all_of.rb +17 -5
  126. data/lib/velopayments/models/get_payments_for_payout_response_v3.rb +13 -3
  127. data/lib/velopayments/models/get_payments_for_payout_response_v3_page.rb +13 -3
  128. data/lib/velopayments/models/get_payments_for_payout_response_v3_summary.rb +13 -3
  129. data/lib/velopayments/models/get_payments_for_payout_response_v4.rb +15 -5
  130. data/lib/velopayments/models/get_payments_for_payout_response_v4_summary.rb +87 -4
  131. data/lib/velopayments/models/get_payout_statistics.rb +13 -3
  132. data/lib/velopayments/models/get_payouts_response_v3.rb +13 -3
  133. data/lib/velopayments/models/get_payouts_response_v3_links.rb +13 -3
  134. data/lib/velopayments/models/get_payouts_response_v3_page.rb +13 -3
  135. data/lib/velopayments/models/get_payouts_response_v3_summary.rb +13 -3
  136. data/lib/velopayments/models/get_payouts_response_v4.rb +16 -6
  137. data/lib/velopayments/models/individual_response.rb +211 -0
  138. data/lib/velopayments/models/{individual.rb → individual_v1.rb} +17 -7
  139. data/lib/velopayments/models/{individual_name.rb → individual_v1_name.rb} +16 -6
  140. data/lib/velopayments/models/invitation_status.rb +2 -2
  141. data/lib/velopayments/models/invitation_status_response.rb +13 -3
  142. data/lib/velopayments/models/invite_payee_request.rb +13 -3
  143. data/lib/velopayments/models/language.rb +2 -2
  144. data/lib/velopayments/models/list_payments_response.rb +13 -3
  145. data/lib/velopayments/models/list_payments_response_page.rb +13 -3
  146. data/lib/velopayments/models/list_payments_response_summary.rb +13 -3
  147. data/lib/velopayments/models/list_source_account_response.rb +13 -3
  148. data/lib/velopayments/models/list_source_account_response_links.rb +13 -3
  149. data/lib/velopayments/models/list_source_account_response_page.rb +13 -3
  150. data/lib/velopayments/models/list_source_account_response_v2.rb +13 -3
  151. data/lib/velopayments/models/list_source_account_response_v2_page.rb +13 -3
  152. data/lib/velopayments/models/marketing_opt_in.rb +13 -3
  153. data/lib/velopayments/models/notifications.rb +13 -3
  154. data/lib/velopayments/models/ofac_status.rb +2 -2
  155. data/lib/velopayments/models/onboarded_status.rb +2 -2
  156. data/lib/velopayments/models/paged_payee_invitation_status_response.rb +15 -5
  157. data/lib/velopayments/models/paged_payee_response.rb +238 -0
  158. data/lib/velopayments/models/paged_payee_response2.rb +238 -0
  159. data/lib/velopayments/models/paged_payee_response2_summary.rb +242 -0
  160. data/lib/velopayments/models/{payee_response_links.rb → paged_payee_response_links.rb} +16 -6
  161. data/lib/velopayments/models/{payee_response_page.rb → paged_payee_response_page.rb} +16 -6
  162. data/lib/velopayments/models/{payee_response_summary.rb → paged_payee_response_summary.rb} +16 -6
  163. data/lib/velopayments/models/paged_response.rb +13 -3
  164. data/lib/velopayments/models/paged_response_page.rb +13 -3
  165. data/lib/velopayments/models/payee.rb +24 -8
  166. data/lib/velopayments/models/{address.rb → payee_address.rb} +21 -6
  167. data/lib/velopayments/models/payee_delta.rb +14 -3
  168. data/lib/velopayments/models/payee_delta_response.rb +13 -3
  169. data/lib/velopayments/models/payee_delta_response_links.rb +13 -3
  170. data/lib/velopayments/models/payee_delta_response_page.rb +13 -3
  171. data/lib/velopayments/models/payee_invitation_status.rb +13 -3
  172. data/lib/velopayments/models/payee_invitation_status_response.rb +13 -3
  173. data/lib/velopayments/models/{payment_channel.rb → payee_payment_channel.rb} +16 -6
  174. data/lib/velopayments/models/{payor_ref.rb → payee_payor_ref.rb} +16 -6
  175. data/lib/velopayments/models/payee_payor_ref2.rb +224 -0
  176. data/lib/velopayments/models/payee_response.rb +192 -32
  177. data/lib/velopayments/models/payee_response2.rb +388 -0
  178. data/lib/velopayments/models/payee_type.rb +2 -2
  179. data/lib/velopayments/models/payment_audit_currency_v3.rb +2 -2
  180. data/lib/velopayments/models/payment_audit_currency_v4.rb +2 -2
  181. data/lib/velopayments/models/payment_channel_country.rb +13 -3
  182. data/lib/velopayments/models/payment_channel_rule.rb +13 -3
  183. data/lib/velopayments/models/payment_channel_rules_response.rb +13 -3
  184. data/lib/velopayments/models/payment_delta.rb +285 -0
  185. data/lib/velopayments/models/payment_delta_response.rb +229 -0
  186. data/lib/velopayments/models/payment_event_response_v3.rb +13 -3
  187. data/lib/velopayments/models/payment_event_response_v4.rb +13 -3
  188. data/lib/velopayments/models/payment_instruction.rb +13 -3
  189. data/lib/velopayments/models/payment_response_v3.rb +13 -3
  190. data/lib/velopayments/models/payment_response_v4.rb +27 -7
  191. data/lib/velopayments/models/payment_response_v4_payout.rb +215 -0
  192. data/lib/velopayments/models/payment_status.rb +42 -0
  193. data/lib/velopayments/models/payor_address.rb +493 -0
  194. data/lib/velopayments/models/payor_address_v2.rb +493 -0
  195. data/lib/velopayments/models/payor_branding_response.rb +16 -3
  196. data/lib/velopayments/models/payor_create_api_key_request.rb +14 -3
  197. data/lib/velopayments/models/payor_create_api_key_response.rb +13 -3
  198. data/lib/velopayments/models/payor_create_application_request.rb +14 -3
  199. data/lib/velopayments/models/payor_email_opt_out_request.rb +13 -3
  200. data/lib/velopayments/models/payor_links_response.rb +13 -3
  201. data/lib/velopayments/models/payor_links_response_links.rb +13 -3
  202. data/lib/velopayments/models/payor_links_response_payors.rb +13 -3
  203. data/lib/velopayments/models/payor_logo_request.rb +13 -3
  204. data/lib/velopayments/models/payor_v1.rb +27 -8
  205. data/lib/velopayments/models/payor_v2.rb +27 -8
  206. data/lib/velopayments/models/payout_payor_v4.rb +273 -0
  207. data/lib/velopayments/models/payout_principal_v4.rb +228 -0
  208. data/lib/velopayments/models/payout_status_v3.rb +2 -2
  209. data/lib/velopayments/models/payout_status_v4.rb +2 -2
  210. data/lib/velopayments/models/payout_summary_audit_v3.rb +13 -3
  211. data/lib/velopayments/models/payout_summary_audit_v4.rb +33 -8
  212. data/lib/velopayments/models/payout_summary_response.rb +13 -3
  213. data/lib/velopayments/models/payout_type_v4.rb +37 -0
  214. data/lib/velopayments/models/query_batch_response.rb +13 -3
  215. data/lib/velopayments/models/quote_fx_summary.rb +69 -3
  216. data/lib/velopayments/models/quote_response.rb +13 -3
  217. data/lib/velopayments/models/rejected_payment.rb +13 -3
  218. data/lib/velopayments/models/set_notifications_request.rb +13 -3
  219. data/lib/velopayments/models/source_account.rb +13 -3
  220. data/lib/velopayments/models/source_account_response.rb +15 -3
  221. data/lib/velopayments/models/source_account_response_v2.rb +15 -3
  222. data/lib/velopayments/models/source_account_summary_v3.rb +13 -3
  223. data/lib/velopayments/models/source_account_summary_v4.rb +13 -3
  224. data/lib/velopayments/models/supported_countries_response.rb +13 -3
  225. data/lib/velopayments/models/supported_country.rb +13 -3
  226. data/lib/velopayments/models/supported_currency.rb +13 -3
  227. data/lib/velopayments/models/supported_currency_response.rb +13 -3
  228. data/lib/velopayments/models/update_remote_id_request.rb +253 -0
  229. data/lib/velopayments/models/watchlist_status.rb +39 -0
  230. data/lib/velopayments/version.rb +3 -3
  231. data/oa3-config.json +2 -2
  232. data/spec/api/auth_api_spec.rb +3 -4
  233. data/spec/api/countries_api_spec.rb +2 -2
  234. data/spec/api/currencies_api_spec.rb +2 -2
  235. data/spec/api/funding_manager_api_spec.rb +17 -15
  236. data/spec/api/get_payout_api_spec.rb +2 -2
  237. data/spec/api/instruct_payout_api_spec.rb +2 -2
  238. data/spec/api/payee_invitation_api_spec.rb +27 -3
  239. data/spec/api/payees_api_spec.rb +39 -4
  240. data/spec/api/payment_audit_service_api_spec.rb +21 -5
  241. data/spec/api/payor_applications_api_spec.rb +2 -2
  242. data/spec/api/payors_api_spec.rb +5 -4
  243. data/spec/api/payout_history_api_spec.rb +2 -2
  244. data/spec/api/quote_payout_api_spec.rb +2 -2
  245. data/spec/api/submit_payout_api_spec.rb +2 -2
  246. data/spec/api/withdraw_payout_api_spec.rb +2 -2
  247. data/spec/api_client_spec.rb +3 -3
  248. data/spec/configuration_spec.rb +2 -2
  249. data/spec/models/auth_response_spec.rb +8 -2
  250. data/spec/models/auto_top_up_config_spec.rb +2 -2
  251. data/spec/models/challenge_spec.rb +2 -2
  252. data/spec/models/company_response_spec.rb +47 -0
  253. data/spec/models/{company_spec.rb → company_v1_spec.rb} +8 -8
  254. data/spec/models/{payor_funding_bank_details_update_spec.rb → create_individual2_spec.rb} +11 -11
  255. data/spec/models/create_individual_spec.rb +2 -2
  256. data/spec/models/create_payee2_spec.rb +101 -0
  257. data/spec/models/create_payee_address2_spec.rb +87 -0
  258. data/spec/models/create_payee_address_spec.rb +2 -2
  259. data/spec/models/create_payee_spec.rb +2 -2
  260. data/spec/models/create_payees_csv_request2_spec.rb +225 -0
  261. data/spec/models/create_payees_csv_request_spec.rb +2 -2
  262. data/spec/models/create_payees_csv_response2_spec.rb +47 -0
  263. data/spec/models/create_payees_csv_response_spec.rb +2 -2
  264. data/spec/models/create_payees_request2_spec.rb +47 -0
  265. data/spec/models/create_payees_request_spec.rb +2 -2
  266. data/spec/models/create_payment_channel2_spec.rb +85 -0
  267. data/spec/models/create_payment_channel_spec.rb +2 -2
  268. data/spec/models/create_payout_request_spec.rb +14 -2
  269. data/spec/models/error_response_spec.rb +47 -0
  270. data/spec/models/error_spec.rb +63 -0
  271. data/spec/models/failed_submission_spec.rb +2 -2
  272. data/spec/models/funding_audit_spec.rb +12 -2
  273. data/spec/models/funding_delta_response_links_spec.rb +47 -0
  274. data/spec/models/funding_delta_response_spec.rb +53 -0
  275. data/spec/models/funding_delta_spec.rb +59 -0
  276. data/spec/models/funding_event_spec.rb +8 -2
  277. data/spec/models/funding_event_type_spec.rb +2 -2
  278. data/spec/models/funding_request_v1_spec.rb +2 -2
  279. data/spec/models/funding_request_v2_spec.rb +2 -2
  280. data/spec/models/fx_summary_v3_spec.rb +2 -2
  281. data/spec/models/fx_summary_v4_spec.rb +2 -2
  282. data/spec/models/get_fundings_response_all_of_spec.rb +2 -2
  283. data/spec/models/get_fundings_response_spec.rb +2 -2
  284. data/spec/models/get_payments_for_payout_response_v3_page_spec.rb +2 -2
  285. data/spec/models/get_payments_for_payout_response_v3_spec.rb +2 -2
  286. data/spec/models/get_payments_for_payout_response_v3_summary_spec.rb +2 -2
  287. data/spec/models/get_payments_for_payout_response_v4_spec.rb +2 -2
  288. data/spec/models/get_payments_for_payout_response_v4_summary_spec.rb +50 -2
  289. data/spec/models/get_payout_statistics_spec.rb +2 -2
  290. data/spec/models/get_payouts_response_v3_links_spec.rb +2 -2
  291. data/spec/models/get_payouts_response_v3_page_spec.rb +2 -2
  292. data/spec/models/get_payouts_response_v3_spec.rb +2 -2
  293. data/spec/models/get_payouts_response_v3_summary_spec.rb +2 -2
  294. data/spec/models/get_payouts_response_v4_spec.rb +2 -2
  295. data/spec/models/individual_response_spec.rb +41 -0
  296. data/spec/models/{individual_name_spec.rb → individual_v1_name_spec.rb} +8 -8
  297. data/spec/models/{individual_spec.rb → individual_v1_spec.rb} +8 -8
  298. data/spec/models/invitation_status_response_spec.rb +2 -2
  299. data/spec/models/invitation_status_spec.rb +2 -2
  300. data/spec/models/invite_payee_request_spec.rb +2 -2
  301. data/spec/models/language_spec.rb +2 -2
  302. data/spec/models/list_payments_response_page_spec.rb +2 -2
  303. data/spec/models/list_payments_response_spec.rb +2 -2
  304. data/spec/models/list_payments_response_summary_spec.rb +2 -2
  305. data/spec/models/list_source_account_response_links_spec.rb +2 -2
  306. data/spec/models/list_source_account_response_page_spec.rb +2 -2
  307. data/spec/models/list_source_account_response_spec.rb +2 -2
  308. data/spec/models/list_source_account_response_v2_page_spec.rb +2 -2
  309. data/spec/models/list_source_account_response_v2_spec.rb +2 -2
  310. data/spec/models/marketing_opt_in_spec.rb +2 -2
  311. data/spec/models/notifications_spec.rb +2 -2
  312. data/spec/models/ofac_status_spec.rb +2 -2
  313. data/spec/models/onboarded_status_spec.rb +2 -2
  314. data/spec/models/paged_payee_invitation_status_response_spec.rb +2 -2
  315. data/spec/models/paged_payee_response2_spec.rb +59 -0
  316. data/spec/models/paged_payee_response2_summary_spec.rb +65 -0
  317. data/spec/models/{payee_response_links_spec.rb → paged_payee_response_links_spec.rb} +8 -8
  318. data/spec/models/{payee_response_page_spec.rb → paged_payee_response_page_spec.rb} +8 -8
  319. data/spec/models/paged_payee_response_spec.rb +59 -0
  320. data/spec/models/{payee_response_summary_spec.rb → paged_payee_response_summary_spec.rb} +8 -8
  321. data/spec/models/paged_response_page_spec.rb +2 -2
  322. data/spec/models/paged_response_spec.rb +2 -2
  323. data/spec/models/{address_spec.rb → payee_address_spec.rb} +8 -8
  324. data/spec/models/payee_delta_response_links_spec.rb +2 -2
  325. data/spec/models/payee_delta_response_page_spec.rb +2 -2
  326. data/spec/models/payee_delta_response_spec.rb +2 -2
  327. data/spec/models/payee_delta_spec.rb +2 -2
  328. data/spec/models/payee_invitation_status_response_spec.rb +2 -2
  329. data/spec/models/payee_invitation_status_spec.rb +2 -2
  330. data/spec/models/{payment_channel_spec.rb → payee_payment_channel_spec.rb} +8 -8
  331. data/spec/models/payee_payor_ref2_spec.rb +53 -0
  332. data/spec/models/{payor_ref_spec.rb → payee_payor_ref_spec.rb} +8 -8
  333. data/spec/models/payee_response2_spec.rb +155 -0
  334. data/spec/models/payee_response_spec.rb +102 -6
  335. data/spec/models/payee_spec.rb +2 -2
  336. data/spec/models/payee_type_spec.rb +2 -2
  337. data/spec/models/payment_audit_currency_v3_spec.rb +2 -2
  338. data/spec/models/payment_audit_currency_v4_spec.rb +2 -2
  339. data/spec/models/payment_channel_country_spec.rb +2 -2
  340. data/spec/models/payment_channel_rule_spec.rb +2 -2
  341. data/spec/models/payment_channel_rules_response_spec.rb +2 -2
  342. data/spec/models/payment_delta_response_spec.rb +53 -0
  343. data/spec/models/payment_delta_spec.rb +83 -0
  344. data/spec/models/payment_event_response_v3_spec.rb +2 -2
  345. data/spec/models/payment_event_response_v4_spec.rb +2 -2
  346. data/spec/models/payment_instruction_spec.rb +2 -2
  347. data/spec/models/payment_response_v3_spec.rb +2 -2
  348. data/spec/models/payment_response_v4_payout_spec.rb +47 -0
  349. data/spec/models/payment_response_v4_spec.rb +8 -2
  350. data/spec/models/payment_status_spec.rb +35 -0
  351. data/spec/models/payor_address_spec.rb +83 -0
  352. data/spec/models/payor_address_v2_spec.rb +83 -0
  353. data/spec/models/payor_branding_response_spec.rb +2 -2
  354. data/spec/models/payor_create_api_key_request_spec.rb +2 -2
  355. data/spec/models/payor_create_api_key_response_spec.rb +2 -2
  356. data/spec/models/payor_create_application_request_spec.rb +2 -2
  357. data/spec/models/payor_email_opt_out_request_spec.rb +2 -2
  358. data/spec/models/payor_links_response_links_spec.rb +2 -2
  359. data/spec/models/payor_links_response_payors_spec.rb +2 -2
  360. data/spec/models/payor_links_response_spec.rb +2 -2
  361. data/spec/models/payor_logo_request_spec.rb +2 -2
  362. data/spec/models/payor_v1_spec.rb +8 -2
  363. data/spec/models/payor_v2_spec.rb +8 -2
  364. data/spec/models/payout_payor_v4_spec.rb +65 -0
  365. data/spec/models/payout_principal_v4_spec.rb +47 -0
  366. data/spec/models/payout_status_v3_spec.rb +2 -2
  367. data/spec/models/payout_status_v4_spec.rb +2 -2
  368. data/spec/models/payout_summary_audit_v3_spec.rb +2 -2
  369. data/spec/models/payout_summary_audit_v4_spec.rb +8 -2
  370. data/spec/models/payout_summary_response_spec.rb +2 -2
  371. data/spec/models/payout_type_v4_spec.rb +35 -0
  372. data/spec/models/query_batch_response_spec.rb +2 -2
  373. data/spec/models/quote_fx_summary_spec.rb +10 -2
  374. data/spec/models/quote_response_spec.rb +2 -2
  375. data/spec/models/rejected_payment_spec.rb +2 -2
  376. data/spec/models/set_notifications_request_spec.rb +2 -2
  377. data/spec/models/source_account_response_spec.rb +2 -2
  378. data/spec/models/source_account_response_v2_spec.rb +2 -2
  379. data/spec/models/source_account_spec.rb +2 -2
  380. data/spec/models/source_account_summary_v3_spec.rb +2 -2
  381. data/spec/models/source_account_summary_v4_spec.rb +2 -2
  382. data/spec/models/supported_countries_response_spec.rb +2 -2
  383. data/spec/models/supported_country_spec.rb +2 -2
  384. data/spec/models/supported_currency_response_spec.rb +2 -2
  385. data/spec/models/supported_currency_spec.rb +2 -2
  386. data/spec/models/update_remote_id_request_spec.rb +47 -0
  387. data/spec/models/watchlist_status_spec.rb +35 -0
  388. data/spec/spec_helper.rb +2 -2
  389. data/velopayments.gemspec +2 -8
  390. metadata +252 -259
  391. data/Gemfile.lock +0 -79
  392. data/docs/PayorFundingBankDetailsUpdate.md +0 -21
  393. data/velopayments-2.11.73.gem +0 -0
  394. data/velopayments-2.14.90.gem +0 -0
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #Velo Payments APIs
3
+
4
+ ### Terms and Definitions Throughout this document and the Velo platform the following terms are used: * **Payor.** An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout. * **Payee.** The recipient of funds paid out by a payor. * **Payment.** A single transfer of funds from a payor to a payee. * **Payout.** A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee. * **Sandbox.** An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking. ## Overview The Velo Payments API allows a payor to perform a number of operations. The following is a list of the main capabilities in a natural order of execution: * Authenticate with the Velo platform * Maintain a collection of payees * Query the payor’s current balance of funds within the platform and perform additional funding * Issue payments to payees * Query the platform for a history of those payments This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference. ## API Considerations The Velo Payments API is REST based and uses the JSON format for requests and responses. Most calls are secured using OAuth 2 security and require a valid authentication access token for successful operation. See the Authentication section for details. Where a dynamic value is required in the examples below, the {token} format is used, suggesting that the caller needs to supply the appropriate value of the token in question (without including the { or } characters). Where curl examples are given, the –d @filename.json approach is used, indicating that the request body should be placed into a file named filename.json in the current directory. Each of the curl examples in this document should be considered a single line on the command-line, regardless of how they appear in print. ## Authenticating with the Velo Platform Once Velo backoffice staff have added your organization as a payor within the Velo platform sandbox, they will create you a payor Id, an API key and an API secret and share these with you in a secure manner. You will need to use these values to authenticate with the Velo platform in order to gain access to the APIs. The steps to take are explained in the following: create a string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529 base64 encode this string. E.g.: NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== create an HTTP **Authorization** header with the value set to e.g. Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== perform the Velo authentication REST call using the HTTP header created above e.g. via curl: ``` curl -X POST \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ==\" \\ 'https://api.sandbox.velopayments.com/v1/authenticate?grant_type=client_credentials' ``` If successful, this call will result in a **200** HTTP status code and a response body such as: ``` { \"access_token\":\"19f6bafd-93fd-4747-b229-00507bbc991f\", \"token_type\":\"bearer\", \"expires_in\":1799, \"scope\":\"...\" } ``` ## API access following authentication Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated. This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below: ``` -H \"Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f \" ``` If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.
5
+
6
+ The version of the OpenAPI document: 2.17.8
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module VeloPayments
16
+ class PaymentStatus
17
+ SUBMITTED = "SUBMITTED".freeze
18
+ ACCEPTED = "ACCEPTED".freeze
19
+ AWAITING_FUNDS = "AWAITING_FUNDS".freeze
20
+ ACCEPTED_BY_RAILS = "ACCEPTED_BY_RAILS".freeze
21
+ CONFIRMED = "CONFIRMED".freeze
22
+ REJECTED = "REJECTED".freeze
23
+ RETURNED = "RETURNED".freeze
24
+ WITHDRAWN = "WITHDRAWN".freeze
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ constantValues = PaymentStatus.constants.select { |c| PaymentStatus::const_get(c) == value }
38
+ raise "Invalid ENUM value #{value} for class #PaymentStatus" if constantValues.empty?
39
+ value
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,493 @@
1
+ =begin
2
+ #Velo Payments APIs
3
+
4
+ ### Terms and Definitions Throughout this document and the Velo platform the following terms are used: * **Payor.** An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout. * **Payee.** The recipient of funds paid out by a payor. * **Payment.** A single transfer of funds from a payor to a payee. * **Payout.** A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee. * **Sandbox.** An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking. ## Overview The Velo Payments API allows a payor to perform a number of operations. The following is a list of the main capabilities in a natural order of execution: * Authenticate with the Velo platform * Maintain a collection of payees * Query the payor’s current balance of funds within the platform and perform additional funding * Issue payments to payees * Query the platform for a history of those payments This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference. ## API Considerations The Velo Payments API is REST based and uses the JSON format for requests and responses. Most calls are secured using OAuth 2 security and require a valid authentication access token for successful operation. See the Authentication section for details. Where a dynamic value is required in the examples below, the {token} format is used, suggesting that the caller needs to supply the appropriate value of the token in question (without including the { or } characters). Where curl examples are given, the –d @filename.json approach is used, indicating that the request body should be placed into a file named filename.json in the current directory. Each of the curl examples in this document should be considered a single line on the command-line, regardless of how they appear in print. ## Authenticating with the Velo Platform Once Velo backoffice staff have added your organization as a payor within the Velo platform sandbox, they will create you a payor Id, an API key and an API secret and share these with you in a secure manner. You will need to use these values to authenticate with the Velo platform in order to gain access to the APIs. The steps to take are explained in the following: create a string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529 base64 encode this string. E.g.: NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== create an HTTP **Authorization** header with the value set to e.g. Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== perform the Velo authentication REST call using the HTTP header created above e.g. via curl: ``` curl -X POST \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ==\" \\ 'https://api.sandbox.velopayments.com/v1/authenticate?grant_type=client_credentials' ``` If successful, this call will result in a **200** HTTP status code and a response body such as: ``` { \"access_token\":\"19f6bafd-93fd-4747-b229-00507bbc991f\", \"token_type\":\"bearer\", \"expires_in\":1799, \"scope\":\"...\" } ``` ## API access following authentication Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated. This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below: ``` -H \"Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f \" ``` If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.
5
+
6
+ The version of the OpenAPI document: 2.17.8
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module VeloPayments
16
+ class PayorAddress
17
+ attr_accessor :line1
18
+
19
+ attr_accessor :line2
20
+
21
+ attr_accessor :line3
22
+
23
+ attr_accessor :line4
24
+
25
+ attr_accessor :city
26
+
27
+ attr_accessor :county_or_province
28
+
29
+ attr_accessor :zip_or_postcode
30
+
31
+ attr_accessor :country
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'line1' => :'line1',
37
+ :'line2' => :'line2',
38
+ :'line3' => :'line3',
39
+ :'line4' => :'line4',
40
+ :'city' => :'city',
41
+ :'county_or_province' => :'countyOrProvince',
42
+ :'zip_or_postcode' => :'zipOrPostcode',
43
+ :'country' => :'country'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'line1' => :'String',
51
+ :'line2' => :'String',
52
+ :'line3' => :'String',
53
+ :'line4' => :'String',
54
+ :'city' => :'String',
55
+ :'county_or_province' => :'String',
56
+ :'zip_or_postcode' => :'String',
57
+ :'country' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'line2',
65
+ :'line3',
66
+ :'line4',
67
+ :'county_or_province',
68
+ :'zip_or_postcode',
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VeloPayments::PayorAddress` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!self.class.attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VeloPayments::PayorAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'line1')
88
+ self.line1 = attributes[:'line1']
89
+ end
90
+
91
+ if attributes.key?(:'line2')
92
+ self.line2 = attributes[:'line2']
93
+ end
94
+
95
+ if attributes.key?(:'line3')
96
+ self.line3 = attributes[:'line3']
97
+ end
98
+
99
+ if attributes.key?(:'line4')
100
+ self.line4 = attributes[:'line4']
101
+ end
102
+
103
+ if attributes.key?(:'city')
104
+ self.city = attributes[:'city']
105
+ end
106
+
107
+ if attributes.key?(:'county_or_province')
108
+ self.county_or_province = attributes[:'county_or_province']
109
+ end
110
+
111
+ if attributes.key?(:'zip_or_postcode')
112
+ self.zip_or_postcode = attributes[:'zip_or_postcode']
113
+ end
114
+
115
+ if attributes.key?(:'country')
116
+ self.country = attributes[:'country']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ invalid_properties = Array.new
124
+ if @line1.nil?
125
+ invalid_properties.push('invalid value for "line1", line1 cannot be nil.')
126
+ end
127
+
128
+ if @line1.to_s.length > 255
129
+ invalid_properties.push('invalid value for "line1", the character length must be smaller than or equal to 255.')
130
+ end
131
+
132
+ if @line1.to_s.length < 2
133
+ invalid_properties.push('invalid value for "line1", the character length must be great than or equal to 2.')
134
+ end
135
+
136
+ if !@line2.nil? && @line2.to_s.length > 255
137
+ invalid_properties.push('invalid value for "line2", the character length must be smaller than or equal to 255.')
138
+ end
139
+
140
+ if !@line2.nil? && @line2.to_s.length < 0
141
+ invalid_properties.push('invalid value for "line2", the character length must be great than or equal to 0.')
142
+ end
143
+
144
+ if !@line3.nil? && @line3.to_s.length > 255
145
+ invalid_properties.push('invalid value for "line3", the character length must be smaller than or equal to 255.')
146
+ end
147
+
148
+ if !@line3.nil? && @line3.to_s.length < 0
149
+ invalid_properties.push('invalid value for "line3", the character length must be great than or equal to 0.')
150
+ end
151
+
152
+ if !@line4.nil? && @line4.to_s.length > 255
153
+ invalid_properties.push('invalid value for "line4", the character length must be smaller than or equal to 255.')
154
+ end
155
+
156
+ if !@line4.nil? && @line4.to_s.length < 0
157
+ invalid_properties.push('invalid value for "line4", the character length must be great than or equal to 0.')
158
+ end
159
+
160
+ if @city.nil?
161
+ invalid_properties.push('invalid value for "city", city cannot be nil.')
162
+ end
163
+
164
+ if @city.to_s.length > 100
165
+ invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 100.')
166
+ end
167
+
168
+ if @city.to_s.length < 2
169
+ invalid_properties.push('invalid value for "city", the character length must be great than or equal to 2.')
170
+ end
171
+
172
+ if !@county_or_province.nil? && @county_or_province.to_s.length > 100
173
+ invalid_properties.push('invalid value for "county_or_province", the character length must be smaller than or equal to 100.')
174
+ end
175
+
176
+ if !@county_or_province.nil? && @county_or_province.to_s.length < 2
177
+ invalid_properties.push('invalid value for "county_or_province", the character length must be great than or equal to 2.')
178
+ end
179
+
180
+ if !@zip_or_postcode.nil? && @zip_or_postcode.to_s.length > 30
181
+ invalid_properties.push('invalid value for "zip_or_postcode", the character length must be smaller than or equal to 30.')
182
+ end
183
+
184
+ if !@zip_or_postcode.nil? && @zip_or_postcode.to_s.length < 2
185
+ invalid_properties.push('invalid value for "zip_or_postcode", the character length must be great than or equal to 2.')
186
+ end
187
+
188
+ if @country.nil?
189
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
190
+ end
191
+
192
+ if @country.to_s.length > 50
193
+ invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 50.')
194
+ end
195
+
196
+ if @country.to_s.length < 2
197
+ invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.')
198
+ end
199
+
200
+ invalid_properties
201
+ end
202
+
203
+ # Check to see if the all the properties in the model are valid
204
+ # @return true if the model is valid
205
+ def valid?
206
+ return false if @line1.nil?
207
+ return false if @line1.to_s.length > 255
208
+ return false if @line1.to_s.length < 2
209
+ return false if !@line2.nil? && @line2.to_s.length > 255
210
+ return false if !@line2.nil? && @line2.to_s.length < 0
211
+ return false if !@line3.nil? && @line3.to_s.length > 255
212
+ return false if !@line3.nil? && @line3.to_s.length < 0
213
+ return false if !@line4.nil? && @line4.to_s.length > 255
214
+ return false if !@line4.nil? && @line4.to_s.length < 0
215
+ return false if @city.nil?
216
+ return false if @city.to_s.length > 100
217
+ return false if @city.to_s.length < 2
218
+ return false if !@county_or_province.nil? && @county_or_province.to_s.length > 100
219
+ return false if !@county_or_province.nil? && @county_or_province.to_s.length < 2
220
+ return false if !@zip_or_postcode.nil? && @zip_or_postcode.to_s.length > 30
221
+ return false if !@zip_or_postcode.nil? && @zip_or_postcode.to_s.length < 2
222
+ return false if @country.nil?
223
+ return false if @country.to_s.length > 50
224
+ return false if @country.to_s.length < 2
225
+ true
226
+ end
227
+
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] line1 Value to be assigned
230
+ def line1=(line1)
231
+ if line1.nil?
232
+ fail ArgumentError, 'line1 cannot be nil'
233
+ end
234
+
235
+ if line1.to_s.length > 255
236
+ fail ArgumentError, 'invalid value for "line1", the character length must be smaller than or equal to 255.'
237
+ end
238
+
239
+ if line1.to_s.length < 2
240
+ fail ArgumentError, 'invalid value for "line1", the character length must be great than or equal to 2.'
241
+ end
242
+
243
+ @line1 = line1
244
+ end
245
+
246
+ # Custom attribute writer method with validation
247
+ # @param [Object] line2 Value to be assigned
248
+ def line2=(line2)
249
+ if !line2.nil? && line2.to_s.length > 255
250
+ fail ArgumentError, 'invalid value for "line2", the character length must be smaller than or equal to 255.'
251
+ end
252
+
253
+ if !line2.nil? && line2.to_s.length < 0
254
+ fail ArgumentError, 'invalid value for "line2", the character length must be great than or equal to 0.'
255
+ end
256
+
257
+ @line2 = line2
258
+ end
259
+
260
+ # Custom attribute writer method with validation
261
+ # @param [Object] line3 Value to be assigned
262
+ def line3=(line3)
263
+ if !line3.nil? && line3.to_s.length > 255
264
+ fail ArgumentError, 'invalid value for "line3", the character length must be smaller than or equal to 255.'
265
+ end
266
+
267
+ if !line3.nil? && line3.to_s.length < 0
268
+ fail ArgumentError, 'invalid value for "line3", the character length must be great than or equal to 0.'
269
+ end
270
+
271
+ @line3 = line3
272
+ end
273
+
274
+ # Custom attribute writer method with validation
275
+ # @param [Object] line4 Value to be assigned
276
+ def line4=(line4)
277
+ if !line4.nil? && line4.to_s.length > 255
278
+ fail ArgumentError, 'invalid value for "line4", the character length must be smaller than or equal to 255.'
279
+ end
280
+
281
+ if !line4.nil? && line4.to_s.length < 0
282
+ fail ArgumentError, 'invalid value for "line4", the character length must be great than or equal to 0.'
283
+ end
284
+
285
+ @line4 = line4
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] city Value to be assigned
290
+ def city=(city)
291
+ if city.nil?
292
+ fail ArgumentError, 'city cannot be nil'
293
+ end
294
+
295
+ if city.to_s.length > 100
296
+ fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 100.'
297
+ end
298
+
299
+ if city.to_s.length < 2
300
+ fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 2.'
301
+ end
302
+
303
+ @city = city
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] county_or_province Value to be assigned
308
+ def county_or_province=(county_or_province)
309
+ if !county_or_province.nil? && county_or_province.to_s.length > 100
310
+ fail ArgumentError, 'invalid value for "county_or_province", the character length must be smaller than or equal to 100.'
311
+ end
312
+
313
+ if !county_or_province.nil? && county_or_province.to_s.length < 2
314
+ fail ArgumentError, 'invalid value for "county_or_province", the character length must be great than or equal to 2.'
315
+ end
316
+
317
+ @county_or_province = county_or_province
318
+ end
319
+
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] zip_or_postcode Value to be assigned
322
+ def zip_or_postcode=(zip_or_postcode)
323
+ if !zip_or_postcode.nil? && zip_or_postcode.to_s.length > 30
324
+ fail ArgumentError, 'invalid value for "zip_or_postcode", the character length must be smaller than or equal to 30.'
325
+ end
326
+
327
+ if !zip_or_postcode.nil? && zip_or_postcode.to_s.length < 2
328
+ fail ArgumentError, 'invalid value for "zip_or_postcode", the character length must be great than or equal to 2.'
329
+ end
330
+
331
+ @zip_or_postcode = zip_or_postcode
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] country Value to be assigned
336
+ def country=(country)
337
+ if country.nil?
338
+ fail ArgumentError, 'country cannot be nil'
339
+ end
340
+
341
+ if country.to_s.length > 50
342
+ fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 50.'
343
+ end
344
+
345
+ if country.to_s.length < 2
346
+ fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.'
347
+ end
348
+
349
+ @country = country
350
+ end
351
+
352
+ # Checks equality by comparing each attribute.
353
+ # @param [Object] Object to be compared
354
+ def ==(o)
355
+ return true if self.equal?(o)
356
+ self.class == o.class &&
357
+ line1 == o.line1 &&
358
+ line2 == o.line2 &&
359
+ line3 == o.line3 &&
360
+ line4 == o.line4 &&
361
+ city == o.city &&
362
+ county_or_province == o.county_or_province &&
363
+ zip_or_postcode == o.zip_or_postcode &&
364
+ country == o.country
365
+ end
366
+
367
+ # @see the `==` method
368
+ # @param [Object] Object to be compared
369
+ def eql?(o)
370
+ self == o
371
+ end
372
+
373
+ # Calculates hash code according to all attributes.
374
+ # @return [Integer] Hash code
375
+ def hash
376
+ [line1, line2, line3, line4, city, county_or_province, zip_or_postcode, country].hash
377
+ end
378
+
379
+ # Builds the object from hash
380
+ # @param [Hash] attributes Model attributes in the form of hash
381
+ # @return [Object] Returns the model itself
382
+ def self.build_from_hash(attributes)
383
+ new.build_from_hash(attributes)
384
+ end
385
+
386
+ # Builds the object from hash
387
+ # @param [Hash] attributes Model attributes in the form of hash
388
+ # @return [Object] Returns the model itself
389
+ def build_from_hash(attributes)
390
+ return nil unless attributes.is_a?(Hash)
391
+ self.class.openapi_types.each_pair do |key, type|
392
+ if type =~ /\AArray<(.*)>/i
393
+ # check to ensure the input is an array given that the attribute
394
+ # is documented as an array but the input is not
395
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
396
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
397
+ end
398
+ elsif !attributes[self.class.attribute_map[key]].nil?
399
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
400
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
401
+ end
402
+
403
+ self
404
+ end
405
+
406
+ # Deserializes the data based on type
407
+ # @param string type Data type
408
+ # @param string value Value to be deserialized
409
+ # @return [Object] Deserialized data
410
+ def _deserialize(type, value)
411
+ case type.to_sym
412
+ when :DateTime
413
+ DateTime.parse(value)
414
+ when :Date
415
+ Date.parse(value)
416
+ when :String
417
+ value.to_s
418
+ when :Integer
419
+ value.to_i
420
+ when :Float
421
+ value.to_f
422
+ when :Boolean
423
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
424
+ true
425
+ else
426
+ false
427
+ end
428
+ when :Object
429
+ # generic object (usually a Hash), return directly
430
+ value
431
+ when /\AArray<(?<inner_type>.+)>\z/
432
+ inner_type = Regexp.last_match[:inner_type]
433
+ value.map { |v| _deserialize(inner_type, v) }
434
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
435
+ k_type = Regexp.last_match[:k_type]
436
+ v_type = Regexp.last_match[:v_type]
437
+ {}.tap do |hash|
438
+ value.each do |k, v|
439
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
440
+ end
441
+ end
442
+ else # model
443
+ VeloPayments.const_get(type).build_from_hash(value)
444
+ end
445
+ end
446
+
447
+ # Returns the string representation of the object
448
+ # @return [String] String presentation of the object
449
+ def to_s
450
+ to_hash.to_s
451
+ end
452
+
453
+ # to_body is an alias to to_hash (backward compatibility)
454
+ # @return [Hash] Returns the object in the form of hash
455
+ def to_body
456
+ to_hash
457
+ end
458
+
459
+ # Returns the object in the form of hash
460
+ # @return [Hash] Returns the object in the form of hash
461
+ def to_hash
462
+ hash = {}
463
+ self.class.attribute_map.each_pair do |attr, param|
464
+ value = self.send(attr)
465
+ if value.nil?
466
+ is_nullable = self.class.openapi_nullable.include?(attr)
467
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
468
+ end
469
+
470
+ hash[param] = _to_hash(value)
471
+ end
472
+ hash
473
+ end
474
+
475
+ # Outputs non-array value in the form of hash
476
+ # For object, use to_hash. Otherwise, just return the value
477
+ # @param [Object] value Any valid value
478
+ # @return [Hash] Returns the value in the form of hash
479
+ def _to_hash(value)
480
+ if value.is_a?(Array)
481
+ value.compact.map { |v| _to_hash(v) }
482
+ elsif value.is_a?(Hash)
483
+ {}.tap do |hash|
484
+ value.each { |k, v| hash[k] = _to_hash(v) }
485
+ end
486
+ elsif value.respond_to? :to_hash
487
+ value.to_hash
488
+ else
489
+ value
490
+ end
491
+ end
492
+ end
493
+ end