Class: CyberSourceMergedSpec::ProcessorInformation25

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

Overview

ProcessorInformation25 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, payment_url: SKIP, response_details: SKIP, token: SKIP, response_code: SKIP, additional_properties: nil) ⇒ ProcessorInformation25

Returns a new instance of ProcessorInformation25.



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

def initialize(transaction_id: SKIP, payment_url: SKIP,
               response_details: SKIP, token: SKIP, response_code: 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
  @payment_url = payment_url unless payment_url == SKIP
  @response_details = response_details unless response_details == SKIP
  @token = token unless token == SKIP
  @response_code = response_code unless response_code == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#payment_urlString

Direct the customer to this URL to complete the payment.

Returns:

  • (String)


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

def payment_url
  @payment_url
end

#response_codeString

Transaction status from the processor.

Returns:

  • (String)


66
67
68
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 66

def response_code
  @response_code
end

#response_detailsString

This field might contain information about a decline.

Returns:

  • (String)


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

def response_details
  @response_details
end

#tokenString

Payment gateway/processor assigned session token.

Returns:

  • (String)


62
63
64
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 62

def token
  @token
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_information25.rb', line 50

def transaction_id
  @transaction_id
end

Class Method Details

.from_element(root) ⇒ Object



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 137

def self.from_element(root)
  transaction_id = XmlUtilities.from_element(root, 'transactionId', String)
  payment_url = XmlUtilities.from_element(root, 'paymentUrl', String)
  response_details = XmlUtilities.from_element(root, 'responseDetails',
                                               String)
  token = XmlUtilities.from_element(root, 'token', String)
  response_code = XmlUtilities.from_element(root, 'responseCode', String)

  new(transaction_id: transaction_id,
      payment_url: payment_url,
      response_details: response_details,
      token: token,
      response_code: response_code,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 110

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



69
70
71
72
73
74
75
76
77
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 69

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

.nullablesObject

An array for nullable fields



91
92
93
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 91

def self.nullables
  []
end

.optionalsObject

An array for optional fields



80
81
82
83
84
85
86
87
88
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 80

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



177
178
179
180
181
182
183
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 177

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

#to_sObject

Provides a human-readable string representation of the object.



169
170
171
172
173
174
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 169

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

#to_xml_element(doc, root_name) ⇒ Object



153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/cyber_source_merged_spec/models/processor_information25.rb', line 153

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, 'paymentUrl', payment_url)
  XmlUtilities.add_as_subelement(doc, root, 'responseDetails',
                                 response_details)
  XmlUtilities.add_as_subelement(doc, root, 'token', token)
  XmlUtilities.add_as_subelement(doc, root, 'responseCode', response_code)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end