Class: CyberSource::V2paymentsPointOfSaleInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/cyberSource_client/models/v2payments_point_of_sale_information.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ V2paymentsPointOfSaleInformation

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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
136
137
138
139
140
141
142
143
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 90

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'terminalId')
    self.terminal_id = attributes[:'terminalId']
  end

  if attributes.has_key?(:'terminalSerialNumber')
    self.terminal_serial_number = attributes[:'terminalSerialNumber']
  end

  if attributes.has_key?(:'laneNumber')
    self.lane_number = attributes[:'laneNumber']
  end

  if attributes.has_key?(:'cardPresent')
    self.card_present = attributes[:'cardPresent']
  end

  if attributes.has_key?(:'catLevel')
    self.cat_level = attributes[:'catLevel']
  end

  if attributes.has_key?(:'entryMode')
    self.entry_mode = attributes[:'entryMode']
  end

  if attributes.has_key?(:'terminalCapability')
    self.terminal_capability = attributes[:'terminalCapability']
  end

  if attributes.has_key?(:'pinEntryCapability')
    self.pin_entry_capability = attributes[:'pinEntryCapability']
  end

  if attributes.has_key?(:'operatingEnvironment')
    self.operating_environment = attributes[:'operatingEnvironment']
  end

  if attributes.has_key?(:'emv')
    self.emv = attributes[:'emv']
  end

  if attributes.has_key?(:'amexCapnData')
    self.amex_capn_data = attributes[:'amexCapnData']
  end

  if attributes.has_key?(:'trackData')
    self.track_data = attributes[:'trackData']
  end
end

Instance Attribute Details

#amex_capn_dataObject

Point-of-sale details for the transaction. This value is returned only for **American Express Direct**. CyberSource generates this value, which consists of a series of codes that identify terminal capability, security data, and specific conditions present at the time the transaction occurred. To comply with the CAPN requirements, this value must be included in all subsequent follow-on requests, such as captures and follow-on credits. When you perform authorizations, captures, and credits through CyberSource, CyberSource passes this value from the authorization service to the subsequent services for you. However, when you perform authorizations through CyberSource and perform subsequent services through other financial institutions, you must ensure that your requests for captures and credits include this value.



47
48
49
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 47

def amex_capn_data
  @amex_capn_data
end

#card_presentObject

Indicates whether the card is present at the time of the transaction. Possible values: - true: Card is present. - false: Card is not present.



27
28
29
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 27

def card_present
  @card_present
end

#cat_levelObject

Type of cardholder-activated terminal. Possible values: - 1: Automated dispensing machine - 2: Self-service terminal - 3: Limited amount terminal - 4: In-flight commerce (IFC) terminal - 5: Radio frequency device - 6: Mobile acceptance terminal - 7: Electronic cash register - 8: E-commerce device at your location - 9: Terminal or cash register that uses a dialup connection to connect to the transaction processing network * Applicable only for CTV for Payouts.



30
31
32
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 30

def cat_level
  @cat_level
end

#emvObject

Returns the value of attribute emv.



44
45
46
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 44

def emv
  @emv
end

#entry_modeObject

Method of entering credit card information into the POS terminal. Possible values: - contact: Read from direct contact with chip card. - contactless: Read from a contactless interface using chip data. - keyed: Manually keyed into POS terminal. - msd: Read from a contactless interface using magnetic stripe data (MSD). - swiped: Read from credit card magnetic stripe. The contact, contactless, and msd values are supported only for EMV transactions. * Applicable only for CTV for Payouts.



33
34
35
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 33

def entry_mode
  @entry_mode
end

#lane_numberObject

Identifier for an alternate terminal at your retail location. You define the value for this field. This field is supported only for MasterCard transactions on FDC Nashville Global. Use the terminalID field to identify the main terminal at your retail location. If your retail location has multiple terminals, use this alternateTerminalID field to identify the terminal used for the transaction. This field is a pass-through, which means that CyberSource does not check the value or modify the value in any way before sending it to the processor.



