onlinepayments-sdk-ruby 3.0.0

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 (269) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +2 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +140 -0
  5. data/Rakefile +34 -0
  6. data/lib/onlinepayments/sdk/api_exception.rb +42 -0
  7. data/lib/onlinepayments/sdk/api_resource.rb +115 -0
  8. data/lib/onlinepayments/sdk/authenticator.rb +16 -0
  9. data/lib/onlinepayments/sdk/authorization_exception.rb +13 -0
  10. data/lib/onlinepayments/sdk/call_context.rb +26 -0
  11. data/lib/onlinepayments/sdk/client.rb +82 -0
  12. data/lib/onlinepayments/sdk/communication_exception.rb +16 -0
  13. data/lib/onlinepayments/sdk/communicator.rb +300 -0
  14. data/lib/onlinepayments/sdk/communicator_configuration.rb +59 -0
  15. data/lib/onlinepayments/sdk/connection.rb +41 -0
  16. data/lib/onlinepayments/sdk/data_object.rb +31 -0
  17. data/lib/onlinepayments/sdk/declined_payment_exception.rb +30 -0
  18. data/lib/onlinepayments/sdk/declined_payout_exception.rb +32 -0
  19. data/lib/onlinepayments/sdk/declined_refund_exception.rb +32 -0
  20. data/lib/onlinepayments/sdk/declined_transaction_exception.rb +16 -0
  21. data/lib/onlinepayments/sdk/defaultimpl/authorization_type.rb +24 -0
  22. data/lib/onlinepayments/sdk/defaultimpl/default_authenticator.rb +108 -0
  23. data/lib/onlinepayments/sdk/defaultimpl/default_connection.rb +295 -0
  24. data/lib/onlinepayments/sdk/defaultimpl/default_marshaller.rb +32 -0
  25. data/lib/onlinepayments/sdk/defaultimpl.rb +6 -0
  26. data/lib/onlinepayments/sdk/domain/account_on_file.rb +49 -0
  27. data/lib/onlinepayments/sdk/domain/account_on_file_attribute.rb +38 -0
  28. data/lib/onlinepayments/sdk/domain/account_on_file_display_hints.rb +37 -0
  29. data/lib/onlinepayments/sdk/domain/additional_order_input.rb +54 -0
  30. data/lib/onlinepayments/sdk/domain/address.rb +50 -0
  31. data/lib/onlinepayments/sdk/domain/address_personal.rb +58 -0
  32. data/lib/onlinepayments/sdk/domain/airline_data.rb +128 -0
  33. data/lib/onlinepayments/sdk/domain/airline_flight_leg.rb +102 -0
  34. data/lib/onlinepayments/sdk/domain/airline_passenger.rb +38 -0
  35. data/lib/onlinepayments/sdk/domain/amount_breakdown.rb +30 -0
  36. data/lib/onlinepayments/sdk/domain/amount_of_money.rb +30 -0
  37. data/lib/onlinepayments/sdk/domain/api_error.rb +46 -0
  38. data/lib/onlinepayments/sdk/domain/bank_account_iban.rb +26 -0
  39. data/lib/onlinepayments/sdk/domain/browser_data.rb +42 -0
  40. data/lib/onlinepayments/sdk/domain/cancel_payment_response.rb +30 -0
  41. data/lib/onlinepayments/sdk/domain/capture.rb +46 -0
  42. data/lib/onlinepayments/sdk/domain/capture_output.rb +82 -0
  43. data/lib/onlinepayments/sdk/domain/capture_payment_request.rb +38 -0
  44. data/lib/onlinepayments/sdk/domain/capture_response.rb +46 -0
  45. data/lib/onlinepayments/sdk/domain/capture_status_output.rb +26 -0
  46. data/lib/onlinepayments/sdk/domain/captures_response.rb +33 -0
  47. data/lib/onlinepayments/sdk/domain/card.rb +38 -0
  48. data/lib/onlinepayments/sdk/domain/card_essentials.rb +34 -0
  49. data/lib/onlinepayments/sdk/domain/card_fraud_results.rb +34 -0
  50. data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input.rb +98 -0
  51. data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input_base.rb +86 -0
  52. data/lib/onlinepayments/sdk/domain/card_payment_method_specific_input_for_hosted_checkout.rb +26 -0
  53. data/lib/onlinepayments/sdk/domain/card_payment_method_specific_output.rb +78 -0
  54. data/lib/onlinepayments/sdk/domain/card_payout_method_specific_input.rb +38 -0
  55. data/lib/onlinepayments/sdk/domain/card_recurrence_details.rb +26 -0
  56. data/lib/onlinepayments/sdk/domain/card_without_cvv.rb +34 -0
  57. data/lib/onlinepayments/sdk/domain/company_information.rb +26 -0
  58. data/lib/onlinepayments/sdk/domain/complete_payment_card_payment_method_specific_input.rb +30 -0
  59. data/lib/onlinepayments/sdk/domain/complete_payment_request.rb +38 -0
  60. data/lib/onlinepayments/sdk/domain/complete_payment_response.rb +46 -0
  61. data/lib/onlinepayments/sdk/domain/contact_details.rb +42 -0
  62. data/lib/onlinepayments/sdk/domain/create_hosted_checkout_request.rb +78 -0
  63. data/lib/onlinepayments/sdk/domain/create_hosted_checkout_response.rb +48 -0
  64. data/lib/onlinepayments/sdk/domain/create_hosted_tokenization_request.rb +38 -0
  65. data/lib/onlinepayments/sdk/domain/create_hosted_tokenization_response.rb +50 -0
  66. data/lib/onlinepayments/sdk/domain/create_mandate_request.rb +58 -0
  67. data/lib/onlinepayments/sdk/domain/create_mandate_response.rb +38 -0
  68. data/lib/onlinepayments/sdk/domain/create_mandate_with_return_url.rb +58 -0
  69. data/lib/onlinepayments/sdk/domain/create_payment_request.rb +74 -0
  70. data/lib/onlinepayments/sdk/domain/create_payment_response.rb +46 -0
  71. data/lib/onlinepayments/sdk/domain/create_payout_request.rb +46 -0
  72. data/lib/onlinepayments/sdk/domain/create_token_request.rb +34 -0
  73. data/lib/onlinepayments/sdk/domain/created_payment_output.rb +34 -0
  74. data/lib/onlinepayments/sdk/domain/created_token_response.rb +50 -0
  75. data/lib/onlinepayments/sdk/domain/customer.rb +86 -0
  76. data/lib/onlinepayments/sdk/domain/customer_account.rb +70 -0
  77. data/lib/onlinepayments/sdk/domain/customer_account_authentication.rb +30 -0
  78. data/lib/onlinepayments/sdk/domain/customer_device.rb +50 -0
  79. data/lib/onlinepayments/sdk/domain/customer_payment_activity.rb +34 -0
  80. data/lib/onlinepayments/sdk/domain/customer_token.rb +46 -0
  81. data/lib/onlinepayments/sdk/domain/decrypted_payment_data.rb +42 -0
  82. data/lib/onlinepayments/sdk/domain/directory_entry.rb +34 -0
  83. data/lib/onlinepayments/sdk/domain/empty_validator.rb +12 -0
  84. data/lib/onlinepayments/sdk/domain/error_response.rb +37 -0
  85. data/lib/onlinepayments/sdk/domain/external_cardholder_authentication_data.rb +58 -0
  86. data/lib/onlinepayments/sdk/domain/external_token_linked.rb +34 -0
  87. data/lib/onlinepayments/sdk/domain/fixed_list_validator.rb +32 -0
  88. data/lib/onlinepayments/sdk/domain/fraud_fields.rb +30 -0
  89. data/lib/onlinepayments/sdk/domain/fraud_results.rb +26 -0
  90. data/lib/onlinepayments/sdk/domain/g_pay_three_d_secure.rb +46 -0
  91. data/lib/onlinepayments/sdk/domain/get_hosted_checkout_response.rb +34 -0
  92. data/lib/onlinepayments/sdk/domain/get_hosted_tokenization_response.rb +34 -0
  93. data/lib/onlinepayments/sdk/domain/get_iin_details_request.rb +34 -0
  94. data/lib/onlinepayments/sdk/domain/get_iin_details_response.rb +45 -0
  95. data/lib/onlinepayments/sdk/domain/get_mandate_response.rb +30 -0
  96. data/lib/onlinepayments/sdk/domain/get_payment_product_groups_response.rb +33 -0
  97. data/lib/onlinepayments/sdk/domain/get_payment_products_response.rb +33 -0
  98. data/lib/onlinepayments/sdk/domain/gift_card_purchase.rb +34 -0
  99. data/lib/onlinepayments/sdk/domain/hosted_checkout_specific_input.rb +66 -0
  100. data/lib/onlinepayments/sdk/domain/hosted_checkout_specific_output.rb +30 -0
  101. data/lib/onlinepayments/sdk/domain/iin_detail.rb +30 -0
  102. data/lib/onlinepayments/sdk/domain/label_template_element.rb +30 -0
  103. data/lib/onlinepayments/sdk/domain/length_validator.rb +30 -0
  104. data/lib/onlinepayments/sdk/domain/line_item.rb +46 -0
  105. data/lib/onlinepayments/sdk/domain/line_item_invoice_data.rb +26 -0
  106. data/lib/onlinepayments/sdk/domain/loan_recipient.rb +42 -0
  107. data/lib/onlinepayments/sdk/domain/lodging_data.rb +26 -0
  108. data/lib/onlinepayments/sdk/domain/mandate_address.rb +42 -0
  109. data/lib/onlinepayments/sdk/domain/mandate_contact_details.rb +26 -0
  110. data/lib/onlinepayments/sdk/domain/mandate_customer.rb +58 -0
  111. data/lib/onlinepayments/sdk/domain/mandate_merchant_action.rb +34 -0
  112. data/lib/onlinepayments/sdk/domain/mandate_personal_information.rb +34 -0
  113. data/lib/onlinepayments/sdk/domain/mandate_personal_name.rb +30 -0
  114. data/lib/onlinepayments/sdk/domain/mandate_redirect_data.rb +30 -0
  115. data/lib/onlinepayments/sdk/domain/mandate_response.rb +50 -0
  116. data/lib/onlinepayments/sdk/domain/merchant_action.rb +34 -0
  117. data/lib/onlinepayments/sdk/domain/mobile_payment_data.rb +30 -0
  118. data/lib/onlinepayments/sdk/domain/mobile_payment_method_hosted_checkout_specific_input.rb +30 -0
  119. data/lib/onlinepayments/sdk/domain/mobile_payment_method_specific_input.rb +62 -0
  120. data/lib/onlinepayments/sdk/domain/mobile_payment_method_specific_output.rb +58 -0
  121. data/lib/onlinepayments/sdk/domain/mobile_payment_product320_specific_input.rb +30 -0
  122. data/lib/onlinepayments/sdk/domain/operation_output.rb +58 -0
  123. data/lib/onlinepayments/sdk/domain/order.rb +70 -0
  124. data/lib/onlinepayments/sdk/domain/order_line_details.rb +54 -0
  125. data/lib/onlinepayments/sdk/domain/order_references.rb +34 -0
  126. data/lib/onlinepayments/sdk/domain/order_status_output.rb +49 -0
  127. data/lib/onlinepayments/sdk/domain/order_type_information.rb +30 -0
  128. data/lib/onlinepayments/sdk/domain/payment_account_on_file.rb +30 -0
  129. data/lib/onlinepayments/sdk/domain/payment_context.rb +38 -0
  130. data/lib/onlinepayments/sdk/domain/payment_creation_output.rb +38 -0
  131. data/lib/onlinepayments/sdk/domain/payment_details_response.rb +65 -0
  132. data/lib/onlinepayments/sdk/domain/payment_error_response.rb +45 -0
  133. data/lib/onlinepayments/sdk/domain/payment_output.rb +82 -0
  134. data/lib/onlinepayments/sdk/domain/payment_product.rb +102 -0
  135. data/lib/onlinepayments/sdk/domain/payment_product130_specific_input.rb +30 -0
  136. data/lib/onlinepayments/sdk/domain/payment_product130_specific_three_d_secure.rb +38 -0
  137. data/lib/onlinepayments/sdk/domain/payment_product302_specific_data.rb +32 -0
  138. data/lib/onlinepayments/sdk/domain/payment_product320_specific_data.rb +36 -0
  139. data/lib/onlinepayments/sdk/domain/payment_product5100_specific_input.rb +26 -0
  140. data/lib/onlinepayments/sdk/domain/payment_product5402_specific_output.rb +26 -0
  141. data/lib/onlinepayments/sdk/domain/payment_product5500_specific_output.rb +34 -0
  142. data/lib/onlinepayments/sdk/domain/payment_product771_specific_output.rb +26 -0
  143. data/lib/onlinepayments/sdk/domain/payment_product840_customer_account.rb +54 -0
  144. data/lib/onlinepayments/sdk/domain/payment_product840_specific_output.rb +53 -0
  145. data/lib/onlinepayments/sdk/domain/payment_product_display_hints.rb +34 -0
  146. data/lib/onlinepayments/sdk/domain/payment_product_field.rb +46 -0
  147. data/lib/onlinepayments/sdk/domain/payment_product_field_data_restrictions.rb +34 -0
  148. data/lib/onlinepayments/sdk/domain/payment_product_field_display_element.rb +38 -0
  149. data/lib/onlinepayments/sdk/domain/payment_product_field_display_hints.rb +70 -0
  150. data/lib/onlinepayments/sdk/domain/payment_product_field_form_element.rb +37 -0
  151. data/lib/onlinepayments/sdk/domain/payment_product_field_tooltip.rb +30 -0
  152. data/lib/onlinepayments/sdk/domain/payment_product_field_validators.rb +90 -0
  153. data/lib/onlinepayments/sdk/domain/payment_product_filter.rb +42 -0
  154. data/lib/onlinepayments/sdk/domain/payment_product_filters_hosted_checkout.rb +37 -0
  155. data/lib/onlinepayments/sdk/domain/payment_product_group.rb +52 -0
  156. data/lib/onlinepayments/sdk/domain/payment_product_networks_response.rb +32 -0
  157. data/lib/onlinepayments/sdk/domain/payment_references.rb +30 -0
  158. data/lib/onlinepayments/sdk/domain/payment_response.rb +54 -0
  159. data/lib/onlinepayments/sdk/domain/payment_status_output.rb +57 -0
  160. data/lib/onlinepayments/sdk/domain/payout_error_response.rb +45 -0
  161. data/lib/onlinepayments/sdk/domain/payout_output.rb +30 -0
  162. data/lib/onlinepayments/sdk/domain/payout_response.rb +46 -0
  163. data/lib/onlinepayments/sdk/domain/payout_result.rb +46 -0
  164. data/lib/onlinepayments/sdk/domain/payout_status_output.rb +34 -0
  165. data/lib/onlinepayments/sdk/domain/personal_information.rb +38 -0
  166. data/lib/onlinepayments/sdk/domain/personal_information_token.rb +30 -0
  167. data/lib/onlinepayments/sdk/domain/personal_name.rb +34 -0
  168. data/lib/onlinepayments/sdk/domain/personal_name_token.rb +30 -0
  169. data/lib/onlinepayments/sdk/domain/product_directory.rb +33 -0
  170. data/lib/onlinepayments/sdk/domain/protection_eligibility.rb +30 -0
  171. data/lib/onlinepayments/sdk/domain/range_validator.rb +30 -0
  172. data/lib/onlinepayments/sdk/domain/redirect_data.rb +30 -0
  173. data/lib/onlinepayments/sdk/domain/redirect_payment_method_specific_input.rb +66 -0
  174. data/lib/onlinepayments/sdk/domain/redirect_payment_method_specific_output.rb +66 -0
  175. data/lib/onlinepayments/sdk/domain/redirect_payment_product809_specific_input.rb +26 -0
  176. data/lib/onlinepayments/sdk/domain/redirect_payment_product840_specific_input.rb +26 -0
  177. data/lib/onlinepayments/sdk/domain/redirection_data.rb +26 -0
  178. data/lib/onlinepayments/sdk/domain/refund_card_method_specific_output.rb +30 -0
  179. data/lib/onlinepayments/sdk/domain/refund_e_wallet_method_specific_output.rb +38 -0
  180. data/lib/onlinepayments/sdk/domain/refund_error_response.rb +45 -0
  181. data/lib/onlinepayments/sdk/domain/refund_mobile_method_specific_output.rb +34 -0
  182. data/lib/onlinepayments/sdk/domain/refund_output.rb +82 -0
  183. data/lib/onlinepayments/sdk/domain/refund_payment_product840_customer_account.rb +34 -0
  184. data/lib/onlinepayments/sdk/domain/refund_payment_product840_specific_output.rb +30 -0
  185. data/lib/onlinepayments/sdk/domain/refund_redirect_method_specific_output.rb +30 -0
  186. data/lib/onlinepayments/sdk/domain/refund_request.rb +38 -0
  187. data/lib/onlinepayments/sdk/domain/refund_response.rb +46 -0
  188. data/lib/onlinepayments/sdk/domain/refunds_response.rb +33 -0
  189. data/lib/onlinepayments/sdk/domain/regular_expression_validator.rb +26 -0
  190. data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_method_specific_input.rb +34 -0
  191. data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_method_specific_input_base.rb +34 -0
  192. data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_method_specific_output.rb +42 -0
  193. data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_product771_specific_input.rb +34 -0
  194. data/lib/onlinepayments/sdk/domain/sepa_direct_debit_payment_product771_specific_input_base.rb +34 -0
  195. data/lib/onlinepayments/sdk/domain/session_request.rb +32 -0
  196. data/lib/onlinepayments/sdk/domain/session_response.rb +48 -0
  197. data/lib/onlinepayments/sdk/domain/shipping.rb +58 -0
  198. data/lib/onlinepayments/sdk/domain/shopping_cart.rb +64 -0
  199. data/lib/onlinepayments/sdk/domain/shopping_cart_extension.rb +52 -0
  200. data/lib/onlinepayments/sdk/domain/test_connection.rb +26 -0
  201. data/lib/onlinepayments/sdk/domain/three_d_secure.rb +78 -0
  202. data/lib/onlinepayments/sdk/domain/three_d_secure_base.rb +58 -0
  203. data/lib/onlinepayments/sdk/domain/three_d_secure_data.rb +34 -0
  204. data/lib/onlinepayments/sdk/domain/three_d_secure_results.rb +30 -0
  205. data/lib/onlinepayments/sdk/domain/token_card.rb +34 -0
  206. data/lib/onlinepayments/sdk/domain/token_card_data.rb +30 -0
  207. data/lib/onlinepayments/sdk/domain/token_card_specific_input.rb +30 -0
  208. data/lib/onlinepayments/sdk/domain/token_data.rb +30 -0
  209. data/lib/onlinepayments/sdk/domain/token_e_wallet.rb +34 -0
  210. data/lib/onlinepayments/sdk/domain/token_response.rb +58 -0
  211. data/lib/onlinepayments/sdk/domain/value_mapping_element.rb +37 -0
  212. data/lib/onlinepayments/sdk/endpoint_configuration.rb +127 -0
  213. data/lib/onlinepayments/sdk/exceptions.rb +8 -0
  214. data/lib/onlinepayments/sdk/factory.rb +136 -0
  215. data/lib/onlinepayments/sdk/idempotence_exception.rb +24 -0
  216. data/lib/onlinepayments/sdk/logging/communicator_logger.rb +22 -0
  217. data/lib/onlinepayments/sdk/logging/log_message_builder.rb +56 -0
  218. data/lib/onlinepayments/sdk/logging/logging_capable.rb +17 -0
  219. data/lib/onlinepayments/sdk/logging/logging_util.rb +286 -0
  220. data/lib/onlinepayments/sdk/logging/request_log_message_builder.rb +39 -0
  221. data/lib/onlinepayments/sdk/logging/response_log_message_builder.rb +34 -0
  222. data/lib/onlinepayments/sdk/logging/ruby_communicator_logger.rb +57 -0
  223. data/lib/onlinepayments/sdk/logging/stdout_communicator_logger.rb +34 -0
  224. data/lib/onlinepayments/sdk/logging.rb +10 -0
  225. data/lib/onlinepayments/sdk/marshaller.rb +24 -0
  226. data/lib/onlinepayments/sdk/marshaller_syntax_exception.rb +6 -0
  227. data/lib/onlinepayments/sdk/merchant/hostedcheckout/hosted_checkout_client.rb +86 -0
  228. data/lib/onlinepayments/sdk/merchant/hostedtokenization/hosted_tokenization_client.rb +86 -0
  229. data/lib/onlinepayments/sdk/merchant/mandates/mandates_client.rb +182 -0
  230. data/lib/onlinepayments/sdk/merchant/merchant_client.rb +89 -0
  231. data/lib/onlinepayments/sdk/merchant/payments/payments_client.rb +322 -0
  232. data/lib/onlinepayments/sdk/merchant/payouts/payouts_client.rb +86 -0
  233. data/lib/onlinepayments/sdk/merchant/productgroups/get_product_group_params.rb +57 -0
  234. data/lib/onlinepayments/sdk/merchant/productgroups/get_product_groups_params.rb +57 -0
  235. data/lib/onlinepayments/sdk/merchant/productgroups/product_groups_client.rb +87 -0
  236. data/lib/onlinepayments/sdk/merchant/products/get_payment_product_networks_params.rb +38 -0
  237. data/lib/onlinepayments/sdk/merchant/products/get_payment_product_params.rb +57 -0
  238. data/lib/onlinepayments/sdk/merchant/products/get_payment_products_params.rb +57 -0
  239. data/lib/onlinepayments/sdk/merchant/products/get_product_directory_params.rb +30 -0
  240. data/lib/onlinepayments/sdk/merchant/products/products_client.rb +155 -0
  241. data/lib/onlinepayments/sdk/merchant/services/services_client.rb +82 -0
  242. data/lib/onlinepayments/sdk/merchant/sessions/sessions_client.rb +54 -0
  243. data/lib/onlinepayments/sdk/merchant/tokens/tokens_client.rb +116 -0
  244. data/lib/onlinepayments/sdk/meta_data_provider.rb +150 -0
  245. data/lib/onlinepayments/sdk/modules.rb +62 -0
  246. data/lib/onlinepayments/sdk/not_found_exception.rb +16 -0
  247. data/lib/onlinepayments/sdk/param_request.rb +11 -0
  248. data/lib/onlinepayments/sdk/payment_platform_exception.rb +15 -0
  249. data/lib/onlinepayments/sdk/pooled_connection.rb +21 -0
  250. data/lib/onlinepayments/sdk/proxy_configuration.rb +74 -0
  251. data/lib/onlinepayments/sdk/reference_exception.rb +14 -0
  252. data/lib/onlinepayments/sdk/request_header.rb +50 -0
  253. data/lib/onlinepayments/sdk/request_param.rb +23 -0
  254. data/lib/onlinepayments/sdk/response_exception.rb +47 -0
  255. data/lib/onlinepayments/sdk/response_header.rb +42 -0
  256. data/lib/onlinepayments/sdk/validation_exception.rb +14 -0
  257. data/lib/onlinepayments/sdk/webhooks/api_version_mismatch_exception.rb +20 -0
  258. data/lib/onlinepayments/sdk/webhooks/in_memory_secret_key_store.rb +56 -0
  259. data/lib/onlinepayments/sdk/webhooks/secret_key_not_available_exception.rb +17 -0
  260. data/lib/onlinepayments/sdk/webhooks/secret_key_store.rb +16 -0
  261. data/lib/onlinepayments/sdk/webhooks/signature_validation_exception.rb +19 -0
  262. data/lib/onlinepayments/sdk/webhooks/webhooks.rb +22 -0
  263. data/lib/onlinepayments/sdk/webhooks/webhooks_event.rb +58 -0
  264. data/lib/onlinepayments/sdk/webhooks/webhooks_helper.rb +100 -0
  265. data/lib/onlinepayments/sdk/webhooks/webhooks_helper_builder.rb +25 -0
  266. data/lib/onlinepayments/sdk/webhooks.rb +11 -0
  267. data/lib/onlinepayments/sdk.rb +26 -0
  268. data/onlinepayments-sdk-ruby.gemspec +28 -0
  269. metadata +416 -0
