Class: CyberSourceMergedSpec::CaptureOptions3
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::CaptureOptions3
- Defined in:
- lib/cyber_source_merged_spec/models/capture_options3.rb
Overview
CaptureOptions3 Model.
Instance Attribute Summary collapse
-
#capture_sequence_number ⇒ Integer
Capture number when requesting multiple partial captures for one authorization.
-
#total_capture_count ⇒ Integer
Total number of captures when requesting multiple partial captures for one payment.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(total_capture_count: SKIP, capture_sequence_number: SKIP, additional_properties: nil) ⇒ CaptureOptions3
constructor
A new instance of CaptureOptions3.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(total_capture_count: SKIP, capture_sequence_number: SKIP, additional_properties: nil) ⇒ CaptureOptions3
Returns a new instance of CaptureOptions3.
55 56 57 58 59 60 61 62 63 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 55 def initialize(total_capture_count: SKIP, capture_sequence_number: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @total_capture_count = total_capture_count unless total_capture_count == SKIP @capture_sequence_number = capture_sequence_number unless capture_sequence_number == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#capture_sequence_number ⇒ Integer
Capture number when requesting multiple partial captures for one
authorization.
Used along with totalCaptureCount to track which capture is being
processed.
For example, the second of five captures would be passed to CyberSource
as:
- `captureSequenceNumber_ = 2`, and
- `totalCaptureCount = 5`
32 33 34 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 32 def capture_sequence_number @capture_sequence_number end |
#total_capture_count ⇒ Integer
Total number of captures when requesting multiple partial captures for one
payment.
Used along with captureSequenceNumber field to track which capture is
being processed.
For example, the second of five captures would be passed to CyberSource
as:
- `captureSequenceNumber = 2`, and
- `totalCaptureCount = 5`
21 22 23 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 21 def total_capture_count @total_capture_count end |
Class Method Details
.from_element(root) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 88 def self.from_element(root) total_capture_count = XmlUtilities.from_element(root, 'totalCaptureCount', Integer) capture_sequence_number = XmlUtilities.from_element( root, 'captureSequenceNumber', Integer ) new(total_capture_count: total_capture_count, capture_sequence_number: capture_sequence_number, 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 86 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. total_capture_count = hash.key?('totalCaptureCount') ? hash['totalCaptureCount'] : SKIP capture_sequence_number = hash.key?('captureSequenceNumber') ? hash['captureSequenceNumber'] : 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. CaptureOptions3.new(total_capture_count: total_capture_count, capture_sequence_number: capture_sequence_number, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['total_capture_count'] = 'totalCaptureCount' @_hash['capture_sequence_number'] = 'captureSequenceNumber' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 46 47 48 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 43 def self.optionals %w[ total_capture_count capture_sequence_number ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
121 122 123 124 125 126 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 121 def inspect class_name = self.class.name.split('::').last "<#{class_name} total_capture_count: #{@total_capture_count.inspect},"\ " capture_sequence_number: #{@capture_sequence_number.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} total_capture_count: #{@total_capture_count}, capture_sequence_number:"\ " #{@capture_sequence_number}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/cyber_source_merged_spec/models/capture_options3.rb', line 100 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'totalCaptureCount', total_capture_count) XmlUtilities.add_as_subelement(doc, root, 'captureSequenceNumber', capture_sequence_number) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |