univapay-apimatic-sdk 0.0.1
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 +224 -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 +903 -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 +116 -0
- data/lib/univapay_client_sdk/configuration.rb +178 -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_finished_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/charge_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/recurring_token_deleted_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_canceled_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_completed_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_created_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_failure_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_payment_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_suspended_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_created_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_check_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_replaced_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_three_ds_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_updated_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/http/api_response.rb +19 -0
- data/lib/univapay_client_sdk/http/auth/oauth_2.rb +53 -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_finished_webhook_callback.rb +131 -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_updated_webhook_callback.rb +131 -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/recurring_token_deleted_webhook_callback.rb +132 -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_canceled_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_completed_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_create_request.rb +216 -0
- data/lib/univapay_client_sdk/models/subscription_created_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_failure_webhook_callback.rb +132 -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_payment_webhook_callback.rb +132 -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_suspended_webhook_callback.rb +132 -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/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 +231 -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 +147 -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_created_webhook_callback.rb +131 -0
- data/lib/univapay_client_sdk/models/token_cvv_auth_check_updated_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/token_cvv_auth_updated_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/token_replaced_webhook_callback.rb +131 -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_three_ds_updated_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/token_updated_webhook_callback.rb +131 -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 +242 -0
- data/lib/univapay_client_sdk.rb +322 -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 +564 -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_finished_handler.rb +95 -0
- data/test/events/webhooks/test_charge_updated_handler.rb +95 -0
- data/test/events/webhooks/test_customs_handler.rb +100 -0
- data/test/events/webhooks/test_recurring_token_deleted_handler.rb +92 -0
- data/test/events/webhooks/test_refund_handler.rb +95 -0
- data/test/events/webhooks/test_subscription_canceled_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_completed_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_created_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_failure_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_payment_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_suspended_handler.rb +101 -0
- data/test/events/webhooks/test_token_created_handler.rb +92 -0
- data/test/events/webhooks/test_token_cvv_auth_check_updated_handler.rb +92 -0
- data/test/events/webhooks/test_token_cvv_auth_updated_handler.rb +92 -0
- data/test/events/webhooks/test_token_replaced_handler.rb +92 -0
- data/test/events/webhooks/test_token_three_ds_updated_handler.rb +92 -0
- data/test/events/webhooks/test_token_updated_handler.rb +92 -0
- data/test/framework_integrations/rails_app_test_helper.rb +14 -0
- data/test/framework_integrations/webhooks/apps/hanami_charge_updated_app.rb +61 -0
- data/test/framework_integrations/webhooks/apps/rails_charge_updated_app.rb +24 -0
- data/test/framework_integrations/webhooks/apps/sinatra_charge_updated_app.rb +27 -0
- data/test/framework_integrations/webhooks/test/test_hanami_charge_updated_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_rails_charge_updated_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_sinatra_charge_updated_app.rb +58 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +397 -0
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
# Configuration for limited-cycle subscriptions (Univapay side).
|
|
8
|
+
class SubscriptionPlanSettings < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Plan type selector.
|
|
13
|
+
# @return [PlanSettingsType]
|
|
14
|
+
attr_accessor :plan_type
|
|
15
|
+
|
|
16
|
+
# Number of cycles for fixed_cycles plan.
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
attr_accessor :fixed_cycles
|
|
19
|
+
|
|
20
|
+
# Total target amount for fixed_cycle_amount plan.
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :fixed_cycle_amount
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['plan_type'] = 'plan_type'
|
|
28
|
+
@_hash['fixed_cycles'] = 'fixed_cycles'
|
|
29
|
+
@_hash['fixed_cycle_amount'] = 'fixed_cycle_amount'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
plan_type
|
|
37
|
+
fixed_cycles
|
|
38
|
+
fixed_cycle_amount
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(plan_type: SKIP, fixed_cycles: SKIP,
|
|
48
|
+
fixed_cycle_amount: SKIP, additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@plan_type = plan_type unless plan_type == SKIP
|
|
53
|
+
@fixed_cycles = fixed_cycles unless fixed_cycles == SKIP
|
|
54
|
+
@fixed_cycle_amount = fixed_cycle_amount unless fixed_cycle_amount == SKIP
|
|
55
|
+
@additional_properties = additional_properties
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Creates an instance of the object from a hash.
|
|
59
|
+
def self.from_hash(hash)
|
|
60
|
+
return nil unless hash
|
|
61
|
+
|
|
62
|
+
# Extract variables from the hash.
|
|
63
|
+
plan_type = hash.key?('plan_type') ? hash['plan_type'] : SKIP
|
|
64
|
+
fixed_cycles = hash.key?('fixed_cycles') ? hash['fixed_cycles'] : SKIP
|
|
65
|
+
fixed_cycle_amount =
|
|
66
|
+
hash.key?('fixed_cycle_amount') ? hash['fixed_cycle_amount'] : SKIP
|
|
67
|
+
|
|
68
|
+
# Create a new hash for additional properties, removing known properties.
|
|
69
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
70
|
+
|
|
71
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
72
|
+
new_hash, proc { |value| value }
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# Create object from extracted values.
|
|
76
|
+
SubscriptionPlanSettings.new(plan_type: plan_type,
|
|
77
|
+
fixed_cycles: fixed_cycles,
|
|
78
|
+
fixed_cycle_amount: fixed_cycle_amount,
|
|
79
|
+
additional_properties: additional_properties)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Provides a human-readable string representation of the object.
|
|
83
|
+
def to_s
|
|
84
|
+
class_name = self.class.name.split('::').last
|
|
85
|
+
"<#{class_name} plan_type: #{@plan_type}, fixed_cycles: #{@fixed_cycles},"\
|
|
86
|
+
" fixed_cycle_amount: #{@fixed_cycle_amount}, additional_properties:"\
|
|
87
|
+
" #{@additional_properties}>"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
91
|
+
def inspect
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} plan_type: #{@plan_type.inspect}, fixed_cycles: #{@fixed_cycles.inspect},"\
|
|
94
|
+
" fixed_cycle_amount: #{@fixed_cycle_amount.inspect}, additional_properties:"\
|
|
95
|
+
" #{@additional_properties}>"
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,132 @@
|
|
|
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
|
+
# Schedule settings applied to a subscription.
|
|
8
|
+
class SubscriptionScheduleSettings < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Date when the recurring schedule starts (YYYY-MM-DD).
|
|
13
|
+
# @return [Date]
|
|
14
|
+
attr_accessor :start_on
|
|
15
|
+
|
|
16
|
+
# IANA Timezone ID.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :zone_id
|
|
19
|
+
|
|
20
|
+
# If true, subsequent charges will always occur on the last day of the
|
|
21
|
+
# month.
|
|
22
|
+
# @return [TrueClass | FalseClass]
|
|
23
|
+
attr_accessor :preserve_end_of_month
|
|
24
|
+
|
|
25
|
+
# ISO-8601 Duration for retry interval if payment fails (e.g., P5D).
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :retry_interval
|
|
28
|
+
|
|
29
|
+
# Subscription Termination Mode schema.
|
|
30
|
+
# @return [SubscriptionTerminationMode]
|
|
31
|
+
attr_accessor :termination_mode
|
|
32
|
+
|
|
33
|
+
# A mapping from model property names to API property names.
|
|
34
|
+
def self.names
|
|
35
|
+
@_hash = {} if @_hash.nil?
|
|
36
|
+
@_hash['start_on'] = 'start_on'
|
|
37
|
+
@_hash['zone_id'] = 'zone_id'
|
|
38
|
+
@_hash['preserve_end_of_month'] = 'preserve_end_of_month'
|
|
39
|
+
@_hash['retry_interval'] = 'retry_interval'
|
|
40
|
+
@_hash['termination_mode'] = 'termination_mode'
|
|
41
|
+
@_hash
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for optional fields
|
|
45
|
+
def self.optionals
|
|
46
|
+
%w[
|
|
47
|
+
start_on
|
|
48
|
+
zone_id
|
|
49
|
+
preserve_end_of_month
|
|
50
|
+
retry_interval
|
|
51
|
+
termination_mode
|
|
52
|
+
]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# An array for nullable fields
|
|
56
|
+
def self.nullables
|
|
57
|
+
[]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def initialize(start_on: SKIP, zone_id: SKIP, preserve_end_of_month: SKIP,
|
|
61
|
+
retry_interval: SKIP,
|
|
62
|
+
termination_mode: SubscriptionTerminationMode::IMMEDIATE,
|
|
63
|
+
additional_properties: nil)
|
|
64
|
+
# Add additional model properties to the instance
|
|
65
|
+
additional_properties = {} if additional_properties.nil?
|
|
66
|
+
|
|
67
|
+
@start_on = start_on unless start_on == SKIP
|
|
68
|
+
@zone_id = zone_id unless zone_id == SKIP
|
|
69
|
+
@preserve_end_of_month = preserve_end_of_month unless preserve_end_of_month == SKIP
|
|
70
|
+
@retry_interval = retry_interval unless retry_interval == SKIP
|
|
71
|
+
@termination_mode = termination_mode unless termination_mode == SKIP
|
|
72
|
+
@additional_properties = additional_properties
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Creates an instance of the object from a hash.
|
|
76
|
+
def self.from_hash(hash)
|
|
77
|
+
return nil unless hash
|
|
78
|
+
|
|
79
|
+
# Extract variables from the hash.
|
|
80
|
+
start_on = hash.key?('start_on') ? hash['start_on'] : SKIP
|
|
81
|
+
zone_id = hash.key?('zone_id') ? hash['zone_id'] : SKIP
|
|
82
|
+
preserve_end_of_month =
|
|
83
|
+
hash.key?('preserve_end_of_month') ? hash['preserve_end_of_month'] : SKIP
|
|
84
|
+
retry_interval =
|
|
85
|
+
hash.key?('retry_interval') ? hash['retry_interval'] : SKIP
|
|
86
|
+
termination_mode =
|
|
87
|
+
hash['termination_mode'] ||= SubscriptionTerminationMode::IMMEDIATE
|
|
88
|
+
|
|
89
|
+
# Create a new hash for additional properties, removing known properties.
|
|
90
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
91
|
+
|
|
92
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
93
|
+
new_hash, proc { |value| value }
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Create object from extracted values.
|
|
97
|
+
SubscriptionScheduleSettings.new(start_on: start_on,
|
|
98
|
+
zone_id: zone_id,
|
|
99
|
+
preserve_end_of_month: preserve_end_of_month,
|
|
100
|
+
retry_interval: retry_interval,
|
|
101
|
+
termination_mode: termination_mode,
|
|
102
|
+
additional_properties: additional_properties)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Validates an instance of the object from a given value.
|
|
106
|
+
# @param [SubscriptionScheduleSettings | Hash] The value against the validation is performed.
|
|
107
|
+
def self.validate(value)
|
|
108
|
+
return true if value.instance_of? self
|
|
109
|
+
|
|
110
|
+
return false unless value.instance_of? Hash
|
|
111
|
+
|
|
112
|
+
true
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Provides a human-readable string representation of the object.
|
|
116
|
+
def to_s
|
|
117
|
+
class_name = self.class.name.split('::').last
|
|
118
|
+
"<#{class_name} start_on: #{@start_on}, zone_id: #{@zone_id}, preserve_end_of_month:"\
|
|
119
|
+
" #{@preserve_end_of_month}, retry_interval: #{@retry_interval}, termination_mode:"\
|
|
120
|
+
" #{@termination_mode}, additional_properties: #{@additional_properties}>"
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
124
|
+
def inspect
|
|
125
|
+
class_name = self.class.name.split('::').last
|
|
126
|
+
"<#{class_name} start_on: #{@start_on.inspect}, zone_id: #{@zone_id.inspect},"\
|
|
127
|
+
" preserve_end_of_month: #{@preserve_end_of_month.inspect}, retry_interval:"\
|
|
128
|
+
" #{@retry_interval.inspect}, termination_mode: #{@termination_mode.inspect},"\
|
|
129
|
+
" additional_properties: #{@additional_properties}>"
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
# Subscription Status schema.
|
|
8
|
+
class SubscriptionStatus
|
|
9
|
+
SUBSCRIPTION_STATUS = [
|
|
10
|
+
# TODO: Write general description for UNVERIFIED
|
|
11
|
+
UNVERIFIED = 'unverified'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for UNCONFIRMED
|
|
14
|
+
UNCONFIRMED = 'unconfirmed'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for CANCELED
|
|
17
|
+
CANCELED = 'canceled'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for UNPAID
|
|
20
|
+
UNPAID = 'unpaid'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for CURRENT
|
|
23
|
+
CURRENT = 'current'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for SUSPENDED
|
|
26
|
+
SUSPENDED = 'suspended'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for COMPLETED
|
|
29
|
+
COMPLETED = 'completed'.freeze
|
|
30
|
+
].freeze
|
|
31
|
+
|
|
32
|
+
def self.validate(value)
|
|
33
|
+
return false if value.nil?
|
|
34
|
+
|
|
35
|
+
SUBSCRIPTION_STATUS.include?(value)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.from_value(value, default_value = UNVERIFIED)
|
|
39
|
+
return default_value if value.nil?
|
|
40
|
+
|
|
41
|
+
str = value.to_s.strip
|
|
42
|
+
|
|
43
|
+
case str.downcase
|
|
44
|
+
when 'unverified' then UNVERIFIED
|
|
45
|
+
when 'unconfirmed' then UNCONFIRMED
|
|
46
|
+
when 'canceled' then CANCELED
|
|
47
|
+
when 'unpaid' then UNPAID
|
|
48
|
+
when 'current' then CURRENT
|
|
49
|
+
when 'suspended' then SUSPENDED
|
|
50
|
+
when 'completed' then COMPLETED
|
|
51
|
+
else
|
|
52
|
+
default_value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
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 suspending a subscription. The
|
|
8
|
+
# `schedule_settings.termination_mode` field controls when the suspension
|
|
9
|
+
# takes effect.
|
|
10
|
+
class SubscriptionSuspendRequest < BaseModel
|
|
11
|
+
SKIP = Object.new
|
|
12
|
+
private_constant :SKIP
|
|
13
|
+
|
|
14
|
+
# Schedule-related settings.
|
|
15
|
+
# @return [SuspendScheduleSettings]
|
|
16
|
+
attr_accessor :schedule_settings
|
|
17
|
+
|
|
18
|
+
# A mapping from model property names to API property names.
|
|
19
|
+
def self.names
|
|
20
|
+
@_hash = {} if @_hash.nil?
|
|
21
|
+
@_hash['schedule_settings'] = 'schedule_settings'
|
|
22
|
+
@_hash
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# An array for optional fields
|
|
26
|
+
def self.optionals
|
|
27
|
+
%w[
|
|
28
|
+
schedule_settings
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# An array for nullable fields
|
|
33
|
+
def self.nullables
|
|
34
|
+
[]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def initialize(schedule_settings: SKIP, additional_properties: nil)
|
|
38
|
+
# Add additional model properties to the instance
|
|
39
|
+
additional_properties = {} if additional_properties.nil?
|
|
40
|
+
|
|
41
|
+
@schedule_settings = schedule_settings unless schedule_settings == SKIP
|
|
42
|
+
@additional_properties = additional_properties
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Creates an instance of the object from a hash.
|
|
46
|
+
def self.from_hash(hash)
|
|
47
|
+
return nil unless hash
|
|
48
|
+
|
|
49
|
+
# Extract variables from the hash.
|
|
50
|
+
schedule_settings = SuspendScheduleSettings.from_hash(hash['schedule_settings']) if
|
|
51
|
+
hash['schedule_settings']
|
|
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
|
+
SubscriptionSuspendRequest.new(schedule_settings: schedule_settings,
|
|
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} schedule_settings: #{@schedule_settings}, 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} schedule_settings: #{@schedule_settings.inspect}, additional_properties:"\
|
|
76
|
+
" #{@additional_properties}>"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module UnivapayClientSdk
|
|
8
|
+
# Webhook envelope for the subscription_suspended event.
|
|
9
|
+
class SubscriptionSuspendedWebhookCallback < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Unique ID of this webhook delivery.
|
|
14
|
+
# @return [UUID | String]
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# Event type discriminator — always `subscription_suspended` for this
|
|
18
|
+
# callback.
|
|
19
|
+
# @return [String]
|
|
20
|
+
attr_reader :event
|
|
21
|
+
|
|
22
|
+
# The Subscription object represents a recurring payment schedule.
|
|
23
|
+
# @return [Subscription]
|
|
24
|
+
attr_accessor :data
|
|
25
|
+
|
|
26
|
+
# Timestamp when the event was fired.
|
|
27
|
+
# @return [DateTime]
|
|
28
|
+
attr_accessor :created_on
|
|
29
|
+
|
|
30
|
+
# A mapping from model property names to API property names.
|
|
31
|
+
def self.names
|
|
32
|
+
@_hash = {} if @_hash.nil?
|
|
33
|
+
@_hash['id'] = 'id'
|
|
34
|
+
@_hash['event'] = 'event'
|
|
35
|
+
@_hash['data'] = 'data'
|
|
36
|
+
@_hash['created_on'] = 'created_on'
|
|
37
|
+
@_hash
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# An array for optional fields
|
|
41
|
+
def self.optionals
|
|
42
|
+
%w[
|
|
43
|
+
data
|
|
44
|
+
]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# An array for nullable fields
|
|
48
|
+
def self.nullables
|
|
49
|
+
[]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def initialize(id:, created_on:, data: SKIP, additional_properties: nil)
|
|
53
|
+
# Add additional model properties to the instance
|
|
54
|
+
additional_properties = {} if additional_properties.nil?
|
|
55
|
+
|
|
56
|
+
@id = id
|
|
57
|
+
@event = 'subscription_suspended'
|
|
58
|
+
@data = data unless data == SKIP
|
|
59
|
+
@created_on = created_on
|
|
60
|
+
@additional_properties = additional_properties
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Creates an instance of the object from a hash.
|
|
64
|
+
def self.from_hash(hash)
|
|
65
|
+
return nil unless hash
|
|
66
|
+
|
|
67
|
+
# Extract variables from the hash.
|
|
68
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
69
|
+
created_on = if hash.key?('created_on')
|
|
70
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
71
|
+
end
|
|
72
|
+
data = Subscription.from_hash(hash['data']) if hash['data']
|
|
73
|
+
|
|
74
|
+
# Create a new hash for additional properties, removing known properties.
|
|
75
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
76
|
+
|
|
77
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
78
|
+
new_hash, proc { |value| value }
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
# Create object from extracted values.
|
|
82
|
+
SubscriptionSuspendedWebhookCallback.new(id: id,
|
|
83
|
+
created_on: created_on,
|
|
84
|
+
data: data,
|
|
85
|
+
additional_properties: additional_properties)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def to_custom_created_on
|
|
89
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Validates an instance of the object from a given value.
|
|
93
|
+
# @param [SubscriptionSuspendedWebhookCallback | Hash] The value against the validation is performed.
|
|
94
|
+
def self.validate(value)
|
|
95
|
+
if value.instance_of? self
|
|
96
|
+
return (
|
|
97
|
+
APIHelper.valid_type?(value.id,
|
|
98
|
+
->(val) { val.instance_of? String }) and
|
|
99
|
+
APIHelper.valid_type?(value.event,
|
|
100
|
+
->(val) { val.instance_of? String }) and
|
|
101
|
+
APIHelper.valid_type?(value.created_on,
|
|
102
|
+
->(val) { val.instance_of? DateTime })
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
return false unless value.instance_of? Hash
|
|
107
|
+
|
|
108
|
+
(
|
|
109
|
+
APIHelper.valid_type?(value['id'],
|
|
110
|
+
->(val) { val.instance_of? String }) and
|
|
111
|
+
APIHelper.valid_type?(value['event'],
|
|
112
|
+
->(val) { val.instance_of? String }) and
|
|
113
|
+
APIHelper.valid_type?(value['created_on'],
|
|
114
|
+
->(val) { val.instance_of? String })
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Provides a human-readable string representation of the object.
|
|
119
|
+
def to_s
|
|
120
|
+
class_name = self.class.name.split('::').last
|
|
121
|
+
"<#{class_name} id: #{@id}, event: #{@event}, data: #{@data}, created_on: #{@created_on},"\
|
|
122
|
+
" additional_properties: #{@additional_properties}>"
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
126
|
+
def inspect
|
|
127
|
+
class_name = self.class.name.split('::').last
|
|
128
|
+
"<#{class_name} id: #{@id.inspect}, event: #{@event.inspect}, data: #{@data.inspect},"\
|
|
129
|
+
" created_on: #{@created_on.inspect}, additional_properties: #{@additional_properties}>"
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module UnivapayClientSdk
|
|
7
|
+
# The status to transition the subscription to on the next payment date.
|
|
8
|
+
class SubscriptionTerminateWithStatus
|
|
9
|
+
SUBSCRIPTION_TERMINATE_WITH_STATUS = [
|
|
10
|
+
# TODO: Write general description for SUSPENDED
|
|
11
|
+
SUSPENDED = 'suspended'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for CANCELED
|
|
14
|
+
CANCELED = 'canceled'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
SUBSCRIPTION_TERMINATE_WITH_STATUS.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = SUSPENDED)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'suspended' then SUSPENDED
|
|
30
|
+
when 'canceled' then CANCELED
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module UnivapayClientSdk
|
|
7
|
+
# Subscription Termination Mode schema.
|
|
8
|
+
class SubscriptionTerminationMode
|
|
9
|
+
SUBSCRIPTION_TERMINATION_MODE = [
|
|
10
|
+
# TODO: Write general description for IMMEDIATE
|
|
11
|
+
IMMEDIATE = 'immediate'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for ON_NEXT_PAYMENT
|
|
14
|
+
ON_NEXT_PAYMENT = 'on_next_payment'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
SUBSCRIPTION_TERMINATION_MODE.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = IMMEDIATE)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'immediate' then IMMEDIATE
|
|
30
|
+
when 'on_next_payment' then ON_NEXT_PAYMENT
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
# Fields that can be updated on the next scheduled payment.
|
|
8
|
+
class SubscriptionUpdateNextPayment < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Next payment date (YYYY-MM-DD). Note: Only available for merchants
|
|
13
|
+
# permitted to edit next payment dates.
|
|
14
|
+
# @return [Date]
|
|
15
|
+
attr_accessor :due_date
|
|
16
|
+
|
|
17
|
+
# Next payment amount. Not available for limited-cycle subscriptions. Only
|
|
18
|
+
# available for permitted merchants. This does not change subsequent cycle
|
|
19
|
+
# amounts.
|
|
20
|
+
# @return [Integer]
|
|
21
|
+
attr_accessor :amount
|
|
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
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['due_date'] = 'due_date'
|
|
33
|
+
@_hash['amount'] = 'amount'
|
|
34
|
+
@_hash['terminate_with_status'] = 'terminate_with_status'
|
|
35
|
+
@_hash
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for optional fields
|
|
39
|
+
def self.optionals
|
|
40
|
+
%w[
|
|
41
|
+
due_date
|
|
42
|
+
amount
|
|
43
|
+
terminate_with_status
|
|
44
|
+
]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# An array for nullable fields
|
|
48
|
+
def self.nullables
|
|
49
|
+
%w[
|
|
50
|
+
terminate_with_status
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def initialize(due_date: SKIP, amount: SKIP, terminate_with_status: SKIP,
|
|
55
|
+
additional_properties: nil)
|
|
56
|
+
# Add additional model properties to the instance
|
|
57
|
+
additional_properties = {} if additional_properties.nil?
|
|
58
|
+
|
|
59
|
+
@due_date = due_date unless due_date == SKIP
|
|
60
|
+
@amount = amount unless amount == SKIP
|
|
61
|
+
@terminate_with_status = terminate_with_status unless terminate_with_status == SKIP
|
|
62
|
+
@additional_properties = additional_properties
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Creates an instance of the object from a hash.
|
|
66
|
+
def self.from_hash(hash)
|
|
67
|
+
return nil unless hash
|
|
68
|
+
|
|
69
|
+
# Extract variables from the hash.
|
|
70
|
+
due_date = hash.key?('due_date') ? hash['due_date'] : SKIP
|
|
71
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
72
|
+
terminate_with_status =
|
|
73
|
+
hash.key?('terminate_with_status') ? hash['terminate_with_status'] : SKIP
|
|
74
|
+
|
|
75
|
+
# Create a new hash for additional properties, removing known properties.
|
|
76
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
77
|
+
|
|
78
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
79
|
+
new_hash, proc { |value| value }
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# Create object from extracted values.
|
|
83
|
+
SubscriptionUpdateNextPayment.new(due_date: due_date,
|
|
84
|
+
amount: amount,
|
|
85
|
+
terminate_with_status: terminate_with_status,
|
|
86
|
+
additional_properties: additional_properties)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Provides a human-readable string representation of the object.
|
|
90
|
+
def to_s
|
|
91
|
+
class_name = self.class.name.split('::').last
|
|
92
|
+
"<#{class_name} due_date: #{@due_date}, amount: #{@amount}, terminate_with_status:"\
|
|
93
|
+
" #{@terminate_with_status}, additional_properties: #{@additional_properties}>"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
97
|
+
def inspect
|
|
98
|
+
class_name = self.class.name.split('::').last
|
|
99
|
+
"<#{class_name} due_date: #{@due_date.inspect}, amount: #{@amount.inspect},"\
|
|
100
|
+
" terminate_with_status: #{@terminate_with_status.inspect}, additional_properties:"\
|
|
101
|
+
" #{@additional_properties}>"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|