wallee-ruby-sdk 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (354) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/{wallee/models/line_item_attribute.rb → wallee-ruby-sdk/models/abstract_account_update.rb} +17 -17
  4. data/lib/{wallee/models/line_item_attribute_create.rb → wallee-ruby-sdk/models/abstract_application_user_update.rb} +16 -16
  5. data/lib/{wallee/models/user.rb → wallee-ruby-sdk/models/abstract_human_user_update.rb} +41 -41
  6. data/lib/{wallee/models/condition.rb → wallee-ruby-sdk/models/abstract_space_update.rb} +39 -47
  7. data/lib/{wallee/models/subscriber.rb → wallee-ruby-sdk/models/abstract_subscriber_update.rb} +16 -64
  8. data/lib/{wallee/models/persistable_currency_amount.rb → wallee-ruby-sdk/models/abstract_subscription_metric_update.rb} +15 -15
  9. data/lib/{wallee/models/subscription_product.rb → wallee-ruby-sdk/models/abstract_subscription_product_active.rb} +6 -66
  10. data/lib/{wallee/models/token.rb → wallee-ruby-sdk/models/abstract_token_update.rb} +12 -72
  11. data/lib/{wallee/models/token_version.rb → wallee-ruby-sdk/models/abstract_transaction_pending.rb} +111 -105
  12. data/lib/{wallee/models/entity_query_order_by.rb → wallee-ruby-sdk/models/abstract_webhook_listener_update.rb} +16 -16
  13. data/lib/{wallee/models/webhook_listener_entity.rb → wallee-ruby-sdk/models/abstract_webhook_url_update.rb} +20 -22
  14. data/lib/wallee-ruby-sdk/models/account_create.rb +8 -98
  15. data/lib/wallee-ruby-sdk/models/account_update.rb +8 -78
  16. data/lib/wallee-ruby-sdk/models/address.rb +1 -1
  17. data/lib/wallee-ruby-sdk/models/address_create.rb +1 -1
  18. data/lib/wallee-ruby-sdk/models/application_user_create.rb +8 -68
  19. data/lib/wallee-ruby-sdk/models/application_user_update.rb +18 -58
  20. data/lib/wallee-ruby-sdk/models/charge.rb +11 -1
  21. data/lib/wallee-ruby-sdk/models/database_translated_string_create.rb +1 -23
  22. data/lib/wallee-ruby-sdk/models/database_translated_string_item_create.rb +1 -11
  23. data/lib/wallee-ruby-sdk/models/human_user.rb +11 -61
  24. data/lib/wallee-ruby-sdk/models/human_user_create.rb +21 -91
  25. data/lib/wallee-ruby-sdk/models/human_user_update.rb +31 -81
  26. data/lib/wallee-ruby-sdk/models/line_item_attribute_create.rb +10 -0
  27. data/lib/wallee-ruby-sdk/models/line_item_create.rb +4 -64
  28. data/lib/wallee-ruby-sdk/models/payment_method_configuration.rb +35 -1
  29. data/lib/wallee-ruby-sdk/models/product_metered_fee_update.rb +24 -44
  30. data/lib/wallee-ruby-sdk/models/product_metered_tier_fee_update.rb +24 -24
  31. data/lib/wallee-ruby-sdk/models/product_period_fee_update.rb +24 -44
  32. data/lib/wallee-ruby-sdk/models/product_setup_fee_update.rb +24 -44
  33. data/lib/wallee-ruby-sdk/models/refund_create.rb +4 -214
  34. data/lib/{wallee/models/tax_class.rb → wallee-ruby-sdk/models/role.rb} +26 -24
  35. data/lib/{wallee/models/space_address.rb → wallee-ruby-sdk/models/space_address_create.rb} +1 -1
  36. data/lib/wallee-ruby-sdk/models/space_create.rb +9 -94
  37. data/lib/wallee-ruby-sdk/models/space_update.rb +12 -72
  38. data/lib/wallee-ruby-sdk/models/subscriber.rb +13 -1
  39. data/lib/wallee-ruby-sdk/models/subscriber_active.rb +33 -51
  40. data/lib/wallee-ruby-sdk/models/subscriber_create.rb +17 -55
  41. data/lib/wallee-ruby-sdk/models/subscriber_update.rb +33 -61
  42. data/lib/wallee-ruby-sdk/models/subscription_charge_create.rb +4 -136
  43. data/lib/wallee-ruby-sdk/models/subscription_ledger_entry_create.rb +4 -104
  44. data/lib/wallee-ruby-sdk/models/subscription_metric_active.rb +20 -60
  45. data/lib/wallee-ruby-sdk/models/subscription_metric_create.rb +4 -64
  46. data/lib/wallee-ruby-sdk/models/subscription_metric_update.rb +20 -60
  47. data/lib/wallee-ruby-sdk/models/subscription_metric_usage_report_create.rb +4 -64
  48. data/lib/wallee-ruby-sdk/models/subscription_pending.rb +17 -97
  49. data/lib/wallee-ruby-sdk/models/subscription_product_active.rb +11 -51
  50. data/lib/wallee-ruby-sdk/models/subscription_product_component_group_update.rb +11 -21
  51. data/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb +24 -34
  52. data/lib/wallee-ruby-sdk/models/subscription_product_create.rb +8 -68
  53. data/lib/wallee-ruby-sdk/models/subscription_product_retirement_create.rb +4 -44
  54. data/lib/wallee-ruby-sdk/models/subscription_product_version_pending.rb +24 -24
  55. data/lib/wallee-ruby-sdk/models/subscription_product_version_retirement_create.rb +4 -44
  56. data/lib/wallee-ruby-sdk/models/subscription_suspension_create.rb +4 -104
  57. data/lib/wallee-ruby-sdk/models/subscription_update.rb +17 -127
  58. data/lib/wallee-ruby-sdk/models/token.rb +11 -1
  59. data/lib/wallee-ruby-sdk/models/token_create.rb +25 -75
  60. data/lib/wallee-ruby-sdk/models/token_update.rb +18 -58
  61. data/lib/wallee-ruby-sdk/models/token_version.rb +21 -1
  62. data/lib/{wallee/models/email_sender_type.rb → wallee-ruby-sdk/models/token_version_type.rb} +2 -2
  63. data/lib/wallee-ruby-sdk/models/transaction.rb +53 -3
  64. data/lib/wallee-ruby-sdk/models/transaction_create.rb +43 -278
  65. data/lib/wallee-ruby-sdk/models/transaction_pending.rb +19 -259
  66. data/lib/{wallee/models/label.rb → wallee-ruby-sdk/models/user_account_role.rb} +34 -24
  67. data/lib/{wallee/models/tenant_database.rb → wallee-ruby-sdk/models/user_space_role.rb} +29 -9
  68. data/lib/wallee-ruby-sdk/models/user_type.rb +1 -0
  69. data/lib/wallee-ruby-sdk/models/webhook_listener_create.rb +24 -79
  70. data/lib/wallee-ruby-sdk/models/webhook_listener_entity.rb +11 -1
  71. data/lib/wallee-ruby-sdk/models/webhook_listener_update.rb +8 -80
  72. data/lib/wallee-ruby-sdk/models/webhook_url_create.rb +4 -59
  73. data/lib/wallee-ruby-sdk/models/webhook_url_update.rb +11 -31
  74. data/lib/wallee-ruby-sdk/services/token_service_api.rb +3 -3
  75. data/lib/wallee-ruby-sdk/services/user_account_role_service_api.rb +223 -0
  76. data/lib/wallee-ruby-sdk/services/user_space_role_service_api.rb +220 -0
  77. data/lib/wallee-ruby-sdk/version.rb +1 -1
  78. data/lib/wallee-ruby-sdk.rb +18 -11
  79. data/test/transactioncreate.rb +5 -9
  80. metadata +21 -293
  81. data/Gemfile.lock +0 -31
  82. data/lib/wallee/api_client.rb +0 -403
  83. data/lib/wallee/api_error.rb +0 -47
  84. data/lib/wallee/configuration.rb +0 -144
  85. data/lib/wallee/models/account.rb +0 -298
  86. data/lib/wallee/models/account_create.rb +0 -308
  87. data/lib/wallee/models/account_state.rb +0 -47
  88. data/lib/wallee/models/account_type.rb +0 -44
  89. data/lib/wallee/models/account_update.rb +0 -308
  90. data/lib/wallee/models/address.rb +0 -388
  91. data/lib/wallee/models/address_create.rb +0 -388
  92. data/lib/wallee/models/application_user.rb +0 -268
  93. data/lib/wallee/models/application_user_create.rb +0 -283
  94. data/lib/wallee/models/application_user_create_with_mac_key.rb +0 -278
  95. data/lib/wallee/models/application_user_update.rb +0 -278
  96. data/lib/wallee/models/attachment_resource.rb +0 -210
  97. data/lib/wallee/models/charge.rb +0 -318
  98. data/lib/wallee/models/charge_attempt.rb +0 -420
  99. data/lib/wallee/models/charge_attempt_environment.rb +0 -43
  100. data/lib/wallee/models/charge_attempt_state.rb +0 -44
  101. data/lib/wallee/models/charge_flow.rb +0 -270
  102. data/lib/wallee/models/charge_flow_level.rb +0 -318
  103. data/lib/wallee/models/charge_flow_level_configuration.rb +0 -288
  104. data/lib/wallee/models/charge_flow_level_configuration_type.rb +0 -222
  105. data/lib/wallee/models/charge_flow_level_state.rb +0 -44
  106. data/lib/wallee/models/charge_state.rb +0 -44
  107. data/lib/wallee/models/charge_type.rb +0 -44
  108. data/lib/wallee/models/client_error.rb +0 -238
  109. data/lib/wallee/models/client_error_type.rb +0 -44
  110. data/lib/wallee/models/condition_type.rb +0 -222
  111. data/lib/wallee/models/connector_invocation.rb +0 -278
  112. data/lib/wallee/models/connector_invocation_stage.rb +0 -45
  113. data/lib/wallee/models/creation_entity_state.rb +0 -46
  114. data/lib/wallee/models/criteria_operator.rb +0 -50
  115. data/lib/wallee/models/customers_presence.rb +0 -44
  116. data/lib/wallee/models/data_collection_type.rb +0 -43
  117. data/lib/wallee/models/database_translated_string.rb +0 -222
  118. data/lib/wallee/models/database_translated_string_create.rb +0 -222
  119. data/lib/wallee/models/database_translated_string_item.rb +0 -218
  120. data/lib/wallee/models/database_translated_string_item_create.rb +0 -223
  121. data/lib/wallee/models/delivery_indication.rb +0 -318
  122. data/lib/wallee/models/delivery_indication_decision_reason.rb +0 -222
  123. data/lib/wallee/models/delivery_indication_state.rb +0 -45
  124. data/lib/wallee/models/document_template.rb +0 -278
  125. data/lib/wallee/models/document_template_type.rb +0 -242
  126. data/lib/wallee/models/email_sender.rb +0 -278
  127. data/lib/wallee/models/email_template.rb +0 -324
  128. data/lib/wallee/models/email_template_type.rb +0 -288
  129. data/lib/wallee/models/entity_query.rb +0 -240
  130. data/lib/wallee/models/entity_query_filter.rb +0 -245
  131. data/lib/wallee/models/entity_query_filter_type.rb +0 -44
  132. data/lib/wallee/models/entity_query_order_by_type.rb +0 -43
  133. data/lib/wallee/models/entity_reference.rb +0 -188
  134. data/lib/wallee/models/failure_category.rb +0 -46
  135. data/lib/wallee/models/failure_reason.rb +0 -244
  136. data/lib/wallee/models/feature.rb +0 -274
  137. data/lib/wallee/models/gender.rb +0 -43
  138. data/lib/wallee/models/human_user.rb +0 -318
  139. data/lib/wallee/models/human_user_create.rb +0 -328
  140. data/lib/wallee/models/human_user_update.rb +0 -328
  141. data/lib/wallee/models/installment_calculated_plan.rb +0 -242
  142. data/lib/wallee/models/installment_calculated_slice.rb +0 -220
  143. data/lib/wallee/models/installment_payment.rb +0 -280
  144. data/lib/wallee/models/installment_payment_slice.rb +0 -300
  145. data/lib/wallee/models/installment_payment_slice_state.rb +0 -48
  146. data/lib/wallee/models/installment_payment_state.rb +0 -49
  147. data/lib/wallee/models/installment_plan_configuration.rb +0 -362
  148. data/lib/wallee/models/installment_plan_slice_configuration.rb +0 -288
  149. data/lib/wallee/models/label_descriptor.rb +0 -274
  150. data/lib/wallee/models/label_descriptor_category.rb +0 -43
  151. data/lib/wallee/models/label_descriptor_group.rb +0 -232
  152. data/lib/wallee/models/label_descriptor_type.rb +0 -222
  153. data/lib/wallee/models/legal_organization_form.rb +0 -242
  154. data/lib/wallee/models/line_item.rb +0 -342
  155. data/lib/wallee/models/line_item_create.rb +0 -367
  156. data/lib/wallee/models/line_item_reduction.rb +0 -218
  157. data/lib/wallee/models/line_item_reduction_create.rb +0 -233
  158. data/lib/wallee/models/line_item_type.rb +0 -45
  159. data/lib/wallee/models/localized_string.rb +0 -218
  160. data/lib/wallee/models/manual_task.rb +0 -290
  161. data/lib/wallee/models/manual_task_action.rb +0 -230
  162. data/lib/wallee/models/manual_task_action_style.rb +0 -44
  163. data/lib/wallee/models/manual_task_state.rb +0 -44
  164. data/lib/wallee/models/manual_task_type.rb +0 -234
  165. data/lib/wallee/models/one_click_payment_mode.rb +0 -44
  166. data/lib/wallee/models/payment_connector.rb +0 -306
  167. data/lib/wallee/models/payment_connector_configuration.rb +0 -322
  168. data/lib/wallee/models/payment_connector_feature.rb +0 -218
  169. data/lib/wallee/models/payment_method.rb +0 -256
  170. data/lib/wallee/models/payment_method_brand.rb +0 -252
  171. data/lib/wallee/models/payment_method_configuration.rb +0 -328
  172. data/lib/wallee/models/payment_primary_risk_taker.rb +0 -44
  173. data/lib/wallee/models/payment_processor.rb +0 -278
  174. data/lib/wallee/models/payment_processor_configuration.rb +0 -258
  175. data/lib/wallee/models/permission.rb +0 -286
  176. data/lib/wallee/models/persistable_currency_amount_update.rb +0 -208
  177. data/lib/wallee/models/product_fee_type.rb +0 -44
  178. data/lib/wallee/models/product_metered_fee.rb +0 -278
  179. data/lib/wallee/models/product_metered_fee_update.rb +0 -288
  180. data/lib/wallee/models/product_metered_tier_fee.rb +0 -240
  181. data/lib/wallee/models/product_metered_tier_fee_update.rb +0 -250
  182. data/lib/wallee/models/product_metered_tier_pricing.rb +0 -43
  183. data/lib/wallee/models/product_period_fee.rb +0 -280
  184. data/lib/wallee/models/product_period_fee_update.rb +0 -290
  185. data/lib/wallee/models/product_setup_fee.rb +0 -294
  186. data/lib/wallee/models/product_setup_fee_update.rb +0 -304
  187. data/lib/wallee/models/refund.rb +0 -450
  188. data/lib/wallee/models/refund_create.rb +0 -470
  189. data/lib/wallee/models/refund_state.rb +0 -46
  190. data/lib/wallee/models/refund_type.rb +0 -45
  191. data/lib/wallee/models/rendered_document.rb +0 -230
  192. data/lib/wallee/models/resource_path.rb +0 -258
  193. data/lib/wallee/models/resource_state.rb +0 -44
  194. data/lib/wallee/models/rest_country.rb +0 -240
  195. data/lib/wallee/models/rest_country_state.rb +0 -228
  196. data/lib/wallee/models/rest_currency.rb +0 -218
  197. data/lib/wallee/models/rest_language.rb +0 -248
  198. data/lib/wallee/models/scope.rb +0 -302
  199. data/lib/wallee/models/server_error.rb +0 -218
  200. data/lib/wallee/models/space.rb +0 -330
  201. data/lib/wallee/models/space_address_setter.rb +0 -318
  202. data/lib/wallee/models/space_create.rb +0 -350
  203. data/lib/wallee/models/space_reference.rb +0 -258
  204. data/lib/wallee/models/space_reference_state.rb +0 -46
  205. data/lib/wallee/models/space_update.rb +0 -340
  206. data/lib/wallee/models/space_view.rb +0 -258
  207. data/lib/wallee/models/static_value.rb +0 -234
  208. data/lib/wallee/models/subscriber_active.rb +0 -342
  209. data/lib/wallee/models/subscriber_create.rb +0 -347
  210. data/lib/wallee/models/subscriber_update.rb +0 -342
  211. data/lib/wallee/models/subscription.rb +0 -338
  212. data/lib/wallee/models/subscription_change_request.rb +0 -250
  213. data/lib/wallee/models/subscription_charge.rb +0 -390
  214. data/lib/wallee/models/subscription_charge_create.rb +0 -405
  215. data/lib/wallee/models/subscription_charge_processing_type.rb +0 -43
  216. data/lib/wallee/models/subscription_charge_state.rb +0 -46
  217. data/lib/wallee/models/subscription_charge_type.rb +0 -43
  218. data/lib/wallee/models/subscription_create_request.rb +0 -245
  219. data/lib/wallee/models/subscription_ledger_entry.rb +0 -350
  220. data/lib/wallee/models/subscription_ledger_entry_create.rb +0 -375
  221. data/lib/wallee/models/subscription_ledger_entry_state.rb +0 -44
  222. data/lib/wallee/models/subscription_metric.rb +0 -268
  223. data/lib/wallee/models/subscription_metric_active.rb +0 -278
  224. data/lib/wallee/models/subscription_metric_create.rb +0 -288
  225. data/lib/wallee/models/subscription_metric_type.rb +0 -232
  226. data/lib/wallee/models/subscription_metric_update.rb +0 -278
  227. data/lib/wallee/models/subscription_metric_usage_report.rb +0 -298
  228. data/lib/wallee/models/subscription_metric_usage_report_create.rb +0 -318
  229. data/lib/wallee/models/subscription_pending.rb +0 -348
  230. data/lib/wallee/models/subscription_period_bill.rb +0 -298
  231. data/lib/wallee/models/subscription_period_bill_state.rb +0 -43
  232. data/lib/wallee/models/subscription_product_active.rb +0 -310
  233. data/lib/wallee/models/subscription_product_component.rb +0 -298
  234. data/lib/wallee/models/subscription_product_component_group.rb +0 -258
  235. data/lib/wallee/models/subscription_product_component_group_update.rb +0 -268
  236. data/lib/wallee/models/subscription_product_component_reference.rb +0 -258
  237. data/lib/wallee/models/subscription_product_component_reference_state.rb +0 -45
  238. data/lib/wallee/models/subscription_product_component_update.rb +0 -308
  239. data/lib/wallee/models/subscription_product_create.rb +0 -315
  240. data/lib/wallee/models/subscription_product_retirement.rb +0 -258
  241. data/lib/wallee/models/subscription_product_retirement_create.rb +0 -263
  242. data/lib/wallee/models/subscription_product_state.rb +0 -46
  243. data/lib/wallee/models/subscription_product_version.rb +0 -390
  244. data/lib/wallee/models/subscription_product_version_pending.rb +0 -310
  245. data/lib/wallee/models/subscription_product_version_retirement.rb +0 -258
  246. data/lib/wallee/models/subscription_product_version_retirement_create.rb +0 -263
  247. data/lib/wallee/models/subscription_product_version_state.rb +0 -46
  248. data/lib/wallee/models/subscription_state.rb +0 -48
  249. data/lib/wallee/models/subscription_suspension.rb +0 -328
  250. data/lib/wallee/models/subscription_suspension_action.rb +0 -43
  251. data/lib/wallee/models/subscription_suspension_create.rb +0 -343
  252. data/lib/wallee/models/subscription_suspension_reason.rb +0 -44
  253. data/lib/wallee/models/subscription_suspension_running.rb +0 -328
  254. data/lib/wallee/models/subscription_suspension_state.rb +0 -43
  255. data/lib/wallee/models/subscription_update.rb +0 -348
  256. data/lib/wallee/models/subscription_version.rb +0 -370
  257. data/lib/wallee/models/subscription_version_state.rb +0 -47
  258. data/lib/wallee/models/tax.rb +0 -208
  259. data/lib/wallee/models/tax_create.rb +0 -218
  260. data/lib/wallee/models/token_create.rb +0 -323
  261. data/lib/wallee/models/token_update.rb +0 -318
  262. data/lib/wallee/models/token_version_state.rb +0 -44
  263. data/lib/wallee/models/transaction.rb +0 -626
  264. data/lib/wallee/models/transaction_aware_entity.rb +0 -218
  265. data/lib/wallee/models/transaction_completion.rb +0 -390
  266. data/lib/wallee/models/transaction_completion_mode.rb +0 -44
  267. data/lib/wallee/models/transaction_completion_state.rb +0 -45
  268. data/lib/wallee/models/transaction_create.rb +0 -646
  269. data/lib/wallee/models/transaction_group.rb +0 -268
  270. data/lib/wallee/models/transaction_group_state.rb +0 -44
  271. data/lib/wallee/models/transaction_invoice.rb +0 -380
  272. data/lib/wallee/models/transaction_invoice_replacement.rb +0 -250
  273. data/lib/wallee/models/transaction_invoice_state.rb +0 -48
  274. data/lib/wallee/models/transaction_line_item_update_request.rb +0 -215
  275. data/lib/wallee/models/transaction_line_item_version.rb +0 -320
  276. data/lib/wallee/models/transaction_pending.rb +0 -636
  277. data/lib/wallee/models/transaction_state.rb +0 -51
  278. data/lib/wallee/models/transaction_user_interface_type.rb +0 -44
  279. data/lib/wallee/models/transaction_void.rb +0 -380
  280. data/lib/wallee/models/transaction_void_mode.rb +0 -43
  281. data/lib/wallee/models/transaction_void_state.rb +0 -45
  282. data/lib/wallee/models/user_type.rb +0 -45
  283. data/lib/wallee/models/webhook_identity.rb +0 -248
  284. data/lib/wallee/models/webhook_listener.rb +0 -300
  285. data/lib/wallee/models/webhook_listener_create.rb +0 -330
  286. data/lib/wallee/models/webhook_listener_update.rb +0 -310
  287. data/lib/wallee/models/webhook_url.rb +0 -258
  288. data/lib/wallee/models/webhook_url_create.rb +0 -273
  289. data/lib/wallee/models/webhook_url_update.rb +0 -268
  290. data/lib/wallee/services/account_service_api.rb +0 -372
  291. data/lib/wallee/services/application_user_service_api.rb +0 -372
  292. data/lib/wallee/services/charge_attempt_service_api.rb +0 -217
  293. data/lib/wallee/services/charge_flow_level_service_api.rb +0 -280
  294. data/lib/wallee/services/charge_flow_service_api.rb +0 -352
  295. data/lib/wallee/services/condition_type_service_api.rb +0 -143
  296. data/lib/wallee/services/country_service_api.rb +0 -85
  297. data/lib/wallee/services/country_state_service_api.rb +0 -143
  298. data/lib/wallee/services/currency_service_api.rb +0 -85
  299. data/lib/wallee/services/delivery_indication_service_api.rb +0 -341
  300. data/lib/wallee/services/document_template_service_api.rb +0 -217
  301. data/lib/wallee/services/document_template_type_service_api.rb +0 -143
  302. data/lib/wallee/services/email_sender_service_api.rb +0 -219
  303. data/lib/wallee/services/email_sender_type_service_api.rb +0 -143
  304. data/lib/wallee/services/email_template_service_api.rb +0 -217
  305. data/lib/wallee/services/email_template_type_service_api.rb +0 -143
  306. data/lib/wallee/services/human_user_service_api.rb +0 -372
  307. data/lib/wallee/services/installment_payment_service_api.rb +0 -287
  308. data/lib/wallee/services/installment_payment_slice_service_api.rb +0 -219
  309. data/lib/wallee/services/installment_plan_calculation_service_api.rb +0 -95
  310. data/lib/wallee/services/installment_plan_configuration_service_api.rb +0 -219
  311. data/lib/wallee/services/installment_plan_slice_configuration_service_api.rb +0 -219
  312. data/lib/wallee/services/label_description_group_service_api.rb +0 -143
  313. data/lib/wallee/services/label_description_service_api.rb +0 -143
  314. data/lib/wallee/services/language_service_api.rb +0 -85
  315. data/lib/wallee/services/manual_task_service_api.rb +0 -217
  316. data/lib/wallee/services/payment_connector_configuration_service_api.rb +0 -217
  317. data/lib/wallee/services/payment_connector_service_api.rb +0 -143
  318. data/lib/wallee/services/payment_method_configuration_service_api.rb +0 -217
  319. data/lib/wallee/services/payment_method_service_api.rb +0 -143
  320. data/lib/wallee/services/payment_processor_configuration_service_api.rb +0 -217
  321. data/lib/wallee/services/payment_processor_service_api.rb +0 -143
  322. data/lib/wallee/services/permission_service_api.rb +0 -143
  323. data/lib/wallee/services/refund_service_api.rb +0 -468
  324. data/lib/wallee/services/space_service_api.rb +0 -372
  325. data/lib/wallee/services/static_value_service_api.rb +0 -143
  326. data/lib/wallee/services/subscriber_service_api.rb +0 -402
  327. data/lib/wallee/services/subscription_charge_service_api.rb +0 -342
  328. data/lib/wallee/services/subscription_ledger_entry_service_api.rb +0 -279
  329. data/lib/wallee/services/subscription_metric_service_api.rb +0 -402
  330. data/lib/wallee/services/subscription_metric_usage_service_api.rb +0 -279
  331. data/lib/wallee/services/subscription_period_bill_service_api.rb +0 -217
  332. data/lib/wallee/services/subscription_product_component_group_service_api.rb +0 -402
  333. data/lib/wallee/services/subscription_product_component_service_api.rb +0 -402
  334. data/lib/wallee/services/subscription_product_fee_tier_service_api.rb +0 -402
  335. data/lib/wallee/services/subscription_product_metered_fee_service_api.rb +0 -402
  336. data/lib/wallee/services/subscription_product_period_fee_service_api.rb +0 -402
  337. data/lib/wallee/services/subscription_product_retirement_service_api.rb +0 -279
  338. data/lib/wallee/services/subscription_product_service_api.rb +0 -341
  339. data/lib/wallee/services/subscription_product_setup_fee_service_api.rb +0 -402
  340. data/lib/wallee/services/subscription_product_version_retirement_service_api.rb +0 -279
  341. data/lib/wallee/services/subscription_product_version_service_api.rb +0 -404
  342. data/lib/wallee/services/subscription_service_api.rb +0 -608
  343. data/lib/wallee/services/subscription_suspension_service_api.rb +0 -342
  344. data/lib/wallee/services/subscription_version_service_api.rb +0 -217
  345. data/lib/wallee/services/token_service_api.rb +0 -402
  346. data/lib/wallee/services/token_version_service_api.rb +0 -280
  347. data/lib/wallee/services/transaction_completion_service_api.rb +0 -343
  348. data/lib/wallee/services/transaction_invoice_service_api.rb +0 -473
  349. data/lib/wallee/services/transaction_service_api.rb +0 -1263
  350. data/lib/wallee/services/transaction_void_service_api.rb +0 -343
  351. data/lib/wallee/services/webhook_listener_service_api.rb +0 -402
  352. data/lib/wallee/services/webhook_url_service_api.rb +0 -402
  353. data/lib/wallee/version.rb +0 -24
  354. data/lib/wallee.rb +0 -332
@@ -1,403 +0,0 @@
1
- =begin
2
- Wallee API: 1.0.0
3
-
4
- The wallee API allows an easy interaction with the wallee web service.
5
-
6
-
7
-
8
- Licensed under the Apache License, Version 2.0 (the "License");
9
- you may not use this file except in compliance with the License.
10
- You may obtain a copy of the License at
11
-
12
- http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- Unless required by applicable law or agreed to in writing, software
15
- distributed under the License is distributed on an "AS IS" BASIS,
16
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- See the License for the specific language governing permissions and
18
- limitations under the License.
19
-
20
- =end
21
-
22
- require 'date'
23
- require 'json'
24
- require 'logger'
25
- require 'tempfile'
26
- require 'typhoeus'
27
- require 'uri'
28
- require 'base64'
29
- require 'time'
30
- require 'openssl'
31
-
32
- module Wallee
33
- class ApiClient
34
- # The Configuration object holding settings to be used in the API client.
35
- attr_accessor :config
36
-
37
- # Defines the headers to be used in HTTP requests of all API calls by default.
38
- #
39
- # @return [Hash]
40
- attr_accessor :default_headers
41
-
42
- # Initializes the ApiClient
43
- # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
44
- def initialize(config = Configuration.default)
45
- @config = config
46
- @user_agent = "Typhoeus"
47
- @default_headers = {
48
- 'Content-Type' => "application/json",
49
- 'User-Agent' => @user_agent
50
- }
51
- end
52
-
53
- def self.default
54
- @@default ||= ApiClient.new
55
- end
56
-
57
- # Call an API with given options.
58
- #
59
- # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
60
- # the data deserialized from response body (could be nil), response status code and response headers.
61
- def call_api(http_method, path, opts = {})
62
- request = build_request(http_method, path, opts)
63
- response = request.run
64
-
65
- if @config.debugging
66
- @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
67
- end
68
-
69
- unless response.success?
70
- if response.timed_out?
71
- fail ApiError.new('Connection timed out')
72
- elsif response.code == 0
73
- # Errors from libcurl will be made visible here
74
- fail ApiError.new(:code => 0,
75
- :message => response.return_message)
76
- else
77
- fail ApiError.new(:code => response.code,
78
- :response_headers => response.headers,
79
- :response_body => response.body),
80
- response.status_message
81
- end
82
- end
83
-
84
- if opts[:return_type]
85
- data = deserialize(response, opts[:return_type])
86
- else
87
- data = nil
88
- end
89
- return data, response.code, response.headers
90
- end
91
-
92
- # Builds the HTTP request
93
- #
94
- # @param [String] http_method HTTP method/verb (e.g. POST)
95
- # @param [String] path URL path (e.g. /account/new)
96
- # @option opts [Hash] :header_params Header parameters
97
- # @option opts [Hash] :query_params Query parameters
98
- # @option opts [Hash] :form_params Query parameters
99
- # @option opts [Object] :body HTTP body (JSON/XML)
100
- # @return [Typhoeus::Request] A Typhoeus Request
101
- def build_request(http_method, path, opts = {})
102
- url = build_request_url(path)
103
- http_method = http_method.to_sym.downcase
104
-
105
- header_params = @default_headers.merge(opts[:header_params] || {})
106
- query_params = opts[:query_params] || {}
107
- form_params = opts[:form_params] || {}
108
-
109
-
110
- # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
111
- _verify_ssl_host = true
112
-
113
- header_params = header_params.merge(get_authentication_headers(http_method, path, query_params))
114
-
115
- req_opts = {
116
- :method => http_method,
117
- :headers => header_params,
118
- :params => query_params,
119
- :params_encoding => @config.params_encoding,
120
- :timeout => @config.timeout,
121
- :ssl_verifypeer => true,
122
- :ssl_verifyhost => 2,
123
- :sslcert => @config.cert_file,
124
- :sslkey => @config.key_file,
125
- :verbose => @config.debugging
126
- }
127
-
128
- # set custom cert, if provided
129
- req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
130
-
131
- if [:post, :patch, :put, :delete].include?(http_method)
132
- req_body = build_request_body(header_params, form_params, opts[:body])
133
- req_opts.update :body => req_body
134
- if @config.debugging
135
- @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
136
- end
137
- end
138
-
139
- Typhoeus::Request.new(url, req_opts)
140
- end
141
-
142
-
143
-
144
- # Returns the headers required for the HTTP authentication
145
- # @param [String] http_method HTTP method/verb (e.g. POST)
146
- # @param [String] path URL path (e.g. /account/new)
147
- # @return [Hash] the authentication headers
148
- def get_authentication_headers(http_method, path, query)
149
- completed_path = "#{@config.base_path}#{path}"+'?'+query.map{|k,v| "#{k}=#{v}"}.join('&')
150
- version = "1"
151
- timestamp = Time.now.to_i
152
- securedData = "#{version}|#{@config.user_id}|#{timestamp}|#{http_method.upcase}|#{completed_path}"
153
- {
154
- "x-mac-version": version,
155
- "x-mac-userid": @config.user_id,
156
- "x-mac-timestamp": timestamp,
157
- "x-mac-value": calculate_hmac(securedData)
158
- }
159
- end
160
-
161
- # Returns the calculated sha512 hmac for the given data
162
- # @param [String] secured_data to hash
163
- # @return [String] the calulated hmac
164
- def calculate_hmac(secured_data)
165
- decoded_secret = Base64.decode64(@config.authentication_key);
166
- digest = OpenSSL::Digest.new('sha512')
167
- Base64.strict_encode64(OpenSSL::HMAC.digest(digest, decoded_secret, secured_data)).strip;
168
- end
169
-
170
- # Check if the given MIME is a JSON MIME.
171
- # JSON MIME examples:
172
- # application/json
173
- # application/json; charset=UTF8
174
- # APPLICATION/JSON
175
- # */*
176
- # @param [String] mime MIME
177
- # @return [Boolean] True if the MIME is application/json
178
- def json_mime?(mime)
179
- (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
180
- end
181
-
182
- # Deserialize the response to the given return type.
183
- #
184
- # @param [Response] response HTTP response
185
- # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
186
- def deserialize(response, return_type)
187
- body = response.body
188
- return nil if body.nil? || body.empty?
189
-
190
- # return response body directly for String return type
191
- return body if return_type == 'String'
192
-
193
- # handle file downloading - save response body into a tmp file and return the File instance
194
- return download_file(response) if return_type == 'File'
195
-
196
- # ensuring a default content type
197
- content_type = response.headers['Content-Type'] || 'application/json'
198
-
199
- fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
200
-
201
- begin
202
- data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
203
- rescue JSON::ParserError => e
204
- if %w(String Date DateTime).include?(return_type)
205
- data = body
206
- else
207
- raise e
208
- end
209
- end
210
-
211
- convert_to_type data, return_type
212
- end
213
-
214
- # Convert data to the given return type.
215
- # @param [Object] data Data to be converted
216
- # @param [String] return_type Return type
217
- # @return [Mixed] Data in a particular type
218
- def convert_to_type(data, return_type)
219
- return nil if data.nil?
220
- case return_type
221
- when 'String'
222
- data.to_s
223
- when 'Integer'
224
- data.to_i
225
- when 'Float'
226
- data.to_f
227
- when 'BOOLEAN'
228
- data == true
229
- when 'DateTime'
230
- # parse date time (expecting ISO 8601 format)
231
- DateTime.parse data
232
- when 'Date'
233
- # parse date time (expecting ISO 8601 format)
234
- Date.parse data
235
- when 'Object'
236
- # generic object (usually a Hash), return directly
237
- data
238
- when /\AArray<(.+)>\z/
239
- # e.g. Array<Pet>
240
- sub_type = $1
241
- data.map {|item| convert_to_type(item, sub_type) }
242
- when /\AHash\<String, (.+)\>\z/
243
- # e.g. Hash<String, Integer>
244
- sub_type = $1
245
- {}.tap do |hash|
246
- data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
247
- end
248
- else
249
- # models, e.g. Pet
250
- Wallee.const_get(return_type).new.tap do |model|
251
- model.build_from_hash data
252
- end
253
- end
254
- end
255
-
256
- # Save response body into a file in (the defined) temporary folder, using the filename
257
- # from the "Content-Disposition" header if provided, otherwise a random filename.
258
- #
259
- # @see Configuration#temp_folder_path
260
- # @return [Tempfile] the file downloaded
261
- def download_file(response)
262
- content_disposition = response.headers['Content-Disposition']
263
- if content_disposition and content_disposition =~ /filename=/i
264
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
265
- prefix = sanitize_filename(filename)
266
- else
267
- prefix = 'download-'
268
- end
269
- prefix = prefix + '-' unless prefix.end_with?('-')
270
-
271
- tempfile = nil
272
- encoding = response.body.encoding
273
- Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) do |file|
274
- file.write(response.body)
275
- tempfile = file
276
- end
277
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
278
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
279
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
280
- "explicitly with `tempfile.delete`"
281
- tempfile
282
- end
283
-
284
- # Sanitize filename by removing path.
285
- # e.g. ../../sun.gif becomes sun.gif
286
- #
287
- # @param [String] filename the filename to be sanitized
288
- # @return [String] the sanitized filename
289
- def sanitize_filename(filename)
290
- filename.gsub(/.*[\/\\]/, '')
291
- end
292
-
293
- def build_request_url(path)
294
- # Add leading and trailing slashes to path
295
- path = "/#{path}".gsub(/\/+/, '/')
296
- URI.encode(@config.base_url + path)
297
- end
298
-
299
- # Builds the HTTP request body
300
- #
301
- # @param [Hash] header_params Header parameters
302
- # @param [Hash] form_params Query parameters
303
- # @param [Object] body HTTP body (JSON/XML)
304
- # @return [String] HTTP body data in the form of string
305
- def build_request_body(header_params, form_params, body)
306
- # http form
307
- if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
308
- header_params['Content-Type'] == 'multipart/form-data'
309
- data = {}
310
- form_params.each do |key, value|
311
- case value
312
- when File, Array, nil
313
- # let typhoeus handle File, Array and nil parameters
314
- data[key] = value
315
- else
316
- data[key] = value.to_s
317
- end
318
- end
319
- elsif body
320
- data = body.is_a?(String) ? body : body.to_json
321
- else
322
- data = nil
323
- end
324
- data
325
- end
326
-
327
-
328
-
329
- # Sets user agent in HTTP header
330
- #
331
- # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
332
- def user_agent=(user_agent)
333
- @user_agent = user_agent
334
- @default_headers['User-Agent'] = @user_agent
335
- end
336
-
337
- # Return Accept header based on an array of accepts provided.
338
- # @param [Array] accepts array for Accept
339
- # @return [String] the Accept header (e.g. application/json)
340
- def select_header_accept(accepts)
341
- return nil if accepts.nil? || accepts.empty?
342
- # use JSON when present, otherwise use all of the provided
343
- json_accept = accepts.find { |s| json_mime?(s) }
344
- return json_accept || accepts.join(',')
345
- end
346
-
347
- # Return Content-Type header based on an array of content types provided.
348
- # @param [Array] content_types array for Content-Type
349
- # @return [String] the Content-Type header (e.g. application/json)
350
- def select_header_content_type(content_types)
351
- # use application/json by default
352
- return 'application/json' if content_types.nil? || content_types.empty?
353
- # use JSON when present, otherwise use the first one
354
- json_content_type = content_types.find { |s| json_mime?(s) }
355
- return json_content_type || content_types.first
356
- end
357
-
358
- # Convert object (array, hash, object, etc) to JSON string.
359
- # @param [Object] model object to be converted into JSON string
360
- # @return [String] JSON string representation of the object
361
- def object_to_http_body(model)
362
- return model if model.nil? || model.is_a?(String)
363
- local_body = nil
364
- if model.is_a?(Array)
365
- local_body = model.map{|m| object_to_hash(m) }
366
- else
367
- local_body = object_to_hash(model)
368
- end
369
- local_body.to_json
370
- end
371
-
372
- # Convert object(non-array) to hash.
373
- # @param [Object] obj object to be converted into JSON string
374
- # @return [String] JSON string representation of the object
375
- def object_to_hash(obj)
376
- if obj.respond_to?(:to_hash)
377
- obj.to_hash
378
- else
379
- obj
380
- end
381
- end
382
-
383
- # Build parameter value according to the given collection format.
384
- # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
385
- def build_collection_param(param, collection_format)
386
- case collection_format
387
- when :csv
388
- param.join(',')
389
- when :ssv
390
- param.join(' ')
391
- when :tsv
392
- param.join("\t")
393
- when :pipes
394
- param.join('|')
395
- when :multi
396
- # return the array directly as typhoeus will handle it as expected
397
- param
398
- else
399
- fail "unknown collection format: #{collection_format.inspect}"
400
- end
401
- end
402
- end
403
- end
@@ -1,47 +0,0 @@
1
- =begin
2
- Wallee API: 1.0.0
3
-
4
- The wallee API allows an easy interaction with the wallee web service.
5
-
6
-
7
-
8
- Licensed under the Apache License, Version 2.0 (the "License");
9
- you may not use this file except in compliance with the License.
10
- You may obtain a copy of the License at
11
-
12
- http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- Unless required by applicable law or agreed to in writing, software
15
- distributed under the License is distributed on an "AS IS" BASIS,
16
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- See the License for the specific language governing permissions and
18
- limitations under the License.
19
-
20
- =end
21
-
22
- module Wallee
23
- class ApiError < StandardError
24
- attr_reader :code, :response_headers, :response_body
25
-
26
- # Usage examples:
27
- # ApiError.new
28
- # ApiError.new("message")
29
- # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
30
- # ApiError.new(:code => 404, :message => "Not Found")
31
- def initialize(arg = nil)
32
- if arg.is_a? Hash
33
- if arg.key?(:message) || arg.key?('message')
34
- super(arg[:message] || arg['message'])
35
- else
36
- super arg
37
- end
38
-
39
- arg.each do |k, v|
40
- instance_variable_set "@#{k}", v
41
- end
42
- else
43
- super arg
44
- end
45
- end
46
- end
47
- end
@@ -1,144 +0,0 @@
1
- =begin
2
- Wallee API: 1.0.0
3
-
4
- The wallee API allows an easy interaction with the wallee web service.
5
-
6
-
7
-
8
- Licensed under the Apache License, Version 2.0 (the "License");
9
- you may not use this file except in compliance with the License.
10
- You may obtain a copy of the License at
11
-
12
- http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- Unless required by applicable law or agreed to in writing, software
15
- distributed under the License is distributed on an "AS IS" BASIS,
16
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- See the License for the specific language governing permissions and
18
- limitations under the License.
19
-
20
- =end
21
-
22
- require 'uri'
23
-
24
- module Wallee
25
- class Configuration
26
- # Defines url scheme
27
- attr_reader :scheme
28
-
29
- # Defines url host
30
- attr_reader :host
31
-
32
- # Defines url base path
33
- attr_reader :base_path
34
-
35
- # Defines the user_id used for request authentication.
36
- #
37
- # @return [String]
38
- attr_accessor :user_id
39
-
40
- # Defines the authentication_key used for request authentication.
41
- #
42
- # @return [String]
43
- attr_accessor :authentication_key
44
-
45
- # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
46
- # details will be logged with `logger.debug` (see the `logger` attribute).
47
- # Default to false.
48
- #
49
- # @return [true, false]
50
- attr_accessor :debugging
51
-
52
- # Defines the logger used for debugging.
53
- # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
54
- #
55
- # @return [#debug]
56
- attr_accessor :logger
57
-
58
- # Defines the temporary folder to store downloaded files
59
- # (for API endpoints that have file response).
60
- # Default to use `Tempfile`.
61
- #
62
- # @return [String]
63
- attr_accessor :temp_folder_path
64
-
65
- # The time limit for HTTP request in seconds.
66
- # Default to 0 (never times out).
67
- attr_accessor :timeout
68
-
69
- ### TLS/SSL setting
70
- # Set this to customize the certificate file to verify the peer.
71
- #
72
- # @return [String] the path to the certificate file
73
- #
74
- # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
75
- # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
76
- attr_accessor :ssl_ca_cert
77
-
78
- ### TLS/SSL setting
79
- # Client certificate file (for client certificate)
80
- attr_accessor :cert_file
81
-
82
- ### TLS/SSL setting
83
- # Client private key file (for client certificate)
84
- attr_accessor :key_file
85
-
86
- # Set this to customize parameters encoding of array parameter with multi collectionFormat.
87
- # Default to nil.
88
- #
89
- # @see The params_encoding option of Ethon. Related source code:
90
- # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
91
- attr_accessor :params_encoding
92
-
93
- attr_accessor :inject_format
94
-
95
- attr_accessor :force_ending_format
96
-
97
- def initialize
98
- @scheme = 'https'
99
- @host = 'app-wallee.com:443'
100
- @base_path = '/api'
101
- @timeout = 0
102
- @params_encoding = nil
103
- @cert_file = nil
104
- @key_file = nil
105
- @debugging = false
106
- @inject_format = false
107
- @force_ending_format = false
108
- @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
109
-
110
- yield(self) if block_given?
111
- end
112
-
113
- # The default Configuration object.
114
- def self.default
115
- @@default ||= Configuration.new
116
- end
117
-
118
- def configure
119
- yield(self) if block_given?
120
- end
121
-
122
- def scheme=(scheme)
123
- # remove :// from scheme
124
- @scheme = scheme.sub(/:\/\//, '')
125
- end
126
-
127
- def host=(host)
128
- # remove http(s):// and anything after a slash
129
- @host = host.sub(/https?:\/\//, '').split('/').first
130
- end
131
-
132
- def base_path=(base_path)
133
- # Add leading and trailing slashes to base_path
134
- @base_path = "/#{base_path}".gsub(/\/+/, '/')
135
- @base_path = "" if @base_path == "/"
136
- end
137
-
138
- def base_url
139
- url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
140
- URI.encode(url)
141
- end
142
-
143
- end
144
- end