Class: CyberSourceMergedSpec::ConversionDetail
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::ConversionDetail
- Defined in:
- lib/cyber_source_merged_spec/models/conversion_detail.rb
Overview
ConversionDetail Model.
Instance Attribute Summary collapse
-
#conversion_time ⇒ DateTime
Date of conversion.
-
#merchant_reference_number ⇒ String
Merchant reference number of a merchant.
-
#new_decision ⇒ String
New decision.
-
#notes ⇒ Array[Note]
Name of the profile.
-
#original_decision ⇒ String
Original decision.
-
#profile ⇒ String
Name of the profile.
-
#queue ⇒ String
Name of the queue.
-
#request_id ⇒ String
Cybersource Transation request id.
-
#reviewer ⇒ String
User name of the reviewer.
-
#reviewer_comments ⇒ String
Comments of the reviewer.
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(merchant_reference_number: SKIP, conversion_time: SKIP, request_id: SKIP, original_decision: SKIP, new_decision: SKIP, reviewer: SKIP, reviewer_comments: SKIP, queue: SKIP, profile: SKIP, notes: SKIP, additional_properties: nil) ⇒ ConversionDetail
constructor
A new instance of ConversionDetail.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_conversion_time ⇒ Object
-
#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(merchant_reference_number: SKIP, conversion_time: SKIP, request_id: SKIP, original_decision: SKIP, new_decision: SKIP, reviewer: SKIP, reviewer_comments: SKIP, queue: SKIP, profile: SKIP, notes: SKIP, additional_properties: nil) ⇒ ConversionDetail
Returns a new instance of ConversionDetail.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 90 def initialize(merchant_reference_number: SKIP, conversion_time: SKIP, request_id: SKIP, original_decision: SKIP, new_decision: SKIP, reviewer: SKIP, reviewer_comments: SKIP, queue: SKIP, profile: SKIP, notes: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? unless merchant_reference_number == SKIP @merchant_reference_number = merchant_reference_number end @conversion_time = conversion_time unless conversion_time == SKIP @request_id = request_id unless request_id == SKIP @original_decision = original_decision unless original_decision == SKIP @new_decision = new_decision unless new_decision == SKIP @reviewer = reviewer unless reviewer == SKIP @reviewer_comments = reviewer_comments unless reviewer_comments == SKIP @queue = queue unless queue == SKIP @profile = profile unless profile == SKIP @notes = notes unless notes == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#conversion_time ⇒ DateTime
Date of conversion
19 20 21 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 19 def conversion_time @conversion_time end |
#merchant_reference_number ⇒ String
Merchant reference number of a merchant
15 16 17 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 15 def merchant_reference_number @merchant_reference_number end |
#new_decision ⇒ String
New decision
31 32 33 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 31 def new_decision @new_decision end |
#notes ⇒ Array[Note]
Name of the profile
51 52 53 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 51 def notes @notes end |
#original_decision ⇒ String
Original decision
27 28 29 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 27 def original_decision @original_decision end |
#profile ⇒ String
Name of the profile
47 48 49 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 47 def profile @profile end |
#queue ⇒ String
Name of the queue
43 44 45 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 43 def queue @queue end |
#request_id ⇒ String
Cybersource Transation request id
23 24 25 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 23 def request_id @request_id end |
#reviewer ⇒ String
User name of the reviewer
35 36 37 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 35 def reviewer @reviewer end |
#reviewer_comments ⇒ String
Comments of the reviewer
39 40 41 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 39 def reviewer_comments @reviewer_comments end |
Class Method Details
.from_element(root) ⇒ Object
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 171 def self.from_element(root) merchant_reference_number = XmlUtilities.from_attribute( root, 'MerchantReferenceNumber', String ) conversion_time = XmlUtilities.from_attribute(root, 'ConversionDate', String, datetime_format: 'rfc3339') request_id = XmlUtilities.from_attribute(root, 'RequestID', String) original_decision = XmlUtilities.from_element(root, 'OriginalDecision', String) new_decision = XmlUtilities.from_element(root, 'NewDecision', String) reviewer = XmlUtilities.from_element(root, 'Reviewer', String) reviewer_comments = XmlUtilities.from_element(root, 'ReviewerComments', String) queue = XmlUtilities.from_element(root, 'Queue', String) profile = XmlUtilities.from_element(root, 'Profile', String) notes = XmlUtilities.from_element_to_array(root, 'Notes', Note) new(merchant_reference_number: merchant_reference_number, conversion_time: conversion_time, request_id: request_id, original_decision: original_decision, new_decision: new_decision, reviewer: reviewer, reviewer_comments: reviewer_comments, queue: queue, profile: profile, notes: notes, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
115 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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 115 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. merchant_reference_number = hash.key?('merchantReferenceNumber') ? hash['merchantReferenceNumber'] : SKIP conversion_time = if hash.key?('conversionTime') (DateTimeHelper.from_rfc3339(hash['conversionTime']) if hash['conversionTime']) else SKIP end request_id = hash.key?('requestId') ? hash['requestId'] : SKIP original_decision = hash.key?('originalDecision') ? hash['originalDecision'] : SKIP new_decision = hash.key?('newDecision') ? hash['newDecision'] : SKIP reviewer = hash.key?('reviewer') ? hash['reviewer'] : SKIP reviewer_comments = hash.key?('reviewerComments') ? hash['reviewerComments'] : SKIP queue = hash.key?('queue') ? hash['queue'] : SKIP profile = hash.key?('profile') ? hash['profile'] : SKIP # Parameter is an array, so we need to iterate through it notes = nil unless hash['notes'].nil? notes = [] hash['notes'].each do |structure| notes << (Note.from_hash(structure) if structure) end end notes = SKIP unless hash.key?('notes') # 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. ConversionDetail.new(merchant_reference_number: merchant_reference_number, conversion_time: conversion_time, request_id: request_id, original_decision: original_decision, new_decision: new_decision, reviewer: reviewer, reviewer_comments: reviewer_comments, queue: queue, profile: profile, notes: notes, 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 62 63 64 65 66 67 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['merchant_reference_number'] = 'merchantReferenceNumber' @_hash['conversion_time'] = 'conversionTime' @_hash['request_id'] = 'requestId' @_hash['original_decision'] = 'originalDecision' @_hash['new_decision'] = 'newDecision' @_hash['reviewer'] = 'reviewer' @_hash['reviewer_comments'] = 'reviewerComments' @_hash['queue'] = 'queue' @_hash['profile'] = 'profile' @_hash['notes'] = 'notes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
86 87 88 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 86 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 70 def self.optionals %w[ merchant_reference_number conversion_time request_id original_decision new_decision reviewer reviewer_comments queue profile notes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
236 237 238 239 240 241 242 243 244 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 236 def inspect class_name = self.class.name.split('::').last "<#{class_name} merchant_reference_number: #{@merchant_reference_number.inspect},"\ " conversion_time: #{@conversion_time.inspect}, request_id: #{@request_id.inspect},"\ " original_decision: #{@original_decision.inspect}, new_decision: #{@new_decision.inspect},"\ " reviewer: #{@reviewer.inspect}, reviewer_comments: #{@reviewer_comments.inspect}, queue:"\ " #{@queue.inspect}, profile: #{@profile.inspect}, notes: #{@notes.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_conversion_time ⇒ Object
167 168 169 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 167 def to_custom_conversion_time DateTimeHelper.to_rfc3339(conversion_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
226 227 228 229 230 231 232 233 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 226 def to_s class_name = self.class.name.split('::').last "<#{class_name} merchant_reference_number: #{@merchant_reference_number}, conversion_time:"\ " #{@conversion_time}, request_id: #{@request_id}, original_decision: #{@original_decision},"\ " new_decision: #{@new_decision}, reviewer: #{@reviewer}, reviewer_comments:"\ " #{@reviewer_comments}, queue: #{@queue}, profile: #{@profile}, notes: #{@notes},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/cyber_source_merged_spec/models/conversion_detail.rb', line 202 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_attribute(root, 'MerchantReferenceNumber', merchant_reference_number) XmlUtilities.add_as_attribute(root, 'ConversionDate', conversion_time, datetime_format: 'rfc3339') XmlUtilities.add_as_attribute(root, 'RequestID', request_id) XmlUtilities.add_as_subelement(doc, root, 'OriginalDecision', original_decision) XmlUtilities.add_as_subelement(doc, root, 'NewDecision', new_decision) XmlUtilities.add_as_subelement(doc, root, 'Reviewer', reviewer) XmlUtilities.add_as_subelement(doc, root, 'ReviewerComments', reviewer_comments) XmlUtilities.add_as_subelement(doc, root, 'Queue', queue) XmlUtilities.add_as_subelement(doc, root, 'Profile', profile) XmlUtilities.add_array_as_subelement(doc, root, 'Notes', notes) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |