univapay-apimatic-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +224 -0
  4. data/bin/console +15 -0
  5. data/lib/univapay_client_sdk/api_helper.rb +10 -0
  6. data/lib/univapay_client_sdk/apis/base_api.rb +67 -0
  7. data/lib/univapay_client_sdk/apis/cancels_api.rb +293 -0
  8. data/lib/univapay_client_sdk/apis/charges_api.rb +903 -0
  9. data/lib/univapay_client_sdk/apis/merchants_api.rb +57 -0
  10. data/lib/univapay_client_sdk/apis/refunds_api.rb +298 -0
  11. data/lib/univapay_client_sdk/apis/stores_api.rb +126 -0
  12. data/lib/univapay_client_sdk/apis/subscriptions_api.rb +1014 -0
  13. data/lib/univapay_client_sdk/apis/transaction_tokens_api.rb +455 -0
  14. data/lib/univapay_client_sdk/apis/webhooks_api.rb +463 -0
  15. data/lib/univapay_client_sdk/client.rb +116 -0
  16. data/lib/univapay_client_sdk/configuration.rb +178 -0
  17. data/lib/univapay_client_sdk/events/unknown_event.rb +32 -0
  18. data/lib/univapay_client_sdk/events/webhooks/bank_transfer_handler.rb +37 -0
  19. data/lib/univapay_client_sdk/events/webhooks/cancel_handler.rb +37 -0
  20. data/lib/univapay_client_sdk/events/webhooks/charge_finished_handler.rb +37 -0
  21. data/lib/univapay_client_sdk/events/webhooks/charge_updated_handler.rb +37 -0
  22. data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
  23. data/lib/univapay_client_sdk/events/webhooks/recurring_token_deleted_handler.rb +37 -0
  24. data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
  25. data/lib/univapay_client_sdk/events/webhooks/subscription_canceled_handler.rb +37 -0
  26. data/lib/univapay_client_sdk/events/webhooks/subscription_completed_handler.rb +37 -0
  27. data/lib/univapay_client_sdk/events/webhooks/subscription_created_handler.rb +37 -0
  28. data/lib/univapay_client_sdk/events/webhooks/subscription_failure_handler.rb +37 -0
  29. data/lib/univapay_client_sdk/events/webhooks/subscription_payment_handler.rb +37 -0
  30. data/lib/univapay_client_sdk/events/webhooks/subscription_suspended_handler.rb +37 -0
  31. data/lib/univapay_client_sdk/events/webhooks/token_created_handler.rb +37 -0
  32. data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_check_updated_handler.rb +37 -0
  33. data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_updated_handler.rb +37 -0
  34. data/lib/univapay_client_sdk/events/webhooks/token_replaced_handler.rb +37 -0
  35. data/lib/univapay_client_sdk/events/webhooks/token_three_ds_updated_handler.rb +37 -0
  36. data/lib/univapay_client_sdk/events/webhooks/token_updated_handler.rb +37 -0
  37. data/lib/univapay_client_sdk/exceptions/api_error_exception.rb +199 -0
  38. data/lib/univapay_client_sdk/exceptions/api_exception.rb +21 -0
  39. data/lib/univapay_client_sdk/http/api_response.rb +19 -0
  40. data/lib/univapay_client_sdk/http/auth/oauth_2.rb +53 -0
  41. data/lib/univapay_client_sdk/http/http_call_back.rb +10 -0
  42. data/lib/univapay_client_sdk/http/http_method_enum.rb +10 -0
  43. data/lib/univapay_client_sdk/http/http_request.rb +10 -0
  44. data/lib/univapay_client_sdk/http/http_response.rb +10 -0
  45. data/lib/univapay_client_sdk/http/proxy_settings.rb +22 -0
  46. data/lib/univapay_client_sdk/logging/configuration/api_logging_configuration.rb +186 -0
  47. data/lib/univapay_client_sdk/logging/sdk_logger.rb +17 -0
  48. data/lib/univapay_client_sdk/models/api_error_detail.rb +87 -0
  49. data/lib/univapay_client_sdk/models/api_error_status.rb +26 -0
  50. data/lib/univapay_client_sdk/models/bank_transfer_event.rb +27 -0
  51. data/lib/univapay_client_sdk/models/bank_transfer_ledger.rb +199 -0
  52. data/lib/univapay_client_sdk/models/bank_transfer_ledger_bank_ledger_type.rb +36 -0
  53. data/lib/univapay_client_sdk/models/bank_transfer_ledger_list.rb +104 -0
  54. data/lib/univapay_client_sdk/models/bank_transfer_ledger_mode.rb +36 -0
  55. data/lib/univapay_client_sdk/models/bank_transfer_payment_status.rb +44 -0
  56. data/lib/univapay_client_sdk/models/bank_transfer_status_data.rb +229 -0
  57. data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback.rb +134 -0
  58. data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback_extension.rb +75 -0
  59. data/lib/univapay_client_sdk/models/base_bank_transfer_data.rb +100 -0
  60. data/lib/univapay_client_sdk/models/base_konbini_data.rb +99 -0
  61. data/lib/univapay_client_sdk/models/base_konbini_data_convenience_store.rb +60 -0
  62. data/lib/univapay_client_sdk/models/base_model.rb +110 -0
  63. data/lib/univapay_client_sdk/models/base_online_data.rb +123 -0
  64. data/lib/univapay_client_sdk/models/base_online_data_brand.rb +48 -0
  65. data/lib/univapay_client_sdk/models/base_online_data_call_method.rb +52 -0
  66. data/lib/univapay_client_sdk/models/base_online_data_os_type.rb +36 -0
  67. data/lib/univapay_client_sdk/models/base_online_data_user_identifier_source.rb +36 -0
  68. data/lib/univapay_client_sdk/models/cancel.rb +183 -0
  69. data/lib/univapay_client_sdk/models/cancel_create_request.rb +77 -0
  70. data/lib/univapay_client_sdk/models/cancel_event.rb +26 -0
  71. data/lib/univapay_client_sdk/models/cancel_list.rb +94 -0
  72. data/lib/univapay_client_sdk/models/cancel_status.rb +44 -0
  73. data/lib/univapay_client_sdk/models/cancel_update_request.rb +76 -0
  74. data/lib/univapay_client_sdk/models/cancel_webhook_callback.rb +132 -0
  75. data/lib/univapay_client_sdk/models/cancel_webhook_callback_extension.rb +74 -0
  76. data/lib/univapay_client_sdk/models/card_processor_installment_config.rb +89 -0
  77. data/lib/univapay_client_sdk/models/charge.rb +411 -0
  78. data/lib/univapay_client_sdk/models/charge_capture_request.rb +84 -0
  79. data/lib/univapay_client_sdk/models/charge_create_request.rb +179 -0
  80. data/lib/univapay_client_sdk/models/charge_create_request_client_metadata.rb +76 -0
  81. data/lib/univapay_client_sdk/models/charge_create_request_redirect.rb +75 -0
  82. data/lib/univapay_client_sdk/models/charge_create_request_three_ds.rb +88 -0
  83. data/lib/univapay_client_sdk/models/charge_create_request_three_ds_mode.rb +44 -0
  84. data/lib/univapay_client_sdk/models/charge_finished_webhook_callback.rb +131 -0
  85. data/lib/univapay_client_sdk/models/charge_list.rb +104 -0
  86. data/lib/univapay_client_sdk/models/charge_mode.rb +36 -0
  87. data/lib/univapay_client_sdk/models/charge_redirect.rb +96 -0
  88. data/lib/univapay_client_sdk/models/charge_status.rb +56 -0
  89. data/lib/univapay_client_sdk/models/charge_three_ds.rb +97 -0
  90. data/lib/univapay_client_sdk/models/charge_transaction_token_type.rb +40 -0
  91. data/lib/univapay_client_sdk/models/charge_update_request.rb +75 -0
  92. data/lib/univapay_client_sdk/models/charge_updated_webhook_callback.rb +131 -0
  93. data/lib/univapay_client_sdk/models/cursor_direction_query.rb +36 -0
  94. data/lib/univapay_client_sdk/models/customs_declaration_create_request.rb +106 -0
  95. data/lib/univapay_client_sdk/models/customs_declaration_event.rb +27 -0
  96. data/lib/univapay_client_sdk/models/customs_declaration_patch_request.rb +77 -0
  97. data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback.rb +135 -0
  98. data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback_extension.rb +76 -0
  99. data/lib/univapay_client_sdk/models/customs_declaration_webhook_data.rb +232 -0
  100. data/lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb +121 -0
  101. data/lib/univapay_client_sdk/models/customs_declaration_webhook_error.rb +127 -0
  102. data/lib/univapay_client_sdk/models/customs_declaration_webhook_other_error.rb +120 -0
  103. data/lib/univapay_client_sdk/models/customs_declaration_webhook_result.rb +125 -0
  104. data/lib/univapay_client_sdk/models/customs_declaration_webhook_status.rb +44 -0
  105. data/lib/univapay_client_sdk/models/generic_metadata.rb +111 -0
  106. data/lib/univapay_client_sdk/models/installment_fixed_cycles.rb +70 -0
  107. data/lib/univapay_client_sdk/models/installment_plan_type.rb +36 -0
  108. data/lib/univapay_client_sdk/models/issuer_token.rb +177 -0
  109. data/lib/univapay_client_sdk/models/issuer_token_call_method.rb +51 -0
  110. data/lib/univapay_client_sdk/models/issuer_token_payload.rb +105 -0
  111. data/lib/univapay_client_sdk/models/issuer_token_payment_type.rb +36 -0
  112. data/lib/univapay_client_sdk/models/merchant.rb +179 -0
  113. data/lib/univapay_client_sdk/models/merchant_webhook_bank_transfer_configuration.rb +342 -0
  114. data/lib/univapay_client_sdk/models/merchant_webhook_card_brand_percent_fees.rb +167 -0
  115. data/lib/univapay_client_sdk/models/merchant_webhook_card_configuration.rb +301 -0
  116. data/lib/univapay_client_sdk/models/merchant_webhook_checkout_configuration.rb +87 -0
  117. data/lib/univapay_client_sdk/models/merchant_webhook_checkout_toggle.rb +77 -0
  118. data/lib/univapay_client_sdk/models/merchant_webhook_configuration.rb +505 -0
  119. data/lib/univapay_client_sdk/models/merchant_webhook_convenience_configuration.rb +88 -0
  120. data/lib/univapay_client_sdk/models/merchant_webhook_customer_management_configuration.rb +99 -0
  121. data/lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb +139 -0
  122. data/lib/univapay_client_sdk/models/merchant_webhook_limit_charge_by_card_configuration.rb +88 -0
  123. data/lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb +100 -0
  124. data/lib/univapay_client_sdk/models/merchant_webhook_money_amount.rb +85 -0
  125. data/lib/univapay_client_sdk/models/merchant_webhook_online_configuration.rb +77 -0
  126. data/lib/univapay_client_sdk/models/merchant_webhook_paidy_configuration.rb +77 -0
  127. data/lib/univapay_client_sdk/models/merchant_webhook_qr_merchant_configuration.rb +77 -0
  128. data/lib/univapay_client_sdk/models/merchant_webhook_qr_scan_configuration.rb +93 -0
  129. data/lib/univapay_client_sdk/models/merchant_webhook_recurring_cvv_confirmation_config.rb +97 -0
  130. data/lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb +109 -0
  131. data/lib/univapay_client_sdk/models/merchant_webhook_security_configuration.rb +234 -0
  132. data/lib/univapay_client_sdk/models/merchant_webhook_subscription_configuration.rb +138 -0
  133. data/lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb +138 -0
  134. data/lib/univapay_client_sdk/models/merchant_webhook_transfer_schedule_configuration.rb +159 -0
  135. data/lib/univapay_client_sdk/models/merchant_webhook_user_transactions_configuration.rb +349 -0
  136. data/lib/univapay_client_sdk/models/mode_query.rb +36 -0
  137. data/lib/univapay_client_sdk/models/payment_error.rb +178 -0
  138. data/lib/univapay_client_sdk/models/plan_settings_type.rb +36 -0
  139. data/lib/univapay_client_sdk/models/recurring_token_deleted_webhook_callback.rb +132 -0
  140. data/lib/univapay_client_sdk/models/refund.rb +240 -0
  141. data/lib/univapay_client_sdk/models/refund_create_request.rb +118 -0
  142. data/lib/univapay_client_sdk/models/refund_event.rb +26 -0
  143. data/lib/univapay_client_sdk/models/refund_list.rb +104 -0
  144. data/lib/univapay_client_sdk/models/refund_reason_request.rb +42 -0
  145. data/lib/univapay_client_sdk/models/refund_reason_response.rb +62 -0
  146. data/lib/univapay_client_sdk/models/refund_status.rb +47 -0
  147. data/lib/univapay_client_sdk/models/refund_update_request.rb +99 -0
  148. data/lib/univapay_client_sdk/models/refund_webhook_callback.rb +132 -0
  149. data/lib/univapay_client_sdk/models/refund_webhook_callback_extension.rb +74 -0
  150. data/lib/univapay_client_sdk/models/restrict_ip_after_failed_charge_config.rb +99 -0
  151. data/lib/univapay_client_sdk/models/store.rb +119 -0
  152. data/lib/univapay_client_sdk/models/store_list.rb +104 -0
  153. data/lib/univapay_client_sdk/models/store_list_item.rb +114 -0
  154. data/lib/univapay_client_sdk/models/subscription.rb +310 -0
  155. data/lib/univapay_client_sdk/models/subscription_canceled_webhook_callback.rb +132 -0
  156. data/lib/univapay_client_sdk/models/subscription_completed_webhook_callback.rb +132 -0
  157. data/lib/univapay_client_sdk/models/subscription_create_request.rb +216 -0
  158. data/lib/univapay_client_sdk/models/subscription_created_webhook_callback.rb +132 -0
  159. data/lib/univapay_client_sdk/models/subscription_failure_webhook_callback.rb +132 -0
  160. data/lib/univapay_client_sdk/models/subscription_installment_plan.rb +86 -0
  161. data/lib/univapay_client_sdk/models/subscription_list.rb +104 -0
  162. data/lib/univapay_client_sdk/models/subscription_list_item.rb +352 -0
  163. data/lib/univapay_client_sdk/models/subscription_next_payment.rb +222 -0
  164. data/lib/univapay_client_sdk/models/subscription_patch_payment_request.rb +117 -0
  165. data/lib/univapay_client_sdk/models/subscription_patch_token_request.rb +79 -0
  166. data/lib/univapay_client_sdk/models/subscription_payment.rb +185 -0
  167. data/lib/univapay_client_sdk/models/subscription_payment_list.rb +94 -0
  168. data/lib/univapay_client_sdk/models/subscription_payment_webhook_callback.rb +132 -0
  169. data/lib/univapay_client_sdk/models/subscription_period.rb +56 -0
  170. data/lib/univapay_client_sdk/models/subscription_plan_settings.rb +98 -0
  171. data/lib/univapay_client_sdk/models/subscription_schedule_settings.rb +132 -0
  172. data/lib/univapay_client_sdk/models/subscription_status.rb +56 -0
  173. data/lib/univapay_client_sdk/models/subscription_suspend_request.rb +79 -0
  174. data/lib/univapay_client_sdk/models/subscription_suspended_webhook_callback.rb +132 -0
  175. data/lib/univapay_client_sdk/models/subscription_terminate_with_status.rb +36 -0
  176. data/lib/univapay_client_sdk/models/subscription_termination_mode.rb +36 -0
  177. data/lib/univapay_client_sdk/models/subscription_update_next_payment.rb +104 -0
  178. data/lib/univapay_client_sdk/models/subscription_update_request.rb +134 -0
  179. data/lib/univapay_client_sdk/models/subscription_update_schedule_settings.rb +110 -0
  180. data/lib/univapay_client_sdk/models/subscription_update_status.rb +37 -0
  181. data/lib/univapay_client_sdk/models/subscription_user_data.rb +134 -0
  182. data/lib/univapay_client_sdk/models/suspend_schedule_settings.rb +78 -0
  183. data/lib/univapay_client_sdk/models/three_ds_issuer_token.rb +116 -0
  184. data/lib/univapay_client_sdk/models/three_ds_issuer_token_call_method.rb +26 -0
  185. data/lib/univapay_client_sdk/models/three_ds_issuer_token_payment_type.rb +26 -0
  186. data/lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb +122 -0
  187. data/lib/univapay_client_sdk/models/token_create_card_data.rb +231 -0
  188. data/lib/univapay_client_sdk/models/token_create_card_data_cvv_authorize.rb +95 -0
  189. data/lib/univapay_client_sdk/models/token_create_card_data_three_ds.rb +97 -0
  190. data/lib/univapay_client_sdk/models/token_create_konbini_data.rb +147 -0
  191. data/lib/univapay_client_sdk/models/token_create_online_data.rb +142 -0
  192. data/lib/univapay_client_sdk/models/token_create_phone_number.rb +104 -0
  193. data/lib/univapay_client_sdk/models/token_created_webhook_callback.rb +131 -0
  194. data/lib/univapay_client_sdk/models/token_cvv_auth_check_updated_webhook_callback.rb +132 -0
  195. data/lib/univapay_client_sdk/models/token_cvv_auth_updated_webhook_callback.rb +132 -0
  196. data/lib/univapay_client_sdk/models/token_replaced_webhook_callback.rb +131 -0
  197. data/lib/univapay_client_sdk/models/token_response_bank_transfer_data.rb +181 -0
  198. data/lib/univapay_client_sdk/models/token_response_card_data.rb +129 -0
  199. data/lib/univapay_client_sdk/models/token_response_card_data_billing.rb +153 -0
  200. data/lib/univapay_client_sdk/models/token_response_card_data_card.rb +187 -0
  201. data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize.rb +132 -0
  202. data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb +118 -0
  203. data/lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb +142 -0
  204. data/lib/univapay_client_sdk/models/token_response_card_data_three_ds_status.rb +48 -0
  205. data/lib/univapay_client_sdk/models/token_response_konbini_data.rb +135 -0
  206. data/lib/univapay_client_sdk/models/token_response_online_data.rb +158 -0
  207. data/lib/univapay_client_sdk/models/token_response_phone_number.rb +96 -0
  208. data/lib/univapay_client_sdk/models/token_three_ds_updated_webhook_callback.rb +132 -0
  209. data/lib/univapay_client_sdk/models/token_updated_webhook_callback.rb +131 -0
  210. data/lib/univapay_client_sdk/models/transaction_token.rb +250 -0
  211. data/lib/univapay_client_sdk/models/transaction_token_create_request.rb +161 -0
  212. data/lib/univapay_client_sdk/models/transaction_token_create_request_metadata.rb +124 -0
  213. data/lib/univapay_client_sdk/models/transaction_token_create_request_payment_type.rb +44 -0
  214. data/lib/univapay_client_sdk/models/transaction_token_create_request_type.rb +40 -0
  215. data/lib/univapay_client_sdk/models/transaction_token_list.rb +104 -0
  216. data/lib/univapay_client_sdk/models/transaction_token_list_item.rb +204 -0
  217. data/lib/univapay_client_sdk/models/transaction_token_list_item_user_data.rb +96 -0
  218. data/lib/univapay_client_sdk/models/transaction_token_mode.rb +36 -0
  219. data/lib/univapay_client_sdk/models/transaction_token_payment_type.rb +48 -0
  220. data/lib/univapay_client_sdk/models/transaction_token_type.rb +40 -0
  221. data/lib/univapay_client_sdk/models/transaction_token_update_request.rb +95 -0
  222. data/lib/univapay_client_sdk/models/transaction_token_update_request_data.rb +184 -0
  223. data/lib/univapay_client_sdk/models/transaction_token_update_request_data_phone_number.rb +86 -0
  224. data/lib/univapay_client_sdk/models/webhook.rb +191 -0
  225. data/lib/univapay_client_sdk/models/webhook_callback_envelope.rb +98 -0
  226. data/lib/univapay_client_sdk/models/webhook_create_request.rb +97 -0
  227. data/lib/univapay_client_sdk/models/webhook_event.rb +166 -0
  228. data/lib/univapay_client_sdk/models/webhook_event_list.rb +94 -0
  229. data/lib/univapay_client_sdk/models/webhook_list.rb +94 -0
  230. data/lib/univapay_client_sdk/models/webhook_trigger.rb +104 -0
  231. data/lib/univapay_client_sdk/models/webhook_update_request.rb +108 -0
  232. data/lib/univapay_client_sdk/utilities/date_time_helper.rb +11 -0
  233. data/lib/univapay_client_sdk/utilities/file_wrapper.rb +28 -0
  234. data/lib/univapay_client_sdk/utilities/union_type_lookup.rb +242 -0
  235. data/lib/univapay_client_sdk.rb +322 -0
  236. data/test/apis/api_test_base.rb +23 -0
  237. data/test/apis/test_cancels_api.rb +162 -0
  238. data/test/apis/test_charges_api.rb +564 -0
  239. data/test/apis/test_merchants_api.rb +50 -0
  240. data/test/apis/test_refunds_api.rb +172 -0
  241. data/test/apis/test_stores_api.rb +86 -0
  242. data/test/apis/test_subscriptions_api.rb +579 -0
  243. data/test/apis/test_transaction_tokens_api.rb +305 -0
  244. data/test/apis/test_webhooks_api.rb +245 -0
  245. data/test/events/webhooks/test_bank_transfer_handler.rb +95 -0
  246. data/test/events/webhooks/test_cancel_handler.rb +90 -0
  247. data/test/events/webhooks/test_charge_finished_handler.rb +95 -0
  248. data/test/events/webhooks/test_charge_updated_handler.rb +95 -0
  249. data/test/events/webhooks/test_customs_handler.rb +100 -0
  250. data/test/events/webhooks/test_recurring_token_deleted_handler.rb +92 -0
  251. data/test/events/webhooks/test_refund_handler.rb +95 -0
  252. data/test/events/webhooks/test_subscription_canceled_handler.rb +101 -0
  253. data/test/events/webhooks/test_subscription_completed_handler.rb +101 -0
  254. data/test/events/webhooks/test_subscription_created_handler.rb +101 -0
  255. data/test/events/webhooks/test_subscription_failure_handler.rb +101 -0
  256. data/test/events/webhooks/test_subscription_payment_handler.rb +101 -0
  257. data/test/events/webhooks/test_subscription_suspended_handler.rb +101 -0
  258. data/test/events/webhooks/test_token_created_handler.rb +92 -0
  259. data/test/events/webhooks/test_token_cvv_auth_check_updated_handler.rb +92 -0
  260. data/test/events/webhooks/test_token_cvv_auth_updated_handler.rb +92 -0
  261. data/test/events/webhooks/test_token_replaced_handler.rb +92 -0
  262. data/test/events/webhooks/test_token_three_ds_updated_handler.rb +92 -0
  263. data/test/events/webhooks/test_token_updated_handler.rb +92 -0
  264. data/test/framework_integrations/rails_app_test_helper.rb +14 -0
  265. data/test/framework_integrations/webhooks/apps/hanami_charge_updated_app.rb +61 -0
  266. data/test/framework_integrations/webhooks/apps/rails_charge_updated_app.rb +24 -0
  267. data/test/framework_integrations/webhooks/apps/sinatra_charge_updated_app.rb +27 -0
  268. data/test/framework_integrations/webhooks/test/test_hanami_charge_updated_app.rb +57 -0
  269. data/test/framework_integrations/webhooks/test/test_rails_charge_updated_app.rb +57 -0
  270. data/test/framework_integrations/webhooks/test/test_sinatra_charge_updated_app.rb +58 -0
  271. data/test/http_response_catcher.rb +19 -0
  272. metadata +397 -0
