Class: CyberSourceMergedSpec::Partner35

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

Overview

Partner35 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(original_transaction_id: SKIP, additional_properties: nil) ⇒ Partner35

Returns a new instance of Partner35.



46
47
48
49
50
51
52
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 46

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

  @original_transaction_id = original_transaction_id unless original_transaction_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#original_transaction_idString

Value that links the previous transaction to the current follow-on request. This value is assigned by the client software that is installed on the POS terminal, which makes it available to the terminal’s software and to CyberSource. Therefore, you can use this value to reconcile transactions between CyberSource and the terminal’s software. CyberSource does not forward this value to the processor. Instead, the value is forwarded to the CyberSource reporting functionality. This field is supported only on American Express Direct, FDC Nashville Global, and SIX.

Returns:

  • (String)


25
26
27
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 25

def original_transaction_id
  @original_transaction_id
end

Class Method Details

.from_element(root) ⇒ Object



74
75
76
77
78
79
80
81
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 74

def self.from_element(root)
  original_transaction_id = XmlUtilities.from_element(
    root, 'originalTransactionId', String
  )

  new(original_transaction_id: original_transaction_id,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  original_transaction_id =
    hash.key?('originalTransactionId') ? hash['originalTransactionId'] : 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.
  Partner35.new(original_transaction_id: original_transaction_id,
                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['original_transaction_id'] = 'originalTransactionId'
  @_hash
end

.nullablesObject

An array for nullable fields



42
43
44
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 42

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    original_transaction_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



95
96
97
98
99
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 95

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

#to_xml_element(doc, root_name) ⇒ Object



83
84
85
86
87
88
89
90
91
92
# File 'lib/cyber_source_merged_spec/models/partner35.rb', line 83

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

  XmlUtilities.add_as_subelement(doc, root, 'originalTransactionId',
                                 original_transaction_id)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end