onlinepayments-sdk-ruby 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,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 Products
10
+
11
+ # Query parameters for 'Get payment product'.
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 GetPaymentProductParams < 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 Products
10
+
11
+ # Query parameters for 'Get payment products'.
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 GetPaymentProductsParams < 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,30 @@
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 directory'.
12
+ # @attr [String] country_code
13
+ # @attr [String] currency_code
14
+ class GetProductDirectoryParams < OnlinePayments::SDK::ParamRequest
15
+
16
+ attr_accessor :country_code
17
+
18
+ attr_accessor :currency_code
19
+
20
+ # @return [Array<OnlinePayments::SDK::RequestParam>] representing the attributes of this class
21
+ def to_request_parameters
22
+ result = []
23
+ result << RequestParam.new('countryCode', @country_code) unless @country_code.nil?
24
+ result << RequestParam.new('currencyCode', @currency_code) unless @currency_code.nil?
25
+ result
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,155 @@
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_products_response'
8
+ require 'onlinepayments/sdk/domain/payment_product'
9
+ require 'onlinepayments/sdk/domain/payment_product_networks_response'
10
+ require 'onlinepayments/sdk/domain/product_directory'
11
+ require 'onlinepayments/sdk/merchant/products/get_payment_product_networks_params'
12
+ require 'onlinepayments/sdk/merchant/products/get_payment_product_params'
13
+ require 'onlinepayments/sdk/merchant/products/get_payment_products_params'
14
+ require 'onlinepayments/sdk/merchant/products/get_product_directory_params'
15
+
16
+ module OnlinePayments::SDK
17
+ module Merchant
18
+ module Products
19
+
20
+ # Products client. Thread-safe.
21
+ class ProductsClient < OnlinePayments::SDK::ApiResource
22
+
23
+ # @param parent [OnlinePayments::SDK::ApiResource]
24
+ # @param path_context [Hash, nil]
25
+ def initialize(parent, path_context = nil)
26
+ super(parent, path_context)
27
+ end
28
+
29
+ # Resource /v2/!{merchantId}/products
30
+ # @param query [OnlinePayments::SDK::Merchant::Products::GetPaymentProductsParams]
31
+ # @param context [OnlinePayments::SDK::CallContext]
32
+ # @return [OnlinePayments::SDK::Domain::GetPaymentProductsResponse]
33
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
34
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
35
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
36
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
37
+ # or there was a conflict (HTTP status code 404, 409 or 410)
38
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
39
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
40
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
41
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
42
+ def get_payment_products(query, context = nil)
43
+ uri = instantiate_uri('/v2/{merchantId}/products')
44
+ @communicator.get(
45
+ uri,
46
+ client_headers,
47
+ query,
48
+ OnlinePayments::SDK::Domain::GetPaymentProductsResponse,
49
+ context
50
+ )
51
+ rescue ResponseException => e
52
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
53
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
54
+ raise create_exception(e.status_code, e.body, error_object, context)
55
+ end
56
+
57
+ # Resource /v2/!{merchantId}/products/!{paymentProductId}
58
+ # @param payment_product_id [Integer]
59
+ # @param query [OnlinePayments::SDK::Merchant::Products::GetPaymentProductParams]
60
+ # @param context [OnlinePayments::SDK::CallContext]
61
+ # @return [OnlinePayments::SDK::Domain::PaymentProduct]
62
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
63
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
64
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
65
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
66
+ # or there was a conflict (HTTP status code 404, 409 or 410)
67
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
68
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
69
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
70
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
71
+ def get_payment_product(payment_product_id, query, context = nil)
72
+ path_context = {
73
+ 'paymentProductId'.freeze => payment_product_id.to_s,
74
+ }
75
+ uri = instantiate_uri('/v2/{merchantId}/products/{paymentProductId}', path_context)
76
+ @communicator.get(
77
+ uri,
78
+ client_headers,
79
+ query,
80
+ OnlinePayments::SDK::Domain::PaymentProduct,
81
+ context
82
+ )
83
+ rescue ResponseException => e
84
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
85
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
86
+ raise create_exception(e.status_code, e.body, error_object, context)
87
+ end
88
+
89
+ # Resource /v2/!{merchantId}/products/!{paymentProductId}/directory
90
+ # @param payment_product_id [Integer]
91
+ # @param query [OnlinePayments::SDK::Merchant::Products::GetProductDirectoryParams]
92
+ # @param context [OnlinePayments::SDK::CallContext]
93
+ # @return [OnlinePayments::SDK::Domain::ProductDirectory]
94
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
95
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
96
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
97
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
98
+ # or there was a conflict (HTTP status code 404, 409 or 410)
99
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
100
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
101
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
102
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
103
+ def get_product_directory(payment_product_id, query, context = nil)
104
+ path_context = {
105
+ 'paymentProductId'.freeze => payment_product_id.to_s,
106
+ }
107
+ uri = instantiate_uri('/v2/{merchantId}/products/{paymentProductId}/directory', path_context)
108
+ @communicator.get(
109
+ uri,
110
+ client_headers,
111
+ query,
112
+ OnlinePayments::SDK::Domain::ProductDirectory,
113
+ context
114
+ )
115
+ rescue ResponseException => e
116
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
117
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
118
+ raise create_exception(e.status_code, e.body, error_object, context)
119
+ end
120
+
121
+ # Resource /v2/!{merchantId}/products/!{paymentProductId}/networks
122
+ # @param payment_product_id [Integer]
123
+ # @param query [OnlinePayments::SDK::Merchant::Products::GetPaymentProductNetworksParams]
124
+ # @param context [OnlinePayments::SDK::CallContext]
125
+ # @return [OnlinePayments::SDK::Domain::PaymentProductNetworksResponse]
126
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
127
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
128
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
129
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
130
+ # or there was a conflict (HTTP status code 404, 409 or 410)
131
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
132
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
133
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
134
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
135
+ def get_payment_product_networks(payment_product_id, query, context = nil)
136
+ path_context = {
137
+ 'paymentProductId'.freeze => payment_product_id.to_s,
138
+ }
139
+ uri = instantiate_uri('/v2/{merchantId}/products/{paymentProductId}/networks', path_context)
140
+ @communicator.get(
141
+ uri,
142
+ client_headers,
143
+ query,
144
+ OnlinePayments::SDK::Domain::PaymentProductNetworksResponse,
145
+ context
146
+ )
147
+ rescue ResponseException => e
148
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
149
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
150
+ raise create_exception(e.status_code, e.body, error_object, context)
151
+ end
152
+ end
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,82 @@
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_iin_details_request'
8
+ require 'onlinepayments/sdk/domain/get_iin_details_response'
9
+ require 'onlinepayments/sdk/domain/test_connection'
10
+
11
+ module OnlinePayments::SDK
12
+ module Merchant
13
+ module Services
14
+
15
+ # Services client. Thread-safe.
16
+ class ServicesClient < 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}/services/testconnection
25
+ # @param context [OnlinePayments::SDK::CallContext]
26
+ # @return [OnlinePayments::SDK::Domain::TestConnection]
27
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
28
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
29
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
30
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
31
+ # or there was a conflict (HTTP status code 404, 409 or 410)
32
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
33
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
34
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
35
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
36
+ def test_connection(context = nil)
37
+ uri = instantiate_uri('/v2/{merchantId}/services/testconnection')
38
+ @communicator.get(
39
+ uri,
40
+ client_headers,
41
+ nil,
42
+ OnlinePayments::SDK::Domain::TestConnection,
43
+ context
44
+ )
45
+ rescue ResponseException => e
46
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
47
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
48
+ raise create_exception(e.status_code, e.body, error_object, context)
49
+ end
50
+
51
+ # Resource /v2/!{merchantId}/services/getIINdetails
52
+ # @param body [OnlinePayments::SDK::Domain::GetIINDetailsRequest]
53
+ # @param context [OnlinePayments::SDK::CallContext]
54
+ # @return [OnlinePayments::SDK::Domain::GetIINDetailsResponse]
55
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
56
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
57
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
58
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
59
+ # or there was a conflict (HTTP status code 404, 409 or 410)
60
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
61
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
62
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
63
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
64
+ def get_iin_details(body, context = nil)
65
+ uri = instantiate_uri('/v2/{merchantId}/services/getIINdetails')
66
+ @communicator.post(
67
+ uri,
68
+ client_headers,
69
+ nil,
70
+ body,
71
+ OnlinePayments::SDK::Domain::GetIINDetailsResponse,
72
+ context
73
+ )
74
+ rescue ResponseException => e
75
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
76
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
77
+ raise create_exception(e.status_code, e.body, error_object, context)
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,54 @@
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/session_request'
8
+ require 'onlinepayments/sdk/domain/session_response'
9
+
10
+ module OnlinePayments::SDK
11
+ module Merchant
12
+ module Sessions
13
+
14
+ # Sessions client. Thread-safe.
15
+ class SessionsClient < OnlinePayments::SDK::ApiResource
16
+
17
+ # @param parent [OnlinePayments::SDK::ApiResource]
18
+ # @param path_context [Hash, nil]
19
+ def initialize(parent, path_context = nil)
20
+ super(parent, path_context)
21
+ end
22
+
23
+ # Resource /v2/!{merchantId}/sessions
24
+ # @param body [OnlinePayments::SDK::Domain::SessionRequest]
25
+ # @param context [OnlinePayments::SDK::CallContext]
26
+ # @return [OnlinePayments::SDK::Domain::SessionResponse]
27
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
28
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
29
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
30
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
31
+ # or there was a conflict (HTTP status code 404, 409 or 410)
32
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
33
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
34
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
35
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
36
+ def create_session(body, context = nil)
37
+ uri = instantiate_uri('/v2/{merchantId}/sessions')
38
+ @communicator.post(
39
+ uri,
40
+ client_headers,
41
+ nil,
42
+ body,
43
+ OnlinePayments::SDK::Domain::SessionResponse,
44
+ context
45
+ )
46
+ rescue ResponseException => e
47
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
48
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
49
+ raise create_exception(e.status_code, e.body, error_object, context)
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,116 @@
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_token_request'
7
+ require 'onlinepayments/sdk/domain/created_token_response'
8
+ require 'onlinepayments/sdk/domain/error_response'
9
+ require 'onlinepayments/sdk/domain/token_response'
10
+
11
+ module OnlinePayments::SDK
12
+ module Merchant
13
+ module Tokens
14
+
15
+ # Tokens client. Thread-safe.
16
+ class TokensClient < 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}/tokens
25
+ # @param body [OnlinePayments::SDK::Domain::CreateTokenRequest]
26
+ # @param context [OnlinePayments::SDK::CallContext]
27
+ # @return [OnlinePayments::SDK::Domain::CreatedTokenResponse]
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_token(body, context = nil)
38
+ uri = instantiate_uri('/v2/{merchantId}/tokens')
39
+ @communicator.post(
40
+ uri,
41
+ client_headers,
42
+ nil,
43
+ body,
44
+ OnlinePayments::SDK::Domain::CreatedTokenResponse,
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}/tokens/!{tokenId}
54
+ # @param token_id [String]
55
+ # @param context [OnlinePayments::SDK::CallContext]
56
+ # @return [OnlinePayments::SDK::Domain::TokenResponse]
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_token(token_id, context = nil)
67
+ path_context = {
68
+ 'tokenId'.freeze => token_id,
69
+ }
70
+ uri = instantiate_uri('/v2/{merchantId}/tokens/{tokenId}', path_context)
71
+ @communicator.get(
72
+ uri,
73
+ client_headers,
74
+ nil,
75
+ OnlinePayments::SDK::Domain::TokenResponse,
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
+
84
+ # Resource /v2/!{merchantId}/tokens/!{tokenId}
85
+ # @param token_id [String]
86
+ # @param context [OnlinePayments::SDK::CallContext]
87
+ # @raise [OnlinePayments::SDK::ValidationException] if the request was not correct and couldn't be processed (HTTP status code 400)
88
+ # @raise [OnlinePayments::SDK::AuthorizationException] if the request was not allowed (HTTP status code 403)
89
+ # @raise [OnlinePayments::SDK::IdempotenceException] if an idempotent request caused a conflict (HTTP status code 409)
90
+ # @raise [OnlinePayments::SDK::ReferenceException] if an object was attempted to be referenced that doesn't exist or has been removed,
91
+ # or there was a conflict (HTTP status code 404, 409 or 410)
92
+ # @raise [OnlinePayments::SDK::PaymentPlatformException] if something went wrong at the payment platform,
93
+ # the payment platform was unable to process a message from a downstream partner/acquirer,
94
+ # or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
95
+ # @raise [OnlinePayments::SDK::ApiException]if the payment platform returned any other error
96
+ def delete_token(token_id, context = nil)
97
+ path_context = {
98
+ 'tokenId'.freeze => token_id,
99
+ }
100
+ uri = instantiate_uri('/v2/{merchantId}/tokens/{tokenId}', path_context)
101
+ @communicator.delete(
102
+ uri,
103
+ client_headers,
104
+ nil,
105
+ nil,
106
+ context
107
+ )
108
+ rescue ResponseException => e
109
+ error_type = OnlinePayments::SDK::Domain::ErrorResponse
110
+ error_object = @communicator.marshaller.unmarshal(e.body, error_type)
111
+ raise create_exception(e.status_code, e.body, error_object, context)
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end