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.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +212 -0
- data/bin/console +15 -0
- data/lib/univapay_client_sdk/api_helper.rb +10 -0
- data/lib/univapay_client_sdk/apis/base_api.rb +67 -0
- data/lib/univapay_client_sdk/apis/cancels_api.rb +293 -0
- data/lib/univapay_client_sdk/apis/charges_api.rb +909 -0
- data/lib/univapay_client_sdk/apis/merchants_api.rb +57 -0
- data/lib/univapay_client_sdk/apis/refunds_api.rb +298 -0
- data/lib/univapay_client_sdk/apis/stores_api.rb +126 -0
- data/lib/univapay_client_sdk/apis/subscriptions_api.rb +1014 -0
- data/lib/univapay_client_sdk/apis/transaction_tokens_api.rb +455 -0
- data/lib/univapay_client_sdk/apis/webhooks_api.rb +463 -0
- data/lib/univapay_client_sdk/client.rb +128 -0
- data/lib/univapay_client_sdk/configuration.rb +179 -0
- data/lib/univapay_client_sdk/events/unknown_event.rb +32 -0
- data/lib/univapay_client_sdk/events/webhooks/bank_transfer_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/cancel_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/charge_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_handler.rb +37 -0
- data/lib/univapay_client_sdk/exceptions/api_error_exception.rb +199 -0
- data/lib/univapay_client_sdk/exceptions/api_exception.rb +21 -0
- data/lib/univapay_client_sdk/extensions.rb +127 -0
- data/lib/univapay_client_sdk/http/api_response.rb +19 -0
- data/lib/univapay_client_sdk/http/auth/oauth_2.rb +58 -0
- data/lib/univapay_client_sdk/http/http_call_back.rb +10 -0
- data/lib/univapay_client_sdk/http/http_method_enum.rb +10 -0
- data/lib/univapay_client_sdk/http/http_request.rb +10 -0
- data/lib/univapay_client_sdk/http/http_response.rb +10 -0
- data/lib/univapay_client_sdk/http/proxy_settings.rb +22 -0
- data/lib/univapay_client_sdk/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/univapay_client_sdk/logging/sdk_logger.rb +17 -0
- data/lib/univapay_client_sdk/models/api_error_detail.rb +87 -0
- data/lib/univapay_client_sdk/models/api_error_status.rb +26 -0
- data/lib/univapay_client_sdk/models/bank_transfer_event.rb +27 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger.rb +199 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_bank_ledger_type.rb +36 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_list.rb +104 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/bank_transfer_payment_status.rb +44 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_data.rb +229 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback.rb +134 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback_extension.rb +75 -0
- data/lib/univapay_client_sdk/models/base_bank_transfer_data.rb +100 -0
- data/lib/univapay_client_sdk/models/base_konbini_data.rb +99 -0
- data/lib/univapay_client_sdk/models/base_konbini_data_convenience_store.rb +60 -0
- data/lib/univapay_client_sdk/models/base_model.rb +110 -0
- data/lib/univapay_client_sdk/models/base_online_data.rb +123 -0
- data/lib/univapay_client_sdk/models/base_online_data_brand.rb +48 -0
- data/lib/univapay_client_sdk/models/base_online_data_call_method.rb +52 -0
- data/lib/univapay_client_sdk/models/base_online_data_os_type.rb +36 -0
- data/lib/univapay_client_sdk/models/base_online_data_user_identifier_source.rb +36 -0
- data/lib/univapay_client_sdk/models/cancel.rb +183 -0
- data/lib/univapay_client_sdk/models/cancel_create_request.rb +77 -0
- data/lib/univapay_client_sdk/models/cancel_event.rb +26 -0
- data/lib/univapay_client_sdk/models/cancel_list.rb +94 -0
- data/lib/univapay_client_sdk/models/cancel_status.rb +44 -0
- data/lib/univapay_client_sdk/models/cancel_update_request.rb +76 -0
- data/lib/univapay_client_sdk/models/cancel_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/cancel_webhook_callback_extension.rb +74 -0
- data/lib/univapay_client_sdk/models/card_processor_installment_config.rb +89 -0
- data/lib/univapay_client_sdk/models/charge.rb +411 -0
- data/lib/univapay_client_sdk/models/charge_capture_request.rb +84 -0
- data/lib/univapay_client_sdk/models/charge_create_request.rb +179 -0
- data/lib/univapay_client_sdk/models/charge_create_request_client_metadata.rb +76 -0
- data/lib/univapay_client_sdk/models/charge_create_request_redirect.rb +75 -0
- data/lib/univapay_client_sdk/models/charge_create_request_three_ds.rb +88 -0
- data/lib/univapay_client_sdk/models/charge_create_request_three_ds_mode.rb +44 -0
- data/lib/univapay_client_sdk/models/charge_event.rb +36 -0
- data/lib/univapay_client_sdk/models/charge_list.rb +104 -0
- data/lib/univapay_client_sdk/models/charge_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/charge_redirect.rb +96 -0
- data/lib/univapay_client_sdk/models/charge_status.rb +56 -0
- data/lib/univapay_client_sdk/models/charge_three_ds.rb +97 -0
- data/lib/univapay_client_sdk/models/charge_transaction_token_type.rb +40 -0
- data/lib/univapay_client_sdk/models/charge_update_request.rb +75 -0
- data/lib/univapay_client_sdk/models/charge_webhook_event.rb +138 -0
- data/lib/univapay_client_sdk/models/cursor_direction_query.rb +36 -0
- data/lib/univapay_client_sdk/models/customs_declaration_create_request.rb +106 -0
- data/lib/univapay_client_sdk/models/customs_declaration_event.rb +27 -0
- data/lib/univapay_client_sdk/models/customs_declaration_patch_request.rb +77 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback.rb +135 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback_extension.rb +76 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_data.rb +232 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb +121 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_error.rb +127 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_other_error.rb +120 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_result.rb +125 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_status.rb +44 -0
- data/lib/univapay_client_sdk/models/generic_metadata.rb +111 -0
- data/lib/univapay_client_sdk/models/installment_fixed_cycles.rb +70 -0
- data/lib/univapay_client_sdk/models/installment_plan_type.rb +36 -0
- data/lib/univapay_client_sdk/models/issuer_token.rb +177 -0
- data/lib/univapay_client_sdk/models/issuer_token_call_method.rb +51 -0
- data/lib/univapay_client_sdk/models/issuer_token_payload.rb +105 -0
- data/lib/univapay_client_sdk/models/issuer_token_payment_type.rb +36 -0
- data/lib/univapay_client_sdk/models/merchant.rb +179 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_bank_transfer_configuration.rb +342 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_card_brand_percent_fees.rb +167 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_card_configuration.rb +301 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_checkout_configuration.rb +87 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_checkout_toggle.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_configuration.rb +505 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_convenience_configuration.rb +88 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_customer_management_configuration.rb +99 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb +139 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_limit_charge_by_card_configuration.rb +88 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb +100 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_money_amount.rb +85 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_online_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_paidy_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_qr_merchant_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_qr_scan_configuration.rb +93 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_recurring_cvv_confirmation_config.rb +97 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb +109 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_security_configuration.rb +234 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_subscription_configuration.rb +138 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb +138 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_transfer_schedule_configuration.rb +159 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_user_transactions_configuration.rb +349 -0
- data/lib/univapay_client_sdk/models/mode_query.rb +36 -0
- data/lib/univapay_client_sdk/models/payment_error.rb +178 -0
- data/lib/univapay_client_sdk/models/plan_settings_type.rb +36 -0
- data/lib/univapay_client_sdk/models/refund.rb +240 -0
- data/lib/univapay_client_sdk/models/refund_create_request.rb +118 -0
- data/lib/univapay_client_sdk/models/refund_event.rb +26 -0
- data/lib/univapay_client_sdk/models/refund_list.rb +104 -0
- data/lib/univapay_client_sdk/models/refund_reason_request.rb +42 -0
- data/lib/univapay_client_sdk/models/refund_reason_response.rb +62 -0
- data/lib/univapay_client_sdk/models/refund_status.rb +47 -0
- data/lib/univapay_client_sdk/models/refund_update_request.rb +99 -0
- data/lib/univapay_client_sdk/models/refund_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/refund_webhook_callback_extension.rb +74 -0
- data/lib/univapay_client_sdk/models/restrict_ip_after_failed_charge_config.rb +99 -0
- data/lib/univapay_client_sdk/models/store.rb +119 -0
- data/lib/univapay_client_sdk/models/store_list.rb +104 -0
- data/lib/univapay_client_sdk/models/store_list_item.rb +114 -0
- data/lib/univapay_client_sdk/models/subscription.rb +310 -0
- data/lib/univapay_client_sdk/models/subscription_create_request.rb +216 -0
- data/lib/univapay_client_sdk/models/subscription_event.rb +54 -0
- data/lib/univapay_client_sdk/models/subscription_installment_plan.rb +86 -0
- data/lib/univapay_client_sdk/models/subscription_list.rb +104 -0
- data/lib/univapay_client_sdk/models/subscription_list_item.rb +352 -0
- data/lib/univapay_client_sdk/models/subscription_next_payment.rb +222 -0
- data/lib/univapay_client_sdk/models/subscription_patch_payment_request.rb +117 -0
- data/lib/univapay_client_sdk/models/subscription_patch_token_request.rb +79 -0
- data/lib/univapay_client_sdk/models/subscription_payment.rb +185 -0
- data/lib/univapay_client_sdk/models/subscription_payment_list.rb +94 -0
- data/lib/univapay_client_sdk/models/subscription_period.rb +56 -0
- data/lib/univapay_client_sdk/models/subscription_plan_settings.rb +98 -0
- data/lib/univapay_client_sdk/models/subscription_schedule_settings.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_status.rb +56 -0
- data/lib/univapay_client_sdk/models/subscription_suspend_request.rb +79 -0
- data/lib/univapay_client_sdk/models/subscription_terminate_with_status.rb +36 -0
- data/lib/univapay_client_sdk/models/subscription_termination_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/subscription_update_next_payment.rb +104 -0
- data/lib/univapay_client_sdk/models/subscription_update_request.rb +134 -0
- data/lib/univapay_client_sdk/models/subscription_update_schedule_settings.rb +110 -0
- data/lib/univapay_client_sdk/models/subscription_update_status.rb +37 -0
- data/lib/univapay_client_sdk/models/subscription_user_data.rb +134 -0
- data/lib/univapay_client_sdk/models/subscription_webhook_event.rb +143 -0
- data/lib/univapay_client_sdk/models/suspend_schedule_settings.rb +78 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token.rb +116 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token_call_method.rb +26 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token_payment_type.rb +26 -0
- data/lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb +122 -0
- data/lib/univapay_client_sdk/models/token_create_card_data.rb +230 -0
- data/lib/univapay_client_sdk/models/token_create_card_data_cvv_authorize.rb +95 -0
- data/lib/univapay_client_sdk/models/token_create_card_data_three_ds.rb +97 -0
- data/lib/univapay_client_sdk/models/token_create_konbini_data.rb +146 -0
- data/lib/univapay_client_sdk/models/token_create_online_data.rb +142 -0
- data/lib/univapay_client_sdk/models/token_create_phone_number.rb +104 -0
- data/lib/univapay_client_sdk/models/token_event.rb +59 -0
- data/lib/univapay_client_sdk/models/token_response_bank_transfer_data.rb +181 -0
- data/lib/univapay_client_sdk/models/token_response_card_data.rb +129 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_billing.rb +153 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_card.rb +187 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize.rb +132 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb +118 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb +142 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_three_ds_status.rb +48 -0
- data/lib/univapay_client_sdk/models/token_response_konbini_data.rb +135 -0
- data/lib/univapay_client_sdk/models/token_response_online_data.rb +158 -0
- data/lib/univapay_client_sdk/models/token_response_phone_number.rb +96 -0
- data/lib/univapay_client_sdk/models/token_webhook_event.rb +144 -0
- data/lib/univapay_client_sdk/models/transaction_token.rb +250 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request.rb +161 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_metadata.rb +124 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_payment_type.rb +44 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_type.rb +40 -0
- data/lib/univapay_client_sdk/models/transaction_token_list.rb +104 -0
- data/lib/univapay_client_sdk/models/transaction_token_list_item.rb +204 -0
- data/lib/univapay_client_sdk/models/transaction_token_list_item_user_data.rb +96 -0
- data/lib/univapay_client_sdk/models/transaction_token_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/transaction_token_payment_type.rb +48 -0
- data/lib/univapay_client_sdk/models/transaction_token_type.rb +40 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request.rb +95 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request_data.rb +184 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request_data_phone_number.rb +86 -0
- data/lib/univapay_client_sdk/models/webhook.rb +191 -0
- data/lib/univapay_client_sdk/models/webhook_callback_envelope.rb +98 -0
- data/lib/univapay_client_sdk/models/webhook_create_request.rb +97 -0
- data/lib/univapay_client_sdk/models/webhook_event.rb +166 -0
- data/lib/univapay_client_sdk/models/webhook_event_list.rb +94 -0
- data/lib/univapay_client_sdk/models/webhook_list.rb +94 -0
- data/lib/univapay_client_sdk/models/webhook_trigger.rb +104 -0
- data/lib/univapay_client_sdk/models/webhook_update_request.rb +108 -0
- data/lib/univapay_client_sdk/utilities/date_time_helper.rb +11 -0
- data/lib/univapay_client_sdk/utilities/file_wrapper.rb +28 -0
- data/lib/univapay_client_sdk/utilities/union_type_lookup.rb +182 -0
- data/lib/univapay_client_sdk.rb +285 -0
- data/test/apis/api_test_base.rb +23 -0
- data/test/apis/test_cancels_api.rb +162 -0
- data/test/apis/test_charges_api.rb +565 -0
- data/test/apis/test_error_messages.rb +38 -0
- data/test/apis/test_merchants_api.rb +50 -0
- data/test/apis/test_refunds_api.rb +172 -0
- data/test/apis/test_stores_api.rb +86 -0
- data/test/apis/test_subscriptions_api.rb +579 -0
- data/test/apis/test_transaction_tokens_api.rb +305 -0
- data/test/apis/test_webhooks_api.rb +245 -0
- data/test/events/webhooks/test_bank_transfer_handler.rb +95 -0
- data/test/events/webhooks/test_cancel_handler.rb +90 -0
- data/test/events/webhooks/test_charge_handler.rb +138 -0
- data/test/events/webhooks/test_customs_handler.rb +100 -0
- data/test/events/webhooks/test_refund_handler.rb +95 -0
- data/test/events/webhooks/test_subscription_handler.rb +346 -0
- data/test/events/webhooks/test_token_handler.rb +332 -0
- data/test/framework_integrations/rails_app_test_helper.rb +14 -0
- data/test/framework_integrations/webhooks/apps/hanami_charge_app.rb +61 -0
- data/test/framework_integrations/webhooks/apps/rails_charge_app.rb +24 -0
- data/test/framework_integrations/webhooks/apps/sinatra_charge_app.rb +27 -0
- data/test/framework_integrations/webhooks/test/test_hanami_charge_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_rails_charge_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_sinatra_charge_app.rb +58 -0
- data/test/http_response_catcher.rb +32 -0
- metadata +366 -0
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
# Store row returned by store list queries.
|
|
9
|
+
class StoreListItem < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Store identifier.
|
|
14
|
+
# @return [UUID | String]
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# Store display name.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# Merchant display name associated with the store row.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :merchant_name
|
|
24
|
+
|
|
25
|
+
# Timestamp when the store was created.
|
|
26
|
+
# @return [DateTime]
|
|
27
|
+
attr_accessor :created_on
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['id'] = 'id'
|
|
33
|
+
@_hash['name'] = 'name'
|
|
34
|
+
@_hash['merchant_name'] = 'merchant_name'
|
|
35
|
+
@_hash['created_on'] = 'created_on'
|
|
36
|
+
@_hash
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An array for optional fields
|
|
40
|
+
def self.optionals
|
|
41
|
+
%w[
|
|
42
|
+
id
|
|
43
|
+
name
|
|
44
|
+
merchant_name
|
|
45
|
+
created_on
|
|
46
|
+
]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for nullable fields
|
|
50
|
+
def self.nullables
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(id: SKIP, name: SKIP, merchant_name: SKIP, created_on: SKIP,
|
|
55
|
+
additional_properties: nil)
|
|
56
|
+
# Add additional model properties to the instance
|
|
57
|
+
additional_properties = {} if additional_properties.nil?
|
|
58
|
+
|
|
59
|
+
@id = id unless id == SKIP
|
|
60
|
+
@name = name unless name == SKIP
|
|
61
|
+
@merchant_name = merchant_name unless merchant_name == SKIP
|
|
62
|
+
@created_on = created_on unless created_on == SKIP
|
|
63
|
+
@additional_properties = additional_properties
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Creates an instance of the object from a hash.
|
|
67
|
+
def self.from_hash(hash)
|
|
68
|
+
return nil unless hash
|
|
69
|
+
|
|
70
|
+
# Extract variables from the hash.
|
|
71
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
72
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
73
|
+
merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP
|
|
74
|
+
created_on = if hash.key?('created_on')
|
|
75
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
76
|
+
else
|
|
77
|
+
SKIP
|
|
78
|
+
end
|
|
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
|
+
StoreListItem.new(id: id,
|
|
89
|
+
name: name,
|
|
90
|
+
merchant_name: merchant_name,
|
|
91
|
+
created_on: created_on,
|
|
92
|
+
additional_properties: additional_properties)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def to_custom_created_on
|
|
96
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Provides a human-readable string representation of the object.
|
|
100
|
+
def to_s
|
|
101
|
+
class_name = self.class.name.split('::').last
|
|
102
|
+
"<#{class_name} id: #{@id}, name: #{@name}, merchant_name: #{@merchant_name}, created_on:"\
|
|
103
|
+
" #{@created_on}, additional_properties: #{@additional_properties}>"
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
107
|
+
def inspect
|
|
108
|
+
class_name = self.class.name.split('::').last
|
|
109
|
+
"<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, merchant_name:"\
|
|
110
|
+
" #{@merchant_name.inspect}, created_on: #{@created_on.inspect}, additional_properties:"\
|
|
111
|
+
" #{@additional_properties}>"
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
@@ -0,0 +1,310 @@
|
|
|
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
|
+
# The Subscription object represents a recurring payment schedule.
|
|
9
|
+
class Subscription < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Unique identifier.
|
|
14
|
+
# @return [UUID | String]
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# Store identifier.
|
|
18
|
+
# @return [UUID | String]
|
|
19
|
+
attr_accessor :store_id
|
|
20
|
+
|
|
21
|
+
# Transaction token identifier.
|
|
22
|
+
# @return [UUID | String]
|
|
23
|
+
attr_accessor :transaction_token_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
|
+
# Initial amount in the smallest currency unit.
|
|
38
|
+
# @return [Integer]
|
|
39
|
+
attr_accessor :initial_amount
|
|
40
|
+
|
|
41
|
+
# Initial amount formatted for display.
|
|
42
|
+
# @return [Float]
|
|
43
|
+
attr_accessor :initial_amount_formatted
|
|
44
|
+
|
|
45
|
+
# Timestamp when recurring cycles begin.
|
|
46
|
+
# @return [DateTime]
|
|
47
|
+
attr_accessor :subsequent_cycles_start
|
|
48
|
+
|
|
49
|
+
# Schedule settings applied to a subscription.
|
|
50
|
+
# @return [SubscriptionScheduleSettings]
|
|
51
|
+
attr_accessor :schedule_settings
|
|
52
|
+
|
|
53
|
+
# Whether only direct currency processing is allowed.
|
|
54
|
+
# @return [TrueClass | FalseClass]
|
|
55
|
+
attr_accessor :only_direct_currency
|
|
56
|
+
|
|
57
|
+
# ISO-8601 Duration (e.g., P3D).
|
|
58
|
+
# @return [String]
|
|
59
|
+
attr_accessor :first_charge_capture_after
|
|
60
|
+
|
|
61
|
+
# Whether the first charge is authorization-only.
|
|
62
|
+
# @return [TrueClass | FalseClass]
|
|
63
|
+
attr_accessor :first_charge_authorization_only
|
|
64
|
+
|
|
65
|
+
# Subscription Status schema.
|
|
66
|
+
# @return [SubscriptionStatus]
|
|
67
|
+
attr_accessor :status
|
|
68
|
+
|
|
69
|
+
# A free-form dictionary for custom metadata.
|
|
70
|
+
# @return [GenericMetadata]
|
|
71
|
+
attr_accessor :metadata
|
|
72
|
+
|
|
73
|
+
# Charge Mode schema.
|
|
74
|
+
# @return [ChargeMode]
|
|
75
|
+
attr_accessor :mode
|
|
76
|
+
|
|
77
|
+
# Timestamp when the resource was created.
|
|
78
|
+
# @return [DateTime]
|
|
79
|
+
attr_accessor :created_on
|
|
80
|
+
|
|
81
|
+
# Subscription Period schema.
|
|
82
|
+
# @return [SubscriptionPeriod]
|
|
83
|
+
attr_accessor :period
|
|
84
|
+
|
|
85
|
+
# Next scheduled payment details for a subscription.
|
|
86
|
+
# @return [SubscriptionNextPayment]
|
|
87
|
+
attr_accessor :next_payment
|
|
88
|
+
|
|
89
|
+
# A mapping from model property names to API property names.
|
|
90
|
+
def self.names
|
|
91
|
+
@_hash = {} if @_hash.nil?
|
|
92
|
+
@_hash['id'] = 'id'
|
|
93
|
+
@_hash['store_id'] = 'store_id'
|
|
94
|
+
@_hash['transaction_token_id'] = 'transaction_token_id'
|
|
95
|
+
@_hash['amount'] = 'amount'
|
|
96
|
+
@_hash['currency'] = 'currency'
|
|
97
|
+
@_hash['amount_formatted'] = 'amount_formatted'
|
|
98
|
+
@_hash['initial_amount'] = 'initial_amount'
|
|
99
|
+
@_hash['initial_amount_formatted'] = 'initial_amount_formatted'
|
|
100
|
+
@_hash['subsequent_cycles_start'] = 'subsequent_cycles_start'
|
|
101
|
+
@_hash['schedule_settings'] = 'schedule_settings'
|
|
102
|
+
@_hash['only_direct_currency'] = 'only_direct_currency'
|
|
103
|
+
@_hash['first_charge_capture_after'] = 'first_charge_capture_after'
|
|
104
|
+
@_hash['first_charge_authorization_only'] =
|
|
105
|
+
'first_charge_authorization_only'
|
|
106
|
+
@_hash['status'] = 'status'
|
|
107
|
+
@_hash['metadata'] = 'metadata'
|
|
108
|
+
@_hash['mode'] = 'mode'
|
|
109
|
+
@_hash['created_on'] = 'created_on'
|
|
110
|
+
@_hash['period'] = 'period'
|
|
111
|
+
@_hash['next_payment'] = 'next_payment'
|
|
112
|
+
@_hash
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# An array for optional fields
|
|
116
|
+
def self.optionals
|
|
117
|
+
%w[
|
|
118
|
+
id
|
|
119
|
+
store_id
|
|
120
|
+
transaction_token_id
|
|
121
|
+
amount
|
|
122
|
+
currency
|
|
123
|
+
amount_formatted
|
|
124
|
+
initial_amount
|
|
125
|
+
initial_amount_formatted
|
|
126
|
+
subsequent_cycles_start
|
|
127
|
+
schedule_settings
|
|
128
|
+
only_direct_currency
|
|
129
|
+
first_charge_capture_after
|
|
130
|
+
first_charge_authorization_only
|
|
131
|
+
status
|
|
132
|
+
metadata
|
|
133
|
+
mode
|
|
134
|
+
created_on
|
|
135
|
+
period
|
|
136
|
+
next_payment
|
|
137
|
+
]
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# An array for nullable fields
|
|
141
|
+
def self.nullables
|
|
142
|
+
%w[
|
|
143
|
+
initial_amount
|
|
144
|
+
initial_amount_formatted
|
|
145
|
+
subsequent_cycles_start
|
|
146
|
+
first_charge_capture_after
|
|
147
|
+
]
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def initialize(id: SKIP, store_id: SKIP, transaction_token_id: SKIP,
|
|
151
|
+
amount: SKIP, currency: SKIP, amount_formatted: SKIP,
|
|
152
|
+
initial_amount: SKIP, initial_amount_formatted: SKIP,
|
|
153
|
+
subsequent_cycles_start: SKIP, schedule_settings: SKIP,
|
|
154
|
+
only_direct_currency: SKIP, first_charge_capture_after: SKIP,
|
|
155
|
+
first_charge_authorization_only: SKIP, status: SKIP,
|
|
156
|
+
metadata: SKIP, mode: SKIP, created_on: SKIP, period: SKIP,
|
|
157
|
+
next_payment: SKIP, additional_properties: nil)
|
|
158
|
+
# Add additional model properties to the instance
|
|
159
|
+
additional_properties = {} if additional_properties.nil?
|
|
160
|
+
|
|
161
|
+
@id = id unless id == SKIP
|
|
162
|
+
@store_id = store_id unless store_id == SKIP
|
|
163
|
+
@transaction_token_id = transaction_token_id unless transaction_token_id == SKIP
|
|
164
|
+
@amount = amount unless amount == SKIP
|
|
165
|
+
@currency = currency unless currency == SKIP
|
|
166
|
+
@amount_formatted = amount_formatted unless amount_formatted == SKIP
|
|
167
|
+
@initial_amount = initial_amount unless initial_amount == SKIP
|
|
168
|
+
@initial_amount_formatted = initial_amount_formatted unless initial_amount_formatted == SKIP
|
|
169
|
+
@subsequent_cycles_start = subsequent_cycles_start unless subsequent_cycles_start == SKIP
|
|
170
|
+
@schedule_settings = schedule_settings unless schedule_settings == SKIP
|
|
171
|
+
@only_direct_currency = only_direct_currency unless only_direct_currency == SKIP
|
|
172
|
+
unless first_charge_capture_after == SKIP
|
|
173
|
+
@first_charge_capture_after =
|
|
174
|
+
first_charge_capture_after
|
|
175
|
+
end
|
|
176
|
+
unless first_charge_authorization_only == SKIP
|
|
177
|
+
@first_charge_authorization_only =
|
|
178
|
+
first_charge_authorization_only
|
|
179
|
+
end
|
|
180
|
+
@status = status unless status == SKIP
|
|
181
|
+
@metadata = metadata unless metadata == SKIP
|
|
182
|
+
@mode = mode unless mode == SKIP
|
|
183
|
+
@created_on = created_on unless created_on == SKIP
|
|
184
|
+
@period = period unless period == SKIP
|
|
185
|
+
@next_payment = next_payment unless next_payment == SKIP
|
|
186
|
+
@additional_properties = additional_properties
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Creates an instance of the object from a hash.
|
|
190
|
+
def self.from_hash(hash)
|
|
191
|
+
return nil unless hash
|
|
192
|
+
|
|
193
|
+
# Extract variables from the hash.
|
|
194
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
195
|
+
store_id = hash.key?('store_id') ? hash['store_id'] : SKIP
|
|
196
|
+
transaction_token_id =
|
|
197
|
+
hash.key?('transaction_token_id') ? hash['transaction_token_id'] : SKIP
|
|
198
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
199
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
200
|
+
amount_formatted =
|
|
201
|
+
hash.key?('amount_formatted') ? hash['amount_formatted'] : SKIP
|
|
202
|
+
initial_amount =
|
|
203
|
+
hash.key?('initial_amount') ? hash['initial_amount'] : SKIP
|
|
204
|
+
initial_amount_formatted =
|
|
205
|
+
hash.key?('initial_amount_formatted') ? hash['initial_amount_formatted'] : SKIP
|
|
206
|
+
subsequent_cycles_start = if hash.key?('subsequent_cycles_start')
|
|
207
|
+
(DateTimeHelper.from_rfc3339(hash['subsequent_cycles_start']) if hash['subsequent_cycles_start'])
|
|
208
|
+
else
|
|
209
|
+
SKIP
|
|
210
|
+
end
|
|
211
|
+
schedule_settings = SubscriptionScheduleSettings.from_hash(hash['schedule_settings']) if
|
|
212
|
+
hash['schedule_settings']
|
|
213
|
+
only_direct_currency =
|
|
214
|
+
hash.key?('only_direct_currency') ? hash['only_direct_currency'] : SKIP
|
|
215
|
+
first_charge_capture_after =
|
|
216
|
+
hash.key?('first_charge_capture_after') ? hash['first_charge_capture_after'] : SKIP
|
|
217
|
+
first_charge_authorization_only =
|
|
218
|
+
hash.key?('first_charge_authorization_only') ? hash['first_charge_authorization_only'] : SKIP
|
|
219
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
220
|
+
metadata = GenericMetadata.from_hash(hash['metadata']) if hash['metadata']
|
|
221
|
+
mode = hash.key?('mode') ? hash['mode'] : SKIP
|
|
222
|
+
created_on = if hash.key?('created_on')
|
|
223
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
224
|
+
else
|
|
225
|
+
SKIP
|
|
226
|
+
end
|
|
227
|
+
period = hash.key?('period') ? hash['period'] : SKIP
|
|
228
|
+
next_payment = SubscriptionNextPayment.from_hash(hash['next_payment']) if
|
|
229
|
+
hash['next_payment']
|
|
230
|
+
|
|
231
|
+
# Create a new hash for additional properties, removing known properties.
|
|
232
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
233
|
+
|
|
234
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
235
|
+
new_hash, proc { |value| value }
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
# Create object from extracted values.
|
|
239
|
+
Subscription.new(id: id,
|
|
240
|
+
store_id: store_id,
|
|
241
|
+
transaction_token_id: transaction_token_id,
|
|
242
|
+
amount: amount,
|
|
243
|
+
currency: currency,
|
|
244
|
+
amount_formatted: amount_formatted,
|
|
245
|
+
initial_amount: initial_amount,
|
|
246
|
+
initial_amount_formatted: initial_amount_formatted,
|
|
247
|
+
subsequent_cycles_start: subsequent_cycles_start,
|
|
248
|
+
schedule_settings: schedule_settings,
|
|
249
|
+
only_direct_currency: only_direct_currency,
|
|
250
|
+
first_charge_capture_after: first_charge_capture_after,
|
|
251
|
+
first_charge_authorization_only: first_charge_authorization_only,
|
|
252
|
+
status: status,
|
|
253
|
+
metadata: metadata,
|
|
254
|
+
mode: mode,
|
|
255
|
+
created_on: created_on,
|
|
256
|
+
period: period,
|
|
257
|
+
next_payment: next_payment,
|
|
258
|
+
additional_properties: additional_properties)
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
def to_custom_subsequent_cycles_start
|
|
262
|
+
DateTimeHelper.to_rfc3339(subsequent_cycles_start)
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
def to_custom_created_on
|
|
266
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Validates an instance of the object from a given value.
|
|
270
|
+
# @param [Subscription | Hash] The value against the validation is performed.
|
|
271
|
+
def self.validate(value)
|
|
272
|
+
return true if value.instance_of? self
|
|
273
|
+
|
|
274
|
+
return false unless value.instance_of? Hash
|
|
275
|
+
|
|
276
|
+
true
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Provides a human-readable string representation of the object.
|
|
280
|
+
def to_s
|
|
281
|
+
class_name = self.class.name.split('::').last
|
|
282
|
+
"<#{class_name} id: #{@id}, store_id: #{@store_id}, transaction_token_id:"\
|
|
283
|
+
" #{@transaction_token_id}, amount: #{@amount}, currency: #{@currency}, amount_formatted:"\
|
|
284
|
+
" #{@amount_formatted}, initial_amount: #{@initial_amount}, initial_amount_formatted:"\
|
|
285
|
+
" #{@initial_amount_formatted}, subsequent_cycles_start: #{@subsequent_cycles_start},"\
|
|
286
|
+
" schedule_settings: #{@schedule_settings}, only_direct_currency: #{@only_direct_currency},"\
|
|
287
|
+
" first_charge_capture_after: #{@first_charge_capture_after},"\
|
|
288
|
+
" first_charge_authorization_only: #{@first_charge_authorization_only}, status: #{@status},"\
|
|
289
|
+
" metadata: #{@metadata}, mode: #{@mode}, created_on: #{@created_on}, period: #{@period},"\
|
|
290
|
+
" next_payment: #{@next_payment}, additional_properties: #{@additional_properties}>"
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
294
|
+
def inspect
|
|
295
|
+
class_name = self.class.name.split('::').last
|
|
296
|
+
"<#{class_name} id: #{@id.inspect}, store_id: #{@store_id.inspect}, transaction_token_id:"\
|
|
297
|
+
" #{@transaction_token_id.inspect}, amount: #{@amount.inspect}, currency:"\
|
|
298
|
+
" #{@currency.inspect}, amount_formatted: #{@amount_formatted.inspect}, initial_amount:"\
|
|
299
|
+
" #{@initial_amount.inspect}, initial_amount_formatted:"\
|
|
300
|
+
" #{@initial_amount_formatted.inspect}, subsequent_cycles_start:"\
|
|
301
|
+
" #{@subsequent_cycles_start.inspect}, schedule_settings: #{@schedule_settings.inspect},"\
|
|
302
|
+
" only_direct_currency: #{@only_direct_currency.inspect}, first_charge_capture_after:"\
|
|
303
|
+
" #{@first_charge_capture_after.inspect}, first_charge_authorization_only:"\
|
|
304
|
+
" #{@first_charge_authorization_only.inspect}, status: #{@status.inspect}, metadata:"\
|
|
305
|
+
" #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect}, period:"\
|
|
306
|
+
" #{@period.inspect}, next_payment: #{@next_payment.inspect}, additional_properties:"\
|
|
307
|
+
" #{@additional_properties}>"
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
end
|
|
@@ -0,0 +1,216 @@
|
|
|
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 payload for creating a subscription.
|
|
8
|
+
class SubscriptionCreateRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Transaction token ID authorized for recurring payments.
|
|
13
|
+
# @return [UUID | String]
|
|
14
|
+
attr_accessor :transaction_token_id
|
|
15
|
+
|
|
16
|
+
# Amount to be charged in each cycle.
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
attr_accessor :amount
|
|
19
|
+
|
|
20
|
+
# ISO-4217 currency code.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :currency
|
|
23
|
+
|
|
24
|
+
# Optional different amount for the first charge.
|
|
25
|
+
# @return [Integer]
|
|
26
|
+
attr_accessor :initial_amount
|
|
27
|
+
|
|
28
|
+
# Subscription Period schema.
|
|
29
|
+
# @return [SubscriptionPeriod]
|
|
30
|
+
attr_accessor :period
|
|
31
|
+
|
|
32
|
+
# ISO-8601 Duration for custom frequency (e.g., P3D, P2M). Cannot be used
|
|
33
|
+
# if 'period' is specified.
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :cyclical_period
|
|
36
|
+
|
|
37
|
+
# Schedule settings applied to a subscription.
|
|
38
|
+
# @return [SubscriptionScheduleSettings]
|
|
39
|
+
attr_accessor :schedule_settings
|
|
40
|
+
|
|
41
|
+
# Configuration for credit card company side installments.
|
|
42
|
+
# @return [SubscriptionInstallmentPlan]
|
|
43
|
+
attr_accessor :installment_plan
|
|
44
|
+
|
|
45
|
+
# Configuration for limited-cycle subscriptions (Univapay side).
|
|
46
|
+
# @return [SubscriptionPlanSettings]
|
|
47
|
+
attr_accessor :subscription_plan
|
|
48
|
+
|
|
49
|
+
# If true, the first charge will only be an authorization (Hold).
|
|
50
|
+
# @return [TrueClass | FalseClass]
|
|
51
|
+
attr_accessor :first_charge_authorization_only
|
|
52
|
+
|
|
53
|
+
# ISO-8601 Duration for auto-capture if authorization only is true. Allowed
|
|
54
|
+
# days: P1D to P6D.
|
|
55
|
+
# @return [String]
|
|
56
|
+
attr_accessor :first_charge_capture_after
|
|
57
|
+
|
|
58
|
+
# A free-form dictionary for custom metadata.
|
|
59
|
+
# @return [GenericMetadata]
|
|
60
|
+
attr_accessor :metadata
|
|
61
|
+
|
|
62
|
+
# Charge Create Request Three Ds schema.
|
|
63
|
+
# @return [ChargeCreateRequestThreeDs]
|
|
64
|
+
attr_accessor :three_ds
|
|
65
|
+
|
|
66
|
+
# A mapping from model property names to API property names.
|
|
67
|
+
def self.names
|
|
68
|
+
@_hash = {} if @_hash.nil?
|
|
69
|
+
@_hash['transaction_token_id'] = 'transaction_token_id'
|
|
70
|
+
@_hash['amount'] = 'amount'
|
|
71
|
+
@_hash['currency'] = 'currency'
|
|
72
|
+
@_hash['initial_amount'] = 'initial_amount'
|
|
73
|
+
@_hash['period'] = 'period'
|
|
74
|
+
@_hash['cyclical_period'] = 'cyclical_period'
|
|
75
|
+
@_hash['schedule_settings'] = 'schedule_settings'
|
|
76
|
+
@_hash['installment_plan'] = 'installment_plan'
|
|
77
|
+
@_hash['subscription_plan'] = 'subscription_plan'
|
|
78
|
+
@_hash['first_charge_authorization_only'] =
|
|
79
|
+
'first_charge_authorization_only'
|
|
80
|
+
@_hash['first_charge_capture_after'] = 'first_charge_capture_after'
|
|
81
|
+
@_hash['metadata'] = 'metadata'
|
|
82
|
+
@_hash['three_ds'] = 'three_ds'
|
|
83
|
+
@_hash
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# An array for optional fields
|
|
87
|
+
def self.optionals
|
|
88
|
+
%w[
|
|
89
|
+
initial_amount
|
|
90
|
+
period
|
|
91
|
+
cyclical_period
|
|
92
|
+
schedule_settings
|
|
93
|
+
installment_plan
|
|
94
|
+
subscription_plan
|
|
95
|
+
first_charge_authorization_only
|
|
96
|
+
first_charge_capture_after
|
|
97
|
+
metadata
|
|
98
|
+
three_ds
|
|
99
|
+
]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# An array for nullable fields
|
|
103
|
+
def self.nullables
|
|
104
|
+
[]
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def initialize(transaction_token_id:, amount:, currency:,
|
|
108
|
+
initial_amount: SKIP, period: SKIP, cyclical_period: SKIP,
|
|
109
|
+
schedule_settings: SKIP, installment_plan: SKIP,
|
|
110
|
+
subscription_plan: SKIP,
|
|
111
|
+
first_charge_authorization_only: false,
|
|
112
|
+
first_charge_capture_after: SKIP, metadata: SKIP,
|
|
113
|
+
three_ds: SKIP, additional_properties: nil)
|
|
114
|
+
# Add additional model properties to the instance
|
|
115
|
+
additional_properties = {} if additional_properties.nil?
|
|
116
|
+
|
|
117
|
+
@transaction_token_id = transaction_token_id
|
|
118
|
+
@amount = amount
|
|
119
|
+
@currency = currency
|
|
120
|
+
@initial_amount = initial_amount unless initial_amount == SKIP
|
|
121
|
+
@period = period unless period == SKIP
|
|
122
|
+
@cyclical_period = cyclical_period unless cyclical_period == SKIP
|
|
123
|
+
@schedule_settings = schedule_settings unless schedule_settings == SKIP
|
|
124
|
+
@installment_plan = installment_plan unless installment_plan == SKIP
|
|
125
|
+
@subscription_plan = subscription_plan unless subscription_plan == SKIP
|
|
126
|
+
unless first_charge_authorization_only == SKIP
|
|
127
|
+
@first_charge_authorization_only =
|
|
128
|
+
first_charge_authorization_only
|
|
129
|
+
end
|
|
130
|
+
unless first_charge_capture_after == SKIP
|
|
131
|
+
@first_charge_capture_after =
|
|
132
|
+
first_charge_capture_after
|
|
133
|
+
end
|
|
134
|
+
@metadata = metadata unless metadata == SKIP
|
|
135
|
+
@three_ds = three_ds unless three_ds == SKIP
|
|
136
|
+
@additional_properties = additional_properties
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Creates an instance of the object from a hash.
|
|
140
|
+
def self.from_hash(hash)
|
|
141
|
+
return nil unless hash
|
|
142
|
+
|
|
143
|
+
# Extract variables from the hash.
|
|
144
|
+
transaction_token_id =
|
|
145
|
+
hash.key?('transaction_token_id') ? hash['transaction_token_id'] : nil
|
|
146
|
+
amount = hash.key?('amount') ? hash['amount'] : nil
|
|
147
|
+
currency = hash.key?('currency') ? hash['currency'] : nil
|
|
148
|
+
initial_amount =
|
|
149
|
+
hash.key?('initial_amount') ? hash['initial_amount'] : SKIP
|
|
150
|
+
period = hash.key?('period') ? hash['period'] : SKIP
|
|
151
|
+
cyclical_period =
|
|
152
|
+
hash.key?('cyclical_period') ? hash['cyclical_period'] : SKIP
|
|
153
|
+
schedule_settings = SubscriptionScheduleSettings.from_hash(hash['schedule_settings']) if
|
|
154
|
+
hash['schedule_settings']
|
|
155
|
+
installment_plan = SubscriptionInstallmentPlan.from_hash(hash['installment_plan']) if
|
|
156
|
+
hash['installment_plan']
|
|
157
|
+
subscription_plan = SubscriptionPlanSettings.from_hash(hash['subscription_plan']) if
|
|
158
|
+
hash['subscription_plan']
|
|
159
|
+
first_charge_authorization_only =
|
|
160
|
+
hash['first_charge_authorization_only'] ||= false
|
|
161
|
+
first_charge_capture_after =
|
|
162
|
+
hash.key?('first_charge_capture_after') ? hash['first_charge_capture_after'] : SKIP
|
|
163
|
+
metadata = GenericMetadata.from_hash(hash['metadata']) if hash['metadata']
|
|
164
|
+
three_ds = ChargeCreateRequestThreeDs.from_hash(hash['three_ds']) if hash['three_ds']
|
|
165
|
+
|
|
166
|
+
# Create a new hash for additional properties, removing known properties.
|
|
167
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
168
|
+
|
|
169
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
170
|
+
new_hash, proc { |value| value }
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
# Create object from extracted values.
|
|
174
|
+
SubscriptionCreateRequest.new(transaction_token_id: transaction_token_id,
|
|
175
|
+
amount: amount,
|
|
176
|
+
currency: currency,
|
|
177
|
+
initial_amount: initial_amount,
|
|
178
|
+
period: period,
|
|
179
|
+
cyclical_period: cyclical_period,
|
|
180
|
+
schedule_settings: schedule_settings,
|
|
181
|
+
installment_plan: installment_plan,
|
|
182
|
+
subscription_plan: subscription_plan,
|
|
183
|
+
first_charge_authorization_only: first_charge_authorization_only,
|
|
184
|
+
first_charge_capture_after: first_charge_capture_after,
|
|
185
|
+
metadata: metadata,
|
|
186
|
+
three_ds: three_ds,
|
|
187
|
+
additional_properties: additional_properties)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Provides a human-readable string representation of the object.
|
|
191
|
+
def to_s
|
|
192
|
+
class_name = self.class.name.split('::').last
|
|
193
|
+
"<#{class_name} transaction_token_id: #{@transaction_token_id}, amount: #{@amount},"\
|
|
194
|
+
" currency: #{@currency}, initial_amount: #{@initial_amount}, period: #{@period},"\
|
|
195
|
+
" cyclical_period: #{@cyclical_period}, schedule_settings: #{@schedule_settings},"\
|
|
196
|
+
" installment_plan: #{@installment_plan}, subscription_plan: #{@subscription_plan},"\
|
|
197
|
+
" first_charge_authorization_only: #{@first_charge_authorization_only},"\
|
|
198
|
+
" first_charge_capture_after: #{@first_charge_capture_after}, metadata: #{@metadata},"\
|
|
199
|
+
" three_ds: #{@three_ds}, additional_properties: #{@additional_properties}>"
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
203
|
+
def inspect
|
|
204
|
+
class_name = self.class.name.split('::').last
|
|
205
|
+
"<#{class_name} transaction_token_id: #{@transaction_token_id.inspect}, amount:"\
|
|
206
|
+
" #{@amount.inspect}, currency: #{@currency.inspect}, initial_amount:"\
|
|
207
|
+
" #{@initial_amount.inspect}, period: #{@period.inspect}, cyclical_period:"\
|
|
208
|
+
" #{@cyclical_period.inspect}, schedule_settings: #{@schedule_settings.inspect},"\
|
|
209
|
+
" installment_plan: #{@installment_plan.inspect}, subscription_plan:"\
|
|
210
|
+
" #{@subscription_plan.inspect}, first_charge_authorization_only:"\
|
|
211
|
+
" #{@first_charge_authorization_only.inspect}, first_charge_capture_after:"\
|
|
212
|
+
" #{@first_charge_capture_after.inspect}, metadata: #{@metadata.inspect}, three_ds:"\
|
|
213
|
+
" #{@three_ds.inspect}, additional_properties: #{@additional_properties}>"
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
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 — `subscription_created`, `subscription_payment`,
|
|
8
|
+
# `subscription_completed`, `subscription_failure`, `subscription_canceled`,
|
|
9
|
+
# or `subscription_suspended`.
|
|
10
|
+
class SubscriptionEvent
|
|
11
|
+
SUBSCRIPTION_EVENT = [
|
|
12
|
+
# TODO: Write general description for SUBSCRIPTION_CREATED
|
|
13
|
+
SUBSCRIPTION_CREATED = 'subscription_created'.freeze,
|
|
14
|
+
|
|
15
|
+
# TODO: Write general description for SUBSCRIPTION_PAYMENT
|
|
16
|
+
SUBSCRIPTION_PAYMENT = 'subscription_payment'.freeze,
|
|
17
|
+
|
|
18
|
+
# TODO: Write general description for SUBSCRIPTION_COMPLETED
|
|
19
|
+
SUBSCRIPTION_COMPLETED = 'subscription_completed'.freeze,
|
|
20
|
+
|
|
21
|
+
# TODO: Write general description for SUBSCRIPTION_FAILURE
|
|
22
|
+
SUBSCRIPTION_FAILURE = 'subscription_failure'.freeze,
|
|
23
|
+
|
|
24
|
+
# TODO: Write general description for SUBSCRIPTION_CANCELED
|
|
25
|
+
SUBSCRIPTION_CANCELED = 'subscription_canceled'.freeze,
|
|
26
|
+
|
|
27
|
+
# TODO: Write general description for SUBSCRIPTION_SUSPENDED
|
|
28
|
+
SUBSCRIPTION_SUSPENDED = 'subscription_suspended'.freeze
|
|
29
|
+
].freeze
|
|
30
|
+
|
|
31
|
+
def self.validate(value)
|
|
32
|
+
return false if value.nil?
|
|
33
|
+
|
|
34
|
+
SUBSCRIPTION_EVENT.include?(value)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def self.from_value(value, default_value = SUBSCRIPTION_CREATED)
|
|
38
|
+
return default_value if value.nil?
|
|
39
|
+
|
|
40
|
+
str = value.to_s.strip
|
|
41
|
+
|
|
42
|
+
case str.downcase
|
|
43
|
+
when 'subscription_created' then SUBSCRIPTION_CREATED
|
|
44
|
+
when 'subscription_payment' then SUBSCRIPTION_PAYMENT
|
|
45
|
+
when 'subscription_completed' then SUBSCRIPTION_COMPLETED
|
|
46
|
+
when 'subscription_failure' then SUBSCRIPTION_FAILURE
|
|
47
|
+
when 'subscription_canceled' then SUBSCRIPTION_CANCELED
|
|
48
|
+
when 'subscription_suspended' then SUBSCRIPTION_SUSPENDED
|
|
49
|
+
else
|
|
50
|
+
default_value
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|