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,120 @@
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
+ # Nested customs-processing error entry returned in `others`.
8
+ class CustomsDeclarationWebhookOtherError < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Backend other-error type.
13
+ # @return [String]
14
+ attr_accessor :type
15
+
16
+ # Gateway credentials involved in the error when applicable.
17
+ # @return [UUID | String]
18
+ attr_accessor :credentials_id
19
+
20
+ # Additional reason values for `not_selected_reasons`.
21
+ # @return [Array[String]]
22
+ attr_accessor :message
23
+
24
+ # Related item name for `related_item`.
25
+ # @return [String]
26
+ attr_accessor :item_name
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['type'] = 'type'
32
+ @_hash['credentials_id'] = 'credentials_id'
33
+ @_hash['message'] = 'message'
34
+ @_hash['item_name'] = 'item_name'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ type
42
+ credentials_id
43
+ message
44
+ item_name
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ %w[
51
+ credentials_id
52
+ message
53
+ item_name
54
+ ]
55
+ end
56
+
57
+ def initialize(type: SKIP, credentials_id: SKIP, message: SKIP,
58
+ item_name: SKIP, additional_properties: nil)
59
+ # Add additional model properties to the instance
60
+ additional_properties = {} if additional_properties.nil?
61
+
62
+ @type = type unless type == SKIP
63
+ @credentials_id = credentials_id unless credentials_id == SKIP
64
+ @message = message unless message == SKIP
65
+ @item_name = item_name unless item_name == SKIP
66
+ @additional_properties = additional_properties
67
+ end
68
+
69
+ # Creates an instance of the object from a hash.
70
+ def self.from_hash(hash)
71
+ return nil unless hash
72
+
73
+ # Extract variables from the hash.
74
+ type = hash.key?('type') ? hash['type'] : SKIP
75
+ credentials_id =
76
+ hash.key?('credentials_id') ? hash['credentials_id'] : SKIP
77
+ message = hash.key?('message') ? hash['message'] : SKIP
78
+ item_name = hash.key?('item_name') ? hash['item_name'] : SKIP
79
+
80
+ # Create a new hash for additional properties, removing known properties.
81
+ new_hash = hash.reject { |k, _| names.value?(k) }
82
+
83
+ additional_properties = APIHelper.get_additional_properties(
84
+ new_hash, proc { |value| value }
85
+ )
86
+
87
+ # Create object from extracted values.
88
+ CustomsDeclarationWebhookOtherError.new(type: type,
89
+ credentials_id: credentials_id,
90
+ message: message,
91
+ item_name: item_name,
92
+ additional_properties: additional_properties)
93
+ end
94
+
95
+ # Validates an instance of the object from a given value.
96
+ # @param [CustomsDeclarationWebhookOtherError | Hash] The value against the validation is performed.
97
+ def self.validate(value)
98
+ return true if value.instance_of? self
99
+
100
+ return false unless value.instance_of? Hash
101
+
102
+ true
103
+ end
104
+
105
+ # Provides a human-readable string representation of the object.
106
+ def to_s
107
+ class_name = self.class.name.split('::').last
108
+ "<#{class_name} type: #{@type}, credentials_id: #{@credentials_id}, message: #{@message},"\
109
+ " item_name: #{@item_name}, additional_properties: #{@additional_properties}>"
110
+ end
111
+
112
+ # Provides a debugging-friendly string with detailed object information.
113
+ def inspect
114
+ class_name = self.class.name.split('::').last
115
+ "<#{class_name} type: #{@type.inspect}, credentials_id: #{@credentials_id.inspect},"\
116
+ " message: #{@message.inspect}, item_name: #{@item_name.inspect}, additional_properties:"\
117
+ " #{@additional_properties}>"
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,125 @@
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
+ # Result payload returned by the customs declaration formatter.
8
+ class CustomsDeclarationWebhookResult < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Customs authority that approved the declaration.
13
+ # @return [String]
14
+ attr_accessor :approving_authority
15
+
16
+ # Gateway trade identifier.
17
+ # @return [String]
18
+ attr_accessor :trade_id
19
+
20
+ # Gateway transaction identifier for customs.
21
+ # @return [String]
22
+ attr_accessor :transaction_id
23
+
24
+ # Gateway charge transaction identifier linked to the declaration.
25
+ # @return [String]
26
+ attr_accessor :charge_transaction_id
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['approving_authority'] = 'approving_authority'
32
+ @_hash['trade_id'] = 'trade_id'
33
+ @_hash['transaction_id'] = 'transaction_id'
34
+ @_hash['charge_transaction_id'] = 'charge_transaction_id'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ approving_authority
42
+ trade_id
43
+ transaction_id
44
+ charge_transaction_id
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ %w[
51
+ approving_authority
52
+ trade_id
53
+ transaction_id
54
+ charge_transaction_id
55
+ ]
56
+ end
57
+
58
+ def initialize(approving_authority: SKIP, trade_id: SKIP,
59
+ transaction_id: SKIP, charge_transaction_id: SKIP,
60
+ additional_properties: nil)
61
+ # Add additional model properties to the instance
62
+ additional_properties = {} if additional_properties.nil?
63
+
64
+ @approving_authority = approving_authority unless approving_authority == SKIP
65
+ @trade_id = trade_id unless trade_id == SKIP
66
+ @transaction_id = transaction_id unless transaction_id == SKIP
67
+ @charge_transaction_id = charge_transaction_id unless charge_transaction_id == SKIP
68
+ @additional_properties = additional_properties
69
+ end
70
+
71
+ # Creates an instance of the object from a hash.
72
+ def self.from_hash(hash)
73
+ return nil unless hash
74
+
75
+ # Extract variables from the hash.
76
+ approving_authority =
77
+ hash.key?('approving_authority') ? hash['approving_authority'] : SKIP
78
+ trade_id = hash.key?('trade_id') ? hash['trade_id'] : SKIP
79
+ transaction_id =
80
+ hash.key?('transaction_id') ? hash['transaction_id'] : SKIP
81
+ charge_transaction_id =
82
+ hash.key?('charge_transaction_id') ? hash['charge_transaction_id'] : SKIP
83
+
84
+ # Create a new hash for additional properties, removing known properties.
85
+ new_hash = hash.reject { |k, _| names.value?(k) }
86
+
87
+ additional_properties = APIHelper.get_additional_properties(
88
+ new_hash, proc { |value| value }
89
+ )
90
+
91
+ # Create object from extracted values.
92
+ CustomsDeclarationWebhookResult.new(approving_authority: approving_authority,
93
+ trade_id: trade_id,
94
+ transaction_id: transaction_id,
95
+ charge_transaction_id: charge_transaction_id,
96
+ additional_properties: additional_properties)
97
+ end
98
+
99
+ # Validates an instance of the object from a given value.
100
+ # @param [CustomsDeclarationWebhookResult | Hash] The value against the validation is performed.
101
+ def self.validate(value)
102
+ return true if value.instance_of? self
103
+
104
+ return false unless value.instance_of? Hash
105
+
106
+ true
107
+ end
108
+
109
+ # Provides a human-readable string representation of the object.
110
+ def to_s
111
+ class_name = self.class.name.split('::').last
112
+ "<#{class_name} approving_authority: #{@approving_authority}, trade_id: #{@trade_id},"\
113
+ " transaction_id: #{@transaction_id}, charge_transaction_id: #{@charge_transaction_id},"\
114
+ " additional_properties: #{@additional_properties}>"
115
+ end
116
+
117
+ # Provides a debugging-friendly string with detailed object information.
118
+ def inspect
119
+ class_name = self.class.name.split('::').last
120
+ "<#{class_name} approving_authority: #{@approving_authority.inspect}, trade_id:"\
121
+ " #{@trade_id.inspect}, transaction_id: #{@transaction_id.inspect}, charge_transaction_id:"\
122
+ " #{@charge_transaction_id.inspect}, additional_properties: #{@additional_properties}>"
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,44 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # Customs declaration status returned by the backend.
8
+ class CustomsDeclarationWebhookStatus
9
+ CUSTOMS_DECLARATION_WEBHOOK_STATUS = [
10
+ # TODO: Write general description for PENDING
11
+ PENDING = 'pending'.freeze,
12
+
13
+ # TODO: Write general description for SUCCESSFUL
14
+ SUCCESSFUL = 'successful'.freeze,
15
+
16
+ # TODO: Write general description for FAILED
17
+ FAILED = 'failed'.freeze,
18
+
19
+ # TODO: Write general description for ERROR
20
+ ERROR = 'error'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ CUSTOMS_DECLARATION_WEBHOOK_STATUS.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = PENDING)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'pending' then PENDING
36
+ when 'successful' then SUCCESSFUL
37
+ when 'failed' then FAILED
38
+ when 'error' then ERROR
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,111 @@
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
+ # A free-form dictionary for custom metadata.
8
+ class GenericMetadata < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Example of a custom metadata key.
13
+ # @return [String]
14
+ attr_accessor :order_id
15
+
16
+ # Consumer name passed to payment processors that require it (e.g., konbini,
17
+ # bank transfer).
18
+ # @return [String]
19
+ attr_accessor :univapay_name
20
+
21
+ # Consumer phone number passed to payment processors that require it.
22
+ # @return [String]
23
+ attr_accessor :univapay_phone_number
24
+
25
+ # A mapping from model property names to API property names.
26
+ def self.names
27
+ @_hash = {} if @_hash.nil?
28
+ @_hash['order_id'] = 'order_id'
29
+ @_hash['univapay_name'] = 'univapay-name'
30
+ @_hash['univapay_phone_number'] = 'univapay-phone-number'
31
+ @_hash
32
+ end
33
+
34
+ # An array for optional fields
35
+ def self.optionals
36
+ %w[
37
+ order_id
38
+ univapay_name
39
+ univapay_phone_number
40
+ ]
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(order_id: SKIP, univapay_name: SKIP,
49
+ univapay_phone_number: SKIP, additional_properties: nil)
50
+ # Add additional model properties to the instance
51
+ additional_properties = {} if additional_properties.nil?
52
+
53
+ @order_id = order_id unless order_id == SKIP
54
+ @univapay_name = univapay_name unless univapay_name == SKIP
55
+ @univapay_phone_number = univapay_phone_number unless univapay_phone_number == SKIP
56
+ @additional_properties = additional_properties
57
+ end
58
+
59
+ # Creates an instance of the object from a hash.
60
+ def self.from_hash(hash)
61
+ return nil unless hash
62
+
63
+ # Extract variables from the hash.
64
+ order_id = hash.key?('order_id') ? hash['order_id'] : SKIP
65
+ univapay_name = hash.key?('univapay-name') ? hash['univapay-name'] : SKIP
66
+ univapay_phone_number =
67
+ hash.key?('univapay-phone-number') ? hash['univapay-phone-number'] : SKIP
68
+
69
+ # Create a new hash for additional properties, removing known properties.
70
+ new_hash = hash.reject { |k, _| names.value?(k) }
71
+
72
+ additional_properties = APIHelper.get_additional_properties(
73
+ new_hash, proc { |x|
74
+ APIHelper.deserialize_union_type(UnionTypeLookUp.get(:GenericMetadataValue), x)
75
+ }
76
+ )
77
+
78
+ # Create object from extracted values.
79
+ GenericMetadata.new(order_id: order_id,
80
+ univapay_name: univapay_name,
81
+ univapay_phone_number: univapay_phone_number,
82
+ additional_properties: additional_properties)
83
+ end
84
+
85
+ # Validates an instance of the object from a given value.
86
+ # @param [GenericMetadata | Hash] The value against the validation is performed.
87
+ def self.validate(value)
88
+ return true if value.instance_of? self
89
+
90
+ return false unless value.instance_of? Hash
91
+
92
+ true
93
+ end
94
+
95
+ # Provides a human-readable string representation of the object.
96
+ def to_s
97
+ class_name = self.class.name.split('::').last
98
+ "<#{class_name} order_id: #{@order_id}, univapay_name: #{@univapay_name},"\
99
+ " univapay_phone_number: #{@univapay_phone_number}, additional_properties:"\
100
+ " #{@additional_properties}>"
101
+ end
102
+
103
+ # Provides a debugging-friendly string with detailed object information.
104
+ def inspect
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} order_id: #{@order_id.inspect}, univapay_name: #{@univapay_name.inspect},"\
107
+ " univapay_phone_number: #{@univapay_phone_number.inspect}, additional_properties:"\
108
+ " #{@additional_properties}>"
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,70 @@
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
+ # Required if plan_type is fixed_cycles.
8
+ class InstallmentFixedCycles
9
+ INSTALLMENT_FIXED_CYCLES = [
10
+ # 3 cycles
11
+ CYCLES_3 = 3,
12
+
13
+ # 5 cycles
14
+ CYCLES_5 = 5,
15
+
16
+ # 6 cycles
17
+ CYCLES_6 = 6,
18
+
19
+ # 10 cycles
20
+ CYCLES_10 = 10,
21
+
22
+ # 12 cycles
23
+ CYCLES_12 = 12,
24
+
25
+ # 15 cycles
26
+ CYCLES_15 = 15,
27
+
28
+ # 18 cycles
29
+ CYCLES_18 = 18,
30
+
31
+ # 20 cycles
32
+ CYCLES_20 = 20,
33
+
34
+ # 24 cycles
35
+ CYCLES_24 = 24
36
+ ].freeze
37
+
38
+ def self.validate(value)
39
+ return false if value.nil?
40
+
41
+ INSTALLMENT_FIXED_CYCLES.include?(value)
42
+ end
43
+
44
+ def self.from_value(value, default_value = CYCLES_3)
45
+ return default_value if value.nil?
46
+
47
+ str = value.to_s.strip
48
+ if str.match?(/\A\d+\z/)
49
+ num = str.to_i
50
+ return num if INSTALLMENT_FIXED_CYCLES.include?(num)
51
+
52
+ return default_value
53
+ end
54
+
55
+ case str.downcase
56
+ when 'cycles_3' then CYCLES_3
57
+ when 'cycles_5' then CYCLES_5
58
+ when 'cycles_6' then CYCLES_6
59
+ when 'cycles_10' then CYCLES_10
60
+ when 'cycles_12' then CYCLES_12
61
+ when 'cycles_15' then CYCLES_15
62
+ when 'cycles_18' then CYCLES_18
63
+ when 'cycles_20' then CYCLES_20
64
+ when 'cycles_24' then CYCLES_24
65
+ else
66
+ default_value
67
+ end
68
+ end
69
+ end
70
+ 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
+ # Plan type selector.
8
+ class InstallmentPlanType
9
+ INSTALLMENT_PLAN_TYPE = [
10
+ # TODO: Write general description for REVOLVING
11
+ REVOLVING = 'revolving'.freeze,
12
+
13
+ # TODO: Write general description for FIXED_CYCLES
14
+ FIXED_CYCLES = 'fixed_cycles'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ INSTALLMENT_PLAN_TYPE.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = REVOLVING)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'revolving' then REVOLVING
30
+ when 'fixed_cycles' then FIXED_CYCLES
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,177 @@
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
+ # Issuer token or bank transfer instruction payload.
8
+ class IssuerToken < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The type of payment method for the charge.
13
+ # @return [IssuerTokenPaymentType]
14
+ attr_accessor :payment_type
15
+
16
+ # (Online) The token or payment URL provided by the payment provider for the
17
+ # consumer to execute.
18
+ # @return [String]
19
+ attr_accessor :issuer_token
20
+
21
+ # (Online) How the client should execute the token. - `sdk` / `app`: Direct
22
+ # use in native app environments/SDKs. - `web`: Direct use in special
23
+ # extended browser environments. - `http_get` / `http_post`: Execute
24
+ # directly in a new browser window or iframe.
25
+ # @return [IssuerTokenCallMethod]
26
+ attr_accessor :call_method
27
+
28
+ # Key-value pairs required to complete the payment action, or null if not
29
+ # applicable. Used when `call_method` is `http_post`. When present, this
30
+ # JSON must be converted by the client to match the expected `content_type`
31
+ # (e.g., transformed into an `application/x-www-form-urlencoded` string)
32
+ # before sending the POST request.
33
+ # @return [IssuerTokenPayload]
34
+ attr_accessor :payload
35
+
36
+ # (Bank Transfer) Unique ID of the bank account issued by the connected
37
+ # system.
38
+ # @return [String]
39
+ attr_accessor :account_id
40
+
41
+ # (Bank Transfer) Branch code.
42
+ # @return [String]
43
+ attr_accessor :branch_code
44
+
45
+ # (Bank Transfer) Branch name.
46
+ # @return [String]
47
+ attr_accessor :branch_name
48
+
49
+ # (Bank Transfer) Account holder name.
50
+ # @return [String]
51
+ attr_accessor :account_holder_name
52
+
53
+ # (Bank Transfer) Account number.
54
+ # @return [String]
55
+ attr_accessor :account_number
56
+
57
+ # A mapping from model property names to API property names.
58
+ def self.names
59
+ @_hash = {} if @_hash.nil?
60
+ @_hash['payment_type'] = 'payment_type'
61
+ @_hash['issuer_token'] = 'issuer_token'
62
+ @_hash['call_method'] = 'call_method'
63
+ @_hash['payload'] = 'payload'
64
+ @_hash['account_id'] = 'account_id'
65
+ @_hash['branch_code'] = 'branch_code'
66
+ @_hash['branch_name'] = 'branch_name'
67
+ @_hash['account_holder_name'] = 'account_holder_name'
68
+ @_hash['account_number'] = 'account_number'
69
+ @_hash
70
+ end
71
+
72
+ # An array for optional fields
73
+ def self.optionals
74
+ %w[
75
+ issuer_token
76
+ call_method
77
+ payload
78
+ account_id
79
+ branch_code
80
+ branch_name
81
+ account_holder_name
82
+ account_number
83
+ ]
84
+ end
85
+
86
+ # An array for nullable fields
87
+ def self.nullables
88
+ %w[
89
+ issuer_token
90
+ call_method
91
+ payload
92
+ account_id
93
+ branch_code
94
+ branch_name
95
+ account_holder_name
96
+ account_number
97
+ ]
98
+ end
99
+
100
+ def initialize(payment_type:, issuer_token: SKIP, call_method: SKIP,
101
+ payload: SKIP, account_id: SKIP, branch_code: SKIP,
102
+ branch_name: SKIP, account_holder_name: SKIP,
103
+ account_number: SKIP, additional_properties: nil)
104
+ # Add additional model properties to the instance
105
+ additional_properties = {} if additional_properties.nil?
106
+
107
+ @payment_type = payment_type
108
+ @issuer_token = issuer_token unless issuer_token == SKIP
109
+ @call_method = call_method unless call_method == SKIP
110
+ @payload = payload unless payload == SKIP
111
+ @account_id = account_id unless account_id == SKIP
112
+ @branch_code = branch_code unless branch_code == SKIP
113
+ @branch_name = branch_name unless branch_name == SKIP
114
+ @account_holder_name = account_holder_name unless account_holder_name == SKIP
115
+ @account_number = account_number unless account_number == SKIP
116
+ @additional_properties = additional_properties
117
+ end
118
+
119
+ # Creates an instance of the object from a hash.
120
+ def self.from_hash(hash)
121
+ return nil unless hash
122
+
123
+ # Extract variables from the hash.
124
+ payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil
125
+ issuer_token = hash.key?('issuer_token') ? hash['issuer_token'] : SKIP
126
+ call_method = hash.key?('call_method') ? hash['call_method'] : SKIP
127
+ payload = IssuerTokenPayload.from_hash(hash['payload']) if hash['payload']
128
+ account_id = hash.key?('account_id') ? hash['account_id'] : SKIP
129
+ branch_code = hash.key?('branch_code') ? hash['branch_code'] : SKIP
130
+ branch_name = hash.key?('branch_name') ? hash['branch_name'] : SKIP
131
+ account_holder_name =
132
+ hash.key?('account_holder_name') ? hash['account_holder_name'] : SKIP
133
+ account_number =
134
+ hash.key?('account_number') ? hash['account_number'] : SKIP
135
+
136
+ # Create a new hash for additional properties, removing known properties.
137
+ new_hash = hash.reject { |k, _| names.value?(k) }
138
+
139
+ additional_properties = APIHelper.get_additional_properties(
140
+ new_hash, proc { |value| value }
141
+ )
142
+
143
+ # Create object from extracted values.
144
+ IssuerToken.new(payment_type: payment_type,
145
+ issuer_token: issuer_token,
146
+ call_method: call_method,
147
+ payload: payload,
148
+ account_id: account_id,
149
+ branch_code: branch_code,
150
+ branch_name: branch_name,
151
+ account_holder_name: account_holder_name,
152
+ account_number: account_number,
153
+ additional_properties: additional_properties)
154
+ end
155
+
156
+ # Provides a human-readable string representation of the object.
157
+ def to_s
158
+ class_name = self.class.name.split('::').last
159
+ "<#{class_name} payment_type: #{@payment_type}, issuer_token: #{@issuer_token},"\
160
+ " call_method: #{@call_method}, payload: #{@payload}, account_id: #{@account_id},"\
161
+ " branch_code: #{@branch_code}, branch_name: #{@branch_name}, account_holder_name:"\
162
+ " #{@account_holder_name}, account_number: #{@account_number}, additional_properties:"\
163
+ " #{@additional_properties}>"
164
+ end
165
+
166
+ # Provides a debugging-friendly string with detailed object information.
167
+ def inspect
168
+ class_name = self.class.name.split('::').last
169
+ "<#{class_name} payment_type: #{@payment_type.inspect}, issuer_token:"\
170
+ " #{@issuer_token.inspect}, call_method: #{@call_method.inspect}, payload:"\
171
+ " #{@payload.inspect}, account_id: #{@account_id.inspect}, branch_code:"\
172
+ " #{@branch_code.inspect}, branch_name: #{@branch_name.inspect}, account_holder_name:"\
173
+ " #{@account_holder_name.inspect}, account_number: #{@account_number.inspect},"\
174
+ " additional_properties: #{@additional_properties}>"
175
+ end
176
+ end
177
+ end