Class: UnivapayClientSdk::ThreeDsIssuerToken

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

Overview

3-D Secure issuer token payload.

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(issuer_token:, content_type:, payload: SKIP, additional_properties: nil) ⇒ ThreeDsIssuerToken

Returns a new instance of ThreeDsIssuerToken.



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/univapay_client_sdk/models/three_ds_issuer_token.rb', line 63

def initialize(issuer_token:, content_type:, payload: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @payment_type = 'card'
  @issuer_token = issuer_token
  @call_method = 'http_post'
  @payload = payload unless payload == SKIP
  @content_type = content_type
  @additional_properties = additional_properties
end

Instance Attribute Details

#call_methodString (readonly)

Execution method. Currently, only 'http_post' is supported.

Returns:

  • (String)


23
24
25
# File 'lib/univapay_client_sdk/models/three_ds_issuer_token.rb', line 23

def call_method
  @call_method
end

#content_typeString

The expected content type of the payload required by the card issuer's endpoint (e.g., 'application/x-www-form-urlencoded; charset=UTF-8').

Returns:

  • (String)


36
37
38
# File 'lib/univapay_client_sdk/models/three_ds_issuer_token.rb', line 36

def content_type
  @content_type
end

#issuer_tokenString

The 3-D Secure authentication URL to which the client must send the request.

Returns:

  • (String)


19
20
21
# File 'lib/univapay_client_sdk/models/three_ds_issuer_token.rb', line 19

def issuer_token
  @issuer_token
end

#payloadIssuerTokenPayload

Key-value pairs required to complete the payment action, or null if not applicable. Used when call_method is http_post. When present, this JSON must be converted by the client to match the expected content_type (e.g., transformed into an application/x-www-form-urlencoded string) before sending the POST request.

Returns:



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

def payload
  @payload
end

#payment_typeString (readonly)

Only 'card' is supported for 3-D Secure issuer tokens.

Returns:

  • (String)


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

def payment_type
  @payment_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/univapay_client_sdk/models/three_ds_issuer_token.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  issuer_token = hash.key?('issuer_token') ? hash['issuer_token'] : nil
  content_type = hash.key?('content_type') ? hash['content_type'] : nil
  payload = IssuerTokenPayload.from_hash(hash['payload']) if hash['payload']

  # 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.
  ThreeDsIssuerToken.new(issuer_token: issuer_token,
                         content_type: content_type,
                         payload: payload,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_type'] = 'payment_type'
  @_hash['issuer_token'] = 'issuer_token'
  @_hash['call_method'] = 'call_method'
  @_hash['payload'] = 'payload'
  @_hash['content_type'] = 'content_type'
  @_hash
end

.nullablesObject

An array for nullable fields



57
58
59
60
61
# File 'lib/univapay_client_sdk/models/three_ds_issuer_token.rb', line 57

def self.nullables
  %w[
    payload
  ]
end

.optionalsObject

An array for optional fields



50
51
52
53
54
# File 'lib/univapay_client_sdk/models/three_ds_issuer_token.rb', line 50

def self.optionals
  %w[
    payload
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type.inspect}, issuer_token:"\
  " #{@issuer_token.inspect}, call_method: #{@call_method.inspect}, payload:"\
  " #{@payload.inspect}, content_type: #{@content_type.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} payment_type: #{@payment_type}, issuer_token: #{@issuer_token},"\
  " call_method: #{@call_method}, payload: #{@payload}, content_type: #{@content_type},"\
  " additional_properties: #{@additional_properties}>"
end