Class: VisaAcceptanceMergedSpec::ProcessorInformation10

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/processor_information10.rb

Overview

ProcessorInformation10 Model.

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(response_code: SKIP, response_details: SKIP, transaction_id: SKIP, additional_properties: nil) ⇒ ProcessorInformation10

Returns a new instance of ProcessorInformation10.



84
85
86
87
88
89
90
91
92
93
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 84

def initialize(response_code: SKIP, response_details: SKIP,
               transaction_id: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @response_code = response_code unless response_code == SKIP
  @response_details = response_details unless response_details == SKIP
  @transaction_id = transaction_id unless transaction_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#response_codeString

For most processors, this is the error message sent directly from the bank. Returned only when the processor returns this value. Important Do not use this field to evaluate the result of the authorization.

PIN debit

Response value that is returned by the processor or bank. Important Do not use this field to evaluate the results of the transaction request. Returned by PIN debit credit, PIN debit purchase, and PIN debit reversal.

AIBMS

If this value is 08, you can accept the transaction if the customer provides you with identification.

Atos

This value is the response code sent from Atos and it might also include the response code from the bank. Format: aa,bb with the two values separated by a comma and where:

  • aa is the two-digit error message from Atos.
  • bb is the optional two-digit error message from the bank.

Comercio Latino

This value is the status code and the error or response code received from the processor separated by a colon. Format: [status code]:E[error code] or [status code]:R[response code] Example 2:R06

JCN Gateway

Processor-defined detail error code. The associated response category code is in the processorInformation.responseCategoryCode field. String (3)

paypalgateway

Processor generated ID for the itemized detail.

Returns:

  • (String)


43
44
45
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 43

def response_code
  @response_code
end

#response_detailsString

The reason for when the transaction status is Pending or Reversed. Possible values:

  • PAYER_SHIPPING_UNCONFIRMED
  • MULTI_CURRENCY
  • RISK_REVIEW
  • REGULATORY_REVIEW
  • VERIFICATION_REQUIRED
  • ORDER
  • OTHER

Returns:

  • (String)


55
56
57
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 55

def response_details
  @response_details
end

#transaction_idString

Identifier of the order transaction.

Returns:

  • (String)


59
60
61
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 59

def transaction_id
  @transaction_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 96

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  response_code = hash.key?('responseCode') ? hash['responseCode'] : SKIP
  response_details =
    hash.key?('responseDetails') ? hash['responseDetails'] : SKIP
  transaction_id = hash.key?('transactionId') ? hash['transactionId'] : 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.
  ProcessorInformation10.new(response_code: response_code,
                             response_details: response_details,
                             transaction_id: transaction_id,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['response_code'] = 'responseCode'
  @_hash['response_details'] = 'responseDetails'
  @_hash['transaction_id'] = 'transactionId'
  @_hash
end

.nullablesObject

An array for nullable fields



80
81
82
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 80

def self.nullables
  []
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
77
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 71

def self.optionals
  %w[
    response_code
    response_details
    transaction_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



127
128
129
130
131
132
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 127

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

#to_sObject

Provides a human-readable string representation of the object.



120
121
122
123
124
# File 'lib/visa_acceptance_merged_spec/models/processor_information10.rb', line 120

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