Class: CyberSourceMergedSpec::ProcessorInformation20

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/processor_information20.rb

Overview

ProcessorInformation20 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(transaction_id: SKIP, trade_number: SKIP, raw_response: SKIP, raw_response_local: SKIP, response_details: SKIP, response_code: SKIP, seller_protection: SKIP, avs: SKIP, additional_properties: nil) ⇒ ProcessorInformation20

Returns a new instance of ProcessorInformation20.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 114

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

  @transaction_id = transaction_id unless transaction_id == SKIP
  @trade_number = trade_number unless trade_number == SKIP
  @raw_response = raw_response unless raw_response == SKIP
  @raw_response_local = raw_response_local unless raw_response_local == SKIP
  @response_details = response_details unless response_details == SKIP
  @response_code = response_code unless response_code == SKIP
  @seller_protection = seller_protection unless seller_protection == SKIP
  @avs = avs unless avs == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#avsAvs1

This field is set to the value of response code returned by the processor.

Returns:



79
80
81
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 79

def avs
  @avs
end

#raw_responseString

Failure reason returned by the processor.

Returns:

  • (String)


58
59
60
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 58

def raw_response
  @raw_response
end

#raw_response_localString

Failure reason returned by the processor in the local language of the processor.

Returns:

  • (String)


63
64
65
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 63

def raw_response_local
  @raw_response_local
end

#response_codeString

This field is set to the value of response code returned by the processor.

Returns:

  • (String)


71
72
73
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 71

def response_code
  @response_code
end

#response_detailsString

This field might contain information about a decline.

Returns:

  • (String)


67
68
69
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 67

def response_details
  @response_details
end

#seller_protectionProcessorInformationSellerProtection

This field is set to the value of response code returned by the processor.



75
76
77
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 75

def seller_protection
  @seller_protection
end

#trade_numberString

The description for this field is not available.

Returns:

  • (String)


54
55
56
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 54

def trade_number
  @trade_number
end

#transaction_idString

Network transaction identifier (TID). You can use this value to identify a specific transaction when you are discussing the transaction with your processor. Not all processors provide this value. Returned by the authorization service.

PIN debit

Transaction identifier generated by the processor. Returned by PIN debit credit.

GPX

Processor transaction ID.

Cielo

For Cielo, this value is the non-sequential unit (NSU) and is supported for all transactions. The value is generated by Cielo or the issuing bank.

Comercio Latino

For Comercio Latino, this value is the proof of sale or non-sequential unit (NSU) number generated by the acquirers Cielo and Rede, or the issuing bank.

CyberSource through VisaNet and GPN

For details about this value for CyberSource through VisaNet and GPN, see "processorInformation.networkTransactionId" in [REST API Fields](https://developer.cybersource.com/content/dam/docs/cybs/en-us/apif ields/reference/all/rest/api-fields.pdf)

Moneris

This value identifies the transaction on a host system. It contains the following information:

  • Terminal used to process the transaction
  • Shift during which the transaction took place
  • Batch number
  • Transaction number within the batch You must store this value. If you give the customer a receipt, display this value on the receipt. Example For the value 66012345001069003:
  • Terminal ID = 66012345
  • Shift number = 001
  • Batch number = 069
  • Transaction number = 003

Returns:

  • (String)


50
51
52
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 50

def transaction_id
  @transaction_id
end

Class Method Details

.from_element(root) ⇒ Object



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
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 169

def self.from_element(root)
  transaction_id = XmlUtilities.from_element(root, 'transactionId', String)
  trade_number = XmlUtilities.from_element(root, 'tradeNumber', String)
  raw_response = XmlUtilities.from_element(root, 'rawResponse', String)
  raw_response_local = XmlUtilities.from_element(root, 'rawResponseLocal',
                                                 String)
  response_details = XmlUtilities.from_element(root, 'responseDetails',
                                               String)
  response_code = XmlUtilities.from_element(root, 'responseCode', String)
  seller_protection = XmlUtilities.from_element(
    root, 'processorInformationSellerProtection',
    ProcessorInformationSellerProtection
  )
  avs = XmlUtilities.from_element(root, 'Avs1', Avs1)

  new(transaction_id: transaction_id,
      trade_number: trade_number,
      raw_response: raw_response,
      raw_response_local: raw_response_local,
      response_details: response_details,
      response_code: response_code,
      seller_protection: seller_protection,
      avs: avs,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
159
160
161
162
163
164
165
166
167
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 133

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  transaction_id = hash.key?('transactionId') ? hash['transactionId'] : SKIP
  trade_number = hash.key?('tradeNumber') ? hash['tradeNumber'] : SKIP
  raw_response = hash.key?('rawResponse') ? hash['rawResponse'] : SKIP
  raw_response_local =
    hash.key?('rawResponseLocal') ? hash['rawResponseLocal'] : SKIP
  response_details =
    hash.key?('responseDetails') ? hash['responseDetails'] : SKIP
  response_code = hash.key?('responseCode') ? hash['responseCode'] : SKIP
  if hash['sellerProtection']
    seller_protection = ProcessorInformationSellerProtection.from_hash(hash['sellerProtection'])
  end
  avs = Avs1.from_hash(hash['avs']) if hash['avs']

  # 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.
  ProcessorInformation20.new(transaction_id: transaction_id,
                             trade_number: trade_number,
                             raw_response: raw_response,
                             raw_response_local: raw_response_local,
                             response_details: response_details,
                             response_code: response_code,
                             seller_protection: seller_protection,
                             avs: avs,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 82

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['transaction_id'] = 'transactionId'
  @_hash['trade_number'] = 'tradeNumber'
  @_hash['raw_response'] = 'rawResponse'
  @_hash['raw_response_local'] = 'rawResponseLocal'
  @_hash['response_details'] = 'responseDetails'
  @_hash['response_code'] = 'responseCode'
  @_hash['seller_protection'] = 'sellerProtection'
  @_hash['avs'] = 'avs'
  @_hash
end

.nullablesObject

An array for nullable fields



110
111
112
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 110

def self.nullables
  []
end

.optionalsObject

An array for optional fields



96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 96

def self.optionals
  %w[
    transaction_id
    trade_number
    raw_response
    raw_response_local
    response_details
    response_code
    seller_protection
    avs
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



227
228
229
230
231
232
233
234
235
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 227

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

#to_sObject

Provides a human-readable string representation of the object.



217
218
219
220
221
222
223
224
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 217

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

#to_xml_element(doc, root_name) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/cyber_source_merged_spec/models/processor_information20.rb', line 195

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'transactionId', transaction_id)
  XmlUtilities.add_as_subelement(doc, root, 'tradeNumber', trade_number)
  XmlUtilities.add_as_subelement(doc, root, 'rawResponse', raw_response)
  XmlUtilities.add_as_subelement(doc, root, 'rawResponseLocal',
                                 raw_response_local)
  XmlUtilities.add_as_subelement(doc, root, 'responseDetails',
                                 response_details)
  XmlUtilities.add_as_subelement(doc, root, 'responseCode', response_code)
  XmlUtilities.add_as_subelement(doc, root,
                                 'processorInformationSellerProtection',
                                 seller_protection)
  XmlUtilities.add_as_subelement(doc, root, 'Avs1', avs)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end