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,342 @@
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 payment settings.
8
+ class MerchantWebhookBankTransferConfiguration < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Enables bank transfer payments.
13
+ # @return [TrueClass | FalseClass]
14
+ attr_accessor :enabled
15
+
16
+ # Requires the received deposit amount to exactly match the charge amount.
17
+ # @return [TrueClass | FalseClass]
18
+ attr_accessor :match_amount
19
+
20
+ # ISO-8601 duration before the charge expires.
21
+ # @return [String]
22
+ attr_accessor :expiration
23
+
24
+ # Threshold for provisioning additional virtual bank accounts.
25
+ # @return [Integer]
26
+ attr_accessor :virtual_bank_accounts_threshold
27
+
28
+ # Number of virtual bank accounts fetched per replenishment batch.
29
+ # @return [Integer]
30
+ attr_accessor :virtual_bank_accounts_fetch_count
31
+
32
+ # Default ISO-8601 extension period applied to eligible charges.
33
+ # @return [String]
34
+ attr_accessor :default_extension_period
35
+
36
+ # Maximum ISO-8601 extension period allowed for a charge.
37
+ # @return [String]
38
+ attr_accessor :maximum_extension_period
39
+
40
+ # Automatically extends eligible bank transfer charges.
41
+ # @return [TrueClass | FalseClass]
42
+ attr_accessor :automatic_extension_enabled
43
+
44
+ # Sends notifications when a bank transfer charge is created.
45
+ # @return [TrueClass | FalseClass]
46
+ attr_accessor :charge_request_notification_enabled
47
+
48
+ # Sends notifications when a bank transfer charge is canceled.
49
+ # @return [TrueClass | FalseClass]
50
+ attr_accessor :charge_request_canceled_notification_enabled
51
+
52
+ # Sends notifications when a bank transfer charge expires.
53
+ # @return [TrueClass | FalseClass]
54
+ attr_accessor :charge_expired_notification_enabled
55
+
56
+ # Sends notifications when a deposit is received.
57
+ # @return [TrueClass | FalseClass]
58
+ attr_accessor :deposit_received_notification_enabled
59
+
60
+ # Sends notifications when a deposit is below the expected amount.
61
+ # @return [TrueClass | FalseClass]
62
+ attr_accessor :deposit_insufficient_notification_enabled
63
+
64
+ # Sends notifications when a deposit exceeds the expected amount.
65
+ # @return [TrueClass | FalseClass]
66
+ attr_accessor :deposit_exceeded_notification_enabled
67
+
68
+ # Sends notifications when a bank transfer charge is extended.
69
+ # @return [TrueClass | FalseClass]
70
+ attr_accessor :extension_notification_enabled
71
+
72
+ # ISO-8601 lead time for payment reminder notifications.
73
+ # @return [String]
74
+ attr_accessor :remind_notification_period
75
+
76
+ # Sends reminder notifications before bank transfer expiry.
77
+ # @return [TrueClass | FalseClass]
78
+ attr_accessor :remind_notification_enabled
79
+
80
+ # A mapping from model property names to API property names.
81
+ def self.names
82
+ @_hash = {} if @_hash.nil?
83
+ @_hash['enabled'] = 'enabled'
84
+ @_hash['match_amount'] = 'match_amount'
85
+ @_hash['expiration'] = 'expiration'
86
+ @_hash['virtual_bank_accounts_threshold'] =
87
+ 'virtual_bank_accounts_threshold'
88
+ @_hash['virtual_bank_accounts_fetch_count'] =
89
+ 'virtual_bank_accounts_fetch_count'
90
+ @_hash['default_extension_period'] = 'default_extension_period'
91
+ @_hash['maximum_extension_period'] = 'maximum_extension_period'
92
+ @_hash['automatic_extension_enabled'] = 'automatic_extension_enabled'
93
+ @_hash['charge_request_notification_enabled'] =
94
+ 'charge_request_notification_enabled'
95
+ @_hash['charge_request_canceled_notification_enabled'] =
96
+ 'charge_request_canceled_notification_enabled'
97
+ @_hash['charge_expired_notification_enabled'] =
98
+ 'charge_expired_notification_enabled'
99
+ @_hash['deposit_received_notification_enabled'] =
100
+ 'deposit_received_notification_enabled'
101
+ @_hash['deposit_insufficient_notification_enabled'] =
102
+ 'deposit_insufficient_notification_enabled'
103
+ @_hash['deposit_exceeded_notification_enabled'] =
104
+ 'deposit_exceeded_notification_enabled'
105
+ @_hash['extension_notification_enabled'] =
106
+ 'extension_notification_enabled'
107
+ @_hash['remind_notification_period'] = 'remind_notification_period'
108
+ @_hash['remind_notification_enabled'] = 'remind_notification_enabled'
109
+ @_hash
110
+ end
111
+
112
+ # An array for optional fields
113
+ def self.optionals
114
+ %w[
115
+ enabled
116
+ match_amount
117
+ expiration
118
+ virtual_bank_accounts_threshold
119
+ virtual_bank_accounts_fetch_count
120
+ default_extension_period
121
+ maximum_extension_period
122
+ automatic_extension_enabled
123
+ charge_request_notification_enabled
124
+ charge_request_canceled_notification_enabled
125
+ charge_expired_notification_enabled
126
+ deposit_received_notification_enabled
127
+ deposit_insufficient_notification_enabled
128
+ deposit_exceeded_notification_enabled
129
+ extension_notification_enabled
130
+ remind_notification_period
131
+ remind_notification_enabled
132
+ ]
133
+ end
134
+
135
+ # An array for nullable fields
136
+ def self.nullables
137
+ %w[
138
+ enabled
139
+ match_amount
140
+ expiration
141
+ virtual_bank_accounts_threshold
142
+ virtual_bank_accounts_fetch_count
143
+ default_extension_period
144
+ maximum_extension_period
145
+ automatic_extension_enabled
146
+ charge_request_notification_enabled
147
+ charge_request_canceled_notification_enabled
148
+ charge_expired_notification_enabled
149
+ deposit_received_notification_enabled
150
+ deposit_insufficient_notification_enabled
151
+ deposit_exceeded_notification_enabled
152
+ extension_notification_enabled
153
+ remind_notification_period
154
+ remind_notification_enabled
155
+ ]
156
+ end
157
+
158
+ def initialize(enabled: SKIP, match_amount: SKIP, expiration: SKIP,
159
+ virtual_bank_accounts_threshold: SKIP,
160
+ virtual_bank_accounts_fetch_count: SKIP,
161
+ default_extension_period: SKIP,
162
+ maximum_extension_period: SKIP,
163
+ automatic_extension_enabled: SKIP,
164
+ charge_request_notification_enabled: SKIP,
165
+ charge_request_canceled_notification_enabled: SKIP,
166
+ charge_expired_notification_enabled: SKIP,
167
+ deposit_received_notification_enabled: SKIP,
168
+ deposit_insufficient_notification_enabled: SKIP,
169
+ deposit_exceeded_notification_enabled: SKIP,
170
+ extension_notification_enabled: SKIP,
171
+ remind_notification_period: SKIP,
172
+ remind_notification_enabled: SKIP,
173
+ additional_properties: nil)
174
+ # Add additional model properties to the instance
175
+ additional_properties = {} if additional_properties.nil?
176
+
177
+ @enabled = enabled unless enabled == SKIP
178
+ @match_amount = match_amount unless match_amount == SKIP
179
+ @expiration = expiration unless expiration == SKIP
180
+ unless virtual_bank_accounts_threshold == SKIP
181
+ @virtual_bank_accounts_threshold =
182
+ virtual_bank_accounts_threshold
183
+ end
184
+ unless virtual_bank_accounts_fetch_count == SKIP
185
+ @virtual_bank_accounts_fetch_count =
186
+ virtual_bank_accounts_fetch_count
187
+ end
188
+ @default_extension_period = default_extension_period unless default_extension_period == SKIP
189
+ @maximum_extension_period = maximum_extension_period unless maximum_extension_period == SKIP
190
+ unless automatic_extension_enabled == SKIP
191
+ @automatic_extension_enabled =
192
+ automatic_extension_enabled
193
+ end
194
+ unless charge_request_notification_enabled == SKIP
195
+ @charge_request_notification_enabled =
196
+ charge_request_notification_enabled
197
+ end
198
+ unless charge_request_canceled_notification_enabled == SKIP
199
+ @charge_request_canceled_notification_enabled =
200
+ charge_request_canceled_notification_enabled
201
+ end
202
+ unless charge_expired_notification_enabled == SKIP
203
+ @charge_expired_notification_enabled =
204
+ charge_expired_notification_enabled
205
+ end
206
+ unless deposit_received_notification_enabled == SKIP
207
+ @deposit_received_notification_enabled =
208
+ deposit_received_notification_enabled
209
+ end
210
+ unless deposit_insufficient_notification_enabled == SKIP
211
+ @deposit_insufficient_notification_enabled =
212
+ deposit_insufficient_notification_enabled
213
+ end
214
+ unless deposit_exceeded_notification_enabled == SKIP
215
+ @deposit_exceeded_notification_enabled =
216
+ deposit_exceeded_notification_enabled
217
+ end
218
+ unless extension_notification_enabled == SKIP
219
+ @extension_notification_enabled =
220
+ extension_notification_enabled
221
+ end
222
+ unless remind_notification_period == SKIP
223
+ @remind_notification_period =
224
+ remind_notification_period
225
+ end
226
+ unless remind_notification_enabled == SKIP
227
+ @remind_notification_enabled =
228
+ remind_notification_enabled
229
+ end
230
+ @additional_properties = additional_properties
231
+ end
232
+
233
+ # Creates an instance of the object from a hash.
234
+ def self.from_hash(hash)
235
+ return nil unless hash
236
+
237
+ # Extract variables from the hash.
238
+ enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
239
+ match_amount = hash.key?('match_amount') ? hash['match_amount'] : SKIP
240
+ expiration = hash.key?('expiration') ? hash['expiration'] : SKIP
241
+ virtual_bank_accounts_threshold =
242
+ hash.key?('virtual_bank_accounts_threshold') ? hash['virtual_bank_accounts_threshold'] : SKIP
243
+ virtual_bank_accounts_fetch_count =
244
+ hash.key?('virtual_bank_accounts_fetch_count') ? hash['virtual_bank_accounts_fetch_count'] : SKIP
245
+ default_extension_period =
246
+ hash.key?('default_extension_period') ? hash['default_extension_period'] : SKIP
247
+ maximum_extension_period =
248
+ hash.key?('maximum_extension_period') ? hash['maximum_extension_period'] : SKIP
249
+ automatic_extension_enabled =
250
+ hash.key?('automatic_extension_enabled') ? hash['automatic_extension_enabled'] : SKIP
251
+ charge_request_notification_enabled =
252
+ hash.key?('charge_request_notification_enabled') ? hash['charge_request_notification_enabled'] : SKIP
253
+ charge_request_canceled_notification_enabled =
254
+ hash.key?('charge_request_canceled_notification_enabled') ? hash['charge_request_canceled_notification_enabled'] : SKIP
255
+ charge_expired_notification_enabled =
256
+ hash.key?('charge_expired_notification_enabled') ? hash['charge_expired_notification_enabled'] : SKIP
257
+ deposit_received_notification_enabled =
258
+ hash.key?('deposit_received_notification_enabled') ? hash['deposit_received_notification_enabled'] : SKIP
259
+ deposit_insufficient_notification_enabled =
260
+ hash.key?('deposit_insufficient_notification_enabled') ? hash['deposit_insufficient_notification_enabled'] : SKIP
261
+ deposit_exceeded_notification_enabled =
262
+ hash.key?('deposit_exceeded_notification_enabled') ? hash['deposit_exceeded_notification_enabled'] : SKIP
263
+ extension_notification_enabled =
264
+ hash.key?('extension_notification_enabled') ? hash['extension_notification_enabled'] : SKIP
265
+ remind_notification_period =
266
+ hash.key?('remind_notification_period') ? hash['remind_notification_period'] : SKIP
267
+ remind_notification_enabled =
268
+ hash.key?('remind_notification_enabled') ? hash['remind_notification_enabled'] : SKIP
269
+
270
+ # Create a new hash for additional properties, removing known properties.
271
+ new_hash = hash.reject { |k, _| names.value?(k) }
272
+
273
+ additional_properties = APIHelper.get_additional_properties(
274
+ new_hash, proc { |value| value }
275
+ )
276
+
277
+ # Create object from extracted values.
278
+ MerchantWebhookBankTransferConfiguration.new(enabled: enabled,
279
+ match_amount: match_amount,
280
+ expiration: expiration,
281
+ virtual_bank_accounts_threshold: virtual_bank_accounts_threshold,
282
+ virtual_bank_accounts_fetch_count: virtual_bank_accounts_fetch_count,
283
+ default_extension_period: default_extension_period,
284
+ maximum_extension_period: maximum_extension_period,
285
+ automatic_extension_enabled: automatic_extension_enabled,
286
+ charge_request_notification_enabled: charge_request_notification_enabled,
287
+ charge_request_canceled_notification_enabled: charge_request_canceled_notification_enabled,
288
+ charge_expired_notification_enabled: charge_expired_notification_enabled,
289
+ deposit_received_notification_enabled: deposit_received_notification_enabled,
290
+ deposit_insufficient_notification_enabled: deposit_insufficient_notification_enabled,
291
+ deposit_exceeded_notification_enabled: deposit_exceeded_notification_enabled,
292
+ extension_notification_enabled: extension_notification_enabled,
293
+ remind_notification_period: remind_notification_period,
294
+ remind_notification_enabled: remind_notification_enabled,
295
+ additional_properties: additional_properties)
296
+ end
297
+
298
+ # Provides a human-readable string representation of the object.
299
+ def to_s
300
+ class_name = self.class.name.split('::').last
301
+ "<#{class_name} enabled: #{@enabled}, match_amount: #{@match_amount}, expiration:"\
302
+ " #{@expiration}, virtual_bank_accounts_threshold: #{@virtual_bank_accounts_threshold},"\
303
+ " virtual_bank_accounts_fetch_count: #{@virtual_bank_accounts_fetch_count},"\
304
+ " default_extension_period: #{@default_extension_period}, maximum_extension_period:"\
305
+ " #{@maximum_extension_period}, automatic_extension_enabled:"\
306
+ " #{@automatic_extension_enabled}, charge_request_notification_enabled:"\
307
+ " #{@charge_request_notification_enabled}, charge_request_canceled_notification_enabled:"\
308
+ " #{@charge_request_canceled_notification_enabled}, charge_expired_notification_enabled:"\
309
+ " #{@charge_expired_notification_enabled}, deposit_received_notification_enabled:"\
310
+ " #{@deposit_received_notification_enabled}, deposit_insufficient_notification_enabled:"\
311
+ " #{@deposit_insufficient_notification_enabled}, deposit_exceeded_notification_enabled:"\
312
+ " #{@deposit_exceeded_notification_enabled}, extension_notification_enabled:"\
313
+ " #{@extension_notification_enabled}, remind_notification_period:"\
314
+ " #{@remind_notification_period}, remind_notification_enabled:"\
315
+ " #{@remind_notification_enabled}, additional_properties: #{@additional_properties}>"
316
+ end
317
+
318
+ # Provides a debugging-friendly string with detailed object information.
319
+ def inspect
320
+ class_name = self.class.name.split('::').last
321
+ "<#{class_name} enabled: #{@enabled.inspect}, match_amount: #{@match_amount.inspect},"\
322
+ " expiration: #{@expiration.inspect}, virtual_bank_accounts_threshold:"\
323
+ " #{@virtual_bank_accounts_threshold.inspect}, virtual_bank_accounts_fetch_count:"\
324
+ " #{@virtual_bank_accounts_fetch_count.inspect}, default_extension_period:"\
325
+ " #{@default_extension_period.inspect}, maximum_extension_period:"\
326
+ " #{@maximum_extension_period.inspect}, automatic_extension_enabled:"\
327
+ " #{@automatic_extension_enabled.inspect}, charge_request_notification_enabled:"\
328
+ " #{@charge_request_notification_enabled.inspect},"\
329
+ ' charge_request_canceled_notification_enabled:'\
330
+ " #{@charge_request_canceled_notification_enabled.inspect},"\
331
+ " charge_expired_notification_enabled: #{@charge_expired_notification_enabled.inspect},"\
332
+ " deposit_received_notification_enabled: #{@deposit_received_notification_enabled.inspect},"\
333
+ ' deposit_insufficient_notification_enabled:'\
334
+ " #{@deposit_insufficient_notification_enabled.inspect},"\
335
+ " deposit_exceeded_notification_enabled: #{@deposit_exceeded_notification_enabled.inspect},"\
336
+ " extension_notification_enabled: #{@extension_notification_enabled.inspect},"\
337
+ " remind_notification_period: #{@remind_notification_period.inspect},"\
338
+ " remind_notification_enabled: #{@remind_notification_enabled.inspect},"\
339
+ " additional_properties: #{@additional_properties}>"
340
+ end
341
+ end
342
+ end
@@ -0,0 +1,167 @@
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
+ # Per-card-brand percent fee overrides.
8
+ class MerchantWebhookCardBrandPercentFees < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Percent fee override applied to Visa transactions.
13
+ # @return [Float]
14
+ attr_accessor :visa
15
+
16
+ # Percent fee override applied to American Express transactions.
17
+ # @return [Float]
18
+ attr_accessor :american_express
19
+
20
+ # Percent fee override applied to Mastercard transactions.
21
+ # @return [Float]
22
+ attr_accessor :mastercard
23
+
24
+ # Percent fee override applied to Maestro transactions.
25
+ # @return [Float]
26
+ attr_accessor :maestro
27
+
28
+ # Percent fee override applied to Discover transactions.
29
+ # @return [Float]
30
+ attr_accessor :discover
31
+
32
+ # Percent fee override applied to JCB transactions.
33
+ # @return [Float]
34
+ attr_accessor :jcb
35
+
36
+ # Percent fee override applied to Diners Club transactions.
37
+ # @return [Float]
38
+ attr_accessor :diners_club
39
+
40
+ # Percent fee override applied to UnionPay transactions.
41
+ # @return [Float]
42
+ attr_accessor :union_pay
43
+
44
+ # Percent fee override applied to private-label card transactions.
45
+ # @return [Float]
46
+ attr_accessor :private_label
47
+
48
+ # A mapping from model property names to API property names.
49
+ def self.names
50
+ @_hash = {} if @_hash.nil?
51
+ @_hash['visa'] = 'visa'
52
+ @_hash['american_express'] = 'american_express'
53
+ @_hash['mastercard'] = 'mastercard'
54
+ @_hash['maestro'] = 'maestro'
55
+ @_hash['discover'] = 'discover'
56
+ @_hash['jcb'] = 'jcb'
57
+ @_hash['diners_club'] = 'diners_club'
58
+ @_hash['union_pay'] = 'union_pay'
59
+ @_hash['private_label'] = 'private_label'
60
+ @_hash
61
+ end
62
+
63
+ # An array for optional fields
64
+ def self.optionals
65
+ %w[
66
+ visa
67
+ american_express
68
+ mastercard
69
+ maestro
70
+ discover
71
+ jcb
72
+ diners_club
73
+ union_pay
74
+ private_label
75
+ ]
76
+ end
77
+
78
+ # An array for nullable fields
79
+ def self.nullables
80
+ %w[
81
+ visa
82
+ american_express
83
+ mastercard
84
+ maestro
85
+ discover
86
+ jcb
87
+ diners_club
88
+ union_pay
89
+ private_label
90
+ ]
91
+ end
92
+
93
+ def initialize(visa: SKIP, american_express: SKIP, mastercard: SKIP,
94
+ maestro: SKIP, discover: SKIP, jcb: SKIP, diners_club: SKIP,
95
+ union_pay: SKIP, private_label: SKIP,
96
+ additional_properties: nil)
97
+ # Add additional model properties to the instance
98
+ additional_properties = {} if additional_properties.nil?
99
+
100
+ @visa = visa unless visa == SKIP
101
+ @american_express = american_express unless american_express == SKIP
102
+ @mastercard = mastercard unless mastercard == SKIP
103
+ @maestro = maestro unless maestro == SKIP
104
+ @discover = discover unless discover == SKIP
105
+ @jcb = jcb unless jcb == SKIP
106
+ @diners_club = diners_club unless diners_club == SKIP
107
+ @union_pay = union_pay unless union_pay == SKIP
108
+ @private_label = private_label unless private_label == SKIP
109
+ @additional_properties = additional_properties
110
+ end
111
+
112
+ # Creates an instance of the object from a hash.
113
+ def self.from_hash(hash)
114
+ return nil unless hash
115
+
116
+ # Extract variables from the hash.
117
+ visa = hash.key?('visa') ? hash['visa'] : SKIP
118
+ american_express =
119
+ hash.key?('american_express') ? hash['american_express'] : SKIP
120
+ mastercard = hash.key?('mastercard') ? hash['mastercard'] : SKIP
121
+ maestro = hash.key?('maestro') ? hash['maestro'] : SKIP
122
+ discover = hash.key?('discover') ? hash['discover'] : SKIP
123
+ jcb = hash.key?('jcb') ? hash['jcb'] : SKIP
124
+ diners_club = hash.key?('diners_club') ? hash['diners_club'] : SKIP
125
+ union_pay = hash.key?('union_pay') ? hash['union_pay'] : SKIP
126
+ private_label = hash.key?('private_label') ? hash['private_label'] : SKIP
127
+
128
+ # Create a new hash for additional properties, removing known properties.
129
+ new_hash = hash.reject { |k, _| names.value?(k) }
130
+
131
+ additional_properties = APIHelper.get_additional_properties(
132
+ new_hash, proc { |value| value }
133
+ )
134
+
135
+ # Create object from extracted values.
136
+ MerchantWebhookCardBrandPercentFees.new(visa: visa,
137
+ american_express: american_express,
138
+ mastercard: mastercard,
139
+ maestro: maestro,
140
+ discover: discover,
141
+ jcb: jcb,
142
+ diners_club: diners_club,
143
+ union_pay: union_pay,
144
+ private_label: private_label,
145
+ additional_properties: additional_properties)
146
+ end
147
+
148
+ # Provides a human-readable string representation of the object.
149
+ def to_s
150
+ class_name = self.class.name.split('::').last
151
+ "<#{class_name} visa: #{@visa}, american_express: #{@american_express}, mastercard:"\
152
+ " #{@mastercard}, maestro: #{@maestro}, discover: #{@discover}, jcb: #{@jcb}, diners_club:"\
153
+ " #{@diners_club}, union_pay: #{@union_pay}, private_label: #{@private_label},"\
154
+ " additional_properties: #{@additional_properties}>"
155
+ end
156
+
157
+ # Provides a debugging-friendly string with detailed object information.
158
+ def inspect
159
+ class_name = self.class.name.split('::').last
160
+ "<#{class_name} visa: #{@visa.inspect}, american_express: #{@american_express.inspect},"\
161
+ " mastercard: #{@mastercard.inspect}, maestro: #{@maestro.inspect}, discover:"\
162
+ " #{@discover.inspect}, jcb: #{@jcb.inspect}, diners_club: #{@diners_club.inspect},"\
163
+ " union_pay: #{@union_pay.inspect}, private_label: #{@private_label.inspect},"\
164
+ " additional_properties: #{@additional_properties}>"
165
+ end
166
+ end
167
+ end