Class: CyberSourceMergedSpec::CaptureOptions
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::CaptureOptions
- Defined in:
- lib/cyber_source_merged_spec/models/capture_options.rb
Overview
CaptureOptions Model.
Instance Attribute Summary collapse
-
#capture_sequence_number ⇒ Integer
Capture number when requesting multiple partial captures for one authorization.
-
#date_to_capture ⇒ String
Date on which you want the capture to occur.
-
#is_final ⇒ String
Indicates whether to release the authorization hold on the remaining funds.
-
#notes ⇒ String
An informational note about this settlement.
-
#reconciliation_id ⇒ String
Used for authbill request when capture field equals true.
-
#reconciliation_id_alternate ⇒ String
Used by Nike merchant to send 12 digit order number.
-
#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(capture_sequence_number: SKIP, total_capture_count: SKIP, date_to_capture: SKIP, is_final: SKIP, notes: SKIP, reconciliation_id: SKIP, reconciliation_id_alternate: SKIP, additional_properties: nil) ⇒ CaptureOptions
constructor
A new instance of CaptureOptions.
-
#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(capture_sequence_number: SKIP, total_capture_count: SKIP, date_to_capture: SKIP, is_final: SKIP, notes: SKIP, reconciliation_id: SKIP, reconciliation_id_alternate: SKIP, additional_properties: nil) ⇒ CaptureOptions
Returns a new instance of CaptureOptions.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 95 def initialize(capture_sequence_number: SKIP, total_capture_count: SKIP, date_to_capture: SKIP, is_final: SKIP, notes: SKIP, reconciliation_id: SKIP, reconciliation_id_alternate: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @capture_sequence_number = capture_sequence_number unless capture_sequence_number == SKIP @total_capture_count = total_capture_count unless total_capture_count == SKIP @date_to_capture = date_to_capture unless date_to_capture == SKIP @is_final = is_final unless is_final == SKIP @notes = notes unless notes == SKIP @reconciliation_id = reconciliation_id unless reconciliation_id == SKIP unless reconciliation_id_alternate == SKIP @reconciliation_id_alternate = reconciliation_id_alternate end @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`
21 22 23 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 21 def capture_sequence_number @capture_sequence_number end |
#date_to_capture ⇒ String
Date on which you want the capture to occur. This field is supported only
for CyberSource through VisaNet.
Format: MMDD
Used by
Authorization Optional field.
41 42 43 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 41 def date_to_capture @date_to_capture end |
#is_final ⇒ String
Indicates whether to release the authorization hold on the remaining
funds.
Possible Values:
truefalse
49 50 51 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 49 def is_final @is_final end |
#notes ⇒ String
An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.
54 55 56 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 54 def notes @notes end |
#reconciliation_id ⇒ String
Used for authbill request when capture field equals true
58 59 60 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 58 def reconciliation_id @reconciliation_id end |
#reconciliation_id_alternate ⇒ String
Used by Nike merchant to send 12 digit order number
62 63 64 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 62 def reconciliation_id_alternate @reconciliation_id_alternate 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`
32 33 34 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 32 def total_capture_count @total_capture_count end |
Class Method Details
.from_element(root) ⇒ Object
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 151 def self.from_element(root) capture_sequence_number = XmlUtilities.from_element( root, 'captureSequenceNumber', Integer ) total_capture_count = XmlUtilities.from_element(root, 'totalCaptureCount', Integer) date_to_capture = XmlUtilities.from_element(root, 'dateToCapture', String) is_final = XmlUtilities.from_element(root, 'isFinal', String) notes = XmlUtilities.from_element(root, 'notes', String) reconciliation_id = XmlUtilities.from_element(root, 'reconciliationId', String) reconciliation_id_alternate = XmlUtilities.from_element( root, 'reconciliationIdAlternate', String ) new(capture_sequence_number: capture_sequence_number, total_capture_count: total_capture_count, date_to_capture: date_to_capture, is_final: is_final, notes: notes, reconciliation_id: reconciliation_id, reconciliation_id_alternate: reconciliation_id_alternate, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 116 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. capture_sequence_number = hash.key?('captureSequenceNumber') ? hash['captureSequenceNumber'] : SKIP total_capture_count = hash.key?('totalCaptureCount') ? hash['totalCaptureCount'] : SKIP date_to_capture = hash.key?('dateToCapture') ? hash['dateToCapture'] : SKIP is_final = hash.key?('isFinal') ? hash['isFinal'] : SKIP notes = hash.key?('notes') ? hash['notes'] : SKIP reconciliation_id = hash.key?('reconciliationId') ? hash['reconciliationId'] : SKIP reconciliation_id_alternate = hash.key?('reconciliationIdAlternate') ? hash['reconciliationIdAlternate'] : 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. CaptureOptions.new(capture_sequence_number: capture_sequence_number, total_capture_count: total_capture_count, date_to_capture: date_to_capture, is_final: is_final, notes: notes, reconciliation_id: reconciliation_id, reconciliation_id_alternate: reconciliation_id_alternate, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 65 def self.names @_hash = {} if @_hash.nil? @_hash['capture_sequence_number'] = 'captureSequenceNumber' @_hash['total_capture_count'] = 'totalCaptureCount' @_hash['date_to_capture'] = 'dateToCapture' @_hash['is_final'] = 'isFinal' @_hash['notes'] = 'notes' @_hash['reconciliation_id'] = 'reconciliationId' @_hash['reconciliation_id_alternate'] = 'reconciliationIdAlternate' @_hash end |
.nullables ⇒ Object
An array for nullable fields
91 92 93 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 91 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 78 def self.optionals %w[ capture_sequence_number total_capture_count date_to_capture is_final notes reconciliation_id reconciliation_id_alternate ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
207 208 209 210 211 212 213 214 215 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 207 def inspect class_name = self.class.name.split('::').last "<#{class_name} capture_sequence_number: #{@capture_sequence_number.inspect},"\ " total_capture_count: #{@total_capture_count.inspect}, date_to_capture:"\ " #{@date_to_capture.inspect}, is_final: #{@is_final.inspect}, notes: #{@notes.inspect},"\ " reconciliation_id: #{@reconciliation_id.inspect}, reconciliation_id_alternate:"\ " #{@reconciliation_id_alternate.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
198 199 200 201 202 203 204 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 198 def to_s class_name = self.class.name.split('::').last "<#{class_name} capture_sequence_number: #{@capture_sequence_number}, total_capture_count:"\ " #{@total_capture_count}, date_to_capture: #{@date_to_capture}, is_final: #{@is_final},"\ " notes: #{@notes}, reconciliation_id: #{@reconciliation_id}, reconciliation_id_alternate:"\ " #{@reconciliation_id_alternate}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/cyber_source_merged_spec/models/capture_options.rb', line 176 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'captureSequenceNumber', capture_sequence_number) XmlUtilities.add_as_subelement(doc, root, 'totalCaptureCount', total_capture_count) XmlUtilities.add_as_subelement(doc, root, 'dateToCapture', date_to_capture) XmlUtilities.add_as_subelement(doc, root, 'isFinal', is_final) XmlUtilities.add_as_subelement(doc, root, 'notes', notes) XmlUtilities.add_as_subelement(doc, root, 'reconciliationId', reconciliation_id) XmlUtilities.add_as_subelement(doc, root, 'reconciliationIdAlternate', reconciliation_id_alternate) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |