Class: UnivapayClientSdk::TokenResponseCardDataThreeDs

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb

Overview

Token Response Card Data Three Ds schema.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(enabled: SKIP, status: SKIP, redirect_endpoint: SKIP, redirect_id: SKIP, exempted: SKIP, error: SKIP, additional_properties: nil) ⇒ TokenResponseCardDataThreeDs

Returns a new instance of TokenResponseCardDataThreeDs.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 70

def initialize(enabled: SKIP, status: SKIP, redirect_endpoint: SKIP,
               redirect_id: SKIP, exempted: SKIP, error: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @enabled = enabled unless enabled == SKIP
  @status = status unless status == SKIP
  @redirect_endpoint = redirect_endpoint unless redirect_endpoint == SKIP
  @redirect_id = redirect_id unless redirect_id == SKIP
  @exempted = exempted unless exempted == SKIP
  @error = error unless error == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#enabledTrueClass | FalseClass

Enabled value.

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 14

def enabled
  @enabled
end

#errorPaymentError

Payment error details, or null if successful.

Returns:



35
36
37
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 35

def error
  @error
end

#exemptedTrueClass | FalseClass

Indicates if the 3DS check was exempted. When creating charge 3DS check will not be required.

Returns:

  • (TrueClass | FalseClass)


31
32
33
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 31

def exempted
  @exempted
end

#redirect_endpointString

Redirect endpoint URL.

Returns:

  • (String)


22
23
24
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 22

def redirect_endpoint
  @redirect_endpoint
end

#redirect_idUUID | String

Redirect identifier.

Returns:

  • (UUID | String)


26
27
28
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 26

def redirect_id
  @redirect_id
end

#statusTokenResponseCardDataThreeDsStatus

Token Response Card Data Three Ds Status schema.



18
19
20
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 18

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 86

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  redirect_endpoint =
    hash.key?('redirect_endpoint') ? hash['redirect_endpoint'] : SKIP
  redirect_id = hash.key?('redirect_id') ? hash['redirect_id'] : SKIP
  exempted = hash.key?('exempted') ? hash['exempted'] : SKIP
  error = PaymentError.from_hash(hash['error']) if hash['error']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  TokenResponseCardDataThreeDs.new(enabled: enabled,
                                   status: status,
                                   redirect_endpoint: redirect_endpoint,
                                   redirect_id: redirect_id,
                                   exempted: exempted,
                                   error: error,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
47
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['enabled'] = 'enabled'
  @_hash['status'] = 'status'
  @_hash['redirect_endpoint'] = 'redirect_endpoint'
  @_hash['redirect_id'] = 'redirect_id'
  @_hash['exempted'] = 'exempted'
  @_hash['error'] = 'error'
  @_hash
end

.nullablesObject

An array for nullable fields



62
63
64
65
66
67
68
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 62

def self.nullables
  %w[
    redirect_endpoint
    redirect_id
    error
  ]
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
59
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 50

def self.optionals
  %w[
    enabled
    status
    redirect_endpoint
    redirect_id
    exempted
    error
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



117
118
119
120
121
122
123
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 117

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



134
135
136
137
138
139
140
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 134

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled: #{@enabled.inspect}, status: #{@status.inspect},"\
  " redirect_endpoint: #{@redirect_endpoint.inspect}, redirect_id: #{@redirect_id.inspect},"\
  " exempted: #{@exempted.inspect}, error: #{@error.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



126
127
128
129
130
131
# File 'lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb', line 126

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} enabled: #{@enabled}, status: #{@status}, redirect_endpoint:"\
  " #{@redirect_endpoint}, redirect_id: #{@redirect_id}, exempted: #{@exempted}, error:"\
  " #{@error}, additional_properties: #{@additional_properties}>"
end