univapay-client-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +212 -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 +909 -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 +128 -0
  16. data/lib/univapay_client_sdk/configuration.rb +179 -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_handler.rb +37 -0
  21. data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
  22. data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
  23. data/lib/univapay_client_sdk/events/webhooks/subscription_handler.rb +37 -0
  24. data/lib/univapay_client_sdk/events/webhooks/token_handler.rb +37 -0
  25. data/lib/univapay_client_sdk/exceptions/api_error_exception.rb +199 -0
  26. data/lib/univapay_client_sdk/exceptions/api_exception.rb +21 -0
  27. data/lib/univapay_client_sdk/extensions.rb +127 -0
  28. data/lib/univapay_client_sdk/http/api_response.rb +19 -0
  29. data/lib/univapay_client_sdk/http/auth/oauth_2.rb +58 -0
  30. data/lib/univapay_client_sdk/http/http_call_back.rb +10 -0
  31. data/lib/univapay_client_sdk/http/http_method_enum.rb +10 -0
  32. data/lib/univapay_client_sdk/http/http_request.rb +10 -0
  33. data/lib/univapay_client_sdk/http/http_response.rb +10 -0
  34. data/lib/univapay_client_sdk/http/proxy_settings.rb +22 -0
  35. data/lib/univapay_client_sdk/logging/configuration/api_logging_configuration.rb +186 -0
  36. data/lib/univapay_client_sdk/logging/sdk_logger.rb +17 -0
  37. data/lib/univapay_client_sdk/models/api_error_detail.rb +87 -0
  38. data/lib/univapay_client_sdk/models/api_error_status.rb +26 -0
  39. data/lib/univapay_client_sdk/models/bank_transfer_event.rb +27 -0
  40. data/lib/univapay_client_sdk/models/bank_transfer_ledger.rb +199 -0
  41. data/lib/univapay_client_sdk/models/bank_transfer_ledger_bank_ledger_type.rb +36 -0
  42. data/lib/univapay_client_sdk/models/bank_transfer_ledger_list.rb +104 -0
  43. data/lib/univapay_client_sdk/models/bank_transfer_ledger_mode.rb +36 -0
  44. data/lib/univapay_client_sdk/models/bank_transfer_payment_status.rb +44 -0
  45. data/lib/univapay_client_sdk/models/bank_transfer_status_data.rb +229 -0
  46. data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback.rb +134 -0
  47. data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback_extension.rb +75 -0
  48. data/lib/univapay_client_sdk/models/base_bank_transfer_data.rb +100 -0
  49. data/lib/univapay_client_sdk/models/base_konbini_data.rb +99 -0
  50. data/lib/univapay_client_sdk/models/base_konbini_data_convenience_store.rb +60 -0
  51. data/lib/univapay_client_sdk/models/base_model.rb +110 -0
  52. data/lib/univapay_client_sdk/models/base_online_data.rb +123 -0
  53. data/lib/univapay_client_sdk/models/base_online_data_brand.rb +48 -0
  54. data/lib/univapay_client_sdk/models/base_online_data_call_method.rb +52 -0
  55. data/lib/univapay_client_sdk/models/base_online_data_os_type.rb +36 -0
  56. data/lib/univapay_client_sdk/models/base_online_data_user_identifier_source.rb +36 -0
  57. data/lib/univapay_client_sdk/models/cancel.rb +183 -0
  58. data/lib/univapay_client_sdk/models/cancel_create_request.rb +77 -0
  59. data/lib/univapay_client_sdk/models/cancel_event.rb +26 -0
  60. data/lib/univapay_client_sdk/models/cancel_list.rb +94 -0
  61. data/lib/univapay_client_sdk/models/cancel_status.rb +44 -0
  62. data/lib/univapay_client_sdk/models/cancel_update_request.rb +76 -0
  63. data/lib/univapay_client_sdk/models/cancel_webhook_callback.rb +132 -0
  64. data/lib/univapay_client_sdk/models/cancel_webhook_callback_extension.rb +74 -0
  65. data/lib/univapay_client_sdk/models/card_processor_installment_config.rb +89 -0
  66. data/lib/univapay_client_sdk/models/charge.rb +411 -0
  67. data/lib/univapay_client_sdk/models/charge_capture_request.rb +84 -0
  68. data/lib/univapay_client_sdk/models/charge_create_request.rb +179 -0
  69. data/lib/univapay_client_sdk/models/charge_create_request_client_metadata.rb +76 -0
  70. data/lib/univapay_client_sdk/models/charge_create_request_redirect.rb +75 -0
  71. data/lib/univapay_client_sdk/models/charge_create_request_three_ds.rb +88 -0
  72. data/lib/univapay_client_sdk/models/charge_create_request_three_ds_mode.rb +44 -0
  73. data/lib/univapay_client_sdk/models/charge_event.rb +36 -0
  74. data/lib/univapay_client_sdk/models/charge_list.rb +104 -0
  75. data/lib/univapay_client_sdk/models/charge_mode.rb +36 -0
  76. data/lib/univapay_client_sdk/models/charge_redirect.rb +96 -0
  77. data/lib/univapay_client_sdk/models/charge_status.rb +56 -0
  78. data/lib/univapay_client_sdk/models/charge_three_ds.rb +97 -0
  79. data/lib/univapay_client_sdk/models/charge_transaction_token_type.rb +40 -0
  80. data/lib/univapay_client_sdk/models/charge_update_request.rb +75 -0
  81. data/lib/univapay_client_sdk/models/charge_webhook_event.rb +138 -0
  82. data/lib/univapay_client_sdk/models/cursor_direction_query.rb +36 -0
  83. data/lib/univapay_client_sdk/models/customs_declaration_create_request.rb +106 -0
  84. data/lib/univapay_client_sdk/models/customs_declaration_event.rb +27 -0
  85. data/lib/univapay_client_sdk/models/customs_declaration_patch_request.rb +77 -0
  86. data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback.rb +135 -0
  87. data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback_extension.rb +76 -0
  88. data/lib/univapay_client_sdk/models/customs_declaration_webhook_data.rb +232 -0
  89. data/lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb +121 -0
  90. data/lib/univapay_client_sdk/models/customs_declaration_webhook_error.rb +127 -0
  91. data/lib/univapay_client_sdk/models/customs_declaration_webhook_other_error.rb +120 -0
  92. data/lib/univapay_client_sdk/models/customs_declaration_webhook_result.rb +125 -0
  93. data/lib/univapay_client_sdk/models/customs_declaration_webhook_status.rb +44 -0
  94. data/lib/univapay_client_sdk/models/generic_metadata.rb +111 -0
  95. data/lib/univapay_client_sdk/models/installment_fixed_cycles.rb +70 -0
  96. data/lib/univapay_client_sdk/models/installment_plan_type.rb +36 -0
  97. data/lib/univapay_client_sdk/models/issuer_token.rb +177 -0
  98. data/lib/univapay_client_sdk/models/issuer_token_call_method.rb +51 -0
  99. data/lib/univapay_client_sdk/models/issuer_token_payload.rb +105 -0
  100. data/lib/univapay_client_sdk/models/issuer_token_payment_type.rb +36 -0
  101. data/lib/univapay_client_sdk/models/merchant.rb +179 -0
  102. data/lib/univapay_client_sdk/models/merchant_webhook_bank_transfer_configuration.rb +342 -0
  103. data/lib/univapay_client_sdk/models/merchant_webhook_card_brand_percent_fees.rb +167 -0
  104. data/lib/univapay_client_sdk/models/merchant_webhook_card_configuration.rb +301 -0
  105. data/lib/univapay_client_sdk/models/merchant_webhook_checkout_configuration.rb +87 -0
  106. data/lib/univapay_client_sdk/models/merchant_webhook_checkout_toggle.rb +77 -0
  107. data/lib/univapay_client_sdk/models/merchant_webhook_configuration.rb +505 -0
  108. data/lib/univapay_client_sdk/models/merchant_webhook_convenience_configuration.rb +88 -0
  109. data/lib/univapay_client_sdk/models/merchant_webhook_customer_management_configuration.rb +99 -0
  110. data/lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb +139 -0
  111. data/lib/univapay_client_sdk/models/merchant_webhook_limit_charge_by_card_configuration.rb +88 -0
  112. data/lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb +100 -0
  113. data/lib/univapay_client_sdk/models/merchant_webhook_money_amount.rb +85 -0
  114. data/lib/univapay_client_sdk/models/merchant_webhook_online_configuration.rb +77 -0
  115. data/lib/univapay_client_sdk/models/merchant_webhook_paidy_configuration.rb +77 -0
  116. data/lib/univapay_client_sdk/models/merchant_webhook_qr_merchant_configuration.rb +77 -0
  117. data/lib/univapay_client_sdk/models/merchant_webhook_qr_scan_configuration.rb +93 -0
  118. data/lib/univapay_client_sdk/models/merchant_webhook_recurring_cvv_confirmation_config.rb +97 -0
  119. data/lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb +109 -0
  120. data/lib/univapay_client_sdk/models/merchant_webhook_security_configuration.rb +234 -0
  121. data/lib/univapay_client_sdk/models/merchant_webhook_subscription_configuration.rb +138 -0
  122. data/lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb +138 -0
  123. data/lib/univapay_client_sdk/models/merchant_webhook_transfer_schedule_configuration.rb +159 -0
  124. data/lib/univapay_client_sdk/models/merchant_webhook_user_transactions_configuration.rb +349 -0
  125. data/lib/univapay_client_sdk/models/mode_query.rb +36 -0
  126. data/lib/univapay_client_sdk/models/payment_error.rb +178 -0
  127. data/lib/univapay_client_sdk/models/plan_settings_type.rb +36 -0
  128. data/lib/univapay_client_sdk/models/refund.rb +240 -0
  129. data/lib/univapay_client_sdk/models/refund_create_request.rb +118 -0
  130. data/lib/univapay_client_sdk/models/refund_event.rb +26 -0
  131. data/lib/univapay_client_sdk/models/refund_list.rb +104 -0
  132. data/lib/univapay_client_sdk/models/refund_reason_request.rb +42 -0
  133. data/lib/univapay_client_sdk/models/refund_reason_response.rb +62 -0
  134. data/lib/univapay_client_sdk/models/refund_status.rb +47 -0
  135. data/lib/univapay_client_sdk/models/refund_update_request.rb +99 -0
  136. data/lib/univapay_client_sdk/models/refund_webhook_callback.rb +132 -0
  137. data/lib/univapay_client_sdk/models/refund_webhook_callback_extension.rb +74 -0
  138. data/lib/univapay_client_sdk/models/restrict_ip_after_failed_charge_config.rb +99 -0
  139. data/lib/univapay_client_sdk/models/store.rb +119 -0
  140. data/lib/univapay_client_sdk/models/store_list.rb +104 -0
  141. data/lib/univapay_client_sdk/models/store_list_item.rb +114 -0
  142. data/lib/univapay_client_sdk/models/subscription.rb +310 -0
  143. data/lib/univapay_client_sdk/models/subscription_create_request.rb +216 -0
  144. data/lib/univapay_client_sdk/models/subscription_event.rb +54 -0
  145. data/lib/univapay_client_sdk/models/subscription_installment_plan.rb +86 -0
  146. data/lib/univapay_client_sdk/models/subscription_list.rb +104 -0
  147. data/lib/univapay_client_sdk/models/subscription_list_item.rb +352 -0
  148. data/lib/univapay_client_sdk/models/subscription_next_payment.rb +222 -0
  149. data/lib/univapay_client_sdk/models/subscription_patch_payment_request.rb +117 -0
  150. data/lib/univapay_client_sdk/models/subscription_patch_token_request.rb +79 -0
  151. data/lib/univapay_client_sdk/models/subscription_payment.rb +185 -0
  152. data/lib/univapay_client_sdk/models/subscription_payment_list.rb +94 -0
  153. data/lib/univapay_client_sdk/models/subscription_period.rb +56 -0
  154. data/lib/univapay_client_sdk/models/subscription_plan_settings.rb +98 -0
  155. data/lib/univapay_client_sdk/models/subscription_schedule_settings.rb +132 -0
  156. data/lib/univapay_client_sdk/models/subscription_status.rb +56 -0
  157. data/lib/univapay_client_sdk/models/subscription_suspend_request.rb +79 -0
  158. data/lib/univapay_client_sdk/models/subscription_terminate_with_status.rb +36 -0
  159. data/lib/univapay_client_sdk/models/subscription_termination_mode.rb +36 -0
  160. data/lib/univapay_client_sdk/models/subscription_update_next_payment.rb +104 -0
  161. data/lib/univapay_client_sdk/models/subscription_update_request.rb +134 -0
  162. data/lib/univapay_client_sdk/models/subscription_update_schedule_settings.rb +110 -0
  163. data/lib/univapay_client_sdk/models/subscription_update_status.rb +37 -0
  164. data/lib/univapay_client_sdk/models/subscription_user_data.rb +134 -0
  165. data/lib/univapay_client_sdk/models/subscription_webhook_event.rb +143 -0
  166. data/lib/univapay_client_sdk/models/suspend_schedule_settings.rb +78 -0
  167. data/lib/univapay_client_sdk/models/three_ds_issuer_token.rb +116 -0
  168. data/lib/univapay_client_sdk/models/three_ds_issuer_token_call_method.rb +26 -0
  169. data/lib/univapay_client_sdk/models/three_ds_issuer_token_payment_type.rb +26 -0
  170. data/lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb +122 -0
  171. data/lib/univapay_client_sdk/models/token_create_card_data.rb +230 -0
  172. data/lib/univapay_client_sdk/models/token_create_card_data_cvv_authorize.rb +95 -0
  173. data/lib/univapay_client_sdk/models/token_create_card_data_three_ds.rb +97 -0
  174. data/lib/univapay_client_sdk/models/token_create_konbini_data.rb +146 -0
  175. data/lib/univapay_client_sdk/models/token_create_online_data.rb +142 -0
  176. data/lib/univapay_client_sdk/models/token_create_phone_number.rb +104 -0
  177. data/lib/univapay_client_sdk/models/token_event.rb +59 -0
  178. data/lib/univapay_client_sdk/models/token_response_bank_transfer_data.rb +181 -0
  179. data/lib/univapay_client_sdk/models/token_response_card_data.rb +129 -0
  180. data/lib/univapay_client_sdk/models/token_response_card_data_billing.rb +153 -0
  181. data/lib/univapay_client_sdk/models/token_response_card_data_card.rb +187 -0
  182. data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize.rb +132 -0
  183. data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb +118 -0
  184. data/lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb +142 -0
  185. data/lib/univapay_client_sdk/models/token_response_card_data_three_ds_status.rb +48 -0
  186. data/lib/univapay_client_sdk/models/token_response_konbini_data.rb +135 -0
  187. data/lib/univapay_client_sdk/models/token_response_online_data.rb +158 -0
  188. data/lib/univapay_client_sdk/models/token_response_phone_number.rb +96 -0
  189. data/lib/univapay_client_sdk/models/token_webhook_event.rb +144 -0
  190. data/lib/univapay_client_sdk/models/transaction_token.rb +250 -0
  191. data/lib/univapay_client_sdk/models/transaction_token_create_request.rb +161 -0
  192. data/lib/univapay_client_sdk/models/transaction_token_create_request_metadata.rb +124 -0
  193. data/lib/univapay_client_sdk/models/transaction_token_create_request_payment_type.rb +44 -0
  194. data/lib/univapay_client_sdk/models/transaction_token_create_request_type.rb +40 -0
  195. data/lib/univapay_client_sdk/models/transaction_token_list.rb +104 -0
  196. data/lib/univapay_client_sdk/models/transaction_token_list_item.rb +204 -0
  197. data/lib/univapay_client_sdk/models/transaction_token_list_item_user_data.rb +96 -0
  198. data/lib/univapay_client_sdk/models/transaction_token_mode.rb +36 -0
  199. data/lib/univapay_client_sdk/models/transaction_token_payment_type.rb +48 -0
  200. data/lib/univapay_client_sdk/models/transaction_token_type.rb +40 -0
  201. data/lib/univapay_client_sdk/models/transaction_token_update_request.rb +95 -0
  202. data/lib/univapay_client_sdk/models/transaction_token_update_request_data.rb +184 -0
  203. data/lib/univapay_client_sdk/models/transaction_token_update_request_data_phone_number.rb +86 -0
  204. data/lib/univapay_client_sdk/models/webhook.rb +191 -0
  205. data/lib/univapay_client_sdk/models/webhook_callback_envelope.rb +98 -0
  206. data/lib/univapay_client_sdk/models/webhook_create_request.rb +97 -0
  207. data/lib/univapay_client_sdk/models/webhook_event.rb +166 -0
  208. data/lib/univapay_client_sdk/models/webhook_event_list.rb +94 -0
  209. data/lib/univapay_client_sdk/models/webhook_list.rb +94 -0
  210. data/lib/univapay_client_sdk/models/webhook_trigger.rb +104 -0
  211. data/lib/univapay_client_sdk/models/webhook_update_request.rb +108 -0
  212. data/lib/univapay_client_sdk/utilities/date_time_helper.rb +11 -0
  213. data/lib/univapay_client_sdk/utilities/file_wrapper.rb +28 -0
  214. data/lib/univapay_client_sdk/utilities/union_type_lookup.rb +182 -0
  215. data/lib/univapay_client_sdk.rb +285 -0
  216. data/test/apis/api_test_base.rb +23 -0
  217. data/test/apis/test_cancels_api.rb +162 -0
  218. data/test/apis/test_charges_api.rb +565 -0
  219. data/test/apis/test_error_messages.rb +38 -0
  220. data/test/apis/test_merchants_api.rb +50 -0
  221. data/test/apis/test_refunds_api.rb +172 -0
  222. data/test/apis/test_stores_api.rb +86 -0
  223. data/test/apis/test_subscriptions_api.rb +579 -0
  224. data/test/apis/test_transaction_tokens_api.rb +305 -0
  225. data/test/apis/test_webhooks_api.rb +245 -0
  226. data/test/events/webhooks/test_bank_transfer_handler.rb +95 -0
  227. data/test/events/webhooks/test_cancel_handler.rb +90 -0
  228. data/test/events/webhooks/test_charge_handler.rb +138 -0
  229. data/test/events/webhooks/test_customs_handler.rb +100 -0
  230. data/test/events/webhooks/test_refund_handler.rb +95 -0
  231. data/test/events/webhooks/test_subscription_handler.rb +346 -0
  232. data/test/events/webhooks/test_token_handler.rb +332 -0
  233. data/test/framework_integrations/rails_app_test_helper.rb +14 -0
  234. data/test/framework_integrations/webhooks/apps/hanami_charge_app.rb +61 -0
  235. data/test/framework_integrations/webhooks/apps/rails_charge_app.rb +24 -0
  236. data/test/framework_integrations/webhooks/apps/sinatra_charge_app.rb +27 -0
  237. data/test/framework_integrations/webhooks/test/test_hanami_charge_app.rb +57 -0
  238. data/test/framework_integrations/webhooks/test/test_rails_charge_app.rb +57 -0
  239. data/test/framework_integrations/webhooks/test/test_sinatra_charge_app.rb +58 -0
  240. data/test/http_response_catcher.rb +32 -0
  241. metadata +366 -0
