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,222 @@
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
+ # Next scheduled payment details for a subscription.
9
+ class SubscriptionNextPayment < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique identifier.
14
+ # @return [UUID | String]
15
+ attr_accessor :id
16
+
17
+ # Scheduled due date.
18
+ # @return [Date]
19
+ attr_accessor :due_date
20
+
21
+ # IANA timezone identifier.
22
+ # @return [String]
23
+ attr_accessor :zone_id
24
+
25
+ # Amount in the smallest currency unit.
26
+ # @return [Integer]
27
+ attr_accessor :amount
28
+
29
+ # ISO-4217 currency code.
30
+ # @return [String]
31
+ attr_accessor :currency
32
+
33
+ # Amount formatted for display.
34
+ # @return [Float]
35
+ attr_accessor :amount_formatted
36
+
37
+ # Whether the payment has been paid.
38
+ # @return [TrueClass | FalseClass]
39
+ attr_accessor :is_paid
40
+
41
+ # Whether this is the final payment in the schedule.
42
+ # @return [TrueClass | FalseClass]
43
+ attr_accessor :is_last_payment
44
+
45
+ # Timestamp when the resource was created.
46
+ # @return [DateTime]
47
+ attr_accessor :created_on
48
+
49
+ # Timestamp when the resource was last updated.
50
+ # @return [DateTime]
51
+ attr_accessor :updated_on
52
+
53
+ # Scheduled retry date.
54
+ # @return [Date]
55
+ attr_accessor :retry_date
56
+
57
+ # Schedule a status transition on a payment's due date. Set to `suspended`
58
+ # or `canceled` to schedule termination. Send `null` to cancel a previously
59
+ # scheduled transition.
60
+ # @return [SubscriptionTerminateWithStatus]
61
+ attr_accessor :terminate_with_status
62
+
63
+ # A mapping from model property names to API property names.
64
+ def self.names
65
+ @_hash = {} if @_hash.nil?
66
+ @_hash['id'] = 'id'
67
+ @_hash['due_date'] = 'due_date'
68
+ @_hash['zone_id'] = 'zone_id'
69
+ @_hash['amount'] = 'amount'
70
+ @_hash['currency'] = 'currency'
71
+ @_hash['amount_formatted'] = 'amount_formatted'
72
+ @_hash['is_paid'] = 'is_paid'
73
+ @_hash['is_last_payment'] = 'is_last_payment'
74
+ @_hash['created_on'] = 'created_on'
75
+ @_hash['updated_on'] = 'updated_on'
76
+ @_hash['retry_date'] = 'retry_date'
77
+ @_hash['terminate_with_status'] = 'terminate_with_status'
78
+ @_hash
79
+ end
80
+
81
+ # An array for optional fields
82
+ def self.optionals
83
+ %w[
84
+ id
85
+ due_date
86
+ zone_id
87
+ amount
88
+ currency
89
+ amount_formatted
90
+ is_paid
91
+ is_last_payment
92
+ created_on
93
+ updated_on
94
+ retry_date
95
+ terminate_with_status
96
+ ]
97
+ end
98
+
99
+ # An array for nullable fields
100
+ def self.nullables
101
+ %w[
102
+ retry_date
103
+ terminate_with_status
104
+ ]
105
+ end
106
+
107
+ def initialize(id: SKIP, due_date: SKIP, zone_id: SKIP, amount: SKIP,
108
+ currency: SKIP, amount_formatted: SKIP, is_paid: SKIP,
109
+ is_last_payment: SKIP, created_on: SKIP, updated_on: SKIP,
110
+ retry_date: SKIP, terminate_with_status: SKIP,
111
+ additional_properties: nil)
112
+ # Add additional model properties to the instance
113
+ additional_properties = {} if additional_properties.nil?
114
+
115
+ @id = id unless id == SKIP
116
+ @due_date = due_date unless due_date == SKIP
117
+ @zone_id = zone_id unless zone_id == SKIP
118
+ @amount = amount unless amount == SKIP
119
+ @currency = currency unless currency == SKIP
120
+ @amount_formatted = amount_formatted unless amount_formatted == SKIP
121
+ @is_paid = is_paid unless is_paid == SKIP
122
+ @is_last_payment = is_last_payment unless is_last_payment == SKIP
123
+ @created_on = created_on unless created_on == SKIP
124
+ @updated_on = updated_on unless updated_on == SKIP
125
+ @retry_date = retry_date unless retry_date == SKIP
126
+ @terminate_with_status = terminate_with_status unless terminate_with_status == SKIP
127
+ @additional_properties = additional_properties
128
+ end
129
+
130
+ # Creates an instance of the object from a hash.
131
+ def self.from_hash(hash)
132
+ return nil unless hash
133
+
134
+ # Extract variables from the hash.
135
+ id = hash.key?('id') ? hash['id'] : SKIP
136
+ due_date = hash.key?('due_date') ? hash['due_date'] : SKIP
137
+ zone_id = hash.key?('zone_id') ? hash['zone_id'] : SKIP
138
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
139
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
140
+ amount_formatted =
141
+ hash.key?('amount_formatted') ? hash['amount_formatted'] : SKIP
142
+ is_paid = hash.key?('is_paid') ? hash['is_paid'] : SKIP
143
+ is_last_payment =
144
+ hash.key?('is_last_payment') ? hash['is_last_payment'] : SKIP
145
+ created_on = if hash.key?('created_on')
146
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
147
+ else
148
+ SKIP
149
+ end
150
+ updated_on = if hash.key?('updated_on')
151
+ (DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
152
+ else
153
+ SKIP
154
+ end
155
+ retry_date = hash.key?('retry_date') ? hash['retry_date'] : SKIP
156
+ terminate_with_status =
157
+ hash.key?('terminate_with_status') ? hash['terminate_with_status'] : SKIP
158
+
159
+ # Create a new hash for additional properties, removing known properties.
160
+ new_hash = hash.reject { |k, _| names.value?(k) }
161
+
162
+ additional_properties = APIHelper.get_additional_properties(
163
+ new_hash, proc { |value| value }
164
+ )
165
+
166
+ # Create object from extracted values.
167
+ SubscriptionNextPayment.new(id: id,
168
+ due_date: due_date,
169
+ zone_id: zone_id,
170
+ amount: amount,
171
+ currency: currency,
172
+ amount_formatted: amount_formatted,
173
+ is_paid: is_paid,
174
+ is_last_payment: is_last_payment,
175
+ created_on: created_on,
176
+ updated_on: updated_on,
177
+ retry_date: retry_date,
178
+ terminate_with_status: terminate_with_status,
179
+ additional_properties: additional_properties)
180
+ end
181
+
182
+ def to_custom_created_on
183
+ DateTimeHelper.to_rfc3339(created_on)
184
+ end
185
+
186
+ def to_custom_updated_on
187
+ DateTimeHelper.to_rfc3339(updated_on)
188
+ end
189
+
190
+ # Validates an instance of the object from a given value.
191
+ # @param [SubscriptionNextPayment | Hash] The value against the validation is performed.
192
+ def self.validate(value)
193
+ return true if value.instance_of? self
194
+
195
+ return false unless value.instance_of? Hash
196
+
197
+ true
198
+ end
199
+
200
+ # Provides a human-readable string representation of the object.
201
+ def to_s
202
+ class_name = self.class.name.split('::').last
203
+ "<#{class_name} id: #{@id}, due_date: #{@due_date}, zone_id: #{@zone_id}, amount:"\
204
+ " #{@amount}, currency: #{@currency}, amount_formatted: #{@amount_formatted}, is_paid:"\
205
+ " #{@is_paid}, is_last_payment: #{@is_last_payment}, created_on: #{@created_on}, updated_on:"\
206
+ " #{@updated_on}, retry_date: #{@retry_date}, terminate_with_status:"\
207
+ " #{@terminate_with_status}, additional_properties: #{@additional_properties}>"
208
+ end
209
+
210
+ # Provides a debugging-friendly string with detailed object information.
211
+ def inspect
212
+ class_name = self.class.name.split('::').last
213
+ "<#{class_name} id: #{@id.inspect}, due_date: #{@due_date.inspect}, zone_id:"\
214
+ " #{@zone_id.inspect}, amount: #{@amount.inspect}, currency: #{@currency.inspect},"\
215
+ " amount_formatted: #{@amount_formatted.inspect}, is_paid: #{@is_paid.inspect},"\
216
+ " is_last_payment: #{@is_last_payment.inspect}, created_on: #{@created_on.inspect},"\
217
+ " updated_on: #{@updated_on.inspect}, retry_date: #{@retry_date.inspect},"\
218
+ " terminate_with_status: #{@terminate_with_status.inspect}, additional_properties:"\
219
+ " #{@additional_properties}>"
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,117 @@
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 for updating a scheduled payment. All fields are optional.
8
+ # Omitted fields are left unchanged.
9
+ class SubscriptionPatchPaymentRequest < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # New due date for this payment (YYYY-MM-DD). Only available to merchants
14
+ # with permission to edit payment dates.
15
+ # @return [Date]
16
+ attr_accessor :due_date
17
+
18
+ # Mark this payment as paid. Setting to `true` will trigger scheduling of
19
+ # the next payment in the cycle.
20
+ # @return [TrueClass | FalseClass]
21
+ attr_accessor :is_paid
22
+
23
+ # Schedule a status transition on a payment's due date. Set to `suspended`
24
+ # or `canceled` to schedule termination. Send `null` to cancel a previously
25
+ # scheduled transition.
26
+ # @return [SubscriptionTerminateWithStatus]
27
+ attr_accessor :terminate_with_status
28
+
29
+ # ISO-8601 Duration override for the retry interval on a scheduled payment
30
+ # (for example `P3D`). Send `null` to clear.
31
+ # @return [String]
32
+ attr_accessor :retry_interval
33
+
34
+ # A mapping from model property names to API property names.
35
+ def self.names
36
+ @_hash = {} if @_hash.nil?
37
+ @_hash['due_date'] = 'due_date'
38
+ @_hash['is_paid'] = 'is_paid'
39
+ @_hash['terminate_with_status'] = 'terminate_with_status'
40
+ @_hash['retry_interval'] = 'retry_interval'
41
+ @_hash
42
+ end
43
+
44
+ # An array for optional fields
45
+ def self.optionals
46
+ %w[
47
+ due_date
48
+ is_paid
49
+ terminate_with_status
50
+ retry_interval
51
+ ]
52
+ end
53
+
54
+ # An array for nullable fields
55
+ def self.nullables
56
+ %w[
57
+ terminate_with_status
58
+ retry_interval
59
+ ]
60
+ end
61
+
62
+ def initialize(due_date: SKIP, is_paid: SKIP, terminate_with_status: SKIP,
63
+ retry_interval: SKIP, additional_properties: nil)
64
+ # Add additional model properties to the instance
65
+ additional_properties = {} if additional_properties.nil?
66
+
67
+ @due_date = due_date unless due_date == SKIP
68
+ @is_paid = is_paid unless is_paid == SKIP
69
+ @terminate_with_status = terminate_with_status unless terminate_with_status == SKIP
70
+ @retry_interval = retry_interval unless retry_interval == SKIP
71
+ @additional_properties = additional_properties
72
+ end
73
+
74
+ # Creates an instance of the object from a hash.
75
+ def self.from_hash(hash)
76
+ return nil unless hash
77
+
78
+ # Extract variables from the hash.
79
+ due_date = hash.key?('due_date') ? hash['due_date'] : SKIP
80
+ is_paid = hash.key?('is_paid') ? hash['is_paid'] : SKIP
81
+ terminate_with_status =
82
+ hash.key?('terminate_with_status') ? hash['terminate_with_status'] : SKIP
83
+ retry_interval =
84
+ hash.key?('retry_interval') ? hash['retry_interval'] : SKIP
85
+
86
+ # Create a new hash for additional properties, removing known properties.
87
+ new_hash = hash.reject { |k, _| names.value?(k) }
88
+
89
+ additional_properties = APIHelper.get_additional_properties(
90
+ new_hash, proc { |value| value }
91
+ )
92
+
93
+ # Create object from extracted values.
94
+ SubscriptionPatchPaymentRequest.new(due_date: due_date,
95
+ is_paid: is_paid,
96
+ terminate_with_status: terminate_with_status,
97
+ retry_interval: retry_interval,
98
+ additional_properties: additional_properties)
99
+ end
100
+
101
+ # Provides a human-readable string representation of the object.
102
+ def to_s
103
+ class_name = self.class.name.split('::').last
104
+ "<#{class_name} due_date: #{@due_date}, is_paid: #{@is_paid}, terminate_with_status:"\
105
+ " #{@terminate_with_status}, retry_interval: #{@retry_interval}, additional_properties:"\
106
+ " #{@additional_properties}>"
107
+ end
108
+
109
+ # Provides a debugging-friendly string with detailed object information.
110
+ def inspect
111
+ class_name = self.class.name.split('::').last
112
+ "<#{class_name} due_date: #{@due_date.inspect}, is_paid: #{@is_paid.inspect},"\
113
+ " terminate_with_status: #{@terminate_with_status.inspect}, retry_interval:"\
114
+ " #{@retry_interval.inspect}, additional_properties: #{@additional_properties}>"
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,79 @@
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 for updating the payment method (transaction token) of a
8
+ # subscription. The new token must belong to the same store, be active, and
9
+ # match the subscription's mode.
10
+ class SubscriptionPatchTokenRequest < BaseModel
11
+ SKIP = Object.new
12
+ private_constant :SKIP
13
+
14
+ # The ID of the new transaction token to use for future subscription
15
+ # payments. Must be a recurring or subscription-type token for the same
16
+ # store.
17
+ # @return [UUID | String]
18
+ attr_accessor :transaction_token_id
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['transaction_token_id'] = 'transaction_token_id'
24
+ @_hash
25
+ end
26
+
27
+ # An array for optional fields
28
+ def self.optionals
29
+ []
30
+ end
31
+
32
+ # An array for nullable fields
33
+ def self.nullables
34
+ []
35
+ end
36
+
37
+ def initialize(transaction_token_id:, additional_properties: nil)
38
+ # Add additional model properties to the instance
39
+ additional_properties = {} if additional_properties.nil?
40
+
41
+ @transaction_token_id = transaction_token_id
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
+ transaction_token_id =
51
+ hash.key?('transaction_token_id') ? hash['transaction_token_id'] : nil
52
+
53
+ # Create a new hash for additional properties, removing known properties.
54
+ new_hash = hash.reject { |k, _| names.value?(k) }
55
+
56
+ additional_properties = APIHelper.get_additional_properties(
57
+ new_hash, proc { |value| value }
58
+ )
59
+
60
+ # Create object from extracted values.
61
+ SubscriptionPatchTokenRequest.new(transaction_token_id: transaction_token_id,
62
+ additional_properties: additional_properties)
63
+ end
64
+
65
+ # Provides a human-readable string representation of the object.
66
+ def to_s
67
+ class_name = self.class.name.split('::').last
68
+ "<#{class_name} transaction_token_id: #{@transaction_token_id}, additional_properties:"\
69
+ " #{@additional_properties}>"
70
+ end
71
+
72
+ # Provides a debugging-friendly string with detailed object information.
73
+ def inspect
74
+ class_name = self.class.name.split('::').last
75
+ "<#{class_name} transaction_token_id: #{@transaction_token_id.inspect},"\
76
+ " additional_properties: #{@additional_properties}>"
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,185 @@
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 single scheduled or historical payment for a subscription.
9
+ class SubscriptionPayment < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique identifier.
14
+ # @return [UUID | String]
15
+ attr_accessor :id
16
+
17
+ # Scheduled due date.
18
+ # @return [Date]
19
+ attr_accessor :due_date
20
+
21
+ # IANA Timezone ID.
22
+ # @return [String]
23
+ attr_accessor :zone_id
24
+
25
+ # Amount in the smallest currency unit.
26
+ # @return [Integer]
27
+ attr_accessor :amount
28
+
29
+ # ISO-4217 currency code.
30
+ # @return [String]
31
+ attr_accessor :currency
32
+
33
+ # Amount formatted for display.
34
+ # @return [Float]
35
+ attr_accessor :amount_formatted
36
+
37
+ # Indicates whether this specific payment cycle has been successfully
38
+ # charged.
39
+ # @return [TrueClass | FalseClass]
40
+ attr_accessor :is_paid
41
+
42
+ # Indicates if this is the final payment in a limited-cycle subscription.
43
+ # @return [TrueClass | FalseClass]
44
+ attr_accessor :is_last_payment
45
+
46
+ # Timestamp when the resource was created.
47
+ # @return [DateTime]
48
+ attr_accessor :created_on
49
+
50
+ # Timestamp when the resource was last updated.
51
+ # @return [DateTime]
52
+ attr_accessor :updated_on
53
+
54
+ # A mapping from model property names to API property names.
55
+ def self.names
56
+ @_hash = {} if @_hash.nil?
57
+ @_hash['id'] = 'id'
58
+ @_hash['due_date'] = 'due_date'
59
+ @_hash['zone_id'] = 'zone_id'
60
+ @_hash['amount'] = 'amount'
61
+ @_hash['currency'] = 'currency'
62
+ @_hash['amount_formatted'] = 'amount_formatted'
63
+ @_hash['is_paid'] = 'is_paid'
64
+ @_hash['is_last_payment'] = 'is_last_payment'
65
+ @_hash['created_on'] = 'created_on'
66
+ @_hash['updated_on'] = 'updated_on'
67
+ @_hash
68
+ end
69
+
70
+ # An array for optional fields
71
+ def self.optionals
72
+ %w[
73
+ id
74
+ due_date
75
+ zone_id
76
+ amount
77
+ currency
78
+ amount_formatted
79
+ is_paid
80
+ is_last_payment
81
+ created_on
82
+ updated_on
83
+ ]
84
+ end
85
+
86
+ # An array for nullable fields
87
+ def self.nullables
88
+ []
89
+ end
90
+
91
+ def initialize(id: SKIP, due_date: SKIP, zone_id: SKIP, amount: SKIP,
92
+ currency: SKIP, amount_formatted: SKIP, is_paid: SKIP,
93
+ is_last_payment: SKIP, created_on: SKIP, updated_on: SKIP,
94
+ additional_properties: nil)
95
+ # Add additional model properties to the instance
96
+ additional_properties = {} if additional_properties.nil?
97
+
98
+ @id = id unless id == SKIP
99
+ @due_date = due_date unless due_date == SKIP
100
+ @zone_id = zone_id unless zone_id == SKIP
101
+ @amount = amount unless amount == SKIP
102
+ @currency = currency unless currency == SKIP
103
+ @amount_formatted = amount_formatted unless amount_formatted == SKIP
104
+ @is_paid = is_paid unless is_paid == SKIP
105
+ @is_last_payment = is_last_payment unless is_last_payment == SKIP
106
+ @created_on = created_on unless created_on == SKIP
107
+ @updated_on = updated_on unless updated_on == SKIP
108
+ @additional_properties = additional_properties
109
+ end
110
+
111
+ # Creates an instance of the object from a hash.
112
+ def self.from_hash(hash)
113
+ return nil unless hash
114
+
115
+ # Extract variables from the hash.
116
+ id = hash.key?('id') ? hash['id'] : SKIP
117
+ due_date = hash.key?('due_date') ? hash['due_date'] : SKIP
118
+ zone_id = hash.key?('zone_id') ? hash['zone_id'] : SKIP
119
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
120
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
121
+ amount_formatted =
122
+ hash.key?('amount_formatted') ? hash['amount_formatted'] : SKIP
123
+ is_paid = hash.key?('is_paid') ? hash['is_paid'] : SKIP
124
+ is_last_payment =
125
+ hash.key?('is_last_payment') ? hash['is_last_payment'] : SKIP
126
+ created_on = if hash.key?('created_on')
127
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
128
+ else
129
+ SKIP
130
+ end
131
+ updated_on = if hash.key?('updated_on')
132
+ (DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
133
+ else
134
+ SKIP
135
+ end
136
+
137
+ # Create a new hash for additional properties, removing known properties.
138
+ new_hash = hash.reject { |k, _| names.value?(k) }
139
+
140
+ additional_properties = APIHelper.get_additional_properties(
141
+ new_hash, proc { |value| value }
142
+ )
143
+
144
+ # Create object from extracted values.
145
+ SubscriptionPayment.new(id: id,
146
+ due_date: due_date,
147
+ zone_id: zone_id,
148
+ amount: amount,
149
+ currency: currency,
150
+ amount_formatted: amount_formatted,
151
+ is_paid: is_paid,
152
+ is_last_payment: is_last_payment,
153
+ created_on: created_on,
154
+ updated_on: updated_on,
155
+ additional_properties: additional_properties)
156
+ end
157
+
158
+ def to_custom_created_on
159
+ DateTimeHelper.to_rfc3339(created_on)
160
+ end
161
+
162
+ def to_custom_updated_on
163
+ DateTimeHelper.to_rfc3339(updated_on)
164
+ end
165
+
166
+ # Provides a human-readable string representation of the object.
167
+ def to_s
168
+ class_name = self.class.name.split('::').last
169
+ "<#{class_name} id: #{@id}, due_date: #{@due_date}, zone_id: #{@zone_id}, amount:"\
170
+ " #{@amount}, currency: #{@currency}, amount_formatted: #{@amount_formatted}, is_paid:"\
171
+ " #{@is_paid}, is_last_payment: #{@is_last_payment}, created_on: #{@created_on}, updated_on:"\
172
+ " #{@updated_on}, additional_properties: #{@additional_properties}>"
173
+ end
174
+
175
+ # Provides a debugging-friendly string with detailed object information.
176
+ def inspect
177
+ class_name = self.class.name.split('::').last
178
+ "<#{class_name} id: #{@id.inspect}, due_date: #{@due_date.inspect}, zone_id:"\
179
+ " #{@zone_id.inspect}, amount: #{@amount.inspect}, currency: #{@currency.inspect},"\
180
+ " amount_formatted: #{@amount_formatted.inspect}, is_paid: #{@is_paid.inspect},"\
181
+ " is_last_payment: #{@is_last_payment.inspect}, created_on: #{@created_on.inspect},"\
182
+ " updated_on: #{@updated_on.inspect}, additional_properties: #{@additional_properties}>"
183
+ end
184
+ end
185
+ 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 subscription payments.
8
+ class SubscriptionPaymentList < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # List of resources.
13
+ # @return [Array[SubscriptionPayment]]
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 << (SubscriptionPayment.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
+ SubscriptionPaymentList.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