Class: VisaAcceptanceMergedSpec::CaptureOptions2

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/capture_options2.rb

Overview

CaptureOptions2 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(capture_sequence_number: SKIP, total_capture_count: SKIP, is_final: SKIP, notes: SKIP, reconciliation_id_alternate: SKIP, additional_properties: nil) ⇒ CaptureOptions2

Returns a new instance of CaptureOptions2.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 78

def initialize(capture_sequence_number: SKIP, total_capture_count: SKIP,
               is_final: SKIP, notes: 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
  @is_final = is_final unless is_final == SKIP
  @notes = notes unless notes == SKIP
  unless reconciliation_id_alternate == SKIP
    @reconciliation_id_alternate =
      reconciliation_id_alternate
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#capture_sequence_numberInteger

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 Visa Acceptance as:

- `captureSequenceNumber_ = 2`, and
- `totalCaptureCount = 5`

Returns:

  • (Integer)


21
22
23
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 21

def capture_sequence_number
  @capture_sequence_number
end

#is_finalString

Indicates whether to release the authorization hold on the remaining funds.
Possible Values:

  • true
  • false

Returns:

  • (String)


40
41
42
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 40

def is_final
  @is_final
end

#notesString

An informational note about this settlement. Appears in both the payer's transaction history and the emails that the payer receives.

Returns:

  • (String)


45
46
47
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 45

def notes
  @notes
end

#reconciliation_id_alternateString

Used by Nike merchant to send 12 digit order number

Returns:

  • (String)


49
50
51
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 49

def reconciliation_id_alternate
  @reconciliation_id_alternate
end

#total_capture_countInteger

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 Visa Acceptance as:

- `captureSequenceNumber = 2`, and
- `totalCaptureCount = 5`

Returns:

  • (Integer)


32
33
34
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 32

def total_capture_count
  @total_capture_count
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 97

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
  is_final = hash.key?('isFinal') ? hash['isFinal'] : SKIP
  notes = hash.key?('notes') ? hash['notes'] : 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.
  CaptureOptions2.new(capture_sequence_number: capture_sequence_number,
                      total_capture_count: total_capture_count,
                      is_final: is_final,
                      notes: notes,
                      reconciliation_id_alternate: reconciliation_id_alternate,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



52
53
54
55
56
57
58
59
60
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 52

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['capture_sequence_number'] = 'captureSequenceNumber'
  @_hash['total_capture_count'] = 'totalCaptureCount'
  @_hash['is_final'] = 'isFinal'
  @_hash['notes'] = 'notes'
  @_hash['reconciliation_id_alternate'] = 'reconciliationIdAlternate'
  @_hash
end

.nullablesObject

An array for nullable fields



74
75
76
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 74

def self.nullables
  []
end

.optionalsObject

An array for optional fields



63
64
65
66
67
68
69
70
71
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 63

def self.optionals
  %w[
    capture_sequence_number
    total_capture_count
    is_final
    notes
    reconciliation_id_alternate
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



136
137
138
139
140
141
142
143
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 136

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}, is_final: #{@is_final.inspect},"\
  " notes: #{@notes.inspect}, reconciliation_id_alternate:"\
  " #{@reconciliation_id_alternate.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



127
128
129
130
131
132
133
# File 'lib/visa_acceptance_merged_spec/models/capture_options2.rb', line 127

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