@@ -0,0 +1,57 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # MerchantsApi
8
+ class MerchantsApi < BaseApi
9
+ # Returns merchant identity and the effective configuration resolved from
10
+ # bearer credentials. Treat this as the canonical introspection endpoint for
11
+ # merchant integrations.
12
+ # @return [ApiResponse] Complete http response with raw body and status code.
13
+ def get_current_merchant
14
+ @api_call
15
+ .request(new_request_builder(HttpMethodEnum::GET,
16
+ '/me',
17
+ Server::DEFAULT)
18
+ .header_param(new_parameter('application/json', key: 'accept'))
19
+ .auth(Single.new('JWT_TOKEN')))
20
+ .response(new_response_handler
21
+ .deserializer(APIHelper.method(:custom_type_deserializer))
22
+ .deserialize_into(Merchant.method(:from_hash))
23
+ .is_api_response(true)
24
+ .local_error_template('401',
25
+ 'HTTP 401 Unauthorized: {$response.body#/code}',
26
+ ApiErrorException)
27
+ .local_error_template('403',
28
+ 'HTTP 403 Forbidden: {$response.body#/code}',
29
+ ApiErrorException)
30
+ .local_error_template('429',
31
+ 'HTTP 429 Rate Limited: {$response.body#/code}',
32
+ APIException)
33
+ .local_error_template('400',
34
+ 'HTTP 400 Bad Request: {$response.body#/code}',
35
+ APIException)
36
+ .local_error_template('404',
37
+ 'HTTP 404 Not Found: {$response.body#/code}',
38
+ APIException)
39
+ .local_error_template('409',
40
+ 'HTTP 409 Conflict: {$response.body#/code}',
41
+ APIException)
42
+ .local_error_template('500',
43
+ 'HTTP 500 Server Error: {$response.body#/code}',
44
+ APIException)
45
+ .local_error_template('503',
46
+ 'HTTP 503 Unavailable: {$response.body#/code}',
47
+ APIException)
48
+ .local_error_template('504',
49
+ 'HTTP 504 Timeout: {$response.body#/code}',
50
+ APIException)
51
+ .local_error_template('default',
52
+ 'HTTP {$statusCode}: {$response.body#/code}',
53
+ APIException))
54
+ .execute
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,298 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # RefundsApi
8
+ class RefundsApi < BaseApi
9
+ # Retrieves a list of all refunds for a specific charge.
10
+ # @param [UUID | String] store_id Required parameter: The unique identifier
11
+ # of the store.
12
+ # @param [UUID | String] charge_id Required parameter: The unique identifier
13
+ # of the charge.
14
+ # @param [Integer] limit Optional parameter: Maximum number of resources to
15
+ # return in one page.
16
+ # @param [UUID | String] cursor Optional parameter: Cursor pointing to the
17
+ # resource after which pagination should continue.
18
+ # @param [CursorDirectionQuery] cursor_direction Optional parameter:
19
+ # Pagination direction relative to the supplied cursor.
20
+ # @param [String] metadata Optional parameter: Filter refunds by metadata
21
+ # content.
22
+ # @return [ApiResponse] Complete http response with raw body and status code.
23
+ def list_refunds(store_id,
24
+ charge_id,
25
+ limit: 10,
26
+ cursor: nil,
27
+ cursor_direction: CursorDirectionQuery::DESC,
28
+ metadata: nil)
29
+ @api_call
30
+ .request(new_request_builder(HttpMethodEnum::GET,
31
+ '/stores/{storeId}/charges/{chargeId}/refunds',
32
+ Server::DEFAULT)
33
+ .template_param(new_parameter(store_id, key: 'storeId')
34
+ .is_required(true)
35
+ .should_encode(true))
36
+ .template_param(new_parameter(charge_id, key: 'chargeId')
37
+ .is_required(true)
38
+ .should_encode(true))
39
+ .query_param(new_parameter(limit, key: 'limit'))
40
+ .query_param(new_parameter(cursor, key: 'cursor'))
41
+ .query_param(new_parameter(cursor_direction, key: 'cursor_direction'))
42
+ .query_param(new_parameter(metadata, key: 'metadata'))
43
+ .header_param(new_parameter('application/json', key: 'accept'))
44
+ .auth(Single.new('JWT_TOKEN')))
45
+ .response(new_response_handler
46
+ .deserializer(APIHelper.method(:custom_type_deserializer))
47
+ .deserialize_into(RefundList.method(:from_hash))
48
+ .is_api_response(true)
49
+ .local_error_template('401',
50
+ 'HTTP 401 Unauthorized: {$response.body#/code}',
51
+ ApiErrorException)
52
+ .local_error_template('403',
53
+ 'HTTP 403 Forbidden: {$response.body#/code}',
54
+ ApiErrorException)
55
+ .local_error_template('404',
56
+ 'HTTP 404 Not Found: {$response.body#/code}',
57
+ ApiErrorException)
58
+ .local_error_template('400',
59
+ 'HTTP 400 Bad Request: {$response.body#/code}',
60
+ APIException)
61
+ .local_error_template('409',
62
+ 'HTTP 409 Conflict: {$response.body#/code}',
63
+ APIException)
64
+ .local_error_template('429',
65
+ 'HTTP 429 Rate Limited: {$response.body#/code}',
66
+ APIException)
67
+ .local_error_template('500',
68
+ 'HTTP 500 Server Error: {$response.body#/code}',
69
+ APIException)
70
+ .local_error_template('503',
71
+ 'HTTP 503 Unavailable: {$response.body#/code}',
72
+ APIException)
73
+ .local_error_template('504',
74
+ 'HTTP 504 Timeout: {$response.body#/code}',
75
+ APIException)
76
+ .local_error_template('default',
77
+ 'HTTP {$statusCode}: {$response.body#/code}',
78
+ APIException))
79
+ .execute
80
+ end
81
+
82
+ # Creates a refund for a successful charge. The charge must have status
83
+ # `successful`. Konbini and bank transfer charges cannot be refunded. The
84
+ # refund is processed asynchronously — the initial status will be `pending`.
85
+ # @param [UUID | String] store_id Required parameter: The unique identifier
86
+ # of the store.
87
+ # @param [UUID | String] charge_id Required parameter: The unique identifier
88
+ # of the charge.
89
+ # @param [RefundCreateRequest] body Required parameter: Request payload for
90
+ # creating a refund.
91
+ # @param [String] idempotency_key Optional parameter: An optional
92
+ # idempotency key to prevent double charges and duplicate operations. We
93
+ # recommend a randomly generated UUID (v4).
94
+ # @return [ApiResponse] Complete http response with raw body and status code.
95
+ def create_refund(store_id,
96
+ charge_id,
97
+ body,
98
+ idempotency_key: nil)
99
+ @api_call
100
+ .request(new_request_builder(HttpMethodEnum::POST,
101
+ '/stores/{storeId}/charges/{chargeId}/refunds',
102
+ Server::DEFAULT)
103
+ .template_param(new_parameter(store_id, key: 'storeId')
104
+ .is_required(true)
105
+ .should_encode(true))
106
+ .template_param(new_parameter(charge_id, key: 'chargeId')
107
+ .is_required(true)
108
+ .should_encode(true))
109
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
110
+ .body_param(new_parameter(body)
111
+ .is_required(true))
112
+ .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
113
+ .header_param(new_parameter('application/json', key: 'accept'))
114
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
115
+ .auth(Single.new('JWT_TOKEN')))
116
+ .response(new_response_handler
117
+ .deserializer(APIHelper.method(:custom_type_deserializer))
118
+ .deserialize_into(Refund.method(:from_hash))
119
+ .is_api_response(true)
120
+ .local_error_template('400',
121
+ 'HTTP 400 Bad Request: {$response.body#/code}',
122
+ ApiErrorException)
123
+ .local_error_template('401',
124
+ 'HTTP 401 Unauthorized: {$response.body#/code}',
125
+ ApiErrorException)
126
+ .local_error_template('403',
127
+ 'HTTP 403 Forbidden: {$response.body#/code}',
128
+ ApiErrorException)
129
+ .local_error_template('404',
130
+ 'HTTP 404 Not Found: {$response.body#/code}',
131
+ ApiErrorException)
132
+ .local_error_template('429',
133
+ 'HTTP 429 Rate Limited: {$response.body#/code}',
134
+ APIException)
135
+ .local_error_template('409',
136
+ 'HTTP 409 Conflict: {$response.body#/code}',
137
+ APIException)
138
+ .local_error_template('500',
139
+ 'HTTP 500 Server Error: {$response.body#/code}',
140
+ APIException)
141
+ .local_error_template('503',
142
+ 'HTTP 503 Unavailable: {$response.body#/code}',
143
+ APIException)
144
+ .local_error_template('504',
145
+ 'HTTP 504 Timeout: {$response.body#/code}',
146
+ APIException)
147
+ .local_error_template('default',
148
+ 'HTTP {$statusCode}: {$response.body#/code}',
149
+ APIException))
150
+ .execute
151
+ end
152
+
153
+ # Retrieves the details of a specific refund. Supports long polling — set
154
+ # `polling=true` to wait until the refund status changes from `pending` to a
155
+ # terminal state (`successful`, `failed`, or `error`).
156
+ # @param [UUID | String] store_id Required parameter: The unique identifier
157
+ # of the store.
158
+ # @param [UUID | String] charge_id Required parameter: The unique identifier
159
+ # of the charge.
160
+ # @param [UUID | String] id Required parameter: The unique identifier of the
161
+ # resource.
162
+ # @param [TrueClass | FalseClass] polling Optional parameter: If `true`, the
163
+ # server holds the connection open until the refund status transitions from
164
+ # `pending` to a terminal state, or until the polling timeout is reached.
165
+ # @return [ApiResponse] Complete http response with raw body and status code.
166
+ def get_refund(store_id,
167
+ charge_id,
168
+ id,
169
+ polling: nil)
170
+ @api_call
171
+ .request(new_request_builder(HttpMethodEnum::GET,
172
+ '/stores/{storeId}/charges/{chargeId}/refunds/{id}',
173
+ Server::DEFAULT)
174
+ .template_param(new_parameter(store_id, key: 'storeId')
175
+ .is_required(true)
176
+ .should_encode(true))
177
+ .template_param(new_parameter(charge_id, key: 'chargeId')
178
+ .is_required(true)
179
+ .should_encode(true))
180
+ .template_param(new_parameter(id, key: 'id')
181
+ .is_required(true)
182
+ .should_encode(true))
183
+ .query_param(new_parameter(polling, key: 'polling'))
184
+ .header_param(new_parameter('application/json', key: 'accept'))
185
+ .auth(Single.new('JWT_TOKEN')))
186
+ .response(new_response_handler
187
+ .deserializer(APIHelper.method(:custom_type_deserializer))
188
+ .deserialize_into(Refund.method(:from_hash))
189
+ .is_api_response(true)
190
+ .local_error_template('401',
191
+ 'HTTP 401 Unauthorized: {$response.body#/code}',
192
+ ApiErrorException)
193
+ .local_error_template('404',
194
+ 'HTTP 404 Not Found: {$response.body#/code}',
195
+ ApiErrorException)
196
+ .local_error_template('400',
197
+ 'HTTP 400 Bad Request: {$response.body#/code}',
198
+ APIException)
199
+ .local_error_template('403',
200
+ 'HTTP 403 Forbidden: {$response.body#/code}',
201
+ APIException)
202
+ .local_error_template('409',
203
+ 'HTTP 409 Conflict: {$response.body#/code}',
204
+ APIException)
205
+ .local_error_template('429',
206
+ 'HTTP 429 Rate Limited: {$response.body#/code}',
207
+ APIException)
208
+ .local_error_template('500',
209
+ 'HTTP 500 Server Error: {$response.body#/code}',
210
+ APIException)
211
+ .local_error_template('503',
212
+ 'HTTP 503 Unavailable: {$response.body#/code}',
213
+ APIException)
214
+ .local_error_template('504',
215
+ 'HTTP 504 Timeout: {$response.body#/code}',
216
+ APIException)
217
+ .local_error_template('default',
218
+ 'HTTP {$statusCode}: {$response.body#/code}',
219
+ APIException))
220
+ .execute
221
+ end
222
+
223
+ # Updates metadata, message, or reason on an existing refund.
224
+ # @param [UUID | String] store_id Required parameter: The unique identifier
225
+ # of the store.
226
+ # @param [UUID | String] charge_id Required parameter: The unique identifier
227
+ # of the charge.
228
+ # @param [UUID | String] id Required parameter: The unique identifier of the
229
+ # resource.
230
+ # @param [RefundUpdateRequest] body Required parameter: Request payload for
231
+ # updating refund metadata or reason.
232
+ # @param [String] idempotency_key Optional parameter: An optional
233
+ # idempotency key to prevent double charges and duplicate operations. We
234
+ # recommend a randomly generated UUID (v4).
235
+ # @return [ApiResponse] Complete http response with raw body and status code.
236
+ def update_refund(store_id,
237
+ charge_id,
238
+ id,
239
+ body,
240
+ idempotency_key: nil)
241
+ @api_call
242
+ .request(new_request_builder(HttpMethodEnum::PATCH,
243
+ '/stores/{storeId}/charges/{chargeId}/refunds/{id}',
244
+ Server::DEFAULT)
245
+ .template_param(new_parameter(store_id, key: 'storeId')
246
+ .is_required(true)
247
+ .should_encode(true))
248
+ .template_param(new_parameter(charge_id, key: 'chargeId')
249
+ .is_required(true)
250
+ .should_encode(true))
251
+ .template_param(new_parameter(id, key: 'id')
252
+ .is_required(true)
253
+ .should_encode(true))
254
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
255
+ .body_param(new_parameter(body)
256
+ .is_required(true))
257
+ .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
258
+ .header_param(new_parameter('application/json', key: 'accept'))
259
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
260
+ .auth(Single.new('JWT_TOKEN')))
261
+ .response(new_response_handler
262
+ .deserializer(APIHelper.method(:custom_type_deserializer))
263
+ .deserialize_into(Refund.method(:from_hash))
264
+ .is_api_response(true)
265
+ .local_error_template('400',
266
+ 'HTTP 400 Bad Request: {$response.body#/code}',
267
+ ApiErrorException)
268
+ .local_error_template('401',
269
+ 'HTTP 401 Unauthorized: {$response.body#/code}',
270
+ ApiErrorException)
271
+ .local_error_template('403',
272
+ 'HTTP 403 Forbidden: {$response.body#/code}',
273
+ ApiErrorException)
274
+ .local_error_template('404',
275
+ 'HTTP 404 Not Found: {$response.body#/code}',
276
+ ApiErrorException)
277
+ .local_error_template('409',
278
+ 'HTTP 409 Conflict: {$response.body#/code}',
279
+ APIException)
280
+ .local_error_template('429',
281
+ 'HTTP 429 Rate Limited: {$response.body#/code}',
282
+ APIException)
283
+ .local_error_template('500',
284
+ 'HTTP 500 Server Error: {$response.body#/code}',
285
+ APIException)
286
+ .local_error_template('503',
287
+ 'HTTP 503 Unavailable: {$response.body#/code}',
288
+ APIException)
289
+ .local_error_template('504',
290
+ 'HTTP 504 Timeout: {$response.body#/code}',
291
+ APIException)
292
+ .local_error_template('default',
293
+ 'HTTP {$statusCode}: {$response.body#/code}',
294
+ APIException))
295
+ .execute
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,126 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # StoresApi
8
+ class StoresApi < BaseApi
9
+ # Returns stores visible to the current merchant credential. Supports cursor
10
+ # pagination plus `short_id` and free-text `search` filters.
11
+ # @param [Integer] limit Optional parameter: Maximum number of resources to
12
+ # return in one page.
13
+ # @param [UUID | String] cursor Optional parameter: Cursor pointing to the
14
+ # resource after which pagination should continue.
15
+ # @param [CursorDirectionQuery] cursor_direction Optional parameter:
16
+ # Pagination direction relative to the supplied cursor.
17
+ # @param [String] short_id Optional parameter: Filter by short identifier.
18
+ # @param [String] search Optional parameter: Case-insensitive free-text
19
+ # search.
20
+ # @return [ApiResponse] Complete http response with raw body and status code.
21
+ def list_stores(limit: 10,
22
+ cursor: nil,
23
+ cursor_direction: CursorDirectionQuery::DESC,
24
+ short_id: nil,
25
+ search: nil)
26
+ @api_call
27
+ .request(new_request_builder(HttpMethodEnum::GET,
28
+ '/stores',
29
+ Server::DEFAULT)
30
+ .query_param(new_parameter(limit, key: 'limit'))
31
+ .query_param(new_parameter(cursor, key: 'cursor'))
32
+ .query_param(new_parameter(cursor_direction, key: 'cursor_direction'))
33
+ .query_param(new_parameter(short_id, key: 'short_id'))
34
+ .query_param(new_parameter(search, key: 'search'))
35
+ .header_param(new_parameter('application/json', key: 'accept'))
36
+ .auth(Single.new('JWT_TOKEN')))
37
+ .response(new_response_handler
38
+ .deserializer(APIHelper.method(:custom_type_deserializer))
39
+ .deserialize_into(StoreList.method(:from_hash))
40
+ .is_api_response(true)
41
+ .local_error_template('400',
42
+ 'HTTP 400 Bad Request: {$response.body#/code}',
43
+ ApiErrorException)
44
+ .local_error_template('401',
45
+ 'HTTP 401 Unauthorized: {$response.body#/code}',
46
+ ApiErrorException)
47
+ .local_error_template('403',
48
+ 'HTTP 403 Forbidden: {$response.body#/code}',
49
+ ApiErrorException)
50
+ .local_error_template('429',
51
+ 'HTTP 429 Rate Limited: {$response.body#/code}',
52
+ APIException)
53
+ .local_error_template('404',
54
+ 'HTTP 404 Not Found: {$response.body#/code}',
55
+ APIException)
56
+ .local_error_template('409',
57
+ 'HTTP 409 Conflict: {$response.body#/code}',
58
+ APIException)
59
+ .local_error_template('500',
60
+ 'HTTP 500 Server Error: {$response.body#/code}',
61
+ APIException)
62
+ .local_error_template('503',
63
+ 'HTTP 503 Unavailable: {$response.body#/code}',
64
+ APIException)
65
+ .local_error_template('504',
66
+ 'HTTP 504 Timeout: {$response.body#/code}',
67
+ APIException)
68
+ .local_error_template('default',
69
+ 'HTTP {$statusCode}: {$response.body#/code}',
70
+ APIException))
71
+ .execute
72
+ end
73
+
74
+ # Returns a single store plus its resolved configuration snapshot for the
75
+ # current merchant context.
76
+ # @param [UUID | String] id Required parameter: The unique identifier of the
77
+ # resource.
78
+ # @return [ApiResponse] Complete http response with raw body and status code.
79
+ def get_store(id)
80
+ @api_call
81
+ .request(new_request_builder(HttpMethodEnum::GET,
82
+ '/stores/{id}',
83
+ Server::DEFAULT)
84
+ .template_param(new_parameter(id, key: 'id')
85
+ .is_required(true)
86
+ .should_encode(true))
87
+ .header_param(new_parameter('application/json', key: 'accept'))
88
+ .auth(Single.new('JWT_TOKEN')))
89
+ .response(new_response_handler
90
+ .deserializer(APIHelper.method(:custom_type_deserializer))
91
+ .deserialize_into(Store.method(:from_hash))
92
+ .is_api_response(true)
93
+ .local_error_template('401',
94
+ 'HTTP 401 Unauthorized: {$response.body#/code}',
95
+ ApiErrorException)
96
+ .local_error_template('403',
97
+ 'HTTP 403 Forbidden: {$response.body#/code}',
98
+ ApiErrorException)
99
+ .local_error_template('404',
100
+ 'HTTP 404 Not Found: {$response.body#/code}',
101
+ ApiErrorException)
102
+ .local_error_template('429',
103
+ 'HTTP 429 Rate Limited: {$response.body#/code}',
104
+ APIException)
105
+ .local_error_template('400',
106
+ 'HTTP 400 Bad Request: {$response.body#/code}',
107
+ APIException)
108
+ .local_error_template('409',
109
+ 'HTTP 409 Conflict: {$response.body#/code}',
110
+ APIException)
111
+ .local_error_template('500',
112
+ 'HTTP 500 Server Error: {$response.body#/code}',
113
+ APIException)
114
+ .local_error_template('503',
115
+ 'HTTP 503 Unavailable: {$response.body#/code}',
116
+ APIException)
117
+ .local_error_template('504',
118
+ 'HTTP 504 Timeout: {$response.body#/code}',
119
+ APIException)
120
+ .local_error_template('default',
121
+ 'HTTP {$statusCode}: {$response.body#/code}',
122
+ APIException))
123
+ .execute
124
+ end
125
+ end
126
+ end