Class: CyberSourceMergedSpec::AmountDetails28
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::AmountDetails28
- Defined in:
- lib/cyber_source_merged_spec/models/amount_details28.rb
Overview
AmountDetails28 Model.
Instance Attribute Summary collapse
-
#currency ⇒ String
Currency used for the order.
-
#discount_amount ⇒ String
Total discount amount applied to the order.
-
#duty_amount ⇒ String
Total charges for any import or export duties included in the order.
-
#exchange_rate ⇒ String
Exchange rate returned by the DCC service.
-
#exchange_rate_time_stamp ⇒ String
Time stamp for the exchange rate.
-
#giftwrap_amount ⇒ String
giftwrap amount (RFU).
-
#handling_amount ⇒ String
handling amount (RFU).
-
#insurance_amount ⇒ String
insurance amount (RFU).
-
#invoice_amount ⇒ String
Invoice amount.
-
#settlement_currency ⇒ String
This is a multicurrency-only field.
-
#shipping_amount ⇒ String
shipping amount (RFU).
-
#shipping_discount_amount ⇒ String
shipping discount amount (RFU).
-
#tax_amount ⇒ String
Total tax amount for all the items in the order.
-
#total_amount ⇒ String
Grand total for the order.
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(total_amount: SKIP, currency: SKIP, discount_amount: SKIP, tax_amount: SKIP, duty_amount: SKIP, exchange_rate: SKIP, exchange_rate_time_stamp: SKIP, settlement_currency: SKIP, invoice_amount: SKIP, giftwrap_amount: SKIP, handling_amount: SKIP, shipping_amount: SKIP, shipping_discount_amount: SKIP, insurance_amount: SKIP, additional_properties: nil) ⇒ AmountDetails28
constructor
A new instance of AmountDetails28.
-
#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(total_amount: SKIP, currency: SKIP, discount_amount: SKIP, tax_amount: SKIP, duty_amount: SKIP, exchange_rate: SKIP, exchange_rate_time_stamp: SKIP, settlement_currency: SKIP, invoice_amount: SKIP, giftwrap_amount: SKIP, handling_amount: SKIP, shipping_amount: SKIP, shipping_discount_amount: SKIP, insurance_amount: SKIP, additional_properties: nil) ⇒ AmountDetails28
Returns a new instance of AmountDetails28.
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 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 195 def initialize(total_amount: SKIP, currency: SKIP, discount_amount: SKIP, tax_amount: SKIP, duty_amount: SKIP, exchange_rate: SKIP, exchange_rate_time_stamp: SKIP, settlement_currency: SKIP, invoice_amount: SKIP, giftwrap_amount: SKIP, handling_amount: SKIP, shipping_amount: SKIP, shipping_discount_amount: SKIP, insurance_amount: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @total_amount = total_amount unless total_amount == SKIP @currency = currency unless currency == SKIP @discount_amount = discount_amount unless discount_amount == SKIP @tax_amount = tax_amount unless tax_amount == SKIP @duty_amount = duty_amount unless duty_amount == SKIP @exchange_rate = exchange_rate unless exchange_rate == SKIP @exchange_rate_time_stamp = exchange_rate_time_stamp unless exchange_rate_time_stamp == SKIP @settlement_currency = settlement_currency unless settlement_currency == SKIP @invoice_amount = invoice_amount unless invoice_amount == SKIP @giftwrap_amount = giftwrap_amount unless giftwrap_amount == SKIP @handling_amount = handling_amount unless handling_amount == SKIP @shipping_amount = shipping_amount unless shipping_amount == SKIP @shipping_discount_amount = shipping_discount_amount unless shipping_discount_amount == SKIP @insurance_amount = insurance_amount unless insurance_amount == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#currency ⇒ String
Currency used for the order. Use the three-character [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/cur rencies.pdf)
Used by
Authorization
Required field.
Authorization Reversal
For an authorization reversal (reversalInformation) or a capture
(processingOptions.capture is set to true), you must use the same
currency that you used in your payment authorization request.
PIN Debit
Currency for the amount you requested for the PIN debit purchase. This value is returned for partial authorizations. The issuing bank can approve a partial amount if the balance on the debit card is less than the requested transaction amount. For the possible values, see the [ISO Standard Currency Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/currencies.pdf). Returned by PIN debit purchase. For PIN debit reversal requests, you must use the same currency that was used for the PIN debit purchase or PIN debit credit that you are reversing. For the possible values, see the [ISO Standard Currency Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/currencies.pdf). Required field for PIN Debit purchase and PIN Debit credit requests. Optional field for PIN Debit reversal requests.
GPX
This field is optional for reversing an authorization or credit.
DCC for First Data
Your local currency.
Tax Calculation
Required for international tax and value added tax only. Optional for U.S. and Canadian taxes. Your local currency.
82 83 84 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 82 def currency @currency end |
#discount_amount ⇒ String
Total discount amount applied to the order.
86 87 88 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 86 def discount_amount @discount_amount end |
#duty_amount ⇒ String
Total charges for any import or export duties included in the order.
94 95 96 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 94 def duty_amount @duty_amount end |
#exchange_rate ⇒ String
Exchange rate returned by the DCC service. Includes a decimal point and a maximum of 4 decimal places.
99 100 101 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 99 def exchange_rate @exchange_rate end |
#exchange_rate_time_stamp ⇒ String
Time stamp for the exchange rate. This value is returned by the DCC
service.
Format: YYYYMMDD~HH:MM where ~ denotes a space.
105 106 107 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 105 def exchange_rate_time_stamp @exchange_rate_time_stamp end |
#giftwrap_amount ⇒ String
giftwrap amount (RFU).
132 133 134 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 132 def giftwrap_amount @giftwrap_amount end |
#handling_amount ⇒ String
handling amount (RFU)
136 137 138 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 136 def handling_amount @handling_amount end |
#insurance_amount ⇒ String
insurance amount (RFU)
148 149 150 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 148 def insurance_amount @insurance_amount end |
#invoice_amount ⇒ String
Invoice amount. The invoice amount issued by the Merchant to the Cardholder, which includes VAT (excluding items such as TIPS or CASHBACK). For transactions that do not have applicable Benefit Laws, the field may be entered as zeros. This field is only applicable for Uruguay market. Example: 100.00 Uruguay The value for this field corresponds to the following data in the TC 33 capture file:
- Record: CP01 TCR9
- Position: 7-18
- Field: Invoice Amount
128 129 130 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 128 def invoice_amount @invoice_amount end |
#settlement_currency ⇒ String
This is a multicurrency-only field. It contains a 3-digit numeric code that identifies the currency used by the issuer to bill the cardholder's account. This field is returned for OCT transactions.
112 113 114 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 112 def settlement_currency @settlement_currency end |
#shipping_amount ⇒ String
shipping amount (RFU)
140 141 142 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 140 def shipping_amount @shipping_amount end |
#shipping_discount_amount ⇒ String
shipping discount amount (RFU)
144 145 146 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 144 def shipping_discount_amount @shipping_discount_amount end |
#tax_amount ⇒ String
Total tax amount for all the items in the order.
90 91 92 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 90 def tax_amount @tax_amount end |
#total_amount ⇒ String
Grand total for the order. This value cannot be negative. You can include a decimal point (.), but no other special characters. CyberSource truncates the amount to the correct number of decimal places. Note For CTV, FDCCompass, Paymentech processors, the maximum length for this field is 12. Important Some processors have specific requirements and limitations, such as maximum amounts and maximum field lengths. If your processor supports zero amount authorizations, you can set this field to 0 for the authorization to check if the card is lost or stolen.
Card Present
Required to include either this field or
orderInformation.lineItems[].unitPrice for the order.
Invoicing / Pay By Link
Required for creating a new invoice or payment link.
PIN Debit
Amount you requested for the PIN debit purchase. This value is returned for partial authorizations. The issuing bank can approve a partial amount if the balance on the debit card is less than the requested transaction amount. Required field for PIN Debit purchase and PIN Debit credit requests. Optional field for PIN Debit reversal requests.
GPX
This field is optional for reversing an authorization or credit; however, for all other processors, these fields are required.
DCC with a Third-Party Provider
Set this field to the converted amount that was returned by the DCC provider. You must include either this field or the 1st line item in the order and the specific line-order amount in your request.
DCC for First Data
Not used.
43 44 45 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 43 def total_amount @total_amount end |
Class Method Details
.from_element(root) ⇒ Object
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 275 def self.from_element(root) total_amount = XmlUtilities.from_element(root, 'totalAmount', String) currency = XmlUtilities.from_element(root, 'currency', String) discount_amount = XmlUtilities.from_element(root, 'discountAmount', String) tax_amount = XmlUtilities.from_element(root, 'taxAmount', String) duty_amount = XmlUtilities.from_element(root, 'dutyAmount', String) exchange_rate = XmlUtilities.from_element(root, 'exchangeRate', String) exchange_rate_time_stamp = XmlUtilities.from_element( root, 'exchangeRateTimeStamp', String ) settlement_currency = XmlUtilities.from_element(root, 'settlementCurrency', String) invoice_amount = XmlUtilities.from_element(root, 'invoiceAmount', String) giftwrap_amount = XmlUtilities.from_element(root, 'giftwrapAmount', String) handling_amount = XmlUtilities.from_element(root, 'handlingAmount', String) shipping_amount = XmlUtilities.from_element(root, 'shippingAmount', String) shipping_discount_amount = XmlUtilities.from_element( root, 'shippingDiscountAmount', String ) insurance_amount = XmlUtilities.from_element(root, 'insuranceAmount', String) new(total_amount: total_amount, currency: currency, discount_amount: discount_amount, tax_amount: tax_amount, duty_amount: duty_amount, exchange_rate: exchange_rate, exchange_rate_time_stamp: exchange_rate_time_stamp, settlement_currency: settlement_currency, invoice_amount: invoice_amount, giftwrap_amount: giftwrap_amount, handling_amount: handling_amount, shipping_amount: shipping_amount, shipping_discount_amount: shipping_discount_amount, insurance_amount: insurance_amount, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 223 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. total_amount = hash.key?('totalAmount') ? hash['totalAmount'] : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP discount_amount = hash.key?('discountAmount') ? hash['discountAmount'] : SKIP tax_amount = hash.key?('taxAmount') ? hash['taxAmount'] : SKIP duty_amount = hash.key?('dutyAmount') ? hash['dutyAmount'] : SKIP exchange_rate = hash.key?('exchangeRate') ? hash['exchangeRate'] : SKIP exchange_rate_time_stamp = hash.key?('exchangeRateTimeStamp') ? hash['exchangeRateTimeStamp'] : SKIP settlement_currency = hash.key?('settlementCurrency') ? hash['settlementCurrency'] : SKIP invoice_amount = hash.key?('invoiceAmount') ? hash['invoiceAmount'] : SKIP giftwrap_amount = hash.key?('giftwrapAmount') ? hash['giftwrapAmount'] : SKIP handling_amount = hash.key?('handlingAmount') ? hash['handlingAmount'] : SKIP shipping_amount = hash.key?('shippingAmount') ? hash['shippingAmount'] : SKIP shipping_discount_amount = hash.key?('shippingDiscountAmount') ? hash['shippingDiscountAmount'] : SKIP insurance_amount = hash.key?('insuranceAmount') ? hash['insuranceAmount'] : 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. AmountDetails28.new(total_amount: total_amount, currency: currency, discount_amount: discount_amount, tax_amount: tax_amount, duty_amount: duty_amount, exchange_rate: exchange_rate, exchange_rate_time_stamp: exchange_rate_time_stamp, settlement_currency: settlement_currency, invoice_amount: invoice_amount, giftwrap_amount: giftwrap_amount, handling_amount: handling_amount, shipping_amount: shipping_amount, shipping_discount_amount: shipping_discount_amount, insurance_amount: insurance_amount, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 151 def self.names @_hash = {} if @_hash.nil? @_hash['total_amount'] = 'totalAmount' @_hash['currency'] = 'currency' @_hash['discount_amount'] = 'discountAmount' @_hash['tax_amount'] = 'taxAmount' @_hash['duty_amount'] = 'dutyAmount' @_hash['exchange_rate'] = 'exchangeRate' @_hash['exchange_rate_time_stamp'] = 'exchangeRateTimeStamp' @_hash['settlement_currency'] = 'settlementCurrency' @_hash['invoice_amount'] = 'invoiceAmount' @_hash['giftwrap_amount'] = 'giftwrapAmount' @_hash['handling_amount'] = 'handlingAmount' @_hash['shipping_amount'] = 'shippingAmount' @_hash['shipping_discount_amount'] = 'shippingDiscountAmount' @_hash['insurance_amount'] = 'insuranceAmount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
191 192 193 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 191 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 171 def self.optionals %w[ total_amount currency discount_amount tax_amount duty_amount exchange_rate exchange_rate_time_stamp settlement_currency invoice_amount giftwrap_amount handling_amount shipping_amount shipping_discount_amount insurance_amount ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 364 def inspect class_name = self.class.name.split('::').last "<#{class_name} total_amount: #{@total_amount.inspect}, currency: #{@currency.inspect},"\ " discount_amount: #{@discount_amount.inspect}, tax_amount: #{@tax_amount.inspect},"\ " duty_amount: #{@duty_amount.inspect}, exchange_rate: #{@exchange_rate.inspect},"\ " exchange_rate_time_stamp: #{@exchange_rate_time_stamp.inspect}, settlement_currency:"\ " #{@settlement_currency.inspect}, invoice_amount: #{@invoice_amount.inspect},"\ " giftwrap_amount: #{@giftwrap_amount.inspect}, handling_amount:"\ " #{@handling_amount.inspect}, shipping_amount: #{@shipping_amount.inspect},"\ " shipping_discount_amount: #{@shipping_discount_amount.inspect}, insurance_amount:"\ " #{@insurance_amount.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 351 def to_s class_name = self.class.name.split('::').last "<#{class_name} total_amount: #{@total_amount}, currency: #{@currency}, discount_amount:"\ " #{@discount_amount}, tax_amount: #{@tax_amount}, duty_amount: #{@duty_amount},"\ " exchange_rate: #{@exchange_rate}, exchange_rate_time_stamp: #{@exchange_rate_time_stamp},"\ " settlement_currency: #{@settlement_currency}, invoice_amount: #{@invoice_amount},"\ " giftwrap_amount: #{@giftwrap_amount}, handling_amount: #{@handling_amount},"\ " shipping_amount: #{@shipping_amount}, shipping_discount_amount:"\ " #{@shipping_discount_amount}, insurance_amount: #{@insurance_amount},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/cyber_source_merged_spec/models/amount_details28.rb', line 319 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'totalAmount', total_amount) XmlUtilities.add_as_subelement(doc, root, 'currency', currency) XmlUtilities.add_as_subelement(doc, root, 'discountAmount', discount_amount) XmlUtilities.add_as_subelement(doc, root, 'taxAmount', tax_amount) XmlUtilities.add_as_subelement(doc, root, 'dutyAmount', duty_amount) XmlUtilities.add_as_subelement(doc, root, 'exchangeRate', exchange_rate) XmlUtilities.add_as_subelement(doc, root, 'exchangeRateTimeStamp', exchange_rate_time_stamp) XmlUtilities.add_as_subelement(doc, root, 'settlementCurrency', settlement_currency) XmlUtilities.add_as_subelement(doc, root, 'invoiceAmount', invoice_amount) XmlUtilities.add_as_subelement(doc, root, 'giftwrapAmount', giftwrap_amount) XmlUtilities.add_as_subelement(doc, root, 'handlingAmount', handling_amount) XmlUtilities.add_as_subelement(doc, root, 'shippingAmount', shipping_amount) XmlUtilities.add_as_subelement(doc, root, 'shippingDiscountAmount', shipping_discount_amount) XmlUtilities.add_as_subelement(doc, root, 'insuranceAmount', insurance_amount) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |