Class: VisaAcceptanceMergedSpec::ProcessorInformation18

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

Overview

ProcessorInformation18 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(approval_code: SKIP, response_code: SKIP, additional_properties: nil) ⇒ ProcessorInformation18

Returns a new instance of ProcessorInformation18.



79
80
81
82
83
84
85
86
87
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 79

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

  @approval_code = approval_code unless approval_code == SKIP
  @response_code = response_code unless response_code == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#approval_codeString

Authorization code. Returned only when the processor returns this value. The length of this value depends on your processor. Returned by authorization service.

PIN debit

Authorization code that is returned by the processor. Returned by PIN debit credit.

Elavon Encrypted Account Number Program

The returned value is OFFLINE.

TSYS Acquiring Solutions

The returned value for a successful zero amount authorization is 000000.

Returns:

  • (String)


23
24
25
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 23

def approval_code
  @approval_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)


56
57
58
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 56

def response_code
  @response_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 90

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  approval_code = hash.key?('approvalCode') ? hash['approvalCode'] : SKIP
  response_code = hash.key?('responseCode') ? hash['responseCode'] : 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.
  ProcessorInformation18.new(approval_code: approval_code,
                             response_code: response_code,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



59
60
61
62
63
64
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 59

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['approval_code'] = 'approvalCode'
  @_hash['response_code'] = 'responseCode'
  @_hash
end

.nullablesObject

An array for nullable fields



75
76
77
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 75

def self.nullables
  []
end

.optionalsObject

An array for optional fields



67
68
69
70
71
72
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 67

def self.optionals
  %w[
    approval_code
    response_code
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 118

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

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
# File 'lib/visa_acceptance_merged_spec/models/processor_information18.rb', line 111

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