Class: CyberSourceMergedSpec::PointOfSaleInformation15

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

Overview

PointOfSaleInformation15 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(terminal_id: SKIP, terminal_serial_number: SKIP, device_id: SKIP, partner: SKIP, emv: SKIP, additional_properties: nil) ⇒ PointOfSaleInformation15

Returns a new instance of PointOfSaleInformation15.



163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 163

def initialize(terminal_id: SKIP, terminal_serial_number: SKIP,
               device_id: SKIP, partner: SKIP, emv: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @terminal_id = terminal_id unless terminal_id == SKIP
  @terminal_serial_number = terminal_serial_number unless terminal_serial_number == SKIP
  @device_id = device_id unless device_id == SKIP
  @partner = partner unless partner == SKIP
  @emv = emv unless emv == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#device_idString

Value created by the client software that uniquely identifies the POS device. CyberSource does not forward this value to the processor. Instead, the value is forwarded to the CyberSource reporting functionality. This field is supported only for authorizations and credits on these processors:

  • American Express Direct
  • Credit Mutuel-CIC
  • FDC Nashville Global
  • OmniPay Direct
  • SIX Optional field. String (32)

Returns:

  • (String)


100
101
102
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 100

def device_id
  @device_id
end

#emvEmv2

Value created by the client software that uniquely identifies the POS device. CyberSource does not forward this value to the processor. Instead, the value is forwarded to the CyberSource reporting functionality. This field is supported only for authorizations and credits on these processors:

  • American Express Direct
  • Credit Mutuel-CIC
  • FDC Nashville Global
  • OmniPay Direct
  • SIX Optional field. String (32)

Returns:



134
135
136
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 134

def emv
  @emv
end

#partnerPartner35

Value created by the client software that uniquely identifies the POS device. CyberSource does not forward this value to the processor. Instead, the value is forwarded to the CyberSource reporting functionality. This field is supported only for authorizations and credits on these processors:

  • American Express Direct
  • Credit Mutuel-CIC
  • FDC Nashville Global
  • OmniPay Direct
  • SIX Optional field. String (32)

Returns:



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

def partner
  @partner
end

#terminal_idString

Identifier for the terminal at your retail location. You can define this value yourself, but consult the processor for requirements.

CyberSource through VisaNet

A list of all possible values is stored in your CyberSource account. If terminal ID validation is enabled for your CyberSource account, the value you send for this field is validated against the list each time you include the field in a request. To enable or disable terminal ID validation, contact CyberSource Customer Support. When you do not include this field in a request, CyberSource uses the default value that is defined in your CyberSource account.

FDC Nashville Global

To have your account configured to support this field, contact CyberSource Customer Support. This value must be a value that FDC Nashville Global issued to you.

For Payouts

This field is applicable for CyberSource through VisaNet.

GPX

Identifier for the terminal at your retail location. A list of all possible values is stored in your account. If terminal ID validation is enabled for your account, the value you send for this field is validated against the list each time you include the field in a request. To enable or disable terminal ID validation, contact customer support. When you do not include this field in a request, the default value that is defined in your account is used. Optional for authorizations.

Used by

Authorization Optional for the following processors. When you do not include this field in a request, the default value that is defined in your account is used.

  • American Express Direct
  • Credit Mutuel-CIC
  • FDC Nashville Global
  • SIX
  • Chase Paymentech Solutions: Optional field. If you include this field in your request, you must also include pointOfSaleInformation.catLevel.
  • FDMS Nashville: The default value that is defined in your account is used.
  • GPX
  • OmniPay Direct: Optional field. For the following processors, this field is not used.
  • GPN
  • JCN Gateway
  • RBS WorldPay Atlanta
  • TSYS Acquiring Solutions
  • Worldpay VAP

Card Present reply

Terminal identifier assigned by the acquirer. This value must be printed on the receipt.

Returns:

  • (String)


65
66
67
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 65

def terminal_id
  @terminal_id
end

#terminal_serial_numberString

Terminal serial number assigned by the hardware manufacturer. This value is provided by the client software that is installed on the POS terminal. This value is not forwarded to the processor. Instead, the value is forwarded to the reporting functionality.

Used by

Authorization and Credit Optional. This field is supported only by client software that is installed on your POS terminals for the following processors:

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

Returns:

  • (String)


83
84
85
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 83

def terminal_serial_number
  @terminal_serial_number
end

Class Method Details

.from_element(root) ⇒ Object



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 205

def self.from_element(root)
  terminal_id = XmlUtilities.from_element(root, 'terminalId', String)
  terminal_serial_number = XmlUtilities.from_element(root,
                                                     'terminalSerialNumber',
                                                     String)
  device_id = XmlUtilities.from_element(root, 'deviceId', String)
  partner = XmlUtilities.from_element(root, 'Partner35', Partner35)
  emv = XmlUtilities.from_element(root, 'Emv2', Emv2)

  new(terminal_id: terminal_id,
      terminal_serial_number: terminal_serial_number,
      device_id: device_id,
      partner: partner,
      emv: emv,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 178

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  terminal_id = hash.key?('terminalId') ? hash['terminalId'] : SKIP
  terminal_serial_number =
    hash.key?('terminalSerialNumber') ? hash['terminalSerialNumber'] : SKIP
  device_id = hash.key?('deviceId') ? hash['deviceId'] : SKIP
  partner = Partner35.from_hash(hash['partner']) if hash['partner']
  emv = Emv2.from_hash(hash['emv']) if hash['emv']

  # 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.
  PointOfSaleInformation15.new(terminal_id: terminal_id,
                               terminal_serial_number: terminal_serial_number,
                               device_id: device_id,
                               partner: partner,
                               emv: emv,
                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



137
138
139
140
141
142
143
144
145
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 137

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['terminal_id'] = 'terminalId'
  @_hash['terminal_serial_number'] = 'terminalSerialNumber'
  @_hash['device_id'] = 'deviceId'
  @_hash['partner'] = 'partner'
  @_hash['emv'] = 'emv'
  @_hash
end

.nullablesObject

An array for nullable fields



159
160
161
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 159

def self.nullables
  []
end

.optionalsObject

An array for optional fields



148
149
150
151
152
153
154
155
156
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 148

def self.optionals
  %w[
    terminal_id
    terminal_serial_number
    device_id
    partner
    emv
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



246
247
248
249
250
251
252
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 246

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} terminal_id: #{@terminal_id.inspect}, terminal_serial_number:"\
  " #{@terminal_serial_number.inspect}, device_id: #{@device_id.inspect}, partner:"\
  " #{@partner.inspect}, emv: #{@emv.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



238
239
240
241
242
243
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 238

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} terminal_id: #{@terminal_id}, terminal_serial_number:"\
  " #{@terminal_serial_number}, device_id: #{@device_id}, partner: #{@partner}, emv: #{@emv},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information15.rb', line 222

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

  XmlUtilities.add_as_subelement(doc, root, 'terminalId', terminal_id)
  XmlUtilities.add_as_subelement(doc, root, 'terminalSerialNumber',
                                 terminal_serial_number)
  XmlUtilities.add_as_subelement(doc, root, 'deviceId', device_id)
  XmlUtilities.add_as_subelement(doc, root, 'Partner35', partner)
  XmlUtilities.add_as_subelement(doc, root, 'Emv2', emv)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end