Class: VisaAcceptanceMergedSpec::PointOfSaleInformation6

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb

Overview

PointOfSaleInformation6 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, additional_properties: nil) ⇒ PointOfSaleInformation6

Returns a new instance of PointOfSaleInformation6.



56
57
58
59
60
61
62
63
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 56

def initialize(emv: SKIP, amex_capn_data: 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
  @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. Visa Acceptance 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 Visa Acceptance, Visa Acceptance passes this value from the authorization service to the subsequent services for you. However, when you perform authorizations through Visa Acceptance 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/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 33

def amex_capn_data
  @amex_capn_data
end

#emvEmv6

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 14

def emv
  @emv
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 66

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



36
37
38
39
40
41
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 36

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

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 52

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 44

def self.optionals
  %w[
    emv
    amex_capn_data
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 94

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

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/visa_acceptance_merged_spec/models/point_of_sale_information6.rb', line 87

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