Class: CyberSourceMergedSpec::MarkingDetails1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::MarkingDetails1
- Defined in:
- lib/cyber_source_merged_spec/models/marking_details1.rb
Overview
Details for marking the transaction.
Instance Attribute Summary collapse
-
#action ⇒ String
This field can contain one of the following values: - add: Mark as Suspect.
-
#fields_included ⇒ Array[String]
This field can contain one or more of the following values.
-
#notes ⇒ String
Notes or details that explain the reasons for marking the transaction as suspect or otherwise.
-
#reason ⇒ String
Reason for marking the transaction as suspect or otherwise.
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(notes: SKIP, reason: SKIP, fields_included: SKIP, action: SKIP, additional_properties: nil) ⇒ MarkingDetails1
constructor
A new instance of MarkingDetails1.
-
#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(notes: SKIP, reason: SKIP, fields_included: SKIP, action: SKIP, additional_properties: nil) ⇒ MarkingDetails1
Returns a new instance of MarkingDetails1.
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 78 def initialize(notes: SKIP, reason: SKIP, fields_included: SKIP, action: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @notes = notes unless notes == SKIP @reason = reason unless reason == SKIP @fields_included = fields_included unless fields_included == SKIP @action = action unless action == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#action ⇒ String
This field can contain one of the following values:
- add: Mark as Suspect.
- clear: Clear Mark as Suspect.
- hide: Remove from history.
51 52 53 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 51 def action @action end |
#fields_included ⇒ Array[String]
This field can contain one or more of the following values. When you specify more than one value, separate them with commas (,).
account_key_hashcustomer_account_idcustomer_emailcustomer_ipaddresscustomer_phonedevice_fingerprintship_addressIf no value is specified,account_key_hash,customer_email, andship_addressare used by default. Noteaccount_key_hashadds the field that contains the card number (customer_cc_number).
44 45 46 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 44 def fields_included @fields_included end |
#notes ⇒ String
Notes or details that explain the reasons for marking the transaction as suspect or otherwise.
15 16 17 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 15 def notes @notes end |
#reason ⇒ String
Reason for marking the transaction as suspect or otherwise. This field can contain one of the following values:
fraud_chargeback:You have received a fraud-related chargeback for the transaction.non_fraud_chargeback:You have received a non-fraudulent chargeback for the transaction.suspected:You believe that you will probably receive a chargeback for the transaction.creditback:You issued a refund to the customer to avoid a chargeback for the transaction.
28 29 30 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 28 def reason @reason end |
Class Method Details
.from_element(root) ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 116 def self.from_element(root) notes = XmlUtilities.from_element(root, 'notes', String) reason = XmlUtilities.from_element(root, 'reason', String) fields_included = XmlUtilities.from_element_to_array(root, 'fieldsIncluded', String) action = XmlUtilities.from_element(root, 'action', String) new(notes: notes, reason: reason, fields_included: fields_included, action: action, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 91 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. notes = hash.key?('notes') ? hash['notes'] : SKIP reason = hash.key?('reason') ? hash['reason'] : SKIP fields_included = hash.key?('fieldsIncluded') ? hash['fieldsIncluded'] : SKIP action = hash.key?('action') ? hash['action'] : 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. MarkingDetails1.new(notes: notes, reason: reason, fields_included: fields_included, action: action, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
54 55 56 57 58 59 60 61 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['notes'] = 'notes' @_hash['reason'] = 'reason' @_hash['fields_included'] = 'fieldsIncluded' @_hash['action'] = 'action' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 74 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 67 68 69 70 71 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 64 def self.optionals %w[ notes reason fields_included action ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
153 154 155 156 157 158 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 153 def inspect class_name = self.class.name.split('::').last "<#{class_name} notes: #{@notes.inspect}, reason: #{@reason.inspect}, fields_included:"\ " #{@fields_included.inspect}, action: #{@action.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
146 147 148 149 150 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 146 def to_s class_name = self.class.name.split('::').last "<#{class_name} notes: #{@notes}, reason: #{@reason}, fields_included: #{@fields_included},"\ " action: #{@action}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/cyber_source_merged_spec/models/marking_details1.rb', line 131 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'notes', notes) XmlUtilities.add_as_subelement(doc, root, 'reason', reason) XmlUtilities.add_array_as_subelement(doc, root, 'fieldsIncluded', fields_included) XmlUtilities.add_as_subelement(doc, root, 'action', action) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |