Class: CyberSourceMergedSpec::PointOfSaleInformation1

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

Overview

PointOfSaleInformation1 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(emv: SKIP, amex_capn_data: SKIP, terminal_id: SKIP, additional_properties: nil) ⇒ PointOfSaleInformation1

Returns a new instance of PointOfSaleInformation1.



113
114
115
116
117
118
119
120
121
122
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 113

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

  @emv = emv unless emv == SKIP
  @amex_capn_data = amex_capn_data unless amex_capn_data == SKIP
  @terminal_id = terminal_id unless terminal_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amex_capn_dataString

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.

Returns:

  • (String)


33
34
35
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 33

def amex_capn_data
  @amex_capn_data
end

#emvEmv1

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 14

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


88
89
90
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 88

def terminal_id
  @terminal_id
end

Class Method Details

.from_element(root) ⇒ Object



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

def self.from_element(root)
  emv = XmlUtilities.from_element(root, 'Emv1', Emv1)
  amex_capn_data = XmlUtilities.from_element(root, 'amexCapnData', String)
  terminal_id = XmlUtilities.from_element(root, 'terminalId', String)

  new(emv: emv,
      amex_capn_data: amex_capn_data,
      terminal_id: terminal_id,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 125

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  emv = Emv1.from_hash(hash['emv']) if hash['emv']
  amex_capn_data = hash.key?('amexCapnData') ? hash['amexCapnData'] : SKIP
  terminal_id = hash.key?('terminalId') ? hash['terminalId'] : 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.
  PointOfSaleInformation1.new(emv: emv,
                              amex_capn_data: amex_capn_data,
                              terminal_id: terminal_id,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



91
92
93
94
95
96
97
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 91

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['emv'] = 'emv'
  @_hash['amex_capn_data'] = 'amexCapnData'
  @_hash['terminal_id'] = 'terminalId'
  @_hash
end

.nullablesObject

An array for nullable fields



109
110
111
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 109

def self.nullables
  []
end

.optionalsObject

An array for optional fields



100
101
102
103
104
105
106
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 100

def self.optionals
  %w[
    emv
    amex_capn_data
    terminal_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



171
172
173
174
175
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 171

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

#to_xml_element(doc, root_name) ⇒ Object



158
159
160
161
162
163
164
165
166
167
168
# File 'lib/cyber_source_merged_spec/models/point_of_sale_information1.rb', line 158

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

  XmlUtilities.add_as_subelement(doc, root, 'Emv1', emv)
  XmlUtilities.add_as_subelement(doc, root, 'amexCapnData', amex_capn_data)
  XmlUtilities.add_as_subelement(doc, root, 'terminalId', terminal_id)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end