@@ -0,0 +1,322 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/api_resource'
5
+ require 'onlinepayments/sdk/response_exception'
6
+ require 'onlinepayments/sdk/domain/cancel_payment_response'
7
+ require 'onlinepayments/sdk/domain/capture_payment_request'
8
+ require 'onlinepayments/sdk/domain/capture_response'
9
+ require 'onlinepayments/sdk/domain/captures_response'
10
+ require 'onlinepayments/sdk/domain/complete_payment_request'
11
+ require 'onlinepayments/sdk/domain/complete_payment_response'
12
+ require 'onlinepayments/sdk/domain/create_payment_request'
13
+ require 'onlinepayments/sdk/domain/create_payment_response'
14
+ require 'onlinepayments/sdk/domain/error_response'
15
+ require 'onlinepayments/sdk/domain/payment_details_response'
16
+ require 'onlinepayments/sdk/domain/payment_error_response'
17
+ require 'onlinepayments/sdk/domain/payment_response'
18
+ require 'onlinepayments/sdk/domain/refund_error_response'
19
+ require 'onlinepayments/sdk/domain/refund_request'
20
+ require 'onlinepayments/sdk/domain/refund_response'
21
+ require 'onlinepayments/sdk/domain/refunds_response'
22
+
23
+ module OnlinePayments::SDK
24
+ module Merchant
25
+ module Payments
26
+
27
+ # Payments client. Thread-safe.
28
+ class PaymentsClient < OnlinePayments::SDK::ApiResource
29
+
30
+ # @param parent [OnlinePayments::SDK::ApiResource]
31
+ # @param path_context [Hash, nil]
32
+ def initialize(parent, path_context = nil)
33
+ super(parent, path_context)
34
+ end
35
+
36
+ # Resource /v2/!{merchantId}/payments
37
+ # @param body [OnlinePayments::SDK::Domain::CreatePaymentRequest]
38
+ # @param context [OnlinePayments::SDK::CallContext]
39
+ # @return [OnlinePayments::SDK::Domain::CreatePaymentResponse]
40
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
41
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
42
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
43
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
44
+ # or there was a conflict (HTTP status code 404, 409 or 410)
45
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
46
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
47
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
48
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
49
+ def create_payment(body, context = nil)
50
+ uri = instantiate_uri('/v2/{merchantId}/payments')
51
+ @communicator.post(
52
+ uri,
53
+ client_headers,
54
+ nil,
55
+ body,
56
+ OnlinePayments::SDK::Domain::CreatePaymentResponse,
57
+ context
58
+ )
59
+ rescue ResponseException => e
60
+ error_type = OnlinePayments::SDK::Domain::PaymentErrorResponse
61
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
62
+ raise create_exception(e.status_code, e.body, error_object, context)
63
+ end
64
+
65
+ # Resource /v2/!{merchantId}/payments/!{paymentId}
66
+ # @param payment_id [String]
67
+ # @param context [OnlinePayments::SDK::CallContext]
68
+ # @return [OnlinePayments::SDK::Domain::PaymentResponse]
69
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
70
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
71
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
72
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
73
+ # or there was a conflict (HTTP status code 404, 409 or 410)
74
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
75
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
76
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
77
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
78
+ def get_payment(payment_id, context = nil)
79
+ path_context = {
80
+ 'paymentId'.freeze => payment_id,
81
+ }
82
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}', path_context)
83
+ @communicator.get(
84
+ uri,
85
+ client_headers,
86
+ nil,
87
+ OnlinePayments::SDK::Domain::PaymentResponse,
88
+ context
89
+ )
90
+ rescue ResponseException => e
91
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
92
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
93
+ raise create_exception(e.status_code, e.body, error_object, context)
94
+ end
95
+
96
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/complete
97
+ # @param payment_id [String]
98
+ # @param body [OnlinePayments::SDK::Domain::CompletePaymentRequest]
99
+ # @param context [OnlinePayments::SDK::CallContext]
100
+ # @return [OnlinePayments::SDK::Domain::CompletePaymentResponse]
101
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
102
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
103
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
104
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
105
+ # or there was a conflict (HTTP status code 404, 409 or 410)
106
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
107
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
108
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
109
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
110
+ def complete_payment(payment_id, body, context = nil)
111
+ path_context = {
112
+ 'paymentId'.freeze => payment_id,
113
+ }
114
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/complete', path_context)
115
+ @communicator.post(
116
+ uri,
117
+ client_headers,
118
+ nil,
119
+ body,
120
+ OnlinePayments::SDK::Domain::CompletePaymentResponse,
121
+ context
122
+ )
123
+ rescue ResponseException => e
124
+ error_type = OnlinePayments::SDK::Domain::PaymentErrorResponse
125
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
126
+ raise create_exception(e.status_code, e.body, error_object, context)
127
+ end
128
+
129
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/cancel
130
+ # @param payment_id [String]
131
+ # @param context [OnlinePayments::SDK::CallContext]
132
+ # @return [OnlinePayments::SDK::Domain::CancelPaymentResponse]
133
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
134
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
135
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
136
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
137
+ # or there was a conflict (HTTP status code 404, 409 or 410)
138
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
139
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
140
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
141
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
142
+ def cancel_payment(payment_id, context = nil)
143
+ path_context = {
144
+ 'paymentId'.freeze => payment_id,
145
+ }
146
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/cancel', path_context)
147
+ @communicator.post(
148
+ uri,
149
+ client_headers,
150
+ nil,
151
+ nil,
152
+ OnlinePayments::SDK::Domain::CancelPaymentResponse,
153
+ context
154
+ )
155
+ rescue ResponseException => e
156
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
157
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
158
+ raise create_exception(e.status_code, e.body, error_object, context)
159
+ end
160
+
161
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/refund
162
+ # @param payment_id [String]
163
+ # @param body [OnlinePayments::SDK::Domain::RefundRequest]
164
+ # @param context [OnlinePayments::SDK::CallContext]
165
+ # @return [OnlinePayments::SDK::Domain::RefundResponse]
166
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
167
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
168
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
169
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
170
+ # or there was a conflict (HTTP status code 404, 409 or 410)
171
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
172
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
173
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
174
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
175
+ def refund_payment(payment_id, body, context = nil)
176
+ path_context = {
177
+ 'paymentId'.freeze => payment_id,
178
+ }
179
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/refund', path_context)
180
+ @communicator.post(
181
+ uri,
182
+ client_headers,
183
+ nil,
184
+ body,
185
+ OnlinePayments::SDK::Domain::RefundResponse,
186
+ context
187
+ )
188
+ rescue ResponseException => e
189
+ error_type = OnlinePayments::SDK::Domain::RefundErrorResponse
190
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
191
+ raise create_exception(e.status_code, e.body, error_object, context)
192
+ end
193
+
194
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/capture
195
+ # @param payment_id [String]
196
+ # @param body [OnlinePayments::SDK::Domain::CapturePaymentRequest]
197
+ # @param context [OnlinePayments::SDK::CallContext]
198
+ # @return [OnlinePayments::SDK::Domain::CaptureResponse]
199
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
200
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
201
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
202
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
203
+ # or there was a conflict (HTTP status code 404, 409 or 410)
204
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
205
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
206
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
207
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
208
+ def capture_payment(payment_id, body, context = nil)
209
+ path_context = {
210
+ 'paymentId'.freeze => payment_id,
211
+ }
212
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/capture', path_context)
213
+ @communicator.post(
214
+ uri,
215
+ client_headers,
216
+ nil,
217
+ body,
218
+ OnlinePayments::SDK::Domain::CaptureResponse,
219
+ context
220
+ )
221
+ rescue ResponseException => e
222
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
223
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
224
+ raise create_exception(e.status_code, e.body, error_object, context)
225
+ end
226
+
227
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/captures
228
+ # @param payment_id [String]
229
+ # @param context [OnlinePayments::SDK::CallContext]
230
+ # @return [OnlinePayments::SDK::Domain::CapturesResponse]
231
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
232
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
233
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
234
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
235
+ # or there was a conflict (HTTP status code 404, 409 or 410)
236
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
237
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
238
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
239
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
240
+ def get_captures(payment_id, context = nil)
241
+ path_context = {
242
+ 'paymentId'.freeze => payment_id,
243
+ }
244
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/captures', path_context)
245
+ @communicator.get(
246
+ uri,
247
+ client_headers,
248
+ nil,
249
+ OnlinePayments::SDK::Domain::CapturesResponse,
250
+ context
251
+ )
252
+ rescue ResponseException => e
253
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
254
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
255
+ raise create_exception(e.status_code, e.body, error_object, context)
256
+ end
257
+
258
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/details
259
+ # @param payment_id [String]
260
+ # @param context [OnlinePayments::SDK::CallContext]
261
+ # @return [OnlinePayments::SDK::Domain::PaymentDetailsResponse]
262
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
263
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
264
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
265
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
266
+ # or there was a conflict (HTTP status code 404, 409 or 410)
267
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
268
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
269
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
270
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
271
+ def get_payment_details(payment_id, context = nil)
272
+ path_context = {
273
+ 'paymentId'.freeze => payment_id,
274
+ }
275
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/details', path_context)
276
+ @communicator.get(
277
+ uri,
278
+ client_headers,
279
+ nil,
280
+ OnlinePayments::SDK::Domain::PaymentDetailsResponse,
281
+ context
282
+ )
283
+ rescue ResponseException => e
284
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
285
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
286
+ raise create_exception(e.status_code, e.body, error_object, context)
287
+ end
288
+
289
+ # Resource /v2/!{merchantId}/payments/!{paymentId}/refunds
290
+ # @param payment_id [String]
291
+ # @param context [OnlinePayments::SDK::CallContext]
292
+ # @return [OnlinePayments::SDK::Domain::RefundsResponse]
293
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
294
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
295
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
296
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
297
+ # or there was a conflict (HTTP status code 404, 409 or 410)
298
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
299
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
300
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
301
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
302
+ def get_refunds(payment_id, context = nil)
303
+ path_context = {
304
+ 'paymentId'.freeze => payment_id,
305
+ }
306
+ uri = instantiate_uri('/v2/{merchantId}/payments/{paymentId}/refunds', path_context)
307
+ @communicator.get(
308
+ uri,
309
+ client_headers,
310
+ nil,
311
+ OnlinePayments::SDK::Domain::RefundsResponse,
312
+ context
313
+ )
314
+ rescue ResponseException => e
315
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
316
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
317
+ raise create_exception(e.status_code, e.body, error_object, context)
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end
@@ -0,0 +1,86 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/api_resource'
5
+ require 'onlinepayments/sdk/response_exception'
6
+ require 'onlinepayments/sdk/domain/create_payout_request'
7
+ require 'onlinepayments/sdk/domain/error_response'
8
+ require 'onlinepayments/sdk/domain/payout_error_response'
9
+ require 'onlinepayments/sdk/domain/payout_response'
10
+
11
+ module OnlinePayments::SDK
12
+ module Merchant
13
+ module Payouts
14
+
15
+ # Payouts client. Thread-safe.
16
+ class PayoutsClient < OnlinePayments::SDK::ApiResource
17
+
18
+ # @param parent [OnlinePayments::SDK::ApiResource]
19
+ # @param path_context [Hash, nil]
20
+ def initialize(parent, path_context = nil)
21
+ super(parent, path_context)
22
+ end
23
+
24
+ # Resource /v2/!{merchantId}/payouts
25
+ # @param body [OnlinePayments::SDK::Domain::CreatePayoutRequest]
26
+ # @param context [OnlinePayments::SDK::CallContext]
27
+ # @return [OnlinePayments::SDK::Domain::PayoutResponse]
28
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
29
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
30
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
31
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
32
+ # or there was a conflict (HTTP status code 404, 409 or 410)
33
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
34
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
35
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
36
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
37
+ def create_payout(body, context = nil)
38
+ uri = instantiate_uri('/v2/{merchantId}/payouts')
39
+ @communicator.post(
40
+ uri,
41
+ client_headers,
42
+ nil,
43
+ body,
44
+ OnlinePayments::SDK::Domain::PayoutResponse,
45
+ context
46
+ )
47
+ rescue ResponseException => e
48
+ error_type = OnlinePayments::SDK::Domain::PayoutErrorResponse
49
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
50
+ raise create_exception(e.status_code, e.body, error_object, context)
51
+ end
52
+
53
+ # Resource /v2/!{merchantId}/payouts/!{payoutId}
54
+ # @param payout_id [String]
55
+ # @param context [OnlinePayments::SDK::CallContext]
56
+ # @return [OnlinePayments::SDK::Domain::PayoutResponse]
57
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
58
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
59
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
60
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
61
+ # or there was a conflict (HTTP status code 404, 409 or 410)
62
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
63
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
64
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
65
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
66
+ def get_payout(payout_id, context = nil)
67
+ path_context = {
68
+ 'payoutId'.freeze => payout_id,
69
+ }
70
+ uri = instantiate_uri('/v2/{merchantId}/payouts/{payoutId}', path_context)
71
+ @communicator.get(
72
+ uri,
73
+ client_headers,
74
+ nil,
75
+ OnlinePayments::SDK::Domain::PayoutResponse,
76
+ context
77
+ )
78
+ rescue ResponseException => e
79
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
80
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
81
+ raise create_exception(e.status_code, e.body, error_object, context)
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,57 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/param_request'
5
+ require 'onlinepayments/sdk/request_param'
6
+
7
+ module OnlinePayments::SDK
8
+ module Merchant
9
+ module ProductGroups
10
+
11
+ # Query parameters for 'Get product group'.
12
+ # @attr [String] country_code
13
+ # @attr [String] currency_code
14
+ # @attr [String] locale
15
+ # @attr [Integer] amount
16
+ # @attr [true/false] is_recurring
17
+ # @attr [Array<String>] hide
18
+ class GetProductGroupParams < OnlinePayments::SDK::ParamRequest
19
+
20
+ attr_accessor :country_code
21
+
22
+ attr_accessor :currency_code
23
+
24
+ attr_accessor :locale
25
+
26
+ attr_accessor :amount
27
+
28
+ attr_accessor :is_recurring
29
+
30
+ attr_accessor :hide
31
+
32
+ # Adds the parameter _value_ to the _hide_ Array
33
+ # @param value [String]
34
+ def add_hide(value)
35
+ unless @hide
36
+ @hide = []
37
+ end
38
+ @hide << value
39
+ end
40
+
41
+ # @return [Array<OnlinePayments::SDK::RequestParam>] representing the attributes of this class
42
+ def to_request_parameters
43
+ result = []
44
+ result << RequestParam.new('countryCode', @country_code) unless @country_code.nil?
45
+ result << RequestParam.new('currencyCode', @currency_code) unless @currency_code.nil?
46
+ result << RequestParam.new('locale', @locale) unless @locale.nil?
47
+ result << RequestParam.new('amount', @amount.to_s) unless @amount.nil?
48
+ result << RequestParam.new('isRecurring', @is_recurring.to_s) unless @is_recurring.nil?
49
+ unless @hide.nil?
50
+ @hide.each { |e| result << RequestParam.new('hide', e) }
51
+ end
52
+ result
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,57 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/param_request'
5
+ require 'onlinepayments/sdk/request_param'
6
+
7
+ module OnlinePayments::SDK
8
+ module Merchant
9
+ module ProductGroups
10
+
11
+ # Query parameters for 'Get product groups'.
12
+ # @attr [String] country_code
13
+ # @attr [String] currency_code
14
+ # @attr [String] locale
15
+ # @attr [Integer] amount
16
+ # @attr [true/false] is_recurring
17
+ # @attr [Array<String>] hide
18
+ class GetProductGroupsParams < OnlinePayments::SDK::ParamRequest
19
+
20
+ attr_accessor :country_code
21
+
22
+ attr_accessor :currency_code
23
+
24
+ attr_accessor :locale
25
+
26
+ attr_accessor :amount
27
+
28
+ attr_accessor :is_recurring
29
+
30
+ attr_accessor :hide
31
+
32
+ # Adds the parameter _value_ to the _hide_ Array
33
+ # @param value [String]
34
+ def add_hide(value)
35
+ unless @hide
36
+ @hide = []
37
+ end
38
+ @hide << value
39
+ end
40
+
41
+ # @return [Array<OnlinePayments::SDK::RequestParam>] representing the attributes of this class
42
+ def to_request_parameters
43
+ result = []
44
+ result << RequestParam.new('countryCode', @country_code) unless @country_code.nil?
45
+ result << RequestParam.new('currencyCode', @currency_code) unless @currency_code.nil?
46
+ result << RequestParam.new('locale', @locale) unless @locale.nil?
47
+ result << RequestParam.new('amount', @amount.to_s) unless @amount.nil?
48
+ result << RequestParam.new('isRecurring', @is_recurring.to_s) unless @is_recurring.nil?
49
+ unless @hide.nil?
50
+ @hide.each { |e| result << RequestParam.new('hide', e) }
51
+ end
52
+ result
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,87 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/api_resource'
5
+ require 'onlinepayments/sdk/response_exception'
6
+ require 'onlinepayments/sdk/domain/error_response'
7
+ require 'onlinepayments/sdk/domain/get_payment_product_groups_response'
8
+ require 'onlinepayments/sdk/domain/payment_product_group'
9
+ require 'onlinepayments/sdk/merchant/productgroups/get_product_group_params'
10
+ require 'onlinepayments/sdk/merchant/productgroups/get_product_groups_params'
11
+
12
+ module OnlinePayments::SDK
13
+ module Merchant
14
+ module ProductGroups
15
+
16
+ # ProductGroups client. Thread-safe.
17
+ class ProductGroupsClient < OnlinePayments::SDK::ApiResource
18
+
19
+ # @param parent [OnlinePayments::SDK::ApiResource]
20
+ # @param path_context [Hash, nil]
21
+ def initialize(parent, path_context = nil)
22
+ super(parent, path_context)
23
+ end
24
+
25
+ # Resource /v2/!{merchantId}/productgroups
26
+ # @param query [OnlinePayments::SDK::Merchant::ProductGroups::GetProductGroupsParams]
27
+ # @param context [OnlinePayments::SDK::CallContext]
28
+ # @return [OnlinePayments::SDK::Domain::GetPaymentProductGroupsResponse]
29
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
30
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
31
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
32
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
33
+ # or there was a conflict (HTTP status code 404, 409 or 410)
34
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
35
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
36
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
37
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
38
+ def get_product_groups(query, context = nil)
39
+ uri = instantiate_uri('/v2/{merchantId}/productgroups')
40
+ @communicator.get(
41
+ uri,
42
+ client_headers,
43
+ query,
44
+ OnlinePayments::SDK::Domain::GetPaymentProductGroupsResponse,
45
+ context
46
+ )
47
+ rescue ResponseException => e
48
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
49
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
50
+ raise create_exception(e.status_code, e.body, error_object, context)
51
+ end
52
+
53
+ # Resource /v2/!{merchantId}/productgroups/!{paymentProductGroupId}
54
+ # @param payment_product_group_id [String]
55
+ # @param query [OnlinePayments::SDK::Merchant::ProductGroups::GetProductGroupParams]
56
+ # @param context [OnlinePayments::SDK::CallContext]
57
+ # @return [OnlinePayments::SDK::Domain::PaymentProductGroup]
58
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
59
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
60
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
61
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
62
+ # or there was a conflict (HTTP status code 404, 409 or 410)
63
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
64
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
65
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
66
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
67
+ def get_product_group(payment_product_group_id, query, context = nil)
68
+ path_context = {
69
+ 'paymentProductGroupId'.freeze => payment_product_group_id,
70
+ }
71
+ uri = instantiate_uri('/v2/{merchantId}/productgroups/{paymentProductGroupId}', path_context)
72
+ @communicator.get(
73
+ uri,
74
+ client_headers,
75
+ query,
76
+ OnlinePayments::SDK::Domain::PaymentProductGroup,
77
+ context
78
+ )
79
+ rescue ResponseException => e
80
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
81
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
82
+ raise create_exception(e.status_code, e.body, error_object, context)
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,38 @@
1
+ #
2
+ # This class was auto-generated.
3
+ #
4
+ require 'onlinepayments/sdk/param_request'
5
+ require 'onlinepayments/sdk/request_param'
6
+
7
+ module OnlinePayments::SDK
8
+ module Merchant
9
+ module Products
10
+
11
+ # Query parameters for 'Get payment product networks'.
12
+ # @attr [String] country_code
13
+ # @attr [String] currency_code
14
+ # @attr [Integer] amount
15
+ # @attr [true/false] is_recurring
16
+ class GetPaymentProductNetworksParams < OnlinePayments::SDK::ParamRequest
17
+
18
+ attr_accessor :country_code
19
+
20
+ attr_accessor :currency_code
21
+
22
+ attr_accessor :amount
23
+
24
+ attr_accessor :is_recurring
25
+
26
+ # @return [Array<OnlinePayments::SDK::RequestParam>] representing the attributes of this class
27
+ def to_request_parameters
28
+ result = []
29
+ result << RequestParam.new('countryCode', @country_code) unless @country_code.nil?
30
+ result << RequestParam.new('currencyCode', @currency_code) unless @currency_code.nil?
31
+ result << RequestParam.new('amount', @amount.to_s) unless @amount.nil?
32
+ result << RequestParam.new('isRecurring', @is_recurring.to_s) unless @is_recurring.nil?
33
+ result
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end