Class: CyberSourceMergedSpec::OrderInformation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::OrderInformation
- Defined in:
- lib/cyber_source_merged_spec/models/order_information.rb
Overview
OrderInformation Model.
Instance Attribute Summary collapse
-
#amount_details ⇒ AmountDetails
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus.
-
#bill_to ⇒ BillTo
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus.
-
#cutoff_date_time ⇒ String
Starting date and time for an event or a journey that is independent of which transportation mechanism, in UTC.
-
#digital_currency ⇒ DigitalCurrency
Digital currency information for the order.
-
#extension_days ⇒ String
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus.
-
#invoice_details ⇒ InvoiceDetails
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus.
-
#is_cryptocurrency_purchase ⇒ String
Visa Platform Connect : This API will contain the Flag that specifies whether the payment is for the purchase of cryptocurrency.
-
#line_items ⇒ Array[LineItem]
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus.
-
#pre_order ⇒ String
Indicates whether cardholder is placing an order with a future availability or release date.
-
#pre_order_date ⇒ String
Expected date that a pre-ordered purchase will be available.
-
#reordered ⇒ TrueClass | FalseClass
Indicates whether the cardholder is reordering previously purchased merchandise.
-
#returns_accepted ⇒ TrueClass | FalseClass
This is only needed when you are requesting both payment and DM service at same time.
-
#ship_to ⇒ ShipTo
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus.
-
#shipping_details ⇒ ShippingDetails
Contains shipping information not related to address.
-
#total_offers_count ⇒ String
Total number of articles/items in the order as a numeric decimal count.
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(extension_days: SKIP, amount_details: SKIP, bill_to: SKIP, ship_to: SKIP, line_items: SKIP, invoice_details: SKIP, shipping_details: SKIP, digital_currency: SKIP, returns_accepted: SKIP, is_cryptocurrency_purchase: SKIP, cutoff_date_time: SKIP, pre_order: SKIP, pre_order_date: SKIP, reordered: SKIP, total_offers_count: SKIP, additional_properties: nil) ⇒ OrderInformation
constructor
A new instance of OrderInformation.
-
#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(extension_days: SKIP, amount_details: SKIP, bill_to: SKIP, ship_to: SKIP, line_items: SKIP, invoice_details: SKIP, shipping_details: SKIP, digital_currency: SKIP, returns_accepted: SKIP, is_cryptocurrency_purchase: SKIP, cutoff_date_time: SKIP, pre_order: SKIP, pre_order_date: SKIP, reordered: SKIP, total_offers_count: SKIP, additional_properties: nil) ⇒ OrderInformation
Returns a new instance of OrderInformation.
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 161 def initialize(extension_days: SKIP, amount_details: SKIP, bill_to: SKIP, ship_to: SKIP, line_items: SKIP, invoice_details: SKIP, shipping_details: SKIP, digital_currency: SKIP, returns_accepted: SKIP, is_cryptocurrency_purchase: SKIP, cutoff_date_time: SKIP, pre_order: SKIP, pre_order_date: SKIP, reordered: SKIP, total_offers_count: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @extension_days = extension_days unless extension_days == SKIP @amount_details = amount_details unless amount_details == SKIP @bill_to = bill_to unless bill_to == SKIP @ship_to = ship_to unless ship_to == SKIP @line_items = line_items unless line_items == SKIP @invoice_details = invoice_details unless invoice_details == SKIP @shipping_details = shipping_details unless shipping_details == SKIP @digital_currency = digital_currency unless digital_currency == SKIP @returns_accepted = returns_accepted unless returns_accepted == SKIP unless is_cryptocurrency_purchase == SKIP @is_cryptocurrency_purchase = is_cryptocurrency_purchase end @cutoff_date_time = cutoff_date_time unless cutoff_date_time == SKIP @pre_order = pre_order unless pre_order == SKIP @pre_order_date = pre_order_date unless pre_order_date == SKIP @reordered = reordered unless reordered == SKIP @total_offers_count = total_offers_count unless total_offers_count == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#amount_details ⇒ AmountDetails
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus. Applicable for Re-Authorization (AP_REAUTH) service.
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 22 def amount_details @amount_details end |
#bill_to ⇒ BillTo
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus. Applicable for Re-Authorization (AP_REAUTH) service.
28 29 30 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 28 def bill_to @bill_to end |
#cutoff_date_time ⇒ String
Starting date and time for an event or a journey that is independent of which transportation mechanism, in UTC. The cutoffDateTime will supersede travelInformation.transit.airline.legs.departureDate and travelInformation.transit.airline.legs.departureTime if these fields are supplied in the request. Format: YYYY-MM-DDThh:mm:ssZ. Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC.
86 87 88 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 86 def cutoff_date_time @cutoff_date_time end |
#digital_currency ⇒ DigitalCurrency
Digital currency information for the order.
54 55 56 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 54 def digital_currency @digital_currency end |
#extension_days ⇒ String
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus. Applicable for Re-Authorization (AP_REAUTH) service.
16 17 18 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 16 def extension_days @extension_days end |
#invoice_details ⇒ InvoiceDetails
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus. Applicable for Re-Authorization (AP_REAUTH) service.
46 47 48 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 46 def invoice_details @invoice_details end |
#is_cryptocurrency_purchase ⇒ String
Visa Platform Connect :
This API will contain the Flag that specifies whether the payment is for the purchase of cryptocurrency. Additional values to add : This API will contain the Flag that specifies whether the payment is for the purchase of cryptocurrency. valid values are
- Y/y, true
- N/n, false
75 76 77 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 75 def is_cryptocurrency_purchase @is_cryptocurrency_purchase end |
#line_items ⇒ Array[LineItem]
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus. Applicable for Re-Authorization (AP_REAUTH) service.
40 41 42 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 40 def line_items @line_items end |
#pre_order ⇒ String
Indicates whether cardholder is placing an order with a future availability or release date. This field can contain one of these values:
- MERCHANDISE_AVAILABLE: Merchandise available
- FUTURE_AVAILABILITY: Future availability
94 95 96 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 94 def pre_order @pre_order end |
#pre_order_date ⇒ String
Expected date that a pre-ordered purchase will be available. Format: YYYYMMDD
99 100 101 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 99 def pre_order_date @pre_order_date end |
#reordered ⇒ TrueClass | FalseClass
Indicates whether the cardholder is reordering previously purchased merchandise. This field can contain one of these values:
- false: First time ordered
- true: Reordered
107 108 109 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 107 def reordered @reordered end |
#returns_accepted ⇒ TrueClass | FalseClass
This is only needed when you are requesting both payment and DM service at same time. Boolean that indicates whether returns are accepted for this order. This field can contain one of the following values:
- true: Returns are accepted for this order.
- false: Returns are not accepted for this order.
63 64 65 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 63 def returns_accepted @returns_accepted end |
#ship_to ⇒ ShipTo
Request field for merchant to increase the AUTH expiry days for Klarna Advantage Plus. Applicable for Re-Authorization (AP_REAUTH) service.
34 35 36 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 34 def ship_to @ship_to end |
#shipping_details ⇒ ShippingDetails
Contains shipping information not related to address.
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 50 def shipping_details @shipping_details end |
#total_offers_count ⇒ String
Total number of articles/items in the order as a numeric decimal count. Possible values: 00 - 99
112 113 114 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 112 def total_offers_count @total_offers_count end |
Class Method Details
.from_element(root) ⇒ Object
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 254 def self.from_element(root) extension_days = XmlUtilities.from_element(root, 'extensionDays', String) amount_details = XmlUtilities.from_element(root, 'AmountDetails', AmountDetails) bill_to = XmlUtilities.from_element(root, 'BillTo', BillTo) ship_to = XmlUtilities.from_element(root, 'ShipTo', ShipTo) line_items = XmlUtilities.from_element_to_array(root, 'LineItem', LineItem) invoice_details = XmlUtilities.from_element(root, 'InvoiceDetails', InvoiceDetails) shipping_details = XmlUtilities.from_element(root, 'ShippingDetails', ShippingDetails) digital_currency = XmlUtilities.from_element(root, 'DigitalCurrency', DigitalCurrency) returns_accepted = XmlUtilities.from_element(root, 'returnsAccepted', TrueClass) is_cryptocurrency_purchase = XmlUtilities.from_element( root, 'isCryptocurrencyPurchase', String ) cutoff_date_time = XmlUtilities.from_element(root, 'cutoffDateTime', String) pre_order = XmlUtilities.from_element(root, 'preOrder', String) pre_order_date = XmlUtilities.from_element(root, 'preOrderDate', String) reordered = XmlUtilities.from_element(root, 'reordered', TrueClass) total_offers_count = XmlUtilities.from_element(root, 'totalOffersCount', String) new(extension_days: extension_days, amount_details: amount_details, bill_to: bill_to, ship_to: ship_to, line_items: line_items, invoice_details: invoice_details, shipping_details: shipping_details, digital_currency: digital_currency, returns_accepted: returns_accepted, is_cryptocurrency_purchase: is_cryptocurrency_purchase, cutoff_date_time: cutoff_date_time, pre_order: pre_order, pre_order_date: pre_order_date, reordered: reordered, total_offers_count: total_offers_count, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 193 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. extension_days = hash.key?('extensionDays') ? hash['extensionDays'] : SKIP amount_details = AmountDetails.from_hash(hash['amountDetails']) if hash['amountDetails'] bill_to = BillTo.from_hash(hash['billTo']) if hash['billTo'] ship_to = ShipTo.from_hash(hash['shipTo']) if hash['shipTo'] # Parameter is an array, so we need to iterate through it line_items = nil unless hash['lineItems'].nil? line_items = [] hash['lineItems'].each do |structure| line_items << (LineItem.from_hash(structure) if structure) end end line_items = SKIP unless hash.key?('lineItems') invoice_details = InvoiceDetails.from_hash(hash['invoiceDetails']) if hash['invoiceDetails'] shipping_details = ShippingDetails.from_hash(hash['shippingDetails']) if hash['shippingDetails'] digital_currency = DigitalCurrency.from_hash(hash['digitalCurrency']) if hash['digitalCurrency'] returns_accepted = hash.key?('returnsAccepted') ? hash['returnsAccepted'] : SKIP is_cryptocurrency_purchase = hash.key?('isCryptocurrencyPurchase') ? hash['isCryptocurrencyPurchase'] : SKIP cutoff_date_time = hash.key?('cutoffDateTime') ? hash['cutoffDateTime'] : SKIP pre_order = hash.key?('preOrder') ? hash['preOrder'] : SKIP pre_order_date = hash.key?('preOrderDate') ? hash['preOrderDate'] : SKIP reordered = hash.key?('reordered') ? hash['reordered'] : SKIP total_offers_count = hash.key?('totalOffersCount') ? hash['totalOffersCount'] : 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. OrderInformation.new(extension_days: extension_days, amount_details: amount_details, bill_to: bill_to, ship_to: ship_to, line_items: line_items, invoice_details: invoice_details, shipping_details: shipping_details, digital_currency: digital_currency, returns_accepted: returns_accepted, is_cryptocurrency_purchase: is_cryptocurrency_purchase, cutoff_date_time: cutoff_date_time, pre_order: pre_order, pre_order_date: pre_order_date, reordered: reordered, total_offers_count: total_offers_count, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 115 def self.names @_hash = {} if @_hash.nil? @_hash['extension_days'] = 'extensionDays' @_hash['amount_details'] = 'amountDetails' @_hash['bill_to'] = 'billTo' @_hash['ship_to'] = 'shipTo' @_hash['line_items'] = 'lineItems' @_hash['invoice_details'] = 'invoiceDetails' @_hash['shipping_details'] = 'shippingDetails' @_hash['digital_currency'] = 'digitalCurrency' @_hash['returns_accepted'] = 'returnsAccepted' @_hash['is_cryptocurrency_purchase'] = 'isCryptocurrencyPurchase' @_hash['cutoff_date_time'] = 'cutoffDateTime' @_hash['pre_order'] = 'preOrder' @_hash['pre_order_date'] = 'preOrderDate' @_hash['reordered'] = 'reordered' @_hash['total_offers_count'] = 'totalOffersCount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
157 158 159 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 157 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 136 def self.optionals %w[ extension_days amount_details bill_to ship_to line_items invoice_details shipping_details digital_currency returns_accepted is_cryptocurrency_purchase cutoff_date_time pre_order pre_order_date reordered total_offers_count ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 344 def inspect class_name = self.class.name.split('::').last "<#{class_name} extension_days: #{@extension_days.inspect}, amount_details:"\ " #{@amount_details.inspect}, bill_to: #{@bill_to.inspect}, ship_to: #{@ship_to.inspect},"\ " line_items: #{@line_items.inspect}, invoice_details: #{@invoice_details.inspect},"\ " shipping_details: #{@shipping_details.inspect}, digital_currency:"\ " #{@digital_currency.inspect}, returns_accepted: #{@returns_accepted.inspect},"\ " is_cryptocurrency_purchase: #{@is_cryptocurrency_purchase.inspect}, cutoff_date_time:"\ " #{@cutoff_date_time.inspect}, pre_order: #{@pre_order.inspect}, pre_order_date:"\ " #{@pre_order_date.inspect}, reordered: #{@reordered.inspect}, total_offers_count:"\ " #{@total_offers_count.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 331 def to_s class_name = self.class.name.split('::').last "<#{class_name} extension_days: #{@extension_days}, amount_details: #{@amount_details},"\ " bill_to: #{@bill_to}, ship_to: #{@ship_to}, line_items: #{@line_items}, invoice_details:"\ " #{@invoice_details}, shipping_details: #{@shipping_details}, digital_currency:"\ " #{@digital_currency}, returns_accepted: #{@returns_accepted}, is_cryptocurrency_purchase:"\ " #{@is_cryptocurrency_purchase}, cutoff_date_time: #{@cutoff_date_time}, pre_order:"\ " #{@pre_order}, pre_order_date: #{@pre_order_date}, reordered: #{@reordered},"\ " total_offers_count: #{@total_offers_count}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/cyber_source_merged_spec/models/order_information.rb', line 299 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'extensionDays', extension_days) XmlUtilities.add_as_subelement(doc, root, 'AmountDetails', amount_details) XmlUtilities.add_as_subelement(doc, root, 'BillTo', bill_to) XmlUtilities.add_as_subelement(doc, root, 'ShipTo', ship_to) XmlUtilities.add_array_as_subelement(doc, root, 'LineItem', line_items) XmlUtilities.add_as_subelement(doc, root, 'InvoiceDetails', invoice_details) XmlUtilities.add_as_subelement(doc, root, 'ShippingDetails', shipping_details) XmlUtilities.add_as_subelement(doc, root, 'DigitalCurrency', digital_currency) XmlUtilities.add_as_subelement(doc, root, 'returnsAccepted', returns_accepted) XmlUtilities.add_as_subelement(doc, root, 'isCryptocurrencyPurchase', is_cryptocurrency_purchase) XmlUtilities.add_as_subelement(doc, root, 'cutoffDateTime', cutoff_date_time) XmlUtilities.add_as_subelement(doc, root, 'preOrder', pre_order) XmlUtilities.add_as_subelement(doc, root, 'preOrderDate', pre_order_date) XmlUtilities.add_as_subelement(doc, root, 'reordered', reordered) XmlUtilities.add_as_subelement(doc, root, 'totalOffersCount', total_offers_count) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |