Class: VisaAcceptanceMergedSpec::MultiProcessorRouting

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

Overview

MultiProcessorRouting 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(name: SKIP, response_code: SKIP, reason_code: SKIP, sequence: SKIP, additional_properties: nil) ⇒ MultiProcessorRouting

Returns a new instance of MultiProcessorRouting.



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

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

  @name = name unless name == SKIP
  @response_code = response_code unless response_code == SKIP
  @reason_code = reason_code unless reason_code == SKIP
  @sequence = sequence unless sequence == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#nameString

Name of the Processor.

Returns:

  • (String)


14
15
16
# File 'lib/visa_acceptance_merged_spec/models/multi_processor_routing.rb', line 14

def name
  @name
end

#reason_codeString

Indicates the reason why a request succeeded or failed and possible action to take if a request fails. For details, see the appendix of reason codes in the documentation for the relevant payment method.

Returns:

  • (String)


54
55
56
# File 'lib/visa_acceptance_merged_spec/models/multi_processor_routing.rb', line 54

def reason_code
  @reason_code
end

#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)


47
48
49
# File 'lib/visa_acceptance_merged_spec/models/multi_processor_routing.rb', line 47

def response_code
  @response_code
end

#sequenceString

The order in which the transaction was routed to the processor

Returns:

  • (String)


58
59
60
# File 'lib/visa_acceptance_merged_spec/models/multi_processor_routing.rb', line 58

def sequence
  @sequence
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  response_code = hash.key?('responseCode') ? hash['responseCode'] : SKIP
  reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : SKIP
  sequence = hash.key?('sequence') ? hash['sequence'] : 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.
  MultiProcessorRouting.new(name: name,
                            response_code: response_code,
                            reason_code: reason_code,
                            sequence: sequence,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['response_code'] = 'responseCode'
  @_hash['reason_code'] = 'reasonCode'
  @_hash['sequence'] = 'sequence'
  @_hash
end

.nullablesObject

An array for nullable fields



81
82
83
# File 'lib/visa_acceptance_merged_spec/models/multi_processor_routing.rb', line 81

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    name
    response_code
    reason_code
    sequence
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
# File 'lib/visa_acceptance_merged_spec/models/multi_processor_routing.rb', line 131

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

#to_sObject

Provides a human-readable string representation of the object.



123
124
125
126
127
128
# File 'lib/visa_acceptance_merged_spec/models/multi_processor_routing.rb', line 123

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