Class: UnivapayClientSdk::ChargeCreateRequestThreeDs

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

Overview

Charge Create Request Three Ds schema. Either supply mode (and optionally redirect_endpoint) to have Univapay run 3DS, or supply all six external-MPI fields (authentication_value through transaction_status) when 3DS authentication was already completed outside of Univapay — in that case mode is set to provided automatically and must not be sent.

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(redirect_endpoint: SKIP, mode: SKIP, authentication_value: SKIP, eci: SKIP, ds_transaction_id: SKIP, server_transaction_id: SKIP, message_version: SKIP, transaction_status: SKIP, additional_properties: nil) ⇒ ChargeCreateRequestThreeDs

Returns a new instance of ChargeCreateRequestThreeDs.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 97

def initialize(redirect_endpoint: SKIP, mode: SKIP,
               authentication_value: SKIP, eci: SKIP,
               ds_transaction_id: SKIP, server_transaction_id: SKIP,
               message_version: SKIP, transaction_status: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @redirect_endpoint = redirect_endpoint unless redirect_endpoint == SKIP
  @mode = mode unless mode == SKIP
  @authentication_value = authentication_value unless authentication_value == SKIP
  @eci = eci unless eci == SKIP
  @ds_transaction_id = ds_transaction_id unless ds_transaction_id == SKIP
  @server_transaction_id = server_transaction_id unless server_transaction_id == SKIP
  @message_version = message_version unless message_version == SKIP
  @transaction_status = transaction_status unless transaction_status == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#authentication_valueString

External MPI: the cardholder authentication value (CAVV/AAV) returned by the 3-D Secure directory server. Submit together with eci, ds_transaction_id, server_transaction_id, message_version, and transaction_status to provide externally completed 3DS authentication data — either all six fields must be present, or none of them.

Returns:

  • (String)


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

def authentication_value
  @authentication_value
end

#ds_transaction_idString

External MPI: the directory server transaction ID. Submit together with the other external MPI fields.

Returns:

  • (String)


46
47
48
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 46

def ds_transaction_id
  @ds_transaction_id
end

#eciString

External MPI: the two-digit Electronic Commerce Indicator returned by the directory server. Submit together with the other external MPI fields.

Returns:

  • (String)


41
42
43
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 41

def eci
  @eci
end

#message_versionString

External MPI: the 3-D Secure protocol message version (e.g., '2.1.0', '2.2.0'). Submit together with the other external MPI fields.

Returns:

  • (String)


56
57
58
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 56

def message_version
  @message_version
end

#modeChargeCreateRequestThreeDsMode

3D-Secure authentication type. App Token Secret is required to use 'skip'. if_available enforces 3DS only if credentials are available for the recurring token and it has not already completed 3DS. provided is set automatically by the server when external MPI authentication data (authentication_value, eci, etc.) is submitted on the request and cannot be set manually. When omitted, the store's default 3DS policy applies — do not assume 'normal'.



28
29
30
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 28

def mode
  @mode
end

#redirect_endpointString

URL to redirect the customer to after 3DS authentication.

Returns:

  • (String)


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

def redirect_endpoint
  @redirect_endpoint
end

#server_transaction_idString

External MPI: the 3DS server transaction ID. Submit together with the other external MPI fields.

Returns:

  • (String)


51
52
53
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 51

def server_transaction_id
  @server_transaction_id
end

#transaction_statusString

External MPI: the 3-D Secure directory server transaction status. Only a successful authentication status is accepted. Submit together with the other external MPI fields.

Returns:

  • (String)


62
63
64
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 62

def transaction_status
  @transaction_status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 117

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  redirect_endpoint =
    hash.key?('redirect_endpoint') ? hash['redirect_endpoint'] : SKIP
  mode = hash.key?('mode') ? hash['mode'] : SKIP
  authentication_value =
    hash.key?('authentication_value') ? hash['authentication_value'] : SKIP
  eci = hash.key?('eci') ? hash['eci'] : SKIP
  ds_transaction_id =
    hash.key?('ds_transaction_id') ? hash['ds_transaction_id'] : SKIP
  server_transaction_id =
    hash.key?('server_transaction_id') ? hash['server_transaction_id'] : SKIP
  message_version =
    hash.key?('message_version') ? hash['message_version'] : SKIP
  transaction_status =
    hash.key?('transaction_status') ? hash['transaction_status'] : 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.
  ChargeCreateRequestThreeDs.new(redirect_endpoint: redirect_endpoint,
                                 mode: mode,
                                 authentication_value: authentication_value,
                                 eci: eci,
                                 ds_transaction_id: ds_transaction_id,
                                 server_transaction_id: server_transaction_id,
                                 message_version: message_version,
                                 transaction_status: transaction_status,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 65

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['redirect_endpoint'] = 'redirect_endpoint'
  @_hash['mode'] = 'mode'
  @_hash['authentication_value'] = 'authentication_value'
  @_hash['eci'] = 'eci'
  @_hash['ds_transaction_id'] = 'ds_transaction_id'
  @_hash['server_transaction_id'] = 'server_transaction_id'
  @_hash['message_version'] = 'message_version'
  @_hash['transaction_status'] = 'transaction_status'
  @_hash
end

.nullablesObject

An array for nullable fields



93
94
95
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 93

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 79

def self.optionals
  %w[
    redirect_endpoint
    mode
    authentication_value
    eci
    ds_transaction_id
    server_transaction_id
    message_version
    transaction_status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



166
167
168
169
170
171
172
173
174
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 166

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} redirect_endpoint: #{@redirect_endpoint.inspect}, mode: #{@mode.inspect},"\
  " authentication_value: #{@authentication_value.inspect}, eci: #{@eci.inspect},"\
  " ds_transaction_id: #{@ds_transaction_id.inspect}, server_transaction_id:"\
  " #{@server_transaction_id.inspect}, message_version: #{@message_version.inspect},"\
  " transaction_status: #{@transaction_status.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



156
157
158
159
160
161
162
163
# File 'lib/univapay_client_sdk/models/charge_create_request_three_ds.rb', line 156

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} redirect_endpoint: #{@redirect_endpoint}, mode: #{@mode},"\
  " authentication_value: #{@authentication_value}, eci: #{@eci}, ds_transaction_id:"\
  " #{@ds_transaction_id}, server_transaction_id: #{@server_transaction_id}, message_version:"\
  " #{@message_version}, transaction_status: #{@transaction_status}, additional_properties:"\
  " #{@additional_properties}>"
end