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,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
|
+
# Paginated list of subscriptions.
|
|
8
|
+
class SubscriptionList < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# List of resources.
|
|
13
|
+
# @return [Array[SubscriptionListItem]]
|
|
14
|
+
attr_accessor :items
|
|
15
|
+
|
|
16
|
+
# Whether more results are available.
|
|
17
|
+
# @return [TrueClass | FalseClass]
|
|
18
|
+
attr_accessor :has_more
|
|
19
|
+
|
|
20
|
+
# Total number of matching resources.
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :total_hits
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['items'] = 'items'
|
|
28
|
+
@_hash['has_more'] = 'has_more'
|
|
29
|
+
@_hash['total_hits'] = 'total_hits'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
items
|
|
37
|
+
has_more
|
|
38
|
+
total_hits
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(items: SKIP, has_more: SKIP, total_hits: SKIP,
|
|
48
|
+
additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@items = items unless items == SKIP
|
|
53
|
+
@has_more = has_more unless has_more == SKIP
|
|
54
|
+
@total_hits = total_hits unless total_hits == 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
|
+
# Parameter is an array, so we need to iterate through it
|
|
64
|
+
items = nil
|
|
65
|
+
unless hash['items'].nil?
|
|
66
|
+
items = []
|
|
67
|
+
hash['items'].each do |structure|
|
|
68
|
+
items << (SubscriptionListItem.from_hash(structure) if structure)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
items = SKIP unless hash.key?('items')
|
|
73
|
+
has_more = hash.key?('has_more') ? hash['has_more'] : SKIP
|
|
74
|
+
total_hits = hash.key?('total_hits') ? hash['total_hits'] : SKIP
|
|
75
|
+
|
|
76
|
+
# Create a new hash for additional properties, removing known properties.
|
|
77
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
new_hash, proc { |value| value }
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Create object from extracted values.
|
|
84
|
+
SubscriptionList.new(items: items,
|
|
85
|
+
has_more: has_more,
|
|
86
|
+
total_hits: total_hits,
|
|
87
|
+
additional_properties: additional_properties)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a human-readable string representation of the object.
|
|
91
|
+
def to_s
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} items: #{@items}, has_more: #{@has_more}, total_hits: #{@total_hits},"\
|
|
94
|
+
" additional_properties: #{@additional_properties}>"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
98
|
+
def inspect
|
|
99
|
+
class_name = self.class.name.split('::').last
|
|
100
|
+
"<#{class_name} items: #{@items.inspect}, has_more: #{@has_more.inspect}, total_hits:"\
|
|
101
|
+
" #{@total_hits.inspect}, additional_properties: #{@additional_properties}>"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,352 @@
|
|
|
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
|
+
# Subscription entry returned in list responses.
|
|
9
|
+
class SubscriptionListItem < 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
|
+
# Merchant display name.
|
|
90
|
+
# @return [String]
|
|
91
|
+
attr_accessor :merchant_name
|
|
92
|
+
|
|
93
|
+
# Store display name.
|
|
94
|
+
# @return [String]
|
|
95
|
+
attr_accessor :store_name
|
|
96
|
+
|
|
97
|
+
# Payment method type.
|
|
98
|
+
# @return [String]
|
|
99
|
+
attr_accessor :payment_type
|
|
100
|
+
|
|
101
|
+
# Next payment date value.
|
|
102
|
+
# @return [Date]
|
|
103
|
+
attr_accessor :next_payment_date
|
|
104
|
+
|
|
105
|
+
# Customer-facing payment method summary data.
|
|
106
|
+
# @return [SubscriptionUserData]
|
|
107
|
+
attr_accessor :user_data
|
|
108
|
+
|
|
109
|
+
# A mapping from model property names to API property names.
|
|
110
|
+
def self.names
|
|
111
|
+
@_hash = {} if @_hash.nil?
|
|
112
|
+
@_hash['id'] = 'id'
|
|
113
|
+
@_hash['store_id'] = 'store_id'
|
|
114
|
+
@_hash['transaction_token_id'] = 'transaction_token_id'
|
|
115
|
+
@_hash['amount'] = 'amount'
|
|
116
|
+
@_hash['currency'] = 'currency'
|
|
117
|
+
@_hash['amount_formatted'] = 'amount_formatted'
|
|
118
|
+
@_hash['initial_amount'] = 'initial_amount'
|
|
119
|
+
@_hash['initial_amount_formatted'] = 'initial_amount_formatted'
|
|
120
|
+
@_hash['subsequent_cycles_start'] = 'subsequent_cycles_start'
|
|
121
|
+
@_hash['schedule_settings'] = 'schedule_settings'
|
|
122
|
+
@_hash['only_direct_currency'] = 'only_direct_currency'
|
|
123
|
+
@_hash['first_charge_capture_after'] = 'first_charge_capture_after'
|
|
124
|
+
@_hash['first_charge_authorization_only'] =
|
|
125
|
+
'first_charge_authorization_only'
|
|
126
|
+
@_hash['status'] = 'status'
|
|
127
|
+
@_hash['metadata'] = 'metadata'
|
|
128
|
+
@_hash['mode'] = 'mode'
|
|
129
|
+
@_hash['created_on'] = 'created_on'
|
|
130
|
+
@_hash['period'] = 'period'
|
|
131
|
+
@_hash['next_payment'] = 'next_payment'
|
|
132
|
+
@_hash['merchant_name'] = 'merchant_name'
|
|
133
|
+
@_hash['store_name'] = 'store_name'
|
|
134
|
+
@_hash['payment_type'] = 'payment_type'
|
|
135
|
+
@_hash['next_payment_date'] = 'next_payment_date'
|
|
136
|
+
@_hash['user_data'] = 'user_data'
|
|
137
|
+
@_hash
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# An array for optional fields
|
|
141
|
+
def self.optionals
|
|
142
|
+
%w[
|
|
143
|
+
id
|
|
144
|
+
store_id
|
|
145
|
+
transaction_token_id
|
|
146
|
+
amount
|
|
147
|
+
currency
|
|
148
|
+
amount_formatted
|
|
149
|
+
initial_amount
|
|
150
|
+
initial_amount_formatted
|
|
151
|
+
subsequent_cycles_start
|
|
152
|
+
schedule_settings
|
|
153
|
+
only_direct_currency
|
|
154
|
+
first_charge_capture_after
|
|
155
|
+
first_charge_authorization_only
|
|
156
|
+
status
|
|
157
|
+
metadata
|
|
158
|
+
mode
|
|
159
|
+
created_on
|
|
160
|
+
period
|
|
161
|
+
next_payment
|
|
162
|
+
merchant_name
|
|
163
|
+
store_name
|
|
164
|
+
payment_type
|
|
165
|
+
next_payment_date
|
|
166
|
+
user_data
|
|
167
|
+
]
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# An array for nullable fields
|
|
171
|
+
def self.nullables
|
|
172
|
+
%w[
|
|
173
|
+
initial_amount
|
|
174
|
+
initial_amount_formatted
|
|
175
|
+
subsequent_cycles_start
|
|
176
|
+
first_charge_capture_after
|
|
177
|
+
]
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
def initialize(id: SKIP, store_id: SKIP, transaction_token_id: SKIP,
|
|
181
|
+
amount: SKIP, currency: SKIP, amount_formatted: SKIP,
|
|
182
|
+
initial_amount: SKIP, initial_amount_formatted: SKIP,
|
|
183
|
+
subsequent_cycles_start: SKIP, schedule_settings: SKIP,
|
|
184
|
+
only_direct_currency: SKIP, first_charge_capture_after: SKIP,
|
|
185
|
+
first_charge_authorization_only: SKIP, status: SKIP,
|
|
186
|
+
metadata: SKIP, mode: SKIP, created_on: SKIP, period: SKIP,
|
|
187
|
+
next_payment: SKIP, merchant_name: SKIP, store_name: SKIP,
|
|
188
|
+
payment_type: SKIP, next_payment_date: SKIP, user_data: SKIP,
|
|
189
|
+
additional_properties: nil)
|
|
190
|
+
# Add additional model properties to the instance
|
|
191
|
+
additional_properties = {} if additional_properties.nil?
|
|
192
|
+
|
|
193
|
+
@id = id unless id == SKIP
|
|
194
|
+
@store_id = store_id unless store_id == SKIP
|
|
195
|
+
@transaction_token_id = transaction_token_id unless transaction_token_id == SKIP
|
|
196
|
+
@amount = amount unless amount == SKIP
|
|
197
|
+
@currency = currency unless currency == SKIP
|
|
198
|
+
@amount_formatted = amount_formatted unless amount_formatted == SKIP
|
|
199
|
+
@initial_amount = initial_amount unless initial_amount == SKIP
|
|
200
|
+
@initial_amount_formatted = initial_amount_formatted unless initial_amount_formatted == SKIP
|
|
201
|
+
@subsequent_cycles_start = subsequent_cycles_start unless subsequent_cycles_start == SKIP
|
|
202
|
+
@schedule_settings = schedule_settings unless schedule_settings == SKIP
|
|
203
|
+
@only_direct_currency = only_direct_currency unless only_direct_currency == SKIP
|
|
204
|
+
unless first_charge_capture_after == SKIP
|
|
205
|
+
@first_charge_capture_after =
|
|
206
|
+
first_charge_capture_after
|
|
207
|
+
end
|
|
208
|
+
unless first_charge_authorization_only == SKIP
|
|
209
|
+
@first_charge_authorization_only =
|
|
210
|
+
first_charge_authorization_only
|
|
211
|
+
end
|
|
212
|
+
@status = status unless status == SKIP
|
|
213
|
+
@metadata = metadata unless metadata == SKIP
|
|
214
|
+
@mode = mode unless mode == SKIP
|
|
215
|
+
@created_on = created_on unless created_on == SKIP
|
|
216
|
+
@period = period unless period == SKIP
|
|
217
|
+
@next_payment = next_payment unless next_payment == SKIP
|
|
218
|
+
@merchant_name = merchant_name unless merchant_name == SKIP
|
|
219
|
+
@store_name = store_name unless store_name == SKIP
|
|
220
|
+
@payment_type = payment_type unless payment_type == SKIP
|
|
221
|
+
@next_payment_date = next_payment_date unless next_payment_date == SKIP
|
|
222
|
+
@user_data = user_data unless user_data == SKIP
|
|
223
|
+
@additional_properties = additional_properties
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Creates an instance of the object from a hash.
|
|
227
|
+
def self.from_hash(hash)
|
|
228
|
+
return nil unless hash
|
|
229
|
+
|
|
230
|
+
# Extract variables from the hash.
|
|
231
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
232
|
+
store_id = hash.key?('store_id') ? hash['store_id'] : SKIP
|
|
233
|
+
transaction_token_id =
|
|
234
|
+
hash.key?('transaction_token_id') ? hash['transaction_token_id'] : SKIP
|
|
235
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
236
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
237
|
+
amount_formatted =
|
|
238
|
+
hash.key?('amount_formatted') ? hash['amount_formatted'] : SKIP
|
|
239
|
+
initial_amount =
|
|
240
|
+
hash.key?('initial_amount') ? hash['initial_amount'] : SKIP
|
|
241
|
+
initial_amount_formatted =
|
|
242
|
+
hash.key?('initial_amount_formatted') ? hash['initial_amount_formatted'] : SKIP
|
|
243
|
+
subsequent_cycles_start = if hash.key?('subsequent_cycles_start')
|
|
244
|
+
(DateTimeHelper.from_rfc3339(hash['subsequent_cycles_start']) if hash['subsequent_cycles_start'])
|
|
245
|
+
else
|
|
246
|
+
SKIP
|
|
247
|
+
end
|
|
248
|
+
schedule_settings = SubscriptionScheduleSettings.from_hash(hash['schedule_settings']) if
|
|
249
|
+
hash['schedule_settings']
|
|
250
|
+
only_direct_currency =
|
|
251
|
+
hash.key?('only_direct_currency') ? hash['only_direct_currency'] : SKIP
|
|
252
|
+
first_charge_capture_after =
|
|
253
|
+
hash.key?('first_charge_capture_after') ? hash['first_charge_capture_after'] : SKIP
|
|
254
|
+
first_charge_authorization_only =
|
|
255
|
+
hash.key?('first_charge_authorization_only') ? hash['first_charge_authorization_only'] : SKIP
|
|
256
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
257
|
+
metadata = GenericMetadata.from_hash(hash['metadata']) if hash['metadata']
|
|
258
|
+
mode = hash.key?('mode') ? hash['mode'] : SKIP
|
|
259
|
+
created_on = if hash.key?('created_on')
|
|
260
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
261
|
+
else
|
|
262
|
+
SKIP
|
|
263
|
+
end
|
|
264
|
+
period = hash.key?('period') ? hash['period'] : SKIP
|
|
265
|
+
next_payment = SubscriptionNextPayment.from_hash(hash['next_payment']) if
|
|
266
|
+
hash['next_payment']
|
|
267
|
+
merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP
|
|
268
|
+
store_name = hash.key?('store_name') ? hash['store_name'] : SKIP
|
|
269
|
+
payment_type = hash.key?('payment_type') ? hash['payment_type'] : SKIP
|
|
270
|
+
next_payment_date =
|
|
271
|
+
hash.key?('next_payment_date') ? hash['next_payment_date'] : SKIP
|
|
272
|
+
user_data = SubscriptionUserData.from_hash(hash['user_data']) if hash['user_data']
|
|
273
|
+
|
|
274
|
+
# Create a new hash for additional properties, removing known properties.
|
|
275
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
276
|
+
|
|
277
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
278
|
+
new_hash, proc { |value| value }
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
# Create object from extracted values.
|
|
282
|
+
SubscriptionListItem.new(id: id,
|
|
283
|
+
store_id: store_id,
|
|
284
|
+
transaction_token_id: transaction_token_id,
|
|
285
|
+
amount: amount,
|
|
286
|
+
currency: currency,
|
|
287
|
+
amount_formatted: amount_formatted,
|
|
288
|
+
initial_amount: initial_amount,
|
|
289
|
+
initial_amount_formatted: initial_amount_formatted,
|
|
290
|
+
subsequent_cycles_start: subsequent_cycles_start,
|
|
291
|
+
schedule_settings: schedule_settings,
|
|
292
|
+
only_direct_currency: only_direct_currency,
|
|
293
|
+
first_charge_capture_after: first_charge_capture_after,
|
|
294
|
+
first_charge_authorization_only: first_charge_authorization_only,
|
|
295
|
+
status: status,
|
|
296
|
+
metadata: metadata,
|
|
297
|
+
mode: mode,
|
|
298
|
+
created_on: created_on,
|
|
299
|
+
period: period,
|
|
300
|
+
next_payment: next_payment,
|
|
301
|
+
merchant_name: merchant_name,
|
|
302
|
+
store_name: store_name,
|
|
303
|
+
payment_type: payment_type,
|
|
304
|
+
next_payment_date: next_payment_date,
|
|
305
|
+
user_data: user_data,
|
|
306
|
+
additional_properties: additional_properties)
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
def to_custom_subsequent_cycles_start
|
|
310
|
+
DateTimeHelper.to_rfc3339(subsequent_cycles_start)
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
def to_custom_created_on
|
|
314
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
# Provides a human-readable string representation of the object.
|
|
318
|
+
def to_s
|
|
319
|
+
class_name = self.class.name.split('::').last
|
|
320
|
+
"<#{class_name} id: #{@id}, store_id: #{@store_id}, transaction_token_id:"\
|
|
321
|
+
" #{@transaction_token_id}, amount: #{@amount}, currency: #{@currency}, amount_formatted:"\
|
|
322
|
+
" #{@amount_formatted}, initial_amount: #{@initial_amount}, initial_amount_formatted:"\
|
|
323
|
+
" #{@initial_amount_formatted}, subsequent_cycles_start: #{@subsequent_cycles_start},"\
|
|
324
|
+
" schedule_settings: #{@schedule_settings}, only_direct_currency: #{@only_direct_currency},"\
|
|
325
|
+
" first_charge_capture_after: #{@first_charge_capture_after},"\
|
|
326
|
+
" first_charge_authorization_only: #{@first_charge_authorization_only}, status: #{@status},"\
|
|
327
|
+
" metadata: #{@metadata}, mode: #{@mode}, created_on: #{@created_on}, period: #{@period},"\
|
|
328
|
+
" next_payment: #{@next_payment}, merchant_name: #{@merchant_name}, store_name:"\
|
|
329
|
+
" #{@store_name}, payment_type: #{@payment_type}, next_payment_date: #{@next_payment_date},"\
|
|
330
|
+
" user_data: #{@user_data}, additional_properties: #{@additional_properties}>"
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
334
|
+
def inspect
|
|
335
|
+
class_name = self.class.name.split('::').last
|
|
336
|
+
"<#{class_name} id: #{@id.inspect}, store_id: #{@store_id.inspect}, transaction_token_id:"\
|
|
337
|
+
" #{@transaction_token_id.inspect}, amount: #{@amount.inspect}, currency:"\
|
|
338
|
+
" #{@currency.inspect}, amount_formatted: #{@amount_formatted.inspect}, initial_amount:"\
|
|
339
|
+
" #{@initial_amount.inspect}, initial_amount_formatted:"\
|
|
340
|
+
" #{@initial_amount_formatted.inspect}, subsequent_cycles_start:"\
|
|
341
|
+
" #{@subsequent_cycles_start.inspect}, schedule_settings: #{@schedule_settings.inspect},"\
|
|
342
|
+
" only_direct_currency: #{@only_direct_currency.inspect}, first_charge_capture_after:"\
|
|
343
|
+
" #{@first_charge_capture_after.inspect}, first_charge_authorization_only:"\
|
|
344
|
+
" #{@first_charge_authorization_only.inspect}, status: #{@status.inspect}, metadata:"\
|
|
345
|
+
" #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect}, period:"\
|
|
346
|
+
" #{@period.inspect}, next_payment: #{@next_payment.inspect}, merchant_name:"\
|
|
347
|
+
" #{@merchant_name.inspect}, store_name: #{@store_name.inspect}, payment_type:"\
|
|
348
|
+
" #{@payment_type.inspect}, next_payment_date: #{@next_payment_date.inspect}, user_data:"\
|
|
349
|
+
" #{@user_data.inspect}, additional_properties: #{@additional_properties}>"
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
end
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module UnivapayClientSdk
|
|
8
|
+
# Next scheduled payment details for a subscription.
|
|
9
|
+
class SubscriptionNextPayment < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Unique identifier.
|
|
14
|
+
# @return [UUID | String]
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# Scheduled due date.
|
|
18
|
+
# @return [Date]
|
|
19
|
+
attr_accessor :due_date
|
|
20
|
+
|
|
21
|
+
# IANA timezone identifier.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :zone_id
|
|
24
|
+
|
|
25
|
+
# Amount in the smallest currency unit.
|
|
26
|
+
# @return [Integer]
|
|
27
|
+
attr_accessor :amount
|
|
28
|
+
|
|
29
|
+
# ISO-4217 currency code.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :currency
|
|
32
|
+
|
|
33
|
+
# Amount formatted for display.
|
|
34
|
+
# @return [Float]
|
|
35
|
+
attr_accessor :amount_formatted
|
|
36
|
+
|
|
37
|
+
# Whether the payment has been paid.
|
|
38
|
+
# @return [TrueClass | FalseClass]
|
|
39
|
+
attr_accessor :is_paid
|
|
40
|
+
|
|
41
|
+
# Whether this is the final payment in the schedule.
|
|
42
|
+
# @return [TrueClass | FalseClass]
|
|
43
|
+
attr_accessor :is_last_payment
|
|
44
|
+
|
|
45
|
+
# Timestamp when the resource was created.
|
|
46
|
+
# @return [DateTime]
|
|
47
|
+
attr_accessor :created_on
|
|
48
|
+
|
|
49
|
+
# Timestamp when the resource was last updated.
|
|
50
|
+
# @return [DateTime]
|
|
51
|
+
attr_accessor :updated_on
|
|
52
|
+
|
|
53
|
+
# Scheduled retry date.
|
|
54
|
+
# @return [Date]
|
|
55
|
+
attr_accessor :retry_date
|
|
56
|
+
|
|
57
|
+
# Schedule a status transition on a payment's due date. Set to `suspended`
|
|
58
|
+
# or `canceled` to schedule termination. Send `null` to cancel a previously
|
|
59
|
+
# scheduled transition.
|
|
60
|
+
# @return [SubscriptionTerminateWithStatus]
|
|
61
|
+
attr_accessor :terminate_with_status
|
|
62
|
+
|
|
63
|
+
# A mapping from model property names to API property names.
|
|
64
|
+
def self.names
|
|
65
|
+
@_hash = {} if @_hash.nil?
|
|
66
|
+
@_hash['id'] = 'id'
|
|
67
|
+
@_hash['due_date'] = 'due_date'
|
|
68
|
+
@_hash['zone_id'] = 'zone_id'
|
|
69
|
+
@_hash['amount'] = 'amount'
|
|
70
|
+
@_hash['currency'] = 'currency'
|
|
71
|
+
@_hash['amount_formatted'] = 'amount_formatted'
|
|
72
|
+
@_hash['is_paid'] = 'is_paid'
|
|
73
|
+
@_hash['is_last_payment'] = 'is_last_payment'
|
|
74
|
+
@_hash['created_on'] = 'created_on'
|
|
75
|
+
@_hash['updated_on'] = 'updated_on'
|
|
76
|
+
@_hash['retry_date'] = 'retry_date'
|
|
77
|
+
@_hash['terminate_with_status'] = 'terminate_with_status'
|
|
78
|
+
@_hash
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# An array for optional fields
|
|
82
|
+
def self.optionals
|
|
83
|
+
%w[
|
|
84
|
+
id
|
|
85
|
+
due_date
|
|
86
|
+
zone_id
|
|
87
|
+
amount
|
|
88
|
+
currency
|
|
89
|
+
amount_formatted
|
|
90
|
+
is_paid
|
|
91
|
+
is_last_payment
|
|
92
|
+
created_on
|
|
93
|
+
updated_on
|
|
94
|
+
retry_date
|
|
95
|
+
terminate_with_status
|
|
96
|
+
]
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# An array for nullable fields
|
|
100
|
+
def self.nullables
|
|
101
|
+
%w[
|
|
102
|
+
retry_date
|
|
103
|
+
terminate_with_status
|
|
104
|
+
]
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def initialize(id: SKIP, due_date: SKIP, zone_id: SKIP, amount: SKIP,
|
|
108
|
+
currency: SKIP, amount_formatted: SKIP, is_paid: SKIP,
|
|
109
|
+
is_last_payment: SKIP, created_on: SKIP, updated_on: SKIP,
|
|
110
|
+
retry_date: SKIP, terminate_with_status: SKIP,
|
|
111
|
+
additional_properties: nil)
|
|
112
|
+
# Add additional model properties to the instance
|
|
113
|
+
additional_properties = {} if additional_properties.nil?
|
|
114
|
+
|
|
115
|
+
@id = id unless id == SKIP
|
|
116
|
+
@due_date = due_date unless due_date == SKIP
|
|
117
|
+
@zone_id = zone_id unless zone_id == SKIP
|
|
118
|
+
@amount = amount unless amount == SKIP
|
|
119
|
+
@currency = currency unless currency == SKIP
|
|
120
|
+
@amount_formatted = amount_formatted unless amount_formatted == SKIP
|
|
121
|
+
@is_paid = is_paid unless is_paid == SKIP
|
|
122
|
+
@is_last_payment = is_last_payment unless is_last_payment == SKIP
|
|
123
|
+
@created_on = created_on unless created_on == SKIP
|
|
124
|
+
@updated_on = updated_on unless updated_on == SKIP
|
|
125
|
+
@retry_date = retry_date unless retry_date == SKIP
|
|
126
|
+
@terminate_with_status = terminate_with_status unless terminate_with_status == SKIP
|
|
127
|
+
@additional_properties = additional_properties
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Creates an instance of the object from a hash.
|
|
131
|
+
def self.from_hash(hash)
|
|
132
|
+
return nil unless hash
|
|
133
|
+
|
|
134
|
+
# Extract variables from the hash.
|
|
135
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
136
|
+
due_date = hash.key?('due_date') ? hash['due_date'] : SKIP
|
|
137
|
+
zone_id = hash.key?('zone_id') ? hash['zone_id'] : SKIP
|
|
138
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
139
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
140
|
+
amount_formatted =
|
|
141
|
+
hash.key?('amount_formatted') ? hash['amount_formatted'] : SKIP
|
|
142
|
+
is_paid = hash.key?('is_paid') ? hash['is_paid'] : SKIP
|
|
143
|
+
is_last_payment =
|
|
144
|
+
hash.key?('is_last_payment') ? hash['is_last_payment'] : SKIP
|
|
145
|
+
created_on = if hash.key?('created_on')
|
|
146
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
147
|
+
else
|
|
148
|
+
SKIP
|
|
149
|
+
end
|
|
150
|
+
updated_on = if hash.key?('updated_on')
|
|
151
|
+
(DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
|
|
152
|
+
else
|
|
153
|
+
SKIP
|
|
154
|
+
end
|
|
155
|
+
retry_date = hash.key?('retry_date') ? hash['retry_date'] : SKIP
|
|
156
|
+
terminate_with_status =
|
|
157
|
+
hash.key?('terminate_with_status') ? hash['terminate_with_status'] : SKIP
|
|
158
|
+
|
|
159
|
+
# Create a new hash for additional properties, removing known properties.
|
|
160
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
161
|
+
|
|
162
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
163
|
+
new_hash, proc { |value| value }
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
# Create object from extracted values.
|
|
167
|
+
SubscriptionNextPayment.new(id: id,
|
|
168
|
+
due_date: due_date,
|
|
169
|
+
zone_id: zone_id,
|
|
170
|
+
amount: amount,
|
|
171
|
+
currency: currency,
|
|
172
|
+
amount_formatted: amount_formatted,
|
|
173
|
+
is_paid: is_paid,
|
|
174
|
+
is_last_payment: is_last_payment,
|
|
175
|
+
created_on: created_on,
|
|
176
|
+
updated_on: updated_on,
|
|
177
|
+
retry_date: retry_date,
|
|
178
|
+
terminate_with_status: terminate_with_status,
|
|
179
|
+
additional_properties: additional_properties)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
def to_custom_created_on
|
|
183
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
def to_custom_updated_on
|
|
187
|
+
DateTimeHelper.to_rfc3339(updated_on)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Validates an instance of the object from a given value.
|
|
191
|
+
# @param [SubscriptionNextPayment | Hash] The value against the validation is performed.
|
|
192
|
+
def self.validate(value)
|
|
193
|
+
return true if value.instance_of? self
|
|
194
|
+
|
|
195
|
+
return false unless value.instance_of? Hash
|
|
196
|
+
|
|
197
|
+
true
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Provides a human-readable string representation of the object.
|
|
201
|
+
def to_s
|
|
202
|
+
class_name = self.class.name.split('::').last
|
|
203
|
+
"<#{class_name} id: #{@id}, due_date: #{@due_date}, zone_id: #{@zone_id}, amount:"\
|
|
204
|
+
" #{@amount}, currency: #{@currency}, amount_formatted: #{@amount_formatted}, is_paid:"\
|
|
205
|
+
" #{@is_paid}, is_last_payment: #{@is_last_payment}, created_on: #{@created_on}, updated_on:"\
|
|
206
|
+
" #{@updated_on}, retry_date: #{@retry_date}, terminate_with_status:"\
|
|
207
|
+
" #{@terminate_with_status}, additional_properties: #{@additional_properties}>"
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
211
|
+
def inspect
|
|
212
|
+
class_name = self.class.name.split('::').last
|
|
213
|
+
"<#{class_name} id: #{@id.inspect}, due_date: #{@due_date.inspect}, zone_id:"\
|
|
214
|
+
" #{@zone_id.inspect}, amount: #{@amount.inspect}, currency: #{@currency.inspect},"\
|
|
215
|
+
" amount_formatted: #{@amount_formatted.inspect}, is_paid: #{@is_paid.inspect},"\
|
|
216
|
+
" is_last_payment: #{@is_last_payment.inspect}, created_on: #{@created_on.inspect},"\
|
|
217
|
+
" updated_on: #{@updated_on.inspect}, retry_date: #{@retry_date.inspect},"\
|
|
218
|
+
" terminate_with_status: #{@terminate_with_status.inspect}, additional_properties:"\
|
|
219
|
+
" #{@additional_properties}>"
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|