Class: OpenapiClient::TransactionErrorResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_client/models/transaction_error_response.rb

Overview

Transaction response with error field included.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TransactionErrorResponse

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {}) —

    Model attributes in the form of hash



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/openapi_client/models/transaction_error_response.rb', line 162

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'clientRequestId')
    self.client_request_id = attributes[:'clientRequestId']
  end

  if attributes.has_key?(:'apiTraceId')
    self.api_trace_id = attributes[:'apiTraceId']
  end

  if attributes.has_key?(:'responseType')
    self.response_type = attributes[:'responseType']
  end

  if attributes.has_key?(:'ipgTransactionId')
    self.ipg_transaction_id = attributes[:'ipgTransactionId']
  end

  if attributes.has_key?(:'orderId')
    self.order_id = attributes[:'orderId']
  end

  if attributes.has_key?(:'transactionType')
    self.transaction_type = attributes[:'transactionType']
  end

  if attributes.has_key?(:'paymentToken')
    self.payment_token = attributes[:'paymentToken']
  end

  if attributes.has_key?(:'transactionOrigin')
    self.transaction_origin = attributes[:'transactionOrigin']
  end

  if attributes.has_key?(:'paymentMethodDetails')
    self.payment_method_details = attributes[:'paymentMethodDetails']
  end

  if attributes.has_key?(:'country')
    self.country = attributes[:'country']
  end

  if attributes.has_key?(:'terminalId')
    self.terminal_id = attributes[:'terminalId']
  end

  if attributes.has_key?(:'merchantTransactionId')
    self.merchant_transaction_id = attributes[:'merchantTransactionId']
  end

  if attributes.has_key?(:'transactionTime')
    self.transaction_time = attributes[:'transactionTime']
  end

  if attributes.has_key?(:'approvedAmount')
    self.approved_amount = attributes[:'approvedAmount']
  end

  if attributes.has_key?(:'transactionStatus')
    self.transaction_status = attributes[:'transactionStatus']
  end

  if attributes.has_key?(:'transactionState')
    self.transaction_state = attributes[:'transactionState']
  end

  if attributes.has_key?(:'secure3dResponse')
    self.secure3d_response = attributes[:'secure3dResponse']
  end

  if attributes.has_key?(:'redirectURL')
    self.redirect_url = attributes[:'redirectURL']
  end

  if attributes.has_key?(:'authenticationRedirect')
    self.authentication_redirect = attributes[:'authenticationRedirect']
  end

  if attributes.has_key?(:'schemeTransactionId')
    self.scheme_transaction_id = attributes[:'schemeTransactionId']
  end

  if attributes.has_key?(:'processor')
    self.processor = attributes[:'processor']
  end

  if attributes.has_key?(:'additionalDetails')
    self.additional_details = attributes[:'additionalDetails']
  end

  if attributes.has_key?(:'accountUpdaterResponse')
    self. = attributes[:'accountUpdaterResponse']
  end

  if attributes.has_key?(:'error')
    self.error = attributes[:'error']
  end
end

Instance Attribute Details

#account_updater_response ⇒ Object

Returns the value of attribute account_updater_response.



74
75
76
# File 'lib/openapi_client/models/transaction_error_response.rb', line 74

def 
  @account_updater_response
end

#additional_details ⇒ Object

Returns the value of attribute additional_details.



72
73
74
# File 'lib/openapi_client/models/transaction_error_response.rb', line 72

def additional_details
  @additional_details
end

#api_trace_id ⇒ Object

Request identifier in API, can be used to request logs from the support team.



22
23
24
# File 'lib/openapi_client/models/transaction_error_response.rb', line 22

def api_trace_id
  @api_trace_id
end

#approved_amount ⇒ Object

Returns the value of attribute approved_amount.



52
53
54
# File 'lib/openapi_client/models/transaction_error_response.rb', line 52

def approved_amount
  @approved_amount
end

#authentication_redirect ⇒ Object

Returns the value of attribute authentication_redirect.



65
66
67
# File 'lib/openapi_client/models/transaction_error_response.rb', line 65

def authentication_redirect
  @authentication_redirect
end

#client_request_id ⇒ Object

Echoes back the value in the request header for tracking.



19
20
21
# File 'lib/openapi_client/models/transaction_error_response.rb', line 19

def client_request_id
  @client_request_id
end

#country ⇒ Object

Country of the card issuer.



41
42
43
# File 'lib/openapi_client/models/transaction_error_response.rb', line 41

def country
  @country
end

#error ⇒ Object

Returns the value of attribute error.



76
77
78
# File 'lib/openapi_client/models/transaction_error_response.rb', line 76

def error
  @error
end

#ipg_transaction_id ⇒ Object

The response transaction ID.



27
28
29
# File 'lib/openapi_client/models/transaction_error_response.rb', line 27

def ipg_transaction_id
  @ipg_transaction_id
end

#merchant_transaction_id ⇒ Object

The unique merchant transaction ID from the request header, if supplied.



47
48
49
# File 'lib/openapi_client/models/transaction_error_response.rb', line 47

def merchant_transaction_id
  @merchant_transaction_id
end

#order_id ⇒ Object

Client order ID if supplied by client, otherwise the order ID.



30
31
32
# File 'lib/openapi_client/models/transaction_error_response.rb', line 30

def order_id
  @order_id
end

#payment_method_details ⇒ Object

Returns the value of attribute payment_method_details.



38
39
40
# File 'lib/openapi_client/models/transaction_error_response.rb', line 38

def payment_method_details
  @payment_method_details
end

#payment_token ⇒ Object

Returns the value of attribute payment_token.



34
35
36
# File 'lib/openapi_client/models/transaction_error_response.rb', line 34

def payment_token
  @payment_token
end

#processor ⇒ Object

Returns the value of attribute processor.



70
71
72
# File 'lib/openapi_client/models/transaction_error_response.rb', line 70

def processor
  @processor
end

#redirect_url ⇒ Object

The endpoint redirection URL.



63
64
65
# File 'lib/openapi_client/models/transaction_error_response.rb', line 63

def redirect_url
  @redirect_url
end

#response_type ⇒ Object

Returns the value of attribute response_type.



24
25
26
# File 'lib/openapi_client/models/transaction_error_response.rb', line 24

def response_type
  @response_type
end

#scheme_transaction_id ⇒ Object

The transaction ID received from schemes for the initial transaction of card on file flows.



68
69
70
# File 'lib/openapi_client/models/transaction_error_response.rb', line 68

def scheme_transaction_id
  @scheme_transaction_id
end

#secure3d_response ⇒ Object

Returns the value of attribute secure3d_response.



60
61
62
# File 'lib/openapi_client/models/transaction_error_response.rb', line 60

def secure3d_response
  @secure3d_response
end

#terminal_id ⇒ Object

The terminal that is processing the transaction.



44
45
46
# File 'lib/openapi_client/models/transaction_error_response.rb', line 44

def terminal_id
  @terminal_id
end

#transaction_origin ⇒ Object

Returns the value of attribute transaction_origin.



36
37
38
# File 'lib/openapi_client/models/transaction_error_response.rb', line 36

def transaction_origin
  @transaction_origin
end

#transaction_state ⇒ Object

The state of the transaction.



58
59
60
# File 'lib/openapi_client/models/transaction_error_response.rb', line 58

def transaction_state
  @transaction_state
end

#transaction_status ⇒ Object

The status of the transaction. APPROVED/WAITING are returned by the endpoints. VALIDATION_FAILED/DECLINED are errors. See ErrorResponse object for details.



55
56
57
# File 'lib/openapi_client/models/transaction_error_response.rb', line 55

def transaction_status
  @transaction_status
end

#transaction_time ⇒ Object

The transaction time in seconds since epoch.



50
51
52
# File 'lib/openapi_client/models/transaction_error_response.rb', line 50

def transaction_time
  @transaction_time
end

#transaction_type ⇒ Object

Returns the value of attribute transaction_type.



32
33
34
# File 'lib/openapi_client/models/transaction_error_response.rb', line 32

def transaction_type
  @transaction_type
end

Class Method Details

.attribute_map ⇒ Object

Attribute mapping from ruby-style variable name to JSON key.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/openapi_client/models/transaction_error_response.rb', line 101

def self.attribute_map
  {
    :'client_request_id' => :'clientRequestId',
    :'api_trace_id' => :'apiTraceId',
    :'response_type' => :'responseType',
    :'ipg_transaction_id' => :'ipgTransactionId',
    :'order_id' => :'orderId',
    :'transaction_type' => :'transactionType',
    :'payment_token' => :'paymentToken',
    :'transaction_origin' => :'transactionOrigin',
    :'payment_method_details' => :'paymentMethodDetails',
    :'country' => :'country',
    :'terminal_id' => :'terminalId',
    :'merchant_transaction_id' => :'merchantTransactionId',
    :'transaction_time' => :'transactionTime',
    :'approved_amount' => :'approvedAmount',
    :'transaction_status' => :'transactionStatus',
    :'transaction_state' => :'transactionState',
    :'secure3d_response' => :'secure3dResponse',
    :'redirect_url' => :'redirectURL',
    :'authentication_redirect' => :'authenticationRedirect',
    :'scheme_transaction_id' => :'schemeTransactionId',
    :'processor' => :'processor',
    :'additional_details' => :'additionalDetails',
    :'account_updater_response' => :'accountUpdaterResponse',
    :'error' => :'error'
  }
end

.openapi_types ⇒ Object

Attribute type mapping.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/openapi_client/models/transaction_error_response.rb', line 131

