Class: CyberSourceMergedSpec::PtsV2UpdateOrderPatch201Response

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

Overview

PtsV2UpdateOrderPatch201Response 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(status: SKIP, processor_information: SKIP, additional_properties: nil) ⇒ PtsV2UpdateOrderPatch201Response

Returns a new instance of PtsV2UpdateOrderPatch201Response.



55
56
57
58
59
60
61
62
63
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 55

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

  @status = status unless status == SKIP
  @processor_information = processor_information unless processor_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#processor_informationProcessorInformation27

The status of the submitted transaction. Possible values:

- CREATED
- SAVED
- APPROVED
- VOIDED
- COMPLETED
- PAYER_ACTION_REQUIRED


32
33
34
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 32

def processor_information
  @processor_information
end

#statusString

The status of the submitted transaction. Possible values:

- CREATED
- SAVED
- APPROVED
- VOIDED
- COMPLETED
- PAYER_ACTION_REQUIRED

Returns:

  • (String)


21
22
23
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 21

def status
  @status
end

Class Method Details

.from_element(root) ⇒ Object



87
88
89
90
91
92
93
94
95
96
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 87

def self.from_element(root)
  status = XmlUtilities.from_element(root, 'status', String)
  processor_information = XmlUtilities.from_element(
    root, 'ProcessorInformation27', ProcessorInformation27
  )

  new(status: status,
      processor_information: processor_information,
      additional_properties: additional_properties)
end

.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
85
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 66

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : SKIP
  processor_information = ProcessorInformation27.from_hash(hash['processorInformation']) if
    hash['processorInformation']

  # 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.
  PtsV2UpdateOrderPatch201Response.new(status: status,
                                       processor_information: processor_information,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['processor_information'] = 'processorInformation'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 51

def self.nullables
  []
end

.optionalsObject

An array for optional fields



43
44
45
46
47
48
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 43

def self.optionals
  %w[
    status
    processor_information
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



118
119
120
121
122
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 118

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

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 111

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

#to_xml_element(doc, root_name) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
# File 'lib/cyber_source_merged_spec/models/pts_v2_update_order_patch201_response.rb', line 98

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

  XmlUtilities.add_as_subelement(doc, root, 'status', status)
  XmlUtilities.add_as_subelement(doc, root, 'ProcessorInformation27',
                                 processor_information)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end