24
25
26
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 24

def lane_number
  @lane_number
end

#operating_environmentObject

Operating environment. Possible values: - 0: No terminal used or unknown environment. - 1: On merchant premises, attended. - 2: On merchant premises, unattended, or cardholder terminal. Examples: oil, kiosks, self-checkout, home computer, mobile telephone, personal digital assistant (PDA). Cardholder terminal is supported only for MasterCard transactions on **CyberSource through VisaNet**. - 3: Off merchant premises, attended. Examples: portable POS devices at trade shows, at service calls, or in taxis. - 4: Off merchant premises, unattended, or cardholder terminal. Examples: vending machines, home computer, mobile telephone, PDA. Cardholder terminal is supported only for MasterCard transactions on **CyberSource through VisaNet**. - 5: On premises of cardholder, unattended. - 9: Unknown delivery mode. - S: Electronic delivery of product. Examples: music, software, or eTickets that are downloaded over the internet. - T: Physical delivery of product. Examples: music or software that is delivered by mail or by a courier. This field is supported only for **American Express Direct** and **CyberSource through VisaNet**. **CyberSource through VisaNet** For MasterCard transactions, the only valid values are 2 and 4.



42
43
44
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 42

def operating_environment
  @operating_environment
end

#pin_entry_capabilityObject

A one-digit code that identifies the capability of terminal to capture PINs. This code does not necessarily mean that a PIN was entered or is included in this message. For Payouts: This field is applicable for CtV.



39
40
41
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 39

def pin_entry_capability
  @pin_entry_capability
end

#terminal_capabilityObject

POS terminal’s capability. Possible values: - 1: Terminal has a magnetic stripe reader only. - 2: Terminal has a magnetic stripe reader and manual entry capability. - 3: Terminal has manual entry capability only. - 4: Terminal can read chip cards. - 5: Terminal can read contactless chip cards. The values of 4 and 5 are supported only for EMV transactions. * Applicable only for CTV for Payouts.



36
37
38
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 36

def terminal_capability
  @terminal_capability
end

#terminal_idObject

Identifier for the terminal at your retail location. You can define this value yourself, but consult the processor for requirements. For Payouts: This field is applicable for CtV.



18
19
20
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 18

def terminal_id
  @terminal_id
end

#terminal_serial_numberObject

TBD



21
22
23
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 21

def terminal_serial_number
  @terminal_serial_number
end

#track_dataObject

Card’s track 1 and 2 data. For all processors except FDMS Nashville, this value consists of one of the following: - Track 1 data - Track 2 data - Data for both tracks 1 and 2 For FDMS Nashville, this value consists of one of the following: - Track 1 data - Data for both tracks 1 and 2 Example: %B4111111111111111^SMITH/JOHN ^1612101976110000868000000?;4111111111111111=16121019761186800000?



50
51
52
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 50

def track_data
  @track_data
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 53

def self.attribute_map
  {
    :'terminal_id' => :'terminalId',
    :'terminal_serial_number' => :'terminalSerialNumber',
    :'lane_number' => :'laneNumber',
    :'card_present' => :'cardPresent',
    :'cat_level' => :'catLevel',
    :'entry_mode' => :'entryMode',
    :'terminal_capability' => :'terminalCapability',
    :'pin_entry_capability' => :'pinEntryCapability',
    :'operating_environment' => :'operatingEnvironment',
    :'emv' => :'emv',
    :'amex_capn_data' => :'amexCapnData',
    :'track_data' => :'trackData'
  }
end

.swagger_typesObject

Attribute type mapping.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 71

def self.swagger_types
  {
    :'terminal_id' => :'String',
    :'terminal_serial_number' => :'String',
    :'lane_number' => :'String',
    :'card_present' => :'BOOLEAN',
    :'cat_level' => :'Integer',
    :'entry_mode' => :'String',
    :'terminal_capability' => :'Integer',
    :'pin_entry_capability' => :'Integer',
    :'operating_environment' => :'String',
    :'emv' => :'V2paymentsPointOfSaleInformationEmv',
    :'amex_capn_data' => :'String',
    :'track_data' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 307

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      terminal_id == o.terminal_id &&
      terminal_serial_number == o.terminal_serial_number &&
      lane_number == o.lane_number &&
      card_present == o.card_present &&
      cat_level == o.cat_level &&
      entry_mode == o.entry_mode &&
      terminal_capability == o.terminal_capability &&
      pin_entry_capability == o.pin_entry_capability &&
      operating_environment == o.operating_environment &&
      emv == o.emv &&
      amex_capn_data == o.amex_capn_data &&
      track_data == o.track_data
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 360

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CyberSource.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 426

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 339

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


326
327
328
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 326

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



332
333
334
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 332

def hash
  [terminal_id, terminal_serial_number, lane_number, card_present, cat_level, entry_mode, terminal_capability, pin_entry_capability, operating_environment, emv, amex_capn_data, track_data].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
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
194
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 147

def list_invalid_properties
  invalid_properties = Array.new
  if !@terminal_id.nil? && @terminal_id.to_s.length > 8
    invalid_properties.push('invalid value for "terminal_id", the character length must be smaller than or equal to 8.')
  end

  if !@lane_number.nil? && @lane_number.to_s.length > 8
    invalid_properties.push('invalid value for "lane_number", the character length must be smaller than or equal to 8.')
  end

  if !@cat_level.nil? && @cat_level > 9
    invalid_properties.push('invalid value for "cat_level", must be smaller than or equal to 9.')
  end

  if !@cat_level.nil? && @cat_level < 1
    invalid_properties.push('invalid value for "cat_level", must be greater than or equal to 1.')
  end

  if !@entry_mode.nil? && @entry_mode.to_s.length > 11
    invalid_properties.push('invalid value for "entry_mode", the character length must be smaller than or equal to 11.')
  end

  if !@terminal_capability.nil? && @terminal_capability > 5
    invalid_properties.push('invalid value for "terminal_capability", must be smaller than or equal to 5.')
  end

  if !@terminal_capability.nil? && @terminal_capability < 1
    invalid_properties.push('invalid value for "terminal_capability", must be greater than or equal to 1.')
  end

  if !@pin_entry_capability.nil? && @pin_entry_capability > 1
    invalid_properties.push('invalid value for "pin_entry_capability", must be smaller than or equal to 1.')
  end

  if !@pin_entry_capability.nil? && @pin_entry_capability < 1
    invalid_properties.push('invalid value for "pin_entry_capability", must be greater than or equal to 1.')
  end

  if !@operating_environment.nil? && @operating_environment.to_s.length > 1
    invalid_properties.push('invalid value for "operating_environment", the character length must be smaller than or equal to 1.')
  end

  if !@amex_capn_data.nil? && @amex_capn_data.to_s.length > 12
    invalid_properties.push('invalid value for "amex_capn_data", the character length must be smaller than or equal to 12.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



406
407
408
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 406

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



412
413
414
415
416
417
418
419
420
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 412

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



400
401
402
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 400

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/cyberSource_client/models/v2payments_point_of_sale_information.rb', line 198

def valid?
  return false if !@terminal_id.nil? && @terminal_id.to_s.length > 8
  return false if !@lane_number.nil? && @lane_number.to_s.length > 8
  return false if !@cat_level.nil? && @cat_level > 9
  return false if !@cat_level.nil? && @cat_level < 1
  return false if !@entry_mode.nil? && @entry_mode.to_s.length > 11
  return false if !@terminal_capability.nil? && @terminal_capability > 5
  return false if !@terminal_capability.nil? && @terminal_capability < 1
  return false if !@pin_entry_capability.nil? && @pin_entry_capability > 1
  return false if !@pin_entry_capability.nil? && @pin_entry_capability < 1
  return false if !@operating_environment.nil? && @operating_environment.to_s.length > 1
  return false if !@amex_capn_data.nil? && @amex_capn_data.to_s.length > 12
  true
end