Class: UnivapayClientSdk::SubscriptionThreeDs

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

Overview

3-D Secure configuration and redirect details applied to the subscription's payments.

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(mode: SKIP, redirect_endpoint: SKIP, redirect_id: SKIP, additional_properties: nil) ⇒ SubscriptionThreeDs

Returns a new instance of SubscriptionThreeDs.



55
56
57
58
59
60
61
62
63
64
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 55

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

  @mode = mode unless mode == SKIP
  @redirect_endpoint = redirect_endpoint unless redirect_endpoint == SKIP
  @redirect_id = redirect_id unless redirect_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#modeSubscriptionThreeDsMode

3-D Secure authentication mode applied to the subscription's payments. if_available enforces 3DS only if credentials are available for the recurring token and it has not already completed 3DS. provided indicates externally supplied MPI authentication data was used.



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

def mode
  @mode
end

#redirect_endpointString

URL the customer is redirected to for 3-D Secure authentication.

Returns:

  • (String)


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

def redirect_endpoint
  @redirect_endpoint
end

#redirect_idUUID | String

Identifier of the 3-D Secure redirect.

Returns:

  • (UUID | String)


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

def redirect_id
  @redirect_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mode = hash.key?('mode') ? hash['mode'] : SKIP
  redirect_endpoint =
    hash.key?('redirect_endpoint') ? hash['redirect_endpoint'] : SKIP
  redirect_id = hash.key?('redirect_id') ? hash['redirect_id'] : SKIP

  # 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.
  SubscriptionThreeDs.new(mode: mode,
                          redirect_endpoint: redirect_endpoint,
                          redirect_id: redirect_id,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mode'] = 'mode'
  @_hash['redirect_endpoint'] = 'redirect_endpoint'
  @_hash['redirect_id'] = 'redirect_id'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
50
51
52
53
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 47

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

.optionalsObject

An array for optional fields



38
39
40
41
42
43
44
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 38

def self.optionals
  %w[
    mode
    redirect_endpoint
    redirect_id
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



92
93
94
95
96
97
98
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 92

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.



108
109
110
111
112
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 108

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

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
# File 'lib/univapay_client_sdk/models/subscription_three_ds.rb', line 101

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