univapay-client-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +212 -0
- data/bin/console +15 -0
- data/lib/univapay_client_sdk/api_helper.rb +10 -0
- data/lib/univapay_client_sdk/apis/base_api.rb +67 -0
- data/lib/univapay_client_sdk/apis/cancels_api.rb +293 -0
- data/lib/univapay_client_sdk/apis/charges_api.rb +909 -0
- data/lib/univapay_client_sdk/apis/merchants_api.rb +57 -0
- data/lib/univapay_client_sdk/apis/refunds_api.rb +298 -0
- data/lib/univapay_client_sdk/apis/stores_api.rb +126 -0
- data/lib/univapay_client_sdk/apis/subscriptions_api.rb +1014 -0
- data/lib/univapay_client_sdk/apis/transaction_tokens_api.rb +455 -0
- data/lib/univapay_client_sdk/apis/webhooks_api.rb +463 -0
- data/lib/univapay_client_sdk/client.rb +128 -0
- data/lib/univapay_client_sdk/configuration.rb +179 -0
- data/lib/univapay_client_sdk/events/unknown_event.rb +32 -0
- data/lib/univapay_client_sdk/events/webhooks/bank_transfer_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/cancel_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/charge_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_handler.rb +37 -0
- data/lib/univapay_client_sdk/exceptions/api_error_exception.rb +199 -0
- data/lib/univapay_client_sdk/exceptions/api_exception.rb +21 -0
- data/lib/univapay_client_sdk/extensions.rb +127 -0
- data/lib/univapay_client_sdk/http/api_response.rb +19 -0
- data/lib/univapay_client_sdk/http/auth/oauth_2.rb +58 -0
- data/lib/univapay_client_sdk/http/http_call_back.rb +10 -0
- data/lib/univapay_client_sdk/http/http_method_enum.rb +10 -0
- data/lib/univapay_client_sdk/http/http_request.rb +10 -0
- data/lib/univapay_client_sdk/http/http_response.rb +10 -0
- data/lib/univapay_client_sdk/http/proxy_settings.rb +22 -0
- data/lib/univapay_client_sdk/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/univapay_client_sdk/logging/sdk_logger.rb +17 -0
- data/lib/univapay_client_sdk/models/api_error_detail.rb +87 -0
- data/lib/univapay_client_sdk/models/api_error_status.rb +26 -0
- data/lib/univapay_client_sdk/models/bank_transfer_event.rb +27 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger.rb +199 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_bank_ledger_type.rb +36 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_list.rb +104 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/bank_transfer_payment_status.rb +44 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_data.rb +229 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback.rb +134 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback_extension.rb +75 -0
- data/lib/univapay_client_sdk/models/base_bank_transfer_data.rb +100 -0
- data/lib/univapay_client_sdk/models/base_konbini_data.rb +99 -0
- data/lib/univapay_client_sdk/models/base_konbini_data_convenience_store.rb +60 -0
- data/lib/univapay_client_sdk/models/base_model.rb +110 -0
- data/lib/univapay_client_sdk/models/base_online_data.rb +123 -0
- data/lib/univapay_client_sdk/models/base_online_data_brand.rb +48 -0
- data/lib/univapay_client_sdk/models/base_online_data_call_method.rb +52 -0
- data/lib/univapay_client_sdk/models/base_online_data_os_type.rb +36 -0
- data/lib/univapay_client_sdk/models/base_online_data_user_identifier_source.rb +36 -0
- data/lib/univapay_client_sdk/models/cancel.rb +183 -0
- data/lib/univapay_client_sdk/models/cancel_create_request.rb +77 -0
- data/lib/univapay_client_sdk/models/cancel_event.rb +26 -0
- data/lib/univapay_client_sdk/models/cancel_list.rb +94 -0
- data/lib/univapay_client_sdk/models/cancel_status.rb +44 -0
- data/lib/univapay_client_sdk/models/cancel_update_request.rb +76 -0
- data/lib/univapay_client_sdk/models/cancel_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/cancel_webhook_callback_extension.rb +74 -0
- data/lib/univapay_client_sdk/models/card_processor_installment_config.rb +89 -0
- data/lib/univapay_client_sdk/models/charge.rb +411 -0
- data/lib/univapay_client_sdk/models/charge_capture_request.rb +84 -0
- data/lib/univapay_client_sdk/models/charge_create_request.rb +179 -0
- data/lib/univapay_client_sdk/models/charge_create_request_client_metadata.rb +76 -0
- data/lib/univapay_client_sdk/models/charge_create_request_redirect.rb +75 -0
- data/lib/univapay_client_sdk/models/charge_create_request_three_ds.rb +88 -0
- data/lib/univapay_client_sdk/models/charge_create_request_three_ds_mode.rb +44 -0
- data/lib/univapay_client_sdk/models/charge_event.rb +36 -0
- data/lib/univapay_client_sdk/models/charge_list.rb +104 -0
- data/lib/univapay_client_sdk/models/charge_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/charge_redirect.rb +96 -0
- data/lib/univapay_client_sdk/models/charge_status.rb +56 -0
- data/lib/univapay_client_sdk/models/charge_three_ds.rb +97 -0
- data/lib/univapay_client_sdk/models/charge_transaction_token_type.rb +40 -0
- data/lib/univapay_client_sdk/models/charge_update_request.rb +75 -0
- data/lib/univapay_client_sdk/models/charge_webhook_event.rb +138 -0
- data/lib/univapay_client_sdk/models/cursor_direction_query.rb +36 -0
- data/lib/univapay_client_sdk/models/customs_declaration_create_request.rb +106 -0
- data/lib/univapay_client_sdk/models/customs_declaration_event.rb +27 -0
- data/lib/univapay_client_sdk/models/customs_declaration_patch_request.rb +77 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback.rb +135 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback_extension.rb +76 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_data.rb +232 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb +121 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_error.rb +127 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_other_error.rb +120 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_result.rb +125 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_status.rb +44 -0
- data/lib/univapay_client_sdk/models/generic_metadata.rb +111 -0
- data/lib/univapay_client_sdk/models/installment_fixed_cycles.rb +70 -0
- data/lib/univapay_client_sdk/models/installment_plan_type.rb +36 -0
- data/lib/univapay_client_sdk/models/issuer_token.rb +177 -0
- data/lib/univapay_client_sdk/models/issuer_token_call_method.rb +51 -0
- data/lib/univapay_client_sdk/models/issuer_token_payload.rb +105 -0
- data/lib/univapay_client_sdk/models/issuer_token_payment_type.rb +36 -0
- data/lib/univapay_client_sdk/models/merchant.rb +179 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_bank_transfer_configuration.rb +342 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_card_brand_percent_fees.rb +167 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_card_configuration.rb +301 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_checkout_configuration.rb +87 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_checkout_toggle.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_configuration.rb +505 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_convenience_configuration.rb +88 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_customer_management_configuration.rb +99 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb +139 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_limit_charge_by_card_configuration.rb +88 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb +100 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_money_amount.rb +85 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_online_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_paidy_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_qr_merchant_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_qr_scan_configuration.rb +93 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_recurring_cvv_confirmation_config.rb +97 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb +109 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_security_configuration.rb +234 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_subscription_configuration.rb +138 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb +138 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_transfer_schedule_configuration.rb +159 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_user_transactions_configuration.rb +349 -0
- data/lib/univapay_client_sdk/models/mode_query.rb +36 -0
- data/lib/univapay_client_sdk/models/payment_error.rb +178 -0
- data/lib/univapay_client_sdk/models/plan_settings_type.rb +36 -0
- data/lib/univapay_client_sdk/models/refund.rb +240 -0
- data/lib/univapay_client_sdk/models/refund_create_request.rb +118 -0
- data/lib/univapay_client_sdk/models/refund_event.rb +26 -0
- data/lib/univapay_client_sdk/models/refund_list.rb +104 -0
- data/lib/univapay_client_sdk/models/refund_reason_request.rb +42 -0
- data/lib/univapay_client_sdk/models/refund_reason_response.rb +62 -0
- data/lib/univapay_client_sdk/models/refund_status.rb +47 -0
- data/lib/univapay_client_sdk/models/refund_update_request.rb +99 -0
- data/lib/univapay_client_sdk/models/refund_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/refund_webhook_callback_extension.rb +74 -0
- data/lib/univapay_client_sdk/models/restrict_ip_after_failed_charge_config.rb +99 -0
- data/lib/univapay_client_sdk/models/store.rb +119 -0
- data/lib/univapay_client_sdk/models/store_list.rb +104 -0
- data/lib/univapay_client_sdk/models/store_list_item.rb +114 -0
- data/lib/univapay_client_sdk/models/subscription.rb +310 -0
- data/lib/univapay_client_sdk/models/subscription_create_request.rb +216 -0
- data/lib/univapay_client_sdk/models/subscription_event.rb +54 -0
- data/lib/univapay_client_sdk/models/subscription_installment_plan.rb +86 -0
- data/lib/univapay_client_sdk/models/subscription_list.rb +104 -0
- data/lib/univapay_client_sdk/models/subscription_list_item.rb +352 -0
- data/lib/univapay_client_sdk/models/subscription_next_payment.rb +222 -0
- data/lib/univapay_client_sdk/models/subscription_patch_payment_request.rb +117 -0
- data/lib/univapay_client_sdk/models/subscription_patch_token_request.rb +79 -0
- data/lib/univapay_client_sdk/models/subscription_payment.rb +185 -0
- data/lib/univapay_client_sdk/models/subscription_payment_list.rb +94 -0
- data/lib/univapay_client_sdk/models/subscription_period.rb +56 -0
- data/lib/univapay_client_sdk/models/subscription_plan_settings.rb +98 -0
- data/lib/univapay_client_sdk/models/subscription_schedule_settings.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_status.rb +56 -0
- data/lib/univapay_client_sdk/models/subscription_suspend_request.rb +79 -0
- data/lib/univapay_client_sdk/models/subscription_terminate_with_status.rb +36 -0
- data/lib/univapay_client_sdk/models/subscription_termination_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/subscription_update_next_payment.rb +104 -0
- data/lib/univapay_client_sdk/models/subscription_update_request.rb +134 -0
- data/lib/univapay_client_sdk/models/subscription_update_schedule_settings.rb +110 -0
- data/lib/univapay_client_sdk/models/subscription_update_status.rb +37 -0
- data/lib/univapay_client_sdk/models/subscription_user_data.rb +134 -0
- data/lib/univapay_client_sdk/models/subscription_webhook_event.rb +143 -0
- data/lib/univapay_client_sdk/models/suspend_schedule_settings.rb +78 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token.rb +116 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token_call_method.rb +26 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token_payment_type.rb +26 -0
- data/lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb +122 -0
- data/lib/univapay_client_sdk/models/token_create_card_data.rb +230 -0
- data/lib/univapay_client_sdk/models/token_create_card_data_cvv_authorize.rb +95 -0
- data/lib/univapay_client_sdk/models/token_create_card_data_three_ds.rb +97 -0
- data/lib/univapay_client_sdk/models/token_create_konbini_data.rb +146 -0
- data/lib/univapay_client_sdk/models/token_create_online_data.rb +142 -0
- data/lib/univapay_client_sdk/models/token_create_phone_number.rb +104 -0
- data/lib/univapay_client_sdk/models/token_event.rb +59 -0
- data/lib/univapay_client_sdk/models/token_response_bank_transfer_data.rb +181 -0
- data/lib/univapay_client_sdk/models/token_response_card_data.rb +129 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_billing.rb +153 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_card.rb +187 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize.rb +132 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb +118 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb +142 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_three_ds_status.rb +48 -0
- data/lib/univapay_client_sdk/models/token_response_konbini_data.rb +135 -0
- data/lib/univapay_client_sdk/models/token_response_online_data.rb +158 -0
- data/lib/univapay_client_sdk/models/token_response_phone_number.rb +96 -0
- data/lib/univapay_client_sdk/models/token_webhook_event.rb +144 -0
- data/lib/univapay_client_sdk/models/transaction_token.rb +250 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request.rb +161 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_metadata.rb +124 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_payment_type.rb +44 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_type.rb +40 -0
- data/lib/univapay_client_sdk/models/transaction_token_list.rb +104 -0
- data/lib/univapay_client_sdk/models/transaction_token_list_item.rb +204 -0
- data/lib/univapay_client_sdk/models/transaction_token_list_item_user_data.rb +96 -0
- data/lib/univapay_client_sdk/models/transaction_token_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/transaction_token_payment_type.rb +48 -0
- data/lib/univapay_client_sdk/models/transaction_token_type.rb +40 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request.rb +95 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request_data.rb +184 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request_data_phone_number.rb +86 -0
- data/lib/univapay_client_sdk/models/webhook.rb +191 -0
- data/lib/univapay_client_sdk/models/webhook_callback_envelope.rb +98 -0
- data/lib/univapay_client_sdk/models/webhook_create_request.rb +97 -0
- data/lib/univapay_client_sdk/models/webhook_event.rb +166 -0
- data/lib/univapay_client_sdk/models/webhook_event_list.rb +94 -0
- data/lib/univapay_client_sdk/models/webhook_list.rb +94 -0
- data/lib/univapay_client_sdk/models/webhook_trigger.rb +104 -0
- data/lib/univapay_client_sdk/models/webhook_update_request.rb +108 -0
- data/lib/univapay_client_sdk/utilities/date_time_helper.rb +11 -0
- data/lib/univapay_client_sdk/utilities/file_wrapper.rb +28 -0
- data/lib/univapay_client_sdk/utilities/union_type_lookup.rb +182 -0
- data/lib/univapay_client_sdk.rb +285 -0
- data/test/apis/api_test_base.rb +23 -0
- data/test/apis/test_cancels_api.rb +162 -0
- data/test/apis/test_charges_api.rb +565 -0
- data/test/apis/test_error_messages.rb +38 -0
- data/test/apis/test_merchants_api.rb +50 -0
- data/test/apis/test_refunds_api.rb +172 -0
- data/test/apis/test_stores_api.rb +86 -0
- data/test/apis/test_subscriptions_api.rb +579 -0
- data/test/apis/test_transaction_tokens_api.rb +305 -0
- data/test/apis/test_webhooks_api.rb +245 -0
- data/test/events/webhooks/test_bank_transfer_handler.rb +95 -0
- data/test/events/webhooks/test_cancel_handler.rb +90 -0
- data/test/events/webhooks/test_charge_handler.rb +138 -0
- data/test/events/webhooks/test_customs_handler.rb +100 -0
- data/test/events/webhooks/test_refund_handler.rb +95 -0
- data/test/events/webhooks/test_subscription_handler.rb +346 -0
- data/test/events/webhooks/test_token_handler.rb +332 -0
- data/test/framework_integrations/rails_app_test_helper.rb +14 -0
- data/test/framework_integrations/webhooks/apps/hanami_charge_app.rb +61 -0
- data/test/framework_integrations/webhooks/apps/rails_charge_app.rb +24 -0
- data/test/framework_integrations/webhooks/apps/sinatra_charge_app.rb +27 -0
- data/test/framework_integrations/webhooks/test/test_hanami_charge_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_rails_charge_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_sinatra_charge_app.rb +58 -0
- data/test/http_response_catcher.rb +32 -0
- metadata +366 -0
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
# 3-D Secure issuer token payload.
|
|
8
|
+
class ThreeDsIssuerToken < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Only 'card' is supported for 3-D Secure issuer tokens.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_reader :payment_type
|
|
15
|
+
|
|
16
|
+
# The 3-D Secure authentication URL to which the client must send the
|
|
17
|
+
# request.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :issuer_token
|
|
20
|
+
|
|
21
|
+
# Execution method. Currently, only 'http_post' is supported.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_reader :call_method
|
|
24
|
+
|
|
25
|
+
# Key-value pairs required to complete the payment action, or null if not
|
|
26
|
+
# applicable. Used when `call_method` is `http_post`. When present, this
|
|
27
|
+
# JSON must be converted by the client to match the expected `content_type`
|
|
28
|
+
# (e.g., transformed into an `application/x-www-form-urlencoded` string)
|
|
29
|
+
# before sending the POST request.
|
|
30
|
+
# @return [IssuerTokenPayload]
|
|
31
|
+
attr_accessor :payload
|
|
32
|
+
|
|
33
|
+
# The expected content type of the payload required by the card issuer's
|
|
34
|
+
# endpoint (e.g., 'application/x-www-form-urlencoded; charset=UTF-8').
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :content_type
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['payment_type'] = 'payment_type'
|
|
42
|
+
@_hash['issuer_token'] = 'issuer_token'
|
|
43
|
+
@_hash['call_method'] = 'call_method'
|
|
44
|
+
@_hash['payload'] = 'payload'
|
|
45
|
+
@_hash['content_type'] = 'content_type'
|
|
46
|
+
@_hash
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for optional fields
|
|
50
|
+
def self.optionals
|
|
51
|
+
%w[
|
|
52
|
+
payload
|
|
53
|
+
]
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# An array for nullable fields
|
|
57
|
+
def self.nullables
|
|
58
|
+
%w[
|
|
59
|
+
payload
|
|
60
|
+
]
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def initialize(issuer_token:, content_type:, payload: SKIP,
|
|
64
|
+
additional_properties: nil)
|
|
65
|
+
# Add additional model properties to the instance
|
|
66
|
+
additional_properties = {} if additional_properties.nil?
|
|
67
|
+
|
|
68
|
+
@payment_type = 'card'
|
|
69
|
+
@issuer_token = issuer_token
|
|
70
|
+
@call_method = 'http_post'
|
|
71
|
+
@payload = payload unless payload == SKIP
|
|
72
|
+
@content_type = content_type
|
|
73
|
+
@additional_properties = additional_properties
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Creates an instance of the object from a hash.
|
|
77
|
+
def self.from_hash(hash)
|
|
78
|
+
return nil unless hash
|
|
79
|
+
|
|
80
|
+
# Extract variables from the hash.
|
|
81
|
+
issuer_token = hash.key?('issuer_token') ? hash['issuer_token'] : nil
|
|
82
|
+
content_type = hash.key?('content_type') ? hash['content_type'] : nil
|
|
83
|
+
payload = IssuerTokenPayload.from_hash(hash['payload']) if hash['payload']
|
|
84
|
+
|
|
85
|
+
# Create a new hash for additional properties, removing known properties.
|
|
86
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
87
|
+
|
|
88
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
89
|
+
new_hash, proc { |value| value }
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Create object from extracted values.
|
|
93
|
+
ThreeDsIssuerToken.new(issuer_token: issuer_token,
|
|
94
|
+
content_type: content_type,
|
|
95
|
+
payload: payload,
|
|
96
|
+
additional_properties: additional_properties)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Provides a human-readable string representation of the object.
|
|
100
|
+
def to_s
|
|
101
|
+
class_name = self.class.name.split('::').last
|
|
102
|
+
"<#{class_name} payment_type: #{@payment_type}, issuer_token: #{@issuer_token},"\
|
|
103
|
+
" call_method: #{@call_method}, payload: #{@payload}, content_type: #{@content_type},"\
|
|
104
|
+
" additional_properties: #{@additional_properties}>"
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
108
|
+
def inspect
|
|
109
|
+
class_name = self.class.name.split('::').last
|
|
110
|
+
"<#{class_name} payment_type: #{@payment_type.inspect}, issuer_token:"\
|
|
111
|
+
" #{@issuer_token.inspect}, call_method: #{@call_method.inspect}, payload:"\
|
|
112
|
+
" #{@payload.inspect}, content_type: #{@content_type.inspect}, additional_properties:"\
|
|
113
|
+
" #{@additional_properties}>"
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
# Execution method. Currently, only 'http_post' is supported.
|
|
8
|
+
class ThreeDsIssuerTokenCallMethod
|
|
9
|
+
THREE_DS_ISSUER_TOKEN_CALL_METHOD = [
|
|
10
|
+
# TODO: Write general description for HTTP_POST
|
|
11
|
+
HTTP_POST = 'http_post'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
THREE_DS_ISSUER_TOKEN_CALL_METHOD.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = HTTP_POST)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
# Only 'card' is supported for 3-D Secure issuer tokens.
|
|
8
|
+
class ThreeDsIssuerTokenPaymentType
|
|
9
|
+
THREE_DS_ISSUER_TOKEN_PAYMENT_TYPE = [
|
|
10
|
+
# TODO: Write general description for CARD
|
|
11
|
+
CARD = 'card'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
def self.validate(value)
|
|
15
|
+
return false if value.nil?
|
|
16
|
+
|
|
17
|
+
THREE_DS_ISSUER_TOKEN_PAYMENT_TYPE.include?(value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from_value(value, default_value = CARD)
|
|
21
|
+
return default_value if value.nil?
|
|
22
|
+
|
|
23
|
+
default_value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
# Token Create Bank Transfer Data schema.
|
|
8
|
+
class TokenCreateBankTransferData < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The bank brand identifier (e.g., 'aozora_bank').
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :brand
|
|
15
|
+
|
|
16
|
+
# ISO 8601 duration format (e.g., 'PT168H').
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :expiration_period
|
|
19
|
+
|
|
20
|
+
# Time shift applied to the expiration, typically pushing it to the end of
|
|
21
|
+
# the day in a specific timezone (e.g., '23:59:59+09:00').
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :expiration_time_shift
|
|
24
|
+
|
|
25
|
+
# The name of the customer initiating the transfer.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :name
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['brand'] = 'brand'
|
|
33
|
+
@_hash['expiration_period'] = 'expiration_period'
|
|
34
|
+
@_hash['expiration_time_shift'] = 'expiration_time_shift'
|
|
35
|
+
@_hash['name'] = 'name'
|
|
36
|
+
@_hash
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An array for optional fields
|
|
40
|
+
def self.optionals
|
|
41
|
+
%w[
|
|
42
|
+
expiration_period
|
|
43
|
+
expiration_time_shift
|
|
44
|
+
name
|
|
45
|
+
]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(brand:, expiration_period: SKIP, expiration_time_shift: SKIP,
|
|
54
|
+
name: SKIP, additional_properties: nil)
|
|
55
|
+
# Add additional model properties to the instance
|
|
56
|
+
additional_properties = {} if additional_properties.nil?
|
|
57
|
+
|
|
58
|
+
@brand = brand
|
|
59
|
+
@expiration_period = expiration_period unless expiration_period == SKIP
|
|
60
|
+
@expiration_time_shift = expiration_time_shift unless expiration_time_shift == SKIP
|
|
61
|
+
@name = name unless name == 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
|
+
brand = hash.key?('brand') ? hash['brand'] : nil
|
|
71
|
+
expiration_period =
|
|
72
|
+
hash.key?('expiration_period') ? hash['expiration_period'] : SKIP
|
|
73
|
+
expiration_time_shift =
|
|
74
|
+
hash.key?('expiration_time_shift') ? hash['expiration_time_shift'] : SKIP
|
|
75
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
|
76
|
+
|
|
77
|
+
# Create a new hash for additional properties, removing known properties.
|
|
78
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
79
|
+
|
|
80
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
81
|
+
new_hash, proc { |value| value }
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Create object from extracted values.
|
|
85
|
+
TokenCreateBankTransferData.new(brand: brand,
|
|
86
|
+
expiration_period: expiration_period,
|
|
87
|
+
expiration_time_shift: expiration_time_shift,
|
|
88
|
+
name: name,
|
|
89
|
+
additional_properties: additional_properties)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Validates an instance of the object from a given value.
|
|
93
|
+
# @param [TokenCreateBankTransferData | Hash] The value against the validation is performed.
|
|
94
|
+
def self.validate(value)
|
|
95
|
+
if value.instance_of? self
|
|
96
|
+
return APIHelper.valid_type?(value.brand,
|
|
97
|
+
->(val) { val.instance_of? String })
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
return false unless value.instance_of? Hash
|
|
101
|
+
|
|
102
|
+
APIHelper.valid_type?(value['brand'],
|
|
103
|
+
->(val) { val.instance_of? String })
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Provides a human-readable string representation of the object.
|
|
107
|
+
def to_s
|
|
108
|
+
class_name = self.class.name.split('::').last
|
|
109
|
+
"<#{class_name} brand: #{@brand}, expiration_period: #{@expiration_period},"\
|
|
110
|
+
" expiration_time_shift: #{@expiration_time_shift}, name: #{@name}, additional_properties:"\
|
|
111
|
+
" #{@additional_properties}>"
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
115
|
+
def inspect
|
|
116
|
+
class_name = self.class.name.split('::').last
|
|
117
|
+
"<#{class_name} brand: #{@brand.inspect}, expiration_period: #{@expiration_period.inspect},"\
|
|
118
|
+
" expiration_time_shift: #{@expiration_time_shift.inspect}, name: #{@name.inspect},"\
|
|
119
|
+
" additional_properties: #{@additional_properties}>"
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
@@ -0,0 +1,230 @@
|
|
|
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
|
+
# Token Create Card Data schema.
|
|
8
|
+
class TokenCreateCardData < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Cardholder name.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :cardholder
|
|
15
|
+
|
|
16
|
+
# Card number.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :card_number
|
|
19
|
+
|
|
20
|
+
# Card expiration month.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :exp_month
|
|
23
|
+
|
|
24
|
+
# Card expiration year.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :exp_year
|
|
27
|
+
|
|
28
|
+
# Card security code.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :cvv
|
|
31
|
+
|
|
32
|
+
# Primary street address line.
|
|
33
|
+
# @return [String]
|
|
34
|
+
attr_accessor :line1
|
|
35
|
+
|
|
36
|
+
# Secondary street address line.
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :line2
|
|
39
|
+
|
|
40
|
+
# State or prefecture.
|
|
41
|
+
# @return [String]
|
|
42
|
+
attr_accessor :state
|
|
43
|
+
|
|
44
|
+
# City or locality.
|
|
45
|
+
# @return [String]
|
|
46
|
+
attr_accessor :city
|
|
47
|
+
|
|
48
|
+
# Country code.
|
|
49
|
+
# @return [String]
|
|
50
|
+
attr_accessor :country
|
|
51
|
+
|
|
52
|
+
# Postal code.
|
|
53
|
+
# @return [String]
|
|
54
|
+
attr_accessor :zip
|
|
55
|
+
|
|
56
|
+
# Token Create Phone Number schema.
|
|
57
|
+
# @return [TokenCreatePhoneNumber]
|
|
58
|
+
attr_accessor :phone_number
|
|
59
|
+
|
|
60
|
+
# Token Create Card Data Cvv Authorize schema.
|
|
61
|
+
# @return [TokenCreateCardDataCvvAuthorize]
|
|
62
|
+
attr_accessor :cvv_authorize
|
|
63
|
+
|
|
64
|
+
# Token Create Card Data Three Ds schema.
|
|
65
|
+
# @return [TokenCreateCardDataThreeDs]
|
|
66
|
+
attr_accessor :three_ds
|
|
67
|
+
|
|
68
|
+
# A mapping from model property names to API property names.
|
|
69
|
+
def self.names
|
|
70
|
+
@_hash = {} if @_hash.nil?
|
|
71
|
+
@_hash['cardholder'] = 'cardholder'
|
|
72
|
+
@_hash['card_number'] = 'card_number'
|
|
73
|
+
@_hash['exp_month'] = 'exp_month'
|
|
74
|
+
@_hash['exp_year'] = 'exp_year'
|
|
75
|
+
@_hash['cvv'] = 'cvv'
|
|
76
|
+
@_hash['line1'] = 'line1'
|
|
77
|
+
@_hash['line2'] = 'line2'
|
|
78
|
+
@_hash['state'] = 'state'
|
|
79
|
+
@_hash['city'] = 'city'
|
|
80
|
+
@_hash['country'] = 'country'
|
|
81
|
+
@_hash['zip'] = 'zip'
|
|
82
|
+
@_hash['phone_number'] = 'phone_number'
|
|
83
|
+
@_hash['cvv_authorize'] = 'cvv_authorize'
|
|
84
|
+
@_hash['three_ds'] = 'three_ds'
|
|
85
|
+
@_hash
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# An array for optional fields
|
|
89
|
+
def self.optionals
|
|
90
|
+
%w[
|
|
91
|
+
cardholder
|
|
92
|
+
cvv
|
|
93
|
+
line1
|
|
94
|
+
line2
|
|
95
|
+
state
|
|
96
|
+
city
|
|
97
|
+
country
|
|
98
|
+
zip
|
|
99
|
+
phone_number
|
|
100
|
+
cvv_authorize
|
|
101
|
+
three_ds
|
|
102
|
+
]
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# An array for nullable fields
|
|
106
|
+
def self.nullables
|
|
107
|
+
%w[
|
|
108
|
+
cvv
|
|
109
|
+
]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def initialize(card_number:, exp_month:, exp_year:, cardholder: SKIP,
|
|
113
|
+
cvv: SKIP, line1: SKIP, line2: SKIP, state: SKIP, city: SKIP,
|
|
114
|
+
country: SKIP, zip: SKIP, phone_number: SKIP,
|
|
115
|
+
cvv_authorize: SKIP, three_ds: SKIP,
|
|
116
|
+
additional_properties: nil)
|
|
117
|
+
# Add additional model properties to the instance
|
|
118
|
+
additional_properties = {} if additional_properties.nil?
|
|
119
|
+
|
|
120
|
+
@cardholder = cardholder unless cardholder == SKIP
|
|
121
|
+
@card_number = card_number
|
|
122
|
+
@exp_month = exp_month
|
|
123
|
+
@exp_year = exp_year
|
|
124
|
+
@cvv = cvv unless cvv == SKIP
|
|
125
|
+
@line1 = line1 unless line1 == SKIP
|
|
126
|
+
@line2 = line2 unless line2 == SKIP
|
|
127
|
+
@state = state unless state == SKIP
|
|
128
|
+
@city = city unless city == SKIP
|
|
129
|
+
@country = country unless country == SKIP
|
|
130
|
+
@zip = zip unless zip == SKIP
|
|
131
|
+
@phone_number = phone_number unless phone_number == SKIP
|
|
132
|
+
@cvv_authorize = cvv_authorize unless cvv_authorize == SKIP
|
|
133
|
+
@three_ds = three_ds unless three_ds == SKIP
|
|
134
|
+
@additional_properties = additional_properties
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Creates an instance of the object from a hash.
|
|
138
|
+
def self.from_hash(hash)
|
|
139
|
+
return nil unless hash
|
|
140
|
+
|
|
141
|
+
# Extract variables from the hash.
|
|
142
|
+
card_number = hash.key?('card_number') ? hash['card_number'] : nil
|
|
143
|
+
exp_month = hash.key?('exp_month') ? hash['exp_month'] : nil
|
|
144
|
+
exp_year = hash.key?('exp_year') ? hash['exp_year'] : nil
|
|
145
|
+
cardholder = hash.key?('cardholder') ? hash['cardholder'] : SKIP
|
|
146
|
+
cvv = hash.key?('cvv') ? hash['cvv'] : SKIP
|
|
147
|
+
line1 = hash.key?('line1') ? hash['line1'] : SKIP
|
|
148
|
+
line2 = hash.key?('line2') ? hash['line2'] : SKIP
|
|
149
|
+
state = hash.key?('state') ? hash['state'] : SKIP
|
|
150
|
+
city = hash.key?('city') ? hash['city'] : SKIP
|
|
151
|
+
country = hash.key?('country') ? hash['country'] : SKIP
|
|
152
|
+
zip = hash.key?('zip') ? hash['zip'] : SKIP
|
|
153
|
+
phone_number = TokenCreatePhoneNumber.from_hash(hash['phone_number']) if hash['phone_number']
|
|
154
|
+
cvv_authorize = TokenCreateCardDataCvvAuthorize.from_hash(hash['cvv_authorize']) if
|
|
155
|
+
hash['cvv_authorize']
|
|
156
|
+
three_ds = TokenCreateCardDataThreeDs.from_hash(hash['three_ds']) if hash['three_ds']
|
|
157
|
+
|
|
158
|
+
# Create a new hash for additional properties, removing known properties.
|
|
159
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
160
|
+
|
|
161
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
162
|
+
new_hash, proc { |value| value }
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# Create object from extracted values.
|
|
166
|
+
TokenCreateCardData.new(card_number: card_number,
|
|
167
|
+
exp_month: exp_month,
|
|
168
|
+
exp_year: exp_year,
|
|
169
|
+
cardholder: cardholder,
|
|
170
|
+
cvv: cvv,
|
|
171
|
+
line1: line1,
|
|
172
|
+
line2: line2,
|
|
173
|
+
state: state,
|
|
174
|
+
city: city,
|
|
175
|
+
country: country,
|
|
176
|
+
zip: zip,
|
|
177
|
+
phone_number: phone_number,
|
|
178
|
+
cvv_authorize: cvv_authorize,
|
|
179
|
+
three_ds: three_ds,
|
|
180
|
+
additional_properties: additional_properties)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Validates an instance of the object from a given value.
|
|
184
|
+
# @param [TokenCreateCardData | Hash] The value against the validation is performed.
|
|
185
|
+
def self.validate(value)
|
|
186
|
+
if value.instance_of? self
|
|
187
|
+
return (
|
|
188
|
+
APIHelper.valid_type?(value.card_number,
|
|
189
|
+
->(val) { val.instance_of? String }) and
|
|
190
|
+
APIHelper.valid_type?(value.exp_month,
|
|
191
|
+
->(val) { val.instance_of? String }) and
|
|
192
|
+
APIHelper.valid_type?(value.exp_year,
|
|
193
|
+
->(val) { val.instance_of? String })
|
|
194
|
+
)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
return false unless value.instance_of? Hash
|
|
198
|
+
|
|
199
|
+
(
|
|
200
|
+
APIHelper.valid_type?(value['card_number'],
|
|
201
|
+
->(val) { val.instance_of? String }) and
|
|
202
|
+
APIHelper.valid_type?(value['exp_month'],
|
|
203
|
+
->(val) { val.instance_of? String }) and
|
|
204
|
+
APIHelper.valid_type?(value['exp_year'],
|
|
205
|
+
->(val) { val.instance_of? String })
|
|
206
|
+
)
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Provides a human-readable string representation of the object.
|
|
210
|
+
def to_s
|
|
211
|
+
class_name = self.class.name.split('::').last
|
|
212
|
+
"<#{class_name} cardholder: #{@cardholder}, card_number: #{@card_number}, exp_month:"\
|
|
213
|
+
" #{@exp_month}, exp_year: #{@exp_year}, cvv: #{@cvv}, line1: #{@line1}, line2: #{@line2},"\
|
|
214
|
+
" state: #{@state}, city: #{@city}, country: #{@country}, zip: #{@zip}, phone_number:"\
|
|
215
|
+
" #{@phone_number}, cvv_authorize: #{@cvv_authorize}, three_ds: #{@three_ds},"\
|
|
216
|
+
" additional_properties: #{@additional_properties}>"
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
220
|
+
def inspect
|
|
221
|
+
class_name = self.class.name.split('::').last
|
|
222
|
+
"<#{class_name} cardholder: #{@cardholder.inspect}, card_number: #{@card_number.inspect},"\
|
|
223
|
+
" exp_month: #{@exp_month.inspect}, exp_year: #{@exp_year.inspect}, cvv: #{@cvv.inspect},"\
|
|
224
|
+
" line1: #{@line1.inspect}, line2: #{@line2.inspect}, state: #{@state.inspect}, city:"\
|
|
225
|
+
" #{@city.inspect}, country: #{@country.inspect}, zip: #{@zip.inspect}, phone_number:"\
|
|
226
|
+
" #{@phone_number.inspect}, cvv_authorize: #{@cvv_authorize.inspect}, three_ds:"\
|
|
227
|
+
" #{@three_ds.inspect}, additional_properties: #{@additional_properties}>"
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
# Token Create Card Data Cvv Authorize schema.
|
|
8
|
+
class TokenCreateCardDataCvvAuthorize < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Enabled value.
|
|
13
|
+
# @return [TrueClass | FalseClass]
|
|
14
|
+
attr_accessor :enabled
|
|
15
|
+
|
|
16
|
+
# ISO-4217 currency code.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :currency
|
|
19
|
+
|
|
20
|
+
# A mapping from model property names to API property names.
|
|
21
|
+
def self.names
|
|
22
|
+
@_hash = {} if @_hash.nil?
|
|
23
|
+
@_hash['enabled'] = 'enabled'
|
|
24
|
+
@_hash['currency'] = 'currency'
|
|
25
|
+
@_hash
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# An array for optional fields
|
|
29
|
+
def self.optionals
|
|
30
|
+
%w[
|
|
31
|
+
enabled
|
|
32
|
+
currency
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# An array for nullable fields
|
|
37
|
+
def self.nullables
|
|
38
|
+
[]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def initialize(enabled: false, currency: SKIP, additional_properties: nil)
|
|
42
|
+
# Add additional model properties to the instance
|
|
43
|
+
additional_properties = {} if additional_properties.nil?
|
|
44
|
+
|
|
45
|
+
@enabled = enabled unless enabled == SKIP
|
|
46
|
+
@currency = currency unless currency == SKIP
|
|
47
|
+
@additional_properties = additional_properties
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates an instance of the object from a hash.
|
|
51
|
+
def self.from_hash(hash)
|
|
52
|
+
return nil unless hash
|
|
53
|
+
|
|
54
|
+
# Extract variables from the hash.
|
|
55
|
+
enabled = hash['enabled'] ||= false
|
|
56
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
57
|
+
|
|
58
|
+
# Create a new hash for additional properties, removing known properties.
|
|
59
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
60
|
+
|
|
61
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
62
|
+
new_hash, proc { |value| value }
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Create object from extracted values.
|
|
66
|
+
TokenCreateCardDataCvvAuthorize.new(enabled: enabled,
|
|
67
|
+
currency: currency,
|
|
68
|
+
additional_properties: additional_properties)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Validates an instance of the object from a given value.
|
|
72
|
+
# @param [TokenCreateCardDataCvvAuthorize | Hash] The value against the validation is performed.
|
|
73
|
+
def self.validate(value)
|
|
74
|
+
return true if value.instance_of? self
|
|
75
|
+
|
|
76
|
+
return false unless value.instance_of? Hash
|
|
77
|
+
|
|
78
|
+
true
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Provides a human-readable string representation of the object.
|
|
82
|
+
def to_s
|
|
83
|
+
class_name = self.class.name.split('::').last
|
|
84
|
+
"<#{class_name} enabled: #{@enabled}, currency: #{@currency}, additional_properties:"\
|
|
85
|
+
" #{@additional_properties}>"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
89
|
+
def inspect
|
|
90
|
+
class_name = self.class.name.split('::').last
|
|
91
|
+
"<#{class_name} enabled: #{@enabled.inspect}, currency: #{@currency.inspect},"\
|
|
92
|
+
" additional_properties: #{@additional_properties}>"
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|