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,123 @@
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 Online Data schema.
8
+ class BaseOnlineData < 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
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['brand'] = 'brand'
37
+ @_hash['call_method'] = 'call_method'
38
+ @_hash['os_type'] = 'os_type'
39
+ @_hash['user_identifier'] = 'user_identifier'
40
+ @_hash['user_identifier_source'] = 'user_identifier_source'
41
+ @_hash
42
+ end
43
+
44
+ # An array for optional fields
45
+ def self.optionals
46
+ %w[
47
+ brand
48
+ call_method
49
+ os_type
50
+ user_identifier
51
+ user_identifier_source
52
+ ]
53
+ end
54
+
55
+ # An array for nullable fields
56
+ def self.nullables
57
+ %w[
58
+ os_type
59
+ user_identifier
60
+ user_identifier_source
61
+ ]
62
+ end
63
+
64
+ def initialize(brand: SKIP, call_method: SKIP, os_type: SKIP,
65
+ user_identifier: SKIP, user_identifier_source: SKIP,
66
+ additional_properties: nil)
67
+ # Add additional model properties to the instance
68
+ additional_properties = {} if additional_properties.nil?
69
+
70
+ @brand = brand unless brand == SKIP
71
+ @call_method = call_method unless call_method == SKIP
72
+ @os_type = os_type unless os_type == SKIP
73
+ @user_identifier = user_identifier unless user_identifier == SKIP
74
+ @user_identifier_source = user_identifier_source unless user_identifier_source == SKIP
75
+ @additional_properties = additional_properties
76
+ end
77
+
78
+ # Creates an instance of the object from a hash.
79
+ def self.from_hash(hash)
80
+ return nil unless hash
81
+
82
+ # Extract variables from the hash.
83
+ brand = hash.key?('brand') ? hash['brand'] : SKIP
84
+ call_method = hash.key?('call_method') ? hash['call_method'] : SKIP
85
+ os_type = hash.key?('os_type') ? hash['os_type'] : SKIP
86
+ user_identifier =
87
+ hash.key?('user_identifier') ? hash['user_identifier'] : SKIP
88
+ user_identifier_source =
89
+ hash.key?('user_identifier_source') ? hash['user_identifier_source'] : SKIP
90
+
91
+ # Create a new hash for additional properties, removing known properties.
92
+ new_hash = hash.reject { |k, _| names.value?(k) }
93
+
94
+ additional_properties = APIHelper.get_additional_properties(
95
+ new_hash, proc { |value| value }
96
+ )
97
+
98
+ # Create object from extracted values.
99
+ BaseOnlineData.new(brand: brand,
100
+ call_method: call_method,
101
+ os_type: os_type,
102
+ user_identifier: user_identifier,
103
+ user_identifier_source: user_identifier_source,
104
+ additional_properties: additional_properties)
105
+ end
106
+
107
+ # Provides a human-readable string representation of the object.
108
+ def to_s
109
+ class_name = self.class.name.split('::').last
110
+ "<#{class_name} brand: #{@brand}, call_method: #{@call_method}, os_type: #{@os_type},"\
111
+ " user_identifier: #{@user_identifier}, user_identifier_source: #{@user_identifier_source},"\
112
+ " additional_properties: #{@additional_properties}>"
113
+ end
114
+
115
+ # Provides a debugging-friendly string with detailed object information.
116
+ def inspect
117
+ class_name = self.class.name.split('::').last
118
+ "<#{class_name} brand: #{@brand.inspect}, call_method: #{@call_method.inspect}, os_type:"\
119
+ " #{@os_type.inspect}, user_identifier: #{@user_identifier.inspect}, user_identifier_source:"\
120
+ " #{@user_identifier_source.inspect}, additional_properties: #{@additional_properties}>"
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,48 @@
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 Online Data Brand schema.
8
+ class BaseOnlineDataBrand
9
+ BASE_ONLINE_DATA_BRAND = [
10
+ # TODO: Write general description for ALIPAY_ONLINE
11
+ ALIPAY_ONLINE = 'alipay_online'.freeze,
12
+
13
+ # TODO: Write general description for ALIPAY_PLUS_ONLINE
14
+ ALIPAY_PLUS_ONLINE = 'alipay_plus_online'.freeze,
15
+
16
+ # TODO: Write general description for PAY_PAY_ONLINE
17
+ PAY_PAY_ONLINE = 'pay_pay_online'.freeze,
18
+
19
+ # TODO: Write general description for WE_CHAT_ONLINE
20
+ WE_CHAT_ONLINE = 'we_chat_online'.freeze,
21
+
22
+ # TODO: Write general description for D_BARAI_ONLINE
23
+ D_BARAI_ONLINE = 'd_barai_online'.freeze
24
+ ].freeze
25
+
26
+ def self.validate(value)
27
+ return false if value.nil?
28
+
29
+ BASE_ONLINE_DATA_BRAND.include?(value)
30
+ end
31
+
32
+ def self.from_value(value, default_value = ALIPAY_ONLINE)
33
+ return default_value if value.nil?
34
+
35
+ str = value.to_s.strip
36
+
37
+ case str.downcase
38
+ when 'alipay_online' then ALIPAY_ONLINE
39
+ when 'alipay_plus_online' then ALIPAY_PLUS_ONLINE
40
+ when 'pay_pay_online' then PAY_PAY_ONLINE
41
+ when 'we_chat_online' then WE_CHAT_ONLINE
42
+ when 'd_barai_online' then D_BARAI_ONLINE
43
+ else
44
+ default_value
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,52 @@
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 Online Data Call Method schema.
8
+ class BaseOnlineDataCallMethod
9
+ BASE_ONLINE_DATA_CALL_METHOD = [
10
+ # TODO: Write general description for HTTP_GET
11
+ HTTP_GET = 'http_get'.freeze,
12
+
13
+ # TODO: Write general description for HTTP_POST
14
+ HTTP_POST = 'http_post'.freeze,
15
+
16
+ # TODO: Write general description for HTTP_GET_MOBILE
17
+ HTTP_GET_MOBILE = 'http_get_mobile'.freeze,
18
+
19
+ # TODO: Write general description for SDK
20
+ SDK = 'sdk'.freeze,
21
+
22
+ # TODO: Write general description for WEB
23
+ WEB = 'web'.freeze,
24
+
25
+ # TODO: Write general description for APP
26
+ APP = 'app'.freeze
27
+ ].freeze
28
+
29
+ def self.validate(value)
30
+ return false if value.nil?
31
+
32
+ BASE_ONLINE_DATA_CALL_METHOD.include?(value)
33
+ end
34
+
35
+ def self.from_value(value, default_value = HTTP_GET)
36
+ return default_value if value.nil?
37
+
38
+ str = value.to_s.strip
39
+
40
+ case str.downcase
41
+ when 'http_get' then HTTP_GET
42
+ when 'http_post' then HTTP_POST
43
+ when 'http_get_mobile' then HTTP_GET_MOBILE
44
+ when 'sdk' then SDK
45
+ when 'web' then WEB
46
+ when 'app' then APP
47
+ else
48
+ default_value
49
+ end
50
+ end
51
+ end
52
+ end
@@ -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
+ # Base Online Data Os Type schema.
8
+ class BaseOnlineDataOsType
9
+ BASE_ONLINE_DATA_OS_TYPE = [
10
+ # TODO: Write general description for ANDROID
11
+ ANDROID = 'android'.freeze,
12
+
13
+ # TODO: Write general description for IOS
14
+ IOS = 'ios'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ BASE_ONLINE_DATA_OS_TYPE.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = ANDROID)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'android' then ANDROID
30
+ when 'ios' then IOS
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -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
+ # The source of the user identifier
8
+ class BaseOnlineDataUserIdentifierSource
9
+ BASE_ONLINE_DATA_USER_IDENTIFIER_SOURCE = [
10
+ # TODO: Write general description for PROVIDED
11
+ PROVIDED = 'provided'.freeze,
12
+
13
+ # TODO: Write general description for INTERNAL
14
+ INTERNAL = 'internal'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ BASE_ONLINE_DATA_USER_IDENTIFIER_SOURCE.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = PROVIDED)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'provided' then PROVIDED
30
+ when 'internal' then INTERNAL
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,183 @@
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
+ # Represents a cancellation request for a charge.
9
+ class Cancel < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique identifier for the cancel.
14
+ # @return [UUID | String]
15
+ attr_accessor :id
16
+
17
+ # ID of the charge this cancel is associated with.
18
+ # @return [UUID | String]
19
+ attr_accessor :charge_id
20
+
21
+ # ID of the store.
22
+ # @return [UUID | String]
23
+ attr_accessor :store_id
24
+
25
+ # Current status of the cancel operation.
26
+ # @return [CancelStatus]
27
+ attr_accessor :status
28
+
29
+ # Payment error details, or null if successful.
30
+ # @return [PaymentError]
31
+ attr_accessor :error
32
+
33
+ # A free-form dictionary for custom metadata.
34
+ # @return [GenericMetadata]
35
+ attr_accessor :metadata
36
+
37
+ # Charge Mode schema.
38
+ # @return [ChargeMode]
39
+ attr_accessor :mode
40
+
41
+ # Timestamp when the cancel was created.
42
+ # @return [DateTime]
43
+ attr_accessor :created_on
44
+
45
+ # Timestamp when the cancel was last updated.
46
+ # @return [DateTime]
47
+ attr_accessor :updated_on
48
+
49
+ # A mapping from model property names to API property names.
50
+ def self.names
51
+ @_hash = {} if @_hash.nil?
52
+ @_hash['id'] = 'id'
53
+ @_hash['charge_id'] = 'charge_id'
54
+ @_hash['store_id'] = 'store_id'
55
+ @_hash['status'] = 'status'
56
+ @_hash['error'] = 'error'
57
+ @_hash['metadata'] = 'metadata'
58
+ @_hash['mode'] = 'mode'
59
+ @_hash['created_on'] = 'created_on'
60
+ @_hash['updated_on'] = 'updated_on'
61
+ @_hash
62
+ end
63
+
64
+ # An array for optional fields
65
+ def self.optionals
66
+ %w[
67
+ id
68
+ charge_id
69
+ store_id
70
+ status
71
+ error
72
+ metadata
73
+ mode
74
+ created_on
75
+ updated_on
76
+ ]
77
+ end
78
+
79
+ # An array for nullable fields
80
+ def self.nullables
81
+ %w[
82
+ error
83
+ ]
84
+ end
85
+
86
+ def initialize(id: SKIP, charge_id: SKIP, store_id: SKIP, status: SKIP,
87
+ error: SKIP, metadata: SKIP, mode: SKIP, created_on: SKIP,
88
+ updated_on: SKIP, additional_properties: nil)
89
+ # Add additional model properties to the instance
90
+ additional_properties = {} if additional_properties.nil?
91
+
92
+ @id = id unless id == SKIP
93
+ @charge_id = charge_id unless charge_id == SKIP
94
+ @store_id = store_id unless store_id == SKIP
95
+ @status = status unless status == SKIP
96
+ @error = error unless error == SKIP
97
+ @metadata = metadata unless metadata == SKIP
98
+ @mode = mode unless mode == SKIP
99
+ @created_on = created_on unless created_on == SKIP
100
+ @updated_on = updated_on unless updated_on == SKIP
101
+ @additional_properties = additional_properties
102
+ end
103
+
104
+ # Creates an instance of the object from a hash.
105
+ def self.from_hash(hash)
106
+ return nil unless hash
107
+
108
+ # Extract variables from the hash.
109
+ id = hash.key?('id') ? hash['id'] : SKIP
110
+ charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
111
+ store_id = hash.key?('store_id') ? hash['store_id'] : SKIP
112
+ status = hash.key?('status') ? hash['status'] : SKIP
113
+ error = PaymentError.from_hash(hash['error']) if hash['error']
114
+ metadata = GenericMetadata.from_hash(hash['metadata']) if hash['metadata']
115
+ mode = hash.key?('mode') ? hash['mode'] : SKIP
116
+ created_on = if hash.key?('created_on')
117
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
118
+ else
119
+ SKIP
120
+ end
121
+ updated_on = if hash.key?('updated_on')
122
+ (DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
123
+ else
124
+ SKIP
125
+ end
126
+
127
+ # Create a new hash for additional properties, removing known properties.
128
+ new_hash = hash.reject { |k, _| names.value?(k) }
129
+
130
+ additional_properties = APIHelper.get_additional_properties(
131
+ new_hash, proc { |value| value }
132
+ )
133
+
134
+ # Create object from extracted values.
135
+ Cancel.new(id: id,
136
+ charge_id: charge_id,
137
+ store_id: store_id,
138
+ status: status,
139
+ error: error,
140
+ metadata: metadata,
141
+ mode: mode,
142
+ created_on: created_on,
143
+ updated_on: updated_on,
144
+ additional_properties: additional_properties)
145
+ end
146
+
147
+ def to_custom_created_on
148
+ DateTimeHelper.to_rfc3339(created_on)
149
+ end
150
+
151
+ def to_custom_updated_on
152
+ DateTimeHelper.to_rfc3339(updated_on)
153
+ end
154
+
155
+ # Validates an instance of the object from a given value.
156
+ # @param [Cancel | Hash] The value against the validation is performed.
157
+ def self.validate(value)
158
+ return true if value.instance_of? self
159
+
160
+ return false unless value.instance_of? Hash
161
+
162
+ true
163
+ end
164
+
165
+ # Provides a human-readable string representation of the object.
166
+ def to_s
167
+ class_name = self.class.name.split('::').last
168
+ "<#{class_name} id: #{@id}, charge_id: #{@charge_id}, store_id: #{@store_id}, status:"\
169
+ " #{@status}, error: #{@error}, metadata: #{@metadata}, mode: #{@mode}, created_on:"\
170
+ " #{@created_on}, updated_on: #{@updated_on}, additional_properties:"\
171
+ " #{@additional_properties}>"
172
+ end
173
+
174
+ # Provides a debugging-friendly string with detailed object information.
175
+ def inspect
176
+ class_name = self.class.name.split('::').last
177
+ "<#{class_name} id: #{@id.inspect}, charge_id: #{@charge_id.inspect}, store_id:"\
178
+ " #{@store_id.inspect}, status: #{@status.inspect}, error: #{@error.inspect}, metadata:"\
179
+ " #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect},"\
180
+ " updated_on: #{@updated_on.inspect}, additional_properties: #{@additional_properties}>"
181
+ end
182
+ end
183
+ end
@@ -0,0 +1,77 @@
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
+ # Request body to create a cancel for a charge. Only `metadata` is accepted;
8
+ # all other fields are determined server-side. The charge must be in a
9
+ # cancellable state.
10
+ class CancelCreateRequest < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # A free-form dictionary for custom metadata.
15
+ # @return [GenericMetadata]
16
+ attr_accessor :metadata
17
+
18
+ # A mapping from model property names to API property names.
19
+ def self.names
20
+ @_hash = {} if @_hash.nil?
21
+ @_hash['metadata'] = 'metadata'
22
+ @_hash
23
+ end
24
+
25
+ # An array for optional fields
26
+ def self.optionals
27
+ %w[
28
+ metadata
29
+ ]
30
+ end
31
+
32
+ # An array for nullable fields
33
+ def self.nullables
34
+ []
35
+ end
36
+
37
+ def initialize(metadata: SKIP, additional_properties: nil)
38
+ # Add additional model properties to the instance
39
+ additional_properties = {} if additional_properties.nil?
40
+
41
+ @metadata = metadata unless metadata == SKIP
42
+ @additional_properties = additional_properties
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ metadata = GenericMetadata.from_hash(hash['metadata']) if hash['metadata']
51
+
52
+ # Create a new hash for additional properties, removing known properties.
53
+ new_hash = hash.reject { |k, _| names.value?(k) }
54
+
55
+ additional_properties = APIHelper.get_additional_properties(
56
+ new_hash, proc { |value| value }
57
+ )
58
+
59
+ # Create object from extracted values.
60
+ CancelCreateRequest.new(metadata: metadata,
61
+ additional_properties: additional_properties)
62
+ end
63
+
64
+ # Provides a human-readable string representation of the object.
65
+ def to_s
66
+ class_name = self.class.name.split('::').last
67
+ "<#{class_name} metadata: #{@metadata}, additional_properties: #{@additional_properties}>"
68
+ end
69
+
70
+ # Provides a debugging-friendly string with detailed object information.
71
+ def inspect
72
+ class_name = self.class.name.split('::').last
73
+ "<#{class_name} metadata: #{@metadata.inspect}, additional_properties:"\
74
+ " #{@additional_properties}>"
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,26 @@
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
+ # Event type discriminator — always `cancel_finished` for this callback.
8
+ class CancelEvent
9
+ CANCEL_EVENT = [
10
+ # TODO: Write general description for CANCEL_FINISHED
11
+ CANCEL_FINISHED = 'cancel_finished'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ CANCEL_EVENT.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = CANCEL_FINISHED)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,94 @@
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
+ # Paginated list of cancels.
8
+ class CancelList < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # List of resources.
13
+ # @return [Array[Cancel]]
14
+ attr_accessor :items
15
+
16
+ # Whether more results are available.
17
+ # @return [TrueClass | FalseClass]
18
+ attr_accessor :has_more
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['items'] = 'items'
24
+ @_hash['has_more'] = 'has_more'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ items
32
+ has_more
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(items: SKIP, has_more: SKIP, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @items = items unless items == SKIP
46
+ @has_more = has_more unless has_more == SKIP
47
+ @additional_properties = additional_properties
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ # Parameter is an array, so we need to iterate through it
56
+ items = nil
57
+ unless hash['items'].nil?
58
+ items = []
59
+ hash['items'].each do |structure|
60
+ items << (Cancel.from_hash(structure) if structure)
61
+ end
62
+ end
63
+
64
+ items = SKIP unless hash.key?('items')
65
+ has_more = hash.key?('has_more') ? hash['has_more'] : SKIP
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ CancelList.new(items: items,
76
+ has_more: has_more,
77
+ additional_properties: additional_properties)
78
+ end
79
+
80
+ # Provides a human-readable string representation of the object.
81
+ def to_s
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} items: #{@items}, has_more: #{@has_more}, additional_properties:"\
84
+ " #{@additional_properties}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} items: #{@items.inspect}, has_more: #{@has_more.inspect},"\
91
+ " additional_properties: #{@additional_properties}>"
92
+ end
93
+ end
94
+ end