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,36 @@
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
+ # Bank Transfer Ledger Mode schema.
8
+ class BankTransferLedgerMode
9
+ BANK_TRANSFER_LEDGER_MODE = [
10
+ # TODO: Write general description for LIVE
11
+ LIVE = 'live'.freeze,
12
+
13
+ # TODO: Write general description for TEST
14
+ TEST = 'test'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ BANK_TRANSFER_LEDGER_MODE.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = LIVE)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'live' then LIVE
30
+ when 'test' then TEST
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,44 @@
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
+ # Payment status of a bank transfer charge.
8
+ class BankTransferPaymentStatus
9
+ BANK_TRANSFER_PAYMENT_STATUS = [
10
+ # TODO: Write general description for UNPAID
11
+ UNPAID = 'unpaid'.freeze,
12
+
13
+ # TODO: Write general description for INSUFFICIENT
14
+ INSUFFICIENT = 'insufficient'.freeze,
15
+
16
+ # TODO: Write general description for EXACT
17
+ EXACT = 'exact'.freeze,
18
+
19
+ # TODO: Write general description for EXCEEDED
20
+ EXCEEDED = 'exceeded'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ BANK_TRANSFER_PAYMENT_STATUS.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = UNPAID)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'unpaid' then UNPAID
36
+ when 'insufficient' then INSUFFICIENT
37
+ when 'exact' then EXACT
38
+ when 'exceeded' then EXCEEDED
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,229 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module UnivapayClientSdk
8
+ # Data payload for `bank_transfer_status_updated` webhook events. Contains the
9
+ # bank transfer extension fields inlined alongside amount and metadata.
10
+ class BankTransferStatusData < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # Bank transfer charge extension ID.
15
+ # @return [UUID | String]
16
+ attr_accessor :id
17
+
18
+ # ID of the associated charge.
19
+ # @return [UUID | String]
20
+ attr_accessor :charge_id
21
+
22
+ # Payment status of a bank transfer charge.
23
+ # @return [BankTransferPaymentStatus]
24
+ attr_accessor :payment_status
25
+
26
+ # Date of the most recent deposit.
27
+ # @return [DateTime]
28
+ attr_accessor :latest_deposit_date
29
+
30
+ # When the bank transfer extension record was created.
31
+ # @return [DateTime]
32
+ attr_accessor :created_on
33
+
34
+ # Amount of the most recent deposit in minor currency units.
35
+ # @return [Integer]
36
+ attr_accessor :latest_deposit_amount
37
+
38
+ # Current outstanding balance in minor currency units.
39
+ # @return [Integer]
40
+ attr_accessor :balance
41
+
42
+ # ISO 4217 currency code.
43
+ # @return [String]
44
+ attr_accessor :currency
45
+
46
+ # Total charge amount in minor currency units.
47
+ # @return [Integer]
48
+ attr_accessor :amount
49
+
50
+ # Difference between paid and expected amount (positive = over, negative =
51
+ # under).
52
+ # @return [Integer]
53
+ attr_accessor :amount_difference
54
+
55
+ # A free-form dictionary for custom metadata.
56
+ # @return [GenericMetadata]
57
+ attr_accessor :token_metadata
58
+
59
+ # A free-form dictionary for custom metadata.
60
+ # @return [GenericMetadata]
61
+ attr_accessor :charge_metadata
62
+
63
+ # A mapping from model property names to API property names.
64
+ def self.names
65
+ @_hash = {} if @_hash.nil?
66
+ @_hash['id'] = 'id'
67
+ @_hash['charge_id'] = 'charge_id'
68
+ @_hash['payment_status'] = 'payment_status'
69
+ @_hash['latest_deposit_date'] = 'latest_deposit_date'
70
+ @_hash['created_on'] = 'created_on'
71
+ @_hash['latest_deposit_amount'] = 'latest_deposit_amount'
72
+ @_hash['balance'] = 'balance'
73
+ @_hash['currency'] = 'currency'
74
+ @_hash['amount'] = 'amount'
75
+ @_hash['amount_difference'] = 'amount_difference'
76
+ @_hash['token_metadata'] = 'token_metadata'
77
+ @_hash['charge_metadata'] = 'charge_metadata'
78
+ @_hash
79
+ end
80
+
81
+ # An array for optional fields
82
+ def self.optionals
83
+ %w[
84
+ id
85
+ charge_id
86
+ payment_status
87
+ latest_deposit_date
88
+ created_on
89
+ latest_deposit_amount
90
+ balance
91
+ currency
92
+ amount
93
+ amount_difference
94
+ token_metadata
95
+ charge_metadata
96
+ ]
97
+ end
98
+
99
+ # An array for nullable fields
100
+ def self.nullables
101
+ %w[
102
+ id
103
+ latest_deposit_date
104
+ created_on
105
+ latest_deposit_amount
106
+ balance
107
+ amount_difference
108
+ ]
109
+ end
110
+
111
+ def initialize(id: SKIP, charge_id: SKIP, payment_status: SKIP,
112
+ latest_deposit_date: SKIP, created_on: SKIP,
113
+ latest_deposit_amount: SKIP, balance: SKIP, currency: SKIP,
114
+ amount: SKIP, amount_difference: SKIP, token_metadata: SKIP,
115
+ charge_metadata: SKIP, additional_properties: nil)
116
+ # Add additional model properties to the instance
117
+ additional_properties = {} if additional_properties.nil?
118
+
119
+ @id = id unless id == SKIP
120
+ @charge_id = charge_id unless charge_id == SKIP
121
+ @payment_status = payment_status unless payment_status == SKIP
122
+ @latest_deposit_date = latest_deposit_date unless latest_deposit_date == SKIP
123
+ @created_on = created_on unless created_on == SKIP
124
+ @latest_deposit_amount = latest_deposit_amount unless latest_deposit_amount == SKIP
125
+ @balance = balance unless balance == SKIP
126
+ @currency = currency unless currency == SKIP
127
+ @amount = amount unless amount == SKIP
128
+ @amount_difference = amount_difference unless amount_difference == SKIP
129
+ @token_metadata = token_metadata unless token_metadata == SKIP
130
+ @charge_metadata = charge_metadata unless charge_metadata == SKIP
131
+ @additional_properties = additional_properties
132
+ end
133
+
134
+ # Creates an instance of the object from a hash.
135
+ def self.from_hash(hash)
136
+ return nil unless hash
137
+
138
+ # Extract variables from the hash.
139
+ id = hash.key?('id') ? hash['id'] : SKIP
140
+ charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
141
+ payment_status =
142
+ hash.key?('payment_status') ? hash['payment_status'] : SKIP
143
+ latest_deposit_date = if hash.key?('latest_deposit_date')
144
+ (DateTimeHelper.from_rfc3339(hash['latest_deposit_date']) if hash['latest_deposit_date'])
145
+ else
146
+ SKIP
147
+ end
148
+ created_on = if hash.key?('created_on')
149
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
150
+ else
151
+ SKIP
152
+ end
153
+ latest_deposit_amount =
154
+ hash.key?('latest_deposit_amount') ? hash['latest_deposit_amount'] : SKIP
155
+ balance = hash.key?('balance') ? hash['balance'] : SKIP
156
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
157
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
158
+ amount_difference =
159
+ hash.key?('amount_difference') ? hash['amount_difference'] : SKIP
160
+ token_metadata = GenericMetadata.from_hash(hash['token_metadata']) if hash['token_metadata']
161
+ charge_metadata = GenericMetadata.from_hash(hash['charge_metadata']) if
162
+ hash['charge_metadata']
163
+
164
+ # Create a new hash for additional properties, removing known properties.
165
+ new_hash = hash.reject { |k, _| names.value?(k) }
166
+
167
+ additional_properties = APIHelper.get_additional_properties(
168
+ new_hash, proc { |value| value }
169
+ )
170
+
171
+ # Create object from extracted values.
172
+ BankTransferStatusData.new(id: id,
173
+ charge_id: charge_id,
174
+ payment_status: payment_status,
175
+ latest_deposit_date: latest_deposit_date,
176
+ created_on: created_on,
177
+ latest_deposit_amount: latest_deposit_amount,
178
+ balance: balance,
179
+ currency: currency,
180
+ amount: amount,
181
+ amount_difference: amount_difference,
182
+ token_metadata: token_metadata,
183
+ charge_metadata: charge_metadata,
184
+ additional_properties: additional_properties)
185
+ end
186
+
187
+ def to_custom_latest_deposit_date
188
+ DateTimeHelper.to_rfc3339(latest_deposit_date)
189
+ end
190
+
191
+ def to_custom_created_on
192
+ DateTimeHelper.to_rfc3339(created_on)
193
+ end
194
+
195
+ # Validates an instance of the object from a given value.
196
+ # @param [BankTransferStatusData | Hash] The value against the validation is performed.
197
+ def self.validate(value)
198
+ return true if value.instance_of? self
199
+
200
+ return false unless value.instance_of? Hash
201
+
202
+ true
203
+ end
204
+
205
+ # Provides a human-readable string representation of the object.
206
+ def to_s
207
+ class_name = self.class.name.split('::').last
208
+ "<#{class_name} id: #{@id}, charge_id: #{@charge_id}, payment_status: #{@payment_status},"\
209
+ " latest_deposit_date: #{@latest_deposit_date}, created_on: #{@created_on},"\
210
+ " latest_deposit_amount: #{@latest_deposit_amount}, balance: #{@balance}, currency:"\
211
+ " #{@currency}, amount: #{@amount}, amount_difference: #{@amount_difference},"\
212
+ " token_metadata: #{@token_metadata}, charge_metadata: #{@charge_metadata},"\
213
+ " additional_properties: #{@additional_properties}>"
214
+ end
215
+
216
+ # Provides a debugging-friendly string with detailed object information.
217
+ def inspect
218
+ class_name = self.class.name.split('::').last
219
+ "<#{class_name} id: #{@id.inspect}, charge_id: #{@charge_id.inspect}, payment_status:"\
220
+ " #{@payment_status.inspect}, latest_deposit_date: #{@latest_deposit_date.inspect},"\
221
+ " created_on: #{@created_on.inspect}, latest_deposit_amount:"\
222
+ " #{@latest_deposit_amount.inspect}, balance: #{@balance.inspect}, currency:"\
223
+ " #{@currency.inspect}, amount: #{@amount.inspect}, amount_difference:"\
224
+ " #{@amount_difference.inspect}, token_metadata: #{@token_metadata.inspect},"\
225
+ " charge_metadata: #{@charge_metadata.inspect}, additional_properties:"\
226
+ " #{@additional_properties}>"
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,134 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module UnivapayClientSdk
8
+ # Webhook envelope whose `data` payload is a BankTransferStatusData resource.
9
+ class BankTransferStatusWebhookCallback < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Event type discriminator — always `bank_transfer_status_updated` for this
14
+ # callback.
15
+ # @return [BankTransferEvent]
16
+ attr_accessor :event
17
+
18
+ # Unique ID of this webhook delivery.
19
+ # @return [UUID | String]
20
+ attr_accessor :id
21
+
22
+ # Timestamp when the event was fired.
23
+ # @return [DateTime]
24
+ attr_accessor :created_on
25
+
26
+ # Data payload for `bank_transfer_status_updated` webhook events. Contains
27
+ # the bank transfer extension fields inlined alongside amount and metadata.
28
+ # @return [BankTransferStatusData]
29
+ attr_accessor :data
30
+
31
+ # A mapping from model property names to API property names.
32
+ def self.names
33
+ @_hash = {} if @_hash.nil?
34
+ @_hash['event'] = 'event'
35
+ @_hash['id'] = 'id'
36
+ @_hash['created_on'] = 'created_on'
37
+ @_hash['data'] = 'data'
38
+ @_hash
39
+ end
40
+
41
+ # An array for optional fields
42
+ def self.optionals
43
+ %w[
44
+ event
45
+ data
46
+ ]
47
+ end
48
+
49
+ # An array for nullable fields
50
+ def self.nullables
51
+ []
52
+ end
53
+
54
+ def initialize(id:, created_on:, event: SKIP, data: SKIP,
55
+ additional_properties: nil)
56
+ # Add additional model properties to the instance
57
+ additional_properties = {} if additional_properties.nil?
58
+
59
+ @event = event unless event == SKIP
60
+ @id = id
61
+ @created_on = created_on
62
+ @data = data unless data == SKIP
63
+ @additional_properties = additional_properties
64
+ end
65
+
66
+ # Creates an instance of the object from a hash.
67
+ def self.from_hash(hash)
68
+ return nil unless hash
69
+
70
+ # Extract variables from the hash.
71
+ id = hash.key?('id') ? hash['id'] : nil
72
+ created_on = if hash.key?('created_on')
73
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
74
+ end
75
+ event = hash.key?('event') ? hash['event'] : SKIP
76
+ data = BankTransferStatusData.from_hash(hash['data']) if hash['data']
77
+
78
+ # Create a new hash for additional properties, removing known properties.
79
+ new_hash = hash.reject { |k, _| names.value?(k) }
80
+
81
+ additional_properties = APIHelper.get_additional_properties(
82
+ new_hash, proc { |value| value }
83
+ )
84
+
85
+ # Create object from extracted values.
86
+ BankTransferStatusWebhookCallback.new(id: id,
87
+ created_on: created_on,
88
+ event: event,
89
+ data: data,
90
+ additional_properties: additional_properties)
91
+ end
92
+
93
+ def to_custom_created_on
94
+ DateTimeHelper.to_rfc3339(created_on)
95
+ end
96
+
97
+ # Validates an instance of the object from a given value.
98
+ # @param [BankTransferStatusWebhookCallback | Hash] The value against the validation is performed.
99
+ def self.validate(value)
100
+ if value.instance_of? self
101
+ return (
102
+ APIHelper.valid_type?(value.id,
103
+ ->(val) { val.instance_of? String }) and
104
+ APIHelper.valid_type?(value.created_on,
105
+ ->(val) { val.instance_of? DateTime })
106
+ )
107
+ end
108
+
109
+ return false unless value.instance_of? Hash
110
+
111
+ (
112
+ APIHelper.valid_type?(value['id'],
113
+ ->(val) { val.instance_of? String }) and
114
+ APIHelper.valid_type?(value['created_on'],
115
+ ->(val) { val.instance_of? String })
116
+ )
117
+ end
118
+
119
+ # Provides a human-readable string representation of the object.
120
+ def to_s
121
+ class_name = self.class.name.split('::').last
122
+ "<#{class_name} event: #{@event}, id: #{@id}, created_on: #{@created_on}, data: #{@data},"\
123
+ " additional_properties: #{@additional_properties}>"
124
+ end
125
+
126
+ # Provides a debugging-friendly string with detailed object information.
127
+ def inspect
128
+ class_name = self.class.name.split('::').last
129
+ "<#{class_name} event: #{@event.inspect}, id: #{@id.inspect}, created_on:"\
130
+ " #{@created_on.inspect}, data: #{@data.inspect}, additional_properties:"\
131
+ " #{@additional_properties}>"
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,75 @@
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
+ # Bank-transfer-specific webhook payload extension.
8
+ class BankTransferStatusWebhookCallbackExtension < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Data payload for `bank_transfer_status_updated` webhook events. Contains
13
+ # the bank transfer extension fields inlined alongside amount and metadata.
14
+ # @return [BankTransferStatusData]
15
+ attr_accessor :data
16
+
17
+ # A mapping from model property names to API property names.
18
+ def self.names
19
+ @_hash = {} if @_hash.nil?
20
+ @_hash['data'] = 'data'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ %w[
27
+ data
28
+ ]
29
+ end
30
+
31
+ # An array for nullable fields
32
+ def self.nullables
33
+ []
34
+ end
35
+
36
+ def initialize(data: SKIP, additional_properties: nil)
37
+ # Add additional model properties to the instance
38
+ additional_properties = {} if additional_properties.nil?
39
+
40
+ @data = data unless data == SKIP
41
+ @additional_properties = additional_properties
42
+ end
43
+
44
+ # Creates an instance of the object from a hash.
45
+ def self.from_hash(hash)
46
+ return nil unless hash
47
+
48
+ # Extract variables from the hash.
49
+ data = BankTransferStatusData.from_hash(hash['data']) if hash['data']
50
+
51
+ # Create a new hash for additional properties, removing known properties.
52
+ new_hash = hash.reject { |k, _| names.value?(k) }
53
+
54
+ additional_properties = APIHelper.get_additional_properties(
55
+ new_hash, proc { |value| value }
56
+ )
57
+
58
+ # Create object from extracted values.
59
+ BankTransferStatusWebhookCallbackExtension.new(data: data,
60
+ additional_properties: additional_properties)
61
+ end
62
+
63
+ # Provides a human-readable string representation of the object.
64
+ def to_s
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} data: #{@data}, additional_properties: #{@additional_properties}>"
67
+ end
68
+
69
+ # Provides a debugging-friendly string with detailed object information.
70
+ def inspect
71
+ class_name = self.class.name.split('::').last
72
+ "<#{class_name} data: #{@data.inspect}, additional_properties: #{@additional_properties}>"
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,100 @@
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
+ # Base Bank Transfer Data schema.
8
+ class BaseBankTransferData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The bank brand identifier (e.g., 'aozora_bank').
13
+ # @return [String]
14
+ attr_accessor :brand
15
+
16
+ # ISO 8601 duration format (e.g., 'PT168H').
17
+ # @return [String]
18
+ attr_accessor :expiration_period
19
+
20
+ # Time shift applied to the expiration, typically pushing it to the end of
21
+ # the day in a specific timezone (e.g., '23:59:59+09:00').
22
+ # @return [String]
23
+ attr_accessor :expiration_time_shift
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['brand'] = 'brand'
29
+ @_hash['expiration_period'] = 'expiration_period'
30
+ @_hash['expiration_time_shift'] = 'expiration_time_shift'
31
+ @_hash
32
+ end
33
+
34
+ # An array for optional fields
35
+ def self.optionals
36
+ %w[
37
+ brand
38
+ expiration_period
39
+ expiration_time_shift
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(brand: SKIP, expiration_period: SKIP,
49
+ expiration_time_shift: SKIP, additional_properties: nil)
50
+ # Add additional model properties to the instance
51
+ additional_properties = {} if additional_properties.nil?
52
+
53
+ @brand = brand unless brand == SKIP
54
+ @expiration_period = expiration_period unless expiration_period == SKIP
55
+ @expiration_time_shift = expiration_time_shift unless expiration_time_shift == SKIP
56
+ @additional_properties = additional_properties
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ brand = hash.key?('brand') ? hash['brand'] : SKIP
65
+ expiration_period =
66
+ hash.key?('expiration_period') ? hash['expiration_period'] : SKIP
67
+ expiration_time_shift =
68
+ hash.key?('expiration_time_shift') ? hash['expiration_time_shift'] : SKIP
69
+
70
+ # Create a new hash for additional properties, removing known properties.
71
+ new_hash = hash.reject { |k, _| names.value?(k) }
72
+
73
+ additional_properties = APIHelper.get_additional_properties(
74
+ new_hash, proc { |value| value }
75
+ )
76
+
77
+ # Create object from extracted values.
78
+ BaseBankTransferData.new(brand: brand,
79
+ expiration_period: expiration_period,
80
+ expiration_time_shift: expiration_time_shift,
81
+ additional_properties: additional_properties)
82
+ end
83
+
84
+ # Provides a human-readable string representation of the object.
85
+ def to_s
86
+ class_name = self.class.name.split('::').last
87
+ "<#{class_name} brand: #{@brand}, expiration_period: #{@expiration_period},"\
88
+ " expiration_time_shift: #{@expiration_time_shift}, additional_properties:"\
89
+ " #{@additional_properties}>"
90
+ end
91
+
92
+ # Provides a debugging-friendly string with detailed object information.
93
+ def inspect
94
+ class_name = self.class.name.split('::').last
95
+ "<#{class_name} brand: #{@brand.inspect}, expiration_period: #{@expiration_period.inspect},"\
96
+ " expiration_time_shift: #{@expiration_time_shift.inspect}, additional_properties:"\
97
+ " #{@additional_properties}>"
98
+ end
99
+ end
100
+ end