Class: CyberSourceMergedSpec::ProcessorInformation10

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_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(approval_code: SKIP, transaction_id: SKIP, forwarded_acquirer_code: SKIP, merchant_number: SKIP, response_code: SKIP, response_source_code: SKIP, ach_verification: SKIP, network_transaction_id: SKIP, settlement_date: SKIP, update_time_utc: SKIP, network: SKIP, merchant_advice: SKIP, additional_properties: nil) ⇒ ProcessorInformation10

Returns a new instance of ProcessorInformation10.



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 198

def initialize(approval_code: SKIP, transaction_id: SKIP,
               forwarded_acquirer_code: SKIP, merchant_number: SKIP,
               response_code: SKIP, response_source_code: SKIP,
               ach_verification: SKIP, network_transaction_id: SKIP,
               settlement_date: SKIP, update_time_utc: SKIP, network: SKIP,
               merchant_advice: 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
  @transaction_id = transaction_id unless transaction_id == SKIP
  @forwarded_acquirer_code = forwarded_acquirer_code unless forwarded_acquirer_code == SKIP
  @merchant_number = merchant_number unless merchant_number == SKIP
  @response_code = response_code unless response_code == SKIP
  @response_source_code = response_source_code unless response_source_code == SKIP
  @ach_verification = ach_verification unless ach_verification == SKIP
  @network_transaction_id = network_transaction_id unless network_transaction_id == SKIP
  @settlement_date = settlement_date unless settlement_date == SKIP
  @update_time_utc = update_time_utc unless update_time_utc == SKIP
  @network = network unless network == SKIP
  @merchant_advice = merchant_advice unless merchant_advice == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#ach_verificationAchVerification

This field is used by Visa only and contains the response source/reason code that identifies the source of the field 39 response decision. Use this field only for clearing with your acquirer.

Returns:



131
132
133
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 131

def ach_verification
  @ach_verification
end

#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/cyber_source_merged_spec/models/processor_information10.rb', line 23

def approval_code
  @approval_code
end

#forwarded_acquirer_codeString

Name of the Japanese acquirer that processed the transaction. Returned only for JCN Gateway. Please contact the CyberSource Japan Support Group for more information.

Returns:

  • (String)


69
70
71
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 69

def forwarded_acquirer_code
  @forwarded_acquirer_code
end

#merchant_adviceMerchantAdvice2

The date and time when the transaction was last updated, in Internet date and time format.

Returns:



155
156
157
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 155

def merchant_advice
  @merchant_advice
end

#merchant_numberString

Identifier that was assigned to you by your acquirer. This value must be printed on the receipt.

Returned by

Authorizations and Credits. This reply field is only supported by merchants who have installed client software on their POS terminals and use these processors:

  • American Express Direct
  • Credit Mutuel-CIC
  • FDC Nashville Global
  • OmniPay Direct
  • SIX

Returns:

  • (String)


84
85
86
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 84

def merchant_number
  @merchant_number
end

#networkNetwork

The date and time when the transaction was last updated, in Internet date and time format.

Returns:



150
151
152
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 150

def network
  @network
end

#network_transaction_idString

Same value as processorInformation.transactionId

Returns:

  • (String)


135
136
137
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 135

def network_transaction_id
  @network_transaction_id
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)


117
118
119
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 117

def response_code
  @response_code
end

#response_source_codeString

This field is used by Visa only and contains the response source/reason code that identifies the source of the field 39 response decision. Use this field only for clearing with your acquirer.

Returns:

  • (String)


124
125
126
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 124

def response_source_code
  @response_source_code
end

#settlement_dateString

Field contains a settlement date. The date is in mmdd format, where: mm = month and dd = day.

Returns:

  • (String)


140
141
142
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 140

def settlement_date
  @settlement_date
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)


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

def transaction_id
  @transaction_id
end

#update_time_utcString

The date and time when the transaction was last updated, in Internet date and time format.

Returns:

  • (String)


145
146
147
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 145

def update_time_utc
  @update_time_utc
end

Class Method Details

.from_element(root) ⇒ Object



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 271

