Class: CyberSourceMergedSpec::ConsumerAuthenticationInformation12

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

Overview

ConsumerAuthenticationInformation12 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(xid: SKIP, transaction_id: SKIP, eci_raw: SKIP, additional_properties: nil) ⇒ ConsumerAuthenticationInformation12

Returns a new instance of ConsumerAuthenticationInformation12.



47
48
49
50
51
52
53
54
55
56
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 47

def initialize(xid: SKIP, transaction_id: SKIP, eci_raw: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @xid = xid unless xid == SKIP
  @transaction_id = transaction_id unless transaction_id == SKIP
  @eci_raw = eci_raw unless eci_raw == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#eci_rawString

Raw electronic commerce indicator (ECI).

Returns:

  • (String)


22
23
24
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 22

def eci_raw
  @eci_raw
end

#transaction_idString

Payer auth Transaction identifier.

Returns:

  • (String)


18
19
20
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 18

def transaction_id
  @transaction_id
end

#xidString

Transaction identifier.

Returns:

  • (String)


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

def xid
  @xid
end

Class Method Details

.from_element(root) ⇒ Object



81
82
83
84
85
86
87
88
89
90
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 81

def self.from_element(root)
  xid = XmlUtilities.from_element(root, 'xid', String)
  transaction_id = XmlUtilities.from_element(root, 'transactionId', String)
  eci_raw = XmlUtilities.from_element(root, 'eciRaw', String)

  new(xid: xid,
      transaction_id: transaction_id,
      eci_raw: eci_raw,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 59

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  xid = hash.key?('xid') ? hash['xid'] : SKIP
  transaction_id = hash.key?('transactionId') ? hash['transactionId'] : SKIP
  eci_raw = hash.key?('eciRaw') ? hash['eciRaw'] : 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.
  ConsumerAuthenticationInformation12.new(xid: xid,
                                          transaction_id: transaction_id,
                                          eci_raw: eci_raw,
                                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['xid'] = 'xid'
  @_hash['transaction_id'] = 'transactionId'
  @_hash['eci_raw'] = 'eciRaw'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 34

def self.optionals
  %w[
    xid
    transaction_id
    eci_raw
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



112
113
114
115
116
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 112

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

#to_sObject

Provides a human-readable string representation of the object.



105
106
107
108
109
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 105

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

#to_xml_element(doc, root_name) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
# File 'lib/cyber_source_merged_spec/models/consumer_authentication_information12.rb', line 92

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

  XmlUtilities.add_as_subelement(doc, root, 'xid', xid)
  XmlUtilities.add_as_subelement(doc, root, 'transactionId', transaction_id)
  XmlUtilities.add_as_subelement(doc, root, 'eciRaw', eci_raw)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end