@@ -0,0 +1,158 @@
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
+ # Token Response Online Data schema.
8
+ class TokenResponseOnlineData < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Base Online Data Brand schema.
13
+ # @return [BaseOnlineDataBrand]
14
+ attr_accessor :brand
15
+
16
+ # Base Online Data Call Method schema.
17
+ # @return [BaseOnlineDataCallMethod]
18
+ attr_accessor :call_method
19
+
20
+ # Base Online Data Os Type schema.
21
+ # @return [BaseOnlineDataOsType]
22
+ attr_accessor :os_type
23
+
24
+ # Consumer specific identifier required by some gateways for fraud
25
+ # prevention.
26
+ # @return [String]
27
+ attr_accessor :user_identifier
28
+
29
+ # The source of the user identifier
30
+ # @return [BaseOnlineDataUserIdentifierSource]
31
+ attr_accessor :user_identifier_source
32
+
33
+ # Token provided by the issuer (if applicable).
34
+ # @return [String]
35
+ attr_accessor :issuer_token
36
+
37
+ # Additional payload from the issuer.
38
+ # @return [String]
39
+ attr_accessor :issuer_token_payload
40
+
41
+ # A mapping from model property names to API property names.
42
+ def self.names
43
+ @_hash = {} if @_hash.nil?
44
+ @_hash['brand'] = 'brand'
45
+ @_hash['call_method'] = 'call_method'
46
+ @_hash['os_type'] = 'os_type'
47
+ @_hash['user_identifier'] = 'user_identifier'
48
+ @_hash['user_identifier_source'] = 'user_identifier_source'
49
+ @_hash['issuer_token'] = 'issuer_token'
50
+ @_hash['issuer_token_payload'] = 'issuer_token_payload'
51
+ @_hash
52
+ end
53
+
54
+ # An array for optional fields
55
+ def self.optionals
56
+ %w[
57
+ brand
58
+ call_method
59
+ os_type
60
+ user_identifier
61
+ user_identifier_source
62
+ issuer_token
63
+ issuer_token_payload
64
+ ]
65
+ end
66
+
67
+ # An array for nullable fields
68
+ def self.nullables
69
+ %w[
70
+ os_type
71
+ user_identifier
72
+ user_identifier_source
73
+ issuer_token
74
+ issuer_token_payload
75
+ ]
76
+ end
77
+
78
+ def initialize(brand: SKIP, call_method: SKIP, os_type: SKIP,
79
+ user_identifier: SKIP, user_identifier_source: SKIP,
80
+ issuer_token: SKIP, issuer_token_payload: SKIP,
81
+ additional_properties: nil)
82
+ # Add additional model properties to the instance
83
+ additional_properties = {} if additional_properties.nil?
84
+
85
+ @brand = brand unless brand == SKIP
86
+ @call_method = call_method unless call_method == SKIP
87
+ @os_type = os_type unless os_type == SKIP
88
+ @user_identifier = user_identifier unless user_identifier == SKIP
89
+ @user_identifier_source = user_identifier_source unless user_identifier_source == SKIP
90
+ @issuer_token = issuer_token unless issuer_token == SKIP
91
+ @issuer_token_payload = issuer_token_payload unless issuer_token_payload == SKIP
92
+ @additional_properties = additional_properties
93
+ end
94
+
95
+ # Creates an instance of the object from a hash.
96
+ def self.from_hash(hash)
97
+ return nil unless hash
98
+
99
+ # Extract variables from the hash.
100
+ brand = hash.key?('brand') ? hash['brand'] : SKIP
101
+ call_method = hash.key?('call_method') ? hash['call_method'] : SKIP
102
+ os_type = hash.key?('os_type') ? hash['os_type'] : SKIP
103
+ user_identifier =
104
+ hash.key?('user_identifier') ? hash['user_identifier'] : SKIP
105
+ user_identifier_source =
106
+ hash.key?('user_identifier_source') ? hash['user_identifier_source'] : SKIP
107
+ issuer_token = hash.key?('issuer_token') ? hash['issuer_token'] : SKIP
108
+ issuer_token_payload =
109
+ hash.key?('issuer_token_payload') ? hash['issuer_token_payload'] : SKIP
110
+
111
+ # Create a new hash for additional properties, removing known properties.
112
+ new_hash = hash.reject { |k, _| names.value?(k) }
113
+
114
+ additional_properties = APIHelper.get_additional_properties(
115
+ new_hash, proc { |value| value }
116
+ )
117
+
118
+ # Create object from extracted values.
119
+ TokenResponseOnlineData.new(brand: brand,
120
+ call_method: call_method,
121
+ os_type: os_type,
122
+ user_identifier: user_identifier,
123
+ user_identifier_source: user_identifier_source,
124
+ issuer_token: issuer_token,
125
+ issuer_token_payload: issuer_token_payload,
126
+ additional_properties: additional_properties)
127
+ end
128
+
129
+ # Validates an instance of the object from a given value.
130
+ # @param [TokenResponseOnlineData | Hash] The value against the validation is performed.
131
+ def self.validate(value)
132
+ return true if value.instance_of? self
133
+
134
+ return false unless value.instance_of? Hash
135
+
136
+ true
137
+ end
138
+
139
+ # Provides a human-readable string representation of the object.
140
+ def to_s
141
+ class_name = self.class.name.split('::').last
142
+ "<#{class_name} brand: #{@brand}, call_method: #{@call_method}, os_type: #{@os_type},"\
143
+ " user_identifier: #{@user_identifier}, user_identifier_source: #{@user_identifier_source},"\
144
+ " issuer_token: #{@issuer_token}, issuer_token_payload: #{@issuer_token_payload},"\
145
+ " additional_properties: #{@additional_properties}>"
146
+ end
147
+
148
+ # Provides a debugging-friendly string with detailed object information.
149
+ def inspect
150
+ class_name = self.class.name.split('::').last
151
+ "<#{class_name} brand: #{@brand.inspect}, call_method: #{@call_method.inspect}, os_type:"\
152
+ " #{@os_type.inspect}, user_identifier: #{@user_identifier.inspect}, user_identifier_source:"\
153
+ " #{@user_identifier_source.inspect}, issuer_token: #{@issuer_token.inspect},"\
154
+ " issuer_token_payload: #{@issuer_token_payload.inspect}, additional_properties:"\
155
+ " #{@additional_properties}>"
156
+ end
157
+ end
158
+ end
@@ -0,0 +1,96 @@
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
+ # Token Response Phone Number schema.
8
+ class TokenResponsePhoneNumber < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Returned as an integer in the response.
13
+ # @return [Integer]
14
+ attr_accessor :country_code
15
+
16
+ # Local phone number.
17
+ # @return [String]
18
+ attr_accessor :local_number
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['country_code'] = 'country_code'
24
+ @_hash['local_number'] = 'local_number'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ country_code
32
+ local_number
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(country_code: SKIP, local_number: SKIP,
42
+ additional_properties: nil)
43
+ # Add additional model properties to the instance
44
+ additional_properties = {} if additional_properties.nil?
45
+
46
+ @country_code = country_code unless country_code == SKIP
47
+ @local_number = local_number unless local_number == SKIP
48
+ @additional_properties = additional_properties
49
+ end
50
+
51
+ # Creates an instance of the object from a hash.
52
+ def self.from_hash(hash)
53
+ return nil unless hash
54
+
55
+ # Extract variables from the hash.
56
+ country_code = hash.key?('country_code') ? hash['country_code'] : SKIP
57
+ local_number = hash.key?('local_number') ? hash['local_number'] : SKIP
58
+
59
+ # Create a new hash for additional properties, removing known properties.
60
+ new_hash = hash.reject { |k, _| names.value?(k) }
61
+
62
+ additional_properties = APIHelper.get_additional_properties(
63
+ new_hash, proc { |value| value }
64
+ )
65
+
66
+ # Create object from extracted values.
67
+ TokenResponsePhoneNumber.new(country_code: country_code,
68
+ local_number: local_number,
69
+ additional_properties: additional_properties)
70
+ end
71
+
72
+ # Validates an instance of the object from a given value.
73
+ # @param [TokenResponsePhoneNumber | Hash] The value against the validation is performed.
74
+ def self.validate(value)
75
+ return true if value.instance_of? self
76
+
77
+ return false unless value.instance_of? Hash
78
+
79
+ true
80
+ end
81
+
82
+ # Provides a human-readable string representation of the object.
83
+ def to_s
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} country_code: #{@country_code}, local_number: #{@local_number},"\
86
+ " additional_properties: #{@additional_properties}>"
87
+ end
88
+
89
+ # Provides a debugging-friendly string with detailed object information.
90
+ def inspect
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} country_code: #{@country_code.inspect}, local_number:"\
93
+ " #{@local_number.inspect}, additional_properties: #{@additional_properties}>"
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,144 @@
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 for transaction token lifecycle events. Fired as
9
+ # `token_created` when a token is created, `token_updated` on metadata
10
+ # changes, `token_three_d_s_updated` on 3-D Secure data changes,
11
+ # `token_cvv_auth_updated` on CVV authorization changes,
12
+ # `token_cvv_auth_check_updated` on CVV auth check changes, `token_replaced`
13
+ # when a token is replaced by a new one (e.g., after a card update), and
14
+ # `recurring_token_deleted` when a recurring token is deleted. The `data`
15
+ # field contains the full TransactionToken object at the time of the event.
16
+ class TokenWebhookEvent < BaseModel
17
+ SKIP = Object.new
18
+ private_constant :SKIP
19
+
20
+ # Unique ID of this webhook delivery.
21
+ # @return [UUID | String]
22
+ attr_accessor :id
23
+
24
+ # Event type discriminator — `token_created`, `token_updated`,
25
+ # `token_three_d_s_updated`, `token_cvv_auth_updated`,
26
+ # `token_cvv_auth_check_updated`, `token_replaced`, or
27
+ # `recurring_token_deleted`.
28
+ # @return [TokenEvent]
29
+ attr_accessor :event
30
+
31
+ # Stored transaction token resource.
32
+ # @return [TransactionToken]
33
+ attr_accessor :data
34
+
35
+ # Timestamp when the event was fired.
36
+ # @return [DateTime]
37
+ attr_accessor :created_on
38
+
39
+ # A mapping from model property names to API property names.
40
+ def self.names
41
+ @_hash = {} if @_hash.nil?
42
+ @_hash['id'] = 'id'
43
+ @_hash['event'] = 'event'
44
+ @_hash['data'] = 'data'
45
+ @_hash['created_on'] = 'created_on'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ %w[
52
+ data
53
+ ]
54
+ end
55
+
56
+ # An array for nullable fields
57
+ def self.nullables
58
+ []
59
+ end
60
+
61
+ def initialize(id:, event:, created_on:, data: SKIP,
62
+ additional_properties: nil)
63
+ # Add additional model properties to the instance
64
+ additional_properties = {} if additional_properties.nil?
65
+
66
+ @id = id
67
+ @event = event
68
+ @data = data unless data == SKIP
69
+ @created_on = created_on
70
+ @additional_properties = additional_properties
71
+ end
72
+
73
+ # Creates an instance of the object from a hash.
74
+ def self.from_hash(hash)
75
+ return nil unless hash
76
+
77
+ # Extract variables from the hash.
78
+ id = hash.key?('id') ? hash['id'] : nil
79
+ event = hash.key?('event') ? hash['event'] : nil
80
+ created_on = if hash.key?('created_on')
81
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
82
+ end
83
+ data = TransactionToken.from_hash(hash['data']) if hash['data']
84
+
85
+ # Create a new hash for additional properties, removing known properties.
86
+ new_hash = hash.reject { |k, _| names.value?(k) }
87
+
88
+ additional_properties = APIHelper.get_additional_properties(
89
+ new_hash, proc { |value| value }
90
+ )
91
+
92
+ # Create object from extracted values.
93
+ TokenWebhookEvent.new(id: id,
94
+ event: event,
95
+ created_on: created_on,
96
+ data: data,
97
+ additional_properties: additional_properties)
98
+ end
99
+
100
+ def to_custom_created_on
101
+ DateTimeHelper.to_rfc3339(created_on)
102
+ end
103
+
104
+ # Validates an instance of the object from a given value.
105
+ # @param [TokenWebhookEvent | Hash] The value against the validation is performed.
106
+ def self.validate(value)
107
+ if value.instance_of? self
108
+ return (
109
+ APIHelper.valid_type?(value.id,
110
+ ->(val) { val.instance_of? String }) and
111
+ APIHelper.valid_type?(value.event,
112
+ ->(val) { TokenEvent.validate(val) }) and
113
+ APIHelper.valid_type?(value.created_on,
114
+ ->(val) { val.instance_of? DateTime })
115
+ )
116
+ end
117
+
118
+ return false unless value.instance_of? Hash
119
+
120
+ (
121
+ APIHelper.valid_type?(value['id'],
122
+ ->(val) { val.instance_of? String }) and
123
+ APIHelper.valid_type?(value['event'],
124
+ ->(val) { TokenEvent.validate(val) }) and
125
+ APIHelper.valid_type?(value['created_on'],
126
+ ->(val) { val.instance_of? String })
127
+ )
128
+ end
129
+
130
+ # Provides a human-readable string representation of the object.
131
+ def to_s
132
+ class_name = self.class.name.split('::').last
133
+ "<#{class_name} id: #{@id}, event: #{@event}, data: #{@data}, created_on: #{@created_on},"\
134
+ " additional_properties: #{@additional_properties}>"
135
+ end
136
+
137
+ # Provides a debugging-friendly string with detailed object information.
138
+ def inspect
139
+ class_name = self.class.name.split('::').last
140
+ "<#{class_name} id: #{@id.inspect}, event: #{@event.inspect}, data: #{@data.inspect},"\
141
+ " created_on: #{@created_on.inspect}, additional_properties: #{@additional_properties}>"
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,250 @@
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
+ # Stored transaction token resource.
9
+ class TransactionToken < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique identifier.
14
+ # @return [UUID | String]
15
+ attr_accessor :id
16
+
17
+ # Store identifier.
18
+ # @return [UUID | String]
19
+ attr_accessor :store_id
20
+
21
+ # Customer email address.
22
+ # @return [String]
23
+ attr_accessor :email
24
+
25
+ # Transaction Token Payment Type schema.
26
+ # @return [TransactionTokenPaymentType]
27
+ attr_accessor :payment_type
28
+
29
+ # Whether the resource is active.
30
+ # @return [TrueClass | FalseClass]
31
+ attr_accessor :active
32
+
33
+ # Transaction Token Mode schema.
34
+ # @return [TransactionTokenMode]
35
+ attr_accessor :mode
36
+
37
+ # Transaction Token Type schema.
38
+ # @return [TransactionTokenType]
39
+ attr_accessor :type
40
+
41
+ # Usage limit applied to the token.
42
+ # @return [String]
43
+ attr_accessor :usage_limit
44
+
45
+ # Whether the token has been confirmed.
46
+ # @return [TrueClass | FalseClass]
47
+ attr_accessor :confirmed
48
+
49
+ # Arbitrary key-value metadata.
50
+ # @return [Hash[String, Object]]
51
+ attr_accessor :metadata
52
+
53
+ # Timestamp when the resource was created.
54
+ # @return [DateTime]
55
+ attr_accessor :created_on
56
+
57
+ # Timestamp when the resource was last updated.
58
+ # @return [DateTime]
59
+ attr_accessor :updated_on
60
+
61
+ # Timestamp when the token was last used.
62
+ # @return [DateTime]
63
+ attr_accessor :last_used_on
64
+
65
+ # Transaction token data payload. The actual structure depends on
66
+ # `payment_type` — card, konbini, online (QR / 3DS), or bank transfer.
67
+ # @return [Object]
68
+ attr_accessor :data
69
+
70
+ # A mapping from model property names to API property names.
71
+ def self.names
72
+ @_hash = {} if @_hash.nil?
73
+ @_hash['id'] = 'id'
74
+ @_hash['store_id'] = 'store_id'
75
+ @_hash['email'] = 'email'
76
+ @_hash['payment_type'] = 'payment_type'
77
+ @_hash['active'] = 'active'
78
+ @_hash['mode'] = 'mode'
79
+ @_hash['type'] = 'type'
80
+ @_hash['usage_limit'] = 'usage_limit'
81
+ @_hash['confirmed'] = 'confirmed'
82
+ @_hash['metadata'] = 'metadata'
83
+ @_hash['created_on'] = 'created_on'
84
+ @_hash['updated_on'] = 'updated_on'
85
+ @_hash['last_used_on'] = 'last_used_on'
86
+ @_hash['data'] = 'data'
87
+ @_hash
88
+ end
89
+
90
+ # An array for optional fields
91
+ def self.optionals
92
+ %w[
93
+ id
94
+ store_id
95
+ email
96
+ payment_type
97
+ active
98
+ mode
99
+ type
100
+ usage_limit
101
+ confirmed
102
+ metadata
103
+ created_on
104
+ updated_on
105
+ last_used_on
106
+ data
107
+ ]
108
+ end
109
+
110
+ # An array for nullable fields
111
+ def self.nullables
112
+ %w[
113
+ email
114
+ usage_limit
115
+ confirmed
116
+ last_used_on
117
+ ]
118
+ end
119
+
120
+ def initialize(id: SKIP, store_id: SKIP, email: SKIP, payment_type: SKIP,
121
+ active: SKIP, mode: SKIP, type: SKIP, usage_limit: SKIP,
122
+ confirmed: SKIP, metadata: SKIP, created_on: SKIP,
123
+ updated_on: SKIP, last_used_on: SKIP, data: SKIP,
124
+ additional_properties: nil)
125
+ # Add additional model properties to the instance
126
+ additional_properties = {} if additional_properties.nil?
127
+
128
+ @id = id unless id == SKIP
129
+ @store_id = store_id unless store_id == SKIP
130
+ @email = email unless email == SKIP
131
+ @payment_type = payment_type unless payment_type == SKIP
132
+ @active = active unless active == SKIP
133
+ @mode = mode unless mode == SKIP
134
+ @type = type unless type == SKIP
135
+ @usage_limit = usage_limit unless usage_limit == SKIP
136
+ @confirmed = confirmed unless confirmed == SKIP
137
+ @metadata = metadata unless metadata == SKIP
138
+ @created_on = created_on unless created_on == SKIP
139
+ @updated_on = updated_on unless updated_on == SKIP
140
+ @last_used_on = last_used_on unless last_used_on == SKIP
141
+ @data = data unless data == SKIP
142
+ @additional_properties = additional_properties
143
+ end
144
+
145
+ # Creates an instance of the object from a hash.
146
+ def self.from_hash(hash)
147
+ return nil unless hash
148
+
149
+ # Extract variables from the hash.
150
+ id = hash.key?('id') ? hash['id'] : SKIP
151
+ store_id = hash.key?('store_id') ? hash['store_id'] : SKIP
152
+ email = hash.key?('email') ? hash['email'] : SKIP
153
+ payment_type = hash.key?('payment_type') ? hash['payment_type'] : SKIP
154
+ active = hash.key?('active') ? hash['active'] : SKIP
155
+ mode = hash.key?('mode') ? hash['mode'] : SKIP
156
+ type = hash.key?('type') ? hash['type'] : SKIP
157
+ usage_limit = hash.key?('usage_limit') ? hash['usage_limit'] : SKIP
158
+ confirmed = hash.key?('confirmed') ? hash['confirmed'] : SKIP
159
+ metadata = hash.key?('metadata') ? APIHelper.deserialize_union_type(
160
+ UnionTypeLookUp.get(:TransactionTokenMetadataAdditionalProperties), hash['metadata']
161
+ ) : SKIP
162
+ created_on = if hash.key?('created_on')
163
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
164
+ else
165
+ SKIP
166
+ end
167
+ updated_on = if hash.key?('updated_on')
168
+ (DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
169
+ else
170
+ SKIP
171
+ end
172
+ last_used_on = if hash.key?('last_used_on')
173
+ (DateTimeHelper.from_rfc3339(hash['last_used_on']) if hash['last_used_on'])
174
+ else
175
+ SKIP
176
+ end
177
+ data = hash.key?('data') ? APIHelper.deserialize_union_type(
178
+ UnionTypeLookUp.get(:TransactionTokenData), hash['data']
179
+ ) : SKIP
180
+
181
+ # Create a new hash for additional properties, removing known properties.
182
+ new_hash = hash.reject { |k, _| names.value?(k) }
183
+
184
+ additional_properties = APIHelper.get_additional_properties(
185
+ new_hash, proc { |value| value }
186
+ )
187
+
188
+ # Create object from extracted values.
189
+ TransactionToken.new(id: id,
190
+ store_id: store_id,
191
+ email: email,
192
+ payment_type: payment_type,
193
+ active: active,
194
+ mode: mode,
195
+ type: type,
196
+ usage_limit: usage_limit,
197
+ confirmed: confirmed,
198
+ metadata: metadata,
199
+ created_on: created_on,
200
+ updated_on: updated_on,
201
+ last_used_on: last_used_on,
202
+ data: data,
203
+ additional_properties: additional_properties)
204
+ end
205
+
206
+ def to_custom_created_on
207
+ DateTimeHelper.to_rfc3339(created_on)
208
+ end
209
+
210
+ def to_custom_updated_on
211
+ DateTimeHelper.to_rfc3339(updated_on)
212
+ end
213
+
214
+ def to_custom_last_used_on
215
+ DateTimeHelper.to_rfc3339(last_used_on)
216
+ end
217
+
218
+ # Validates an instance of the object from a given value.
219
+ # @param [TransactionToken | Hash] The value against the validation is performed.
220
+ def self.validate(value)
221
+ return true if value.instance_of? self
222
+
223
+ return false unless value.instance_of? Hash
224
+
225
+ true
226
+ end
227
+
228
+ # Provides a human-readable string representation of the object.
229
+ def to_s
230
+ class_name = self.class.name.split('::').last
231
+ "<#{class_name} id: #{@id}, store_id: #{@store_id}, email: #{@email}, payment_type:"\
232
+ " #{@payment_type}, active: #{@active}, mode: #{@mode}, type: #{@type}, usage_limit:"\
233
+ " #{@usage_limit}, confirmed: #{@confirmed}, metadata: #{@metadata}, created_on:"\
234
+ " #{@created_on}, updated_on: #{@updated_on}, last_used_on: #{@last_used_on}, data:"\
235
+ " #{@data}, additional_properties: #{@additional_properties}>"
236
+ end
237
+
238
+ # Provides a debugging-friendly string with detailed object information.
239
+ def inspect
240
+ class_name = self.class.name.split('::').last
241
+ "<#{class_name} id: #{@id.inspect}, store_id: #{@store_id.inspect}, email:"\
242
+ " #{@email.inspect}, payment_type: #{@payment_type.inspect}, active: #{@active.inspect},"\
243
+ " mode: #{@mode.inspect}, type: #{@type.inspect}, usage_limit: #{@usage_limit.inspect},"\
244
+ " confirmed: #{@confirmed.inspect}, metadata: #{@metadata.inspect}, created_on:"\
245
+ " #{@created_on.inspect}, updated_on: #{@updated_on.inspect}, last_used_on:"\
246
+ " #{@last_used_on.inspect}, data: #{@data.inspect}, additional_properties:"\
247
+ " #{@additional_properties}>"
248
+ end
249
+ end
250
+ end