def self.openapi_types
  {
    :'client_request_id' => :'String',
    :'api_trace_id' => :'String',
    :'response_type' => :'ResponseType',
    :'ipg_transaction_id' => :'String',
    :'order_id' => :'String',
    :'transaction_type' => :'TransactionType',
    :'payment_token' => :'PaymentTokenDetails',
    :'transaction_origin' => :'TransactionOrigin',
    :'payment_method_details' => :'PaymentMethodDetails',
    :'country' => :'String',
    :'terminal_id' => :'String',
    :'merchant_transaction_id' => :'String',
    :'transaction_time' => :'Integer',
    :'approved_amount' => :'Amount',
    :'transaction_status' => :'String',
    :'transaction_state' => :'String',
    :'secure3d_response' => :'Secure3dResponse',
    :'redirect_url' => :'String',
    :'authentication_redirect' => :'AuthenticationRedirect',
    :'scheme_transaction_id' => :'String',
    :'processor' => :'ProcessorData',
    :'additional_details' => :'AdditionalTransactionDetails',
    :'account_updater_response' => :'AccountUpdaterResponse',
    :'error' => :'Error'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/openapi_client/models/transaction_error_response.rb', line 334

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      client_request_id == o.client_request_id &&
      api_trace_id == o.api_trace_id &&
      response_type == o.response_type &&
      ipg_transaction_id == o.ipg_transaction_id &&
      order_id == o.order_id &&
      transaction_type == o.transaction_type &&
      payment_token == o.payment_token &&
      transaction_origin == o.transaction_origin &&
      payment_method_details == o.payment_method_details &&
      country == o.country &&
      terminal_id == o.terminal_id &&
      merchant_transaction_id == o.merchant_transaction_id &&
      transaction_time == o.transaction_time &&
      approved_amount == o.approved_amount &&
      transaction_status == o.transaction_status &&
      transaction_state == o.transaction_state &&
      secure3d_response == o.secure3d_response &&
      redirect_url == o.redirect_url &&
      authentication_redirect == o.authentication_redirect &&
      scheme_transaction_id == o.scheme_transaction_id &&
      processor == o.processor &&
      additional_details == o.additional_details &&
       == o. &&
      error == o.error
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string —

    type Data type

  • string —

    value Value to be deserialized

Returns:

  • (Object) —

    Deserialized data



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/openapi_client/models/transaction_error_response.rb', line 399

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = OpenapiClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object) —

    Any valid value

Returns:

  • (Hash) —

    Returns the value in the form of hash



465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/openapi_client/models/transaction_error_response.rb', line 465

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash) —

    Model attributes in the form of hash

Returns:

  • (Object) —

    Returns the model itself



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/openapi_client/models/transaction_error_response.rb', line 378

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


365
366
367
# File 'lib/openapi_client/models/transaction_error_response.rb', line 365

def eql?(o)
  self == o
end

#hash ⇒ Fixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum) —

    Hash code



371
372
373
# File 'lib/openapi_client/models/transaction_error_response.rb', line 371

def hash
  [client_request_id, api_trace_id, response_type, ipg_transaction_id, order_id, transaction_type, payment_token, transaction_origin, payment_method_details, country, terminal_id, merchant_transaction_id, transaction_time, approved_amount, transaction_status, transaction_state, secure3d_response, redirect_url, authentication_redirect, scheme_transaction_id, processor, additional_details, , error].hash
end

#list_invalid_properties ⇒ Object

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/openapi_client/models/transaction_error_response.rb', line 267

def list_invalid_properties
  invalid_properties = Array.new
  if !@merchant_transaction_id.nil? && @merchant_transaction_id.to_s.length > 40
    invalid_properties.push('invalid value for "merchant_transaction_id", the character length must be smaller than or equal to 40.')
  end

  if !@scheme_transaction_id.nil? && @scheme_transaction_id.to_s.length > 40
    invalid_properties.push('invalid value for "scheme_transaction_id", the character length must be smaller than or equal to 40.')
  end

  invalid_properties
end

#to_body ⇒ Hash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash) —

    Returns the object in the form of hash



445
446
447
# File 'lib/openapi_client/models/transaction_error_response.rb', line 445

def to_body
  to_hash
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



451
452
453
454
455
456
457
458
459
# File 'lib/openapi_client/models/transaction_error_response.rb', line 451

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_s ⇒ String

Returns the string representation of the object

Returns:

  • (String) —

    String presentation of the object



439
440
441
# File 'lib/openapi_client/models/transaction_error_response.rb', line 439

def to_s
  to_hash.to_s
end

#valid? ⇒ Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean) —

    true if the model is valid



282
283
284
285
286
287
288
289
290
# File 'lib/openapi_client/models/transaction_error_response.rb', line 282

def valid?
  return false if !@merchant_transaction_id.nil? && @merchant_transaction_id.to_s.length > 40
  transaction_status_validator = EnumAttributeValidator.new('String', ['APPROVED', 'WAITING', 'VALIDATION_FAILED', 'PROCESSING_FAILED', 'DECLINED'])
  return false unless transaction_status_validator.valid?(@transaction_status)
  transaction_state_validator = EnumAttributeValidator.new('String', ['AUTHORIZED', 'CAPTURED', 'DECLINED', 'CHECKED', 'COMPLETED_GET', 'INITIALIZED', 'PENDING', 'READY', 'TEMPLATE', 'SETTLED', 'VOIDED', 'WAITING'])
  return false unless transaction_state_validator.valid?(@transaction_state)
  return false if !@scheme_transaction_id.nil? && @scheme_transaction_id.to_s.length > 40
  true
end