def self.from_element(root)
  approval_code = XmlUtilities.from_element(root, 'approvalCode', String)
  transaction_id = XmlUtilities.from_element(root, 'transactionId', String)
  forwarded_acquirer_code = XmlUtilities.from_element(
    root, 'forwardedAcquirerCode', String
  )
  merchant_number = XmlUtilities.from_element(root, 'merchantNumber',
                                              String)
  response_code = XmlUtilities.from_element(root, 'responseCode', String)
  response_source_code = XmlUtilities.from_element(root,
                                                   'responseSourceCode',
                                                   String)
  ach_verification = XmlUtilities.from_element(root, 'AchVerification',
                                               AchVerification)
  network_transaction_id = XmlUtilities.from_element(root,
                                                     'networkTransactionId',
                                                     String)
  settlement_date = XmlUtilities.from_element(root, 'settlementDate',
                                              String)
  update_time_utc = XmlUtilities.from_element(root, 'updateTimeUtc', String)
  network = XmlUtilities.from_element(root, 'Network', Network)
  merchant_advice = XmlUtilities.from_element(root, 'MerchantAdvice2',
                                              MerchantAdvice2)

  new(approval_code: approval_code,
      transaction_id: transaction_id,
      forwarded_acquirer_code: forwarded_acquirer_code,
      merchant_number: merchant_number,
      response_code: response_code,
      response_source_code: response_source_code,
      ach_verification: ach_verification,
      network_transaction_id: network_transaction_id,
      settlement_date: settlement_date,
      update_time_utc: update_time_utc,
      network: network,
      merchant_advice: merchant_advice,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
264
265
266
267
268
269
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 223

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  approval_code = hash.key?('approvalCode') ? hash['approvalCode'] : SKIP
  transaction_id = hash.key?('transactionId') ? hash['transactionId'] : SKIP
  forwarded_acquirer_code =
    hash.key?('forwardedAcquirerCode') ? hash['forwardedAcquirerCode'] : SKIP
  merchant_number =
    hash.key?('merchantNumber') ? hash['merchantNumber'] : SKIP
  response_code = hash.key?('responseCode') ? hash['responseCode'] : SKIP
  response_source_code =
    hash.key?('responseSourceCode') ? hash['responseSourceCode'] : SKIP
  ach_verification = AchVerification.from_hash(hash['achVerification']) if
    hash['achVerification']
  network_transaction_id =
    hash.key?('networkTransactionId') ? hash['networkTransactionId'] : SKIP
  settlement_date =
    hash.key?('settlementDate') ? hash['settlementDate'] : SKIP
  update_time_utc =
    hash.key?('updateTimeUtc') ? hash['updateTimeUtc'] : SKIP
  network = Network.from_hash(hash['network']) if hash['network']
  merchant_advice = MerchantAdvice2.from_hash(hash['merchantAdvice']) if
    hash['merchantAdvice']

  # 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(approval_code: approval_code,
                             transaction_id: transaction_id,
                             forwarded_acquirer_code: forwarded_acquirer_code,
                             merchant_number: merchant_number,
                             response_code: response_code,
                             response_source_code: response_source_code,
                             ach_verification: ach_verification,
                             network_transaction_id: network_transaction_id,
                             settlement_date: settlement_date,
                             update_time_utc: update_time_utc,
                             network: network,
                             merchant_advice: merchant_advice,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 158

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['approval_code'] = 'approvalCode'
  @_hash['transaction_id'] = 'transactionId'
  @_hash['forwarded_acquirer_code'] = 'forwardedAcquirerCode'
  @_hash['merchant_number'] = 'merchantNumber'
  @_hash['response_code'] = 'responseCode'
  @_hash['response_source_code'] = 'responseSourceCode'
  @_hash['ach_verification'] = 'achVerification'
  @_hash['network_transaction_id'] = 'networkTransactionId'
  @_hash['settlement_date'] = 'settlementDate'
  @_hash['update_time_utc'] = 'updateTimeUtc'
  @_hash['network'] = 'network'
  @_hash['merchant_advice'] = 'merchantAdvice'
  @_hash
end

.nullablesObject

An array for nullable fields



194
195
196
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 194

def self.nullables
  []
end

.optionalsObject

An array for optional fields



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 176

def self.optionals
  %w[
    approval_code
    transaction_id
    forwarded_acquirer_code
    merchant_number
    response_code
    response_source_code
    ach_verification
    network_transaction_id
    settlement_date
    update_time_utc
    network
    merchant_advice
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



352
353
354
355
356
357
358
359
360
361
362
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 352

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} approval_code: #{@approval_code.inspect}, transaction_id:"\
  " #{@transaction_id.inspect}, forwarded_acquirer_code: #{@forwarded_acquirer_code.inspect},"\
  " merchant_number: #{@merchant_number.inspect}, response_code: #{@response_code.inspect},"\
  " response_source_code: #{@response_source_code.inspect}, ach_verification:"\
  " #{@ach_verification.inspect}, network_transaction_id: #{@network_transaction_id.inspect},"\
  " settlement_date: #{@settlement_date.inspect}, update_time_utc:"\
  " #{@update_time_utc.inspect}, network: #{@network.inspect}, merchant_advice:"\
  " #{@merchant_advice.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



340
341
342
343
344
345
346
347
348
349
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 340

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} approval_code: #{@approval_code}, transaction_id: #{@transaction_id},"\
  " forwarded_acquirer_code: #{@forwarded_acquirer_code}, merchant_number:"\
  " #{@merchant_number}, response_code: #{@response_code}, response_source_code:"\
  " #{@response_source_code}, ach_verification: #{@ach_verification}, network_transaction_id:"\
  " #{@network_transaction_id}, settlement_date: #{@settlement_date}, update_time_utc:"\
  " #{@update_time_utc}, network: #{@network}, merchant_advice: #{@merchant_advice},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/cyber_source_merged_spec/models/processor_information10.rb', line 310

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

  XmlUtilities.add_as_subelement(doc, root, 'approvalCode', approval_code)
  XmlUtilities.add_as_subelement(doc, root, 'transactionId', transaction_id)
  XmlUtilities.add_as_subelement(doc, root, 'forwardedAcquirerCode',
                                 forwarded_acquirer_code)
  XmlUtilities.add_as_subelement(doc, root, 'merchantNumber',
                                 merchant_number)
  XmlUtilities.add_as_subelement(doc, root, 'responseCode', response_code)
  XmlUtilities.add_as_subelement(doc, root, 'responseSourceCode',
                                 response_source_code)
  XmlUtilities.add_as_subelement(doc, root, 'AchVerification',
                                 ach_verification)
  XmlUtilities.add_as_subelement(doc, root, 'networkTransactionId',
                                 network_transaction_id)
  XmlUtilities.add_as_subelement(doc, root, 'settlementDate',
                                 settlement_date)
  XmlUtilities.add_as_subelement(doc, root, 'updateTimeUtc',
                                 update_time_utc)
  XmlUtilities.add_as_subelement(doc, root, 'Network', network)
  XmlUtilities.add_as_subelement(doc, root, 'MerchantAdvice2',
                                 merchant_advice)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end