cybersource_rest_client 0.0.73 → 0.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/core/MerchantConfig.rb +2 -1
  3. data/lib/cybersource_rest_client/api/batches_api.rb +9 -9
  4. data/lib/cybersource_rest_client/api/bin_lookup_api.rb +5 -5
  5. data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +6 -6
  6. data/lib/cybersource_rest_client/api/decision_manager_api.rb +3 -3
  7. data/lib/cybersource_rest_client/api/device_de_association_api.rb +168 -0
  8. data/lib/cybersource_rest_client/api/device_search_api.rb +78 -5
  9. data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +9 -9
  10. data/lib/cybersource_rest_client/api/merchant_boarding_api.rb +3 -3
  11. data/lib/cybersource_rest_client/api/payment_tokens_api.rb +96 -0
  12. data/lib/cybersource_rest_client/api/subscriptions_api.rb +5 -2
  13. data/lib/cybersource_rest_client/models/create_order_request.rb +269 -229
  14. data/lib/cybersource_rest_client/models/de_association_request_body.rb +190 -0
  15. data/lib/cybersource_rest_client/models/generate_capture_context_request.rb +1 -1
  16. data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +2 -2
  17. data/lib/cybersource_rest_client/models/get_subscription_response.rb +15 -5
  18. data/lib/cybersource_rest_client/models/get_subscription_response_reactivation_information.rb +213 -0
  19. data/lib/cybersource_rest_client/models/inline_response_200_10.rb +292 -0
  20. data/lib/cybersource_rest_client/models/{inline_response_200_9_records.rb → inline_response_200_10_records.rb} +3 -3
  21. data/lib/cybersource_rest_client/models/{inline_response_200_9_response_record.rb → inline_response_200_10_response_record.rb} +2 -2
  22. data/lib/cybersource_rest_client/models/{inline_response_200_9_response_record_additional_updates.rb → inline_response_200_10_response_record_additional_updates.rb} +1 -1
  23. data/lib/cybersource_rest_client/models/{inline_response_200_9_source_record.rb → inline_response_200_10_source_record.rb} +1 -1
  24. data/lib/cybersource_rest_client/models/inline_response_200_2.rb +253 -253
  25. data/lib/cybersource_rest_client/models/inline_response_200_5.rb +55 -10
  26. data/lib/cybersource_rest_client/models/inline_response_200_5_devices.rb +357 -0
  27. data/lib/cybersource_rest_client/models/inline_response_200_6.rb +10 -55
  28. data/lib/cybersource_rest_client/models/inline_response_200_7.rb +33 -37
  29. data/lib/cybersource_rest_client/models/{inline_response_200_6_devices.rb → inline_response_200_7_devices.rb} +2 -2
  30. data/lib/cybersource_rest_client/models/{inline_response_200_6_payment_processor_to_terminal_map.rb → inline_response_200_7_payment_processor_to_terminal_map.rb} +1 -1
  31. data/lib/cybersource_rest_client/models/inline_response_200_8.rb +47 -86
  32. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded.rb → inline_response_200_8__embedded.rb} +2 -2
  33. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded__links.rb → inline_response_200_8__embedded__links.rb} +2 -2
  34. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded__links_reports.rb → inline_response_200_8__embedded__links_reports.rb} +1 -1
  35. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded_batches.rb → inline_response_200_8__embedded_batches.rb} +3 -3
  36. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded_totals.rb → inline_response_200_8__embedded_totals.rb} +1 -1
  37. data/lib/cybersource_rest_client/models/inline_response_200_8__links.rb +16 -17
  38. data/lib/cybersource_rest_client/models/inline_response_200_9.rb +47 -49
  39. data/lib/cybersource_rest_client/models/inline_response_200_9__links.rb +201 -0
  40. data/lib/cybersource_rest_client/models/{inline_response_200_8__links_report.rb → inline_response_200_9__links_report.rb} +1 -1
  41. data/lib/cybersource_rest_client/models/{inline_response_200_8_billing.rb → inline_response_200_9_billing.rb} +1 -1
  42. data/lib/cybersource_rest_client/models/inline_response_201.rb +227 -218
  43. data/lib/cybersource_rest_client/models/inline_response_201_1.rb +218 -248
  44. data/lib/cybersource_rest_client/models/inline_response_201_2.rb +248 -281
  45. data/lib/cybersource_rest_client/models/{inline_response_201_1_payout_information.rb → inline_response_201_2_payout_information.rb} +216 -216
  46. data/lib/cybersource_rest_client/models/{inline_response_201_1_payout_information_pull_funds.rb → inline_response_201_2_payout_information_pull_funds.rb} +213 -213
  47. data/lib/cybersource_rest_client/models/{inline_response_201_1_payout_information_push_funds.rb → inline_response_201_2_payout_information_push_funds.rb} +417 -417
  48. data/lib/cybersource_rest_client/models/inline_response_201_3.rb +281 -222
  49. data/lib/cybersource_rest_client/models/{inline_response_201_2_integration_information.rb → inline_response_201_3_integration_information.rb} +192 -192
  50. data/lib/cybersource_rest_client/models/{inline_response_201_2_integration_information_tenant_configurations.rb → inline_response_201_3_integration_information_tenant_configurations.rb} +253 -253
  51. data/lib/cybersource_rest_client/models/{inline_response_201_2_organization_information.rb → inline_response_201_3_organization_information.rb} +217 -217
  52. data/lib/cybersource_rest_client/models/{inline_response_201_2_product_information_setups.rb → inline_response_201_3_product_information_setups.rb} +214 -214
  53. data/lib/cybersource_rest_client/models/{inline_response_201_2_registration_information.rb → inline_response_201_3_registration_information.rb} +222 -222
  54. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups.rb → inline_response_201_3_setups.rb} +219 -219
  55. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_commerce_solutions.rb → inline_response_201_3_setups_commerce_solutions.rb} +209 -209
  56. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_payments.rb → inline_response_201_3_setups_payments.rb} +369 -369
  57. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_payments_alternative_payment_methods.rb → inline_response_201_3_setups_payments_alternative_payment_methods.rb} +221 -221
  58. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_payments_alternative_payment_methods_configuration_status.rb → inline_response_201_3_setups_payments_alternative_payment_methods_configuration_status.rb} +200 -200
  59. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_payments_card_processing.rb → inline_response_201_3_setups_payments_card_processing.rb} +199 -199
  60. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_payments_card_processing_configuration_status.rb → inline_response_201_3_setups_payments_card_processing_configuration_status.rb} +255 -255
  61. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_payments_card_processing_subscription_status.rb → inline_response_201_3_setups_payments_card_processing_subscription_status.rb} +234 -234
  62. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_payments_digital_payments.rb → inline_response_201_3_setups_payments_digital_payments.rb} +189 -189
  63. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_risk.rb → inline_response_201_3_setups_risk.rb} +199 -199
  64. data/lib/cybersource_rest_client/models/{inline_response_201_2_setups_value_added_services.rb → inline_response_201_3_setups_value_added_services.rb} +209 -209
  65. data/lib/cybersource_rest_client/models/inline_response_201_4.rb +222 -312
  66. data/lib/cybersource_rest_client/models/{inline_response_201_3_key_information.rb → inline_response_201_4_key_information.rb} +300 -300
  67. data/lib/cybersource_rest_client/models/{inline_response_201_3_key_information_error_information.rb → inline_response_201_4_key_information_error_information.rb} +202 -202
  68. data/lib/cybersource_rest_client/models/{inline_response_201_3_key_information_error_information_details.rb → inline_response_201_4_key_information_error_information_details.rb} +201 -201
  69. data/lib/cybersource_rest_client/models/inline_response_201_5.rb +312 -277
  70. data/lib/cybersource_rest_client/models/inline_response_201_6.rb +277 -202
  71. data/lib/cybersource_rest_client/models/{inline_response_201_5_payloads.rb → inline_response_201_6_payloads.rb} +189 -189
  72. data/lib/cybersource_rest_client/models/{inline_response_201_5_payloads_test_payload.rb → inline_response_201_6_payloads_test_payload.rb} +190 -190
  73. data/lib/cybersource_rest_client/models/inline_response_201_7.rb +202 -0
  74. data/lib/cybersource_rest_client/models/inline_response_201_order_information.rb +189 -0
  75. data/lib/cybersource_rest_client/models/inline_response_201_order_information_ship_to.rb +315 -0
  76. data/lib/cybersource_rest_client/models/inline_response_201_payment_information.rb +199 -0
  77. data/lib/cybersource_rest_client/models/inline_response_201_payment_information_e_wallet.rb +196 -0
  78. data/lib/cybersource_rest_client/models/inline_response_201_payment_information_tokenized_payment_method.rb +213 -0
  79. data/lib/cybersource_rest_client/models/payments_products.rb +1 -1
  80. data/lib/cybersource_rest_client/models/payments_products_unified_checkout.rb +199 -0
  81. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information.rb +189 -0
  82. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations.rb +189 -0
  83. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations_features.rb +189 -0
  84. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations_features_paze.rb +213 -0
  85. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information.rb +225 -0
  86. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information_features.rb +189 -0
  87. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information_features_paze_for_unified_checkout.rb +190 -0
  88. data/lib/cybersource_rest_client/models/post_device_search_request.rb +223 -0
  89. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +609 -609
  90. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card.rb +269 -269
  91. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +364 -354
  92. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +309 -309
  93. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_payment_method.rb +213 -0
  94. data/lib/cybersource_rest_client/models/pts_v2_retrieve_payment_token_get400_response.rb +252 -0
  95. data/lib/cybersource_rest_client/models/pts_v2_retrieve_payment_token_get502_response.rb +240 -0
  96. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_card.rb +258 -258
  97. data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_tokenized_card.rb +275 -275
  98. data/lib/cybersource_rest_client/models/ptsv2intents_event_information.rb +212 -0
  99. data/lib/cybersource_rest_client/models/ptsv2intents_order_information_ship_to.rb +354 -332
  100. data/lib/cybersource_rest_client/models/ptsv2intents_payment_information.rb +220 -189
  101. data/lib/cybersource_rest_client/models/ptsv2intents_payment_information_e_wallet.rb +196 -0
  102. data/lib/cybersource_rest_client/models/ptsv2intents_payment_information_tokenized_payment_method.rb +241 -0
  103. data/lib/cybersource_rest_client/models/ptsv2intents_processing_information.rb +351 -219
  104. data/lib/cybersource_rest_client/models/ptsv2intents_recipient_information.rb +245 -0
  105. data/lib/cybersource_rest_client/models/ptsv2intents_sender_information.rb +277 -0
  106. data/lib/cybersource_rest_client/models/ptsv2intents_sender_information_account.rb +190 -0
  107. data/lib/cybersource_rest_client/models/ptsv2intents_travel_information.rb +211 -0
  108. data/lib/cybersource_rest_client/models/ptsv2intents_travel_information_agency.rb +245 -0
  109. data/lib/cybersource_rest_client/models/{inline_response_200_7__links.rb → ptsv2intentsid_payment_information.rb} +189 -200
  110. data/lib/cybersource_rest_client/models/ptsv2paymentreferences_order_information_amount_details.rb +417 -400
  111. data/lib/cybersource_rest_client/models/ptsv2paymentreferences_payment_information_card.rb +275 -275
  112. data/lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb +433 -416
  113. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +668 -651
  114. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +716 -699
  115. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +356 -346
  116. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +445 -445
  117. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +377 -377
  118. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_payment_method.rb +196 -0
  119. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_installment_information.rb +604 -604
  120. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +377 -377
  121. data/lib/cybersource_rest_client/models/ptsv2paymenttokens_payment_information.rb +199 -0
  122. data/lib/cybersource_rest_client/models/ptsv2paymenttokens_processing_information.rb +192 -0
  123. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +258 -258
  124. data/lib/cybersource_rest_client/models/request.rb +199 -0
  125. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +241 -241
  126. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +258 -258
  127. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +351 -351
  128. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_card.rb +268 -268
  129. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_tokenized_card.rb +299 -299
  130. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +259 -259
  131. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +259 -259
  132. data/lib/cybersource_rest_client/models/riskv1decisions_travel_information_legs.rb +16 -5
  133. data/lib/cybersource_rest_client/models/riskv1liststypeentries_payment_information_card.rb +224 -224
  134. data/lib/cybersource_rest_client/models/tms_bin_lookup_issuer_information.rb +264 -264
  135. data/lib/cybersource_rest_client/models/tms_bin_lookup_payment_account_information_card.rb +277 -277
  136. data/lib/cybersource_rest_client/models/tms_bin_lookup_payment_account_information_card_brands.rb +213 -213
  137. data/lib/cybersource_rest_client/models/tms_bin_lookup_payment_account_information_features.rb +430 -430
  138. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_brands.rb +201 -201
  139. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +365 -365
  140. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +12 -1
  141. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +218 -218
  142. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_processor_information.rb +245 -234
  143. data/lib/cybersource_rest_client/models/update_order_request.rb +229 -229
  144. data/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb +12 -1
  145. data/lib/cybersource_rest_client/models/upv1capturecontexts_complete_mandate.rb +18 -7
  146. data/lib/cybersource_rest_client.rb +75 -39
  147. metadata +77 -41
  148. data/lib/cybersource_rest_client/api/device_de_association_v3_api.rb +0 -96
@@ -1,699 +1,716 @@
1
- =begin
2
- #CyberSource Merged Spec
3
-
4
- #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
-
6
- OpenAPI spec version: 0.0.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.4.38
10
- =end
11
-
12
- require 'date'
13
-
14
- module CyberSource
15
- class Ptsv2paymentsOrderInformationLineItems
16
- # Type of product. The value for this field is used to identify the product category (electronic, handling, physical, service, or shipping). The default value is `default`. If you are performing an authorization transaction (`processingOptions.capture` is set to `false`), and you set this field to a value other than `default` or one of the values related to shipping and/or handling, then `orderInformation.lineItems[].quantity`, `orderInformation.lineItems[].productName`, and `orderInformation.lineItems[].productSku` fields are required. Optional field. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. The Product Codes for the tax service are located in the Cybersource Tax Codes guide. Contact Customer Support to request the guide. If you don't send a tax service Product Code in your tax request, product-based rules or exemptions will not be applied and the transaction will default to fully taxable in the locations where you've indicated you need to collect tax [by way of nexus, no nexus, or seller registration number fields].
17
- attr_accessor :product_code
18
-
19
- # For an authorization or capture transaction (`processingOptions.capture` is `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the other values that are related to shipping and/or handling. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes.
20
- attr_accessor :product_name
21
-
22
- # Product identifier code. Also known as the Stock Keeping Unit (SKU) code for the product. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not set to **default** or one of the other values that are related to shipping and/or handling. #### Tax Calculation Optional field for U.S. and Canadian taxes. Not applicable to international and value added taxes. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the values related to shipping and/or handling.
23
- attr_accessor :product_sku
24
-
25
- # Number of units for this order. Must be a non-negative integer. The default is `1`. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the other values related to shipping and/or handling. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes.
26
- attr_accessor :quantity
27
-
28
- # Per-item price of the product. This value for this field cannot be negative. You must include either this field or the request-level field `orderInformation.amountDetails.totalAmount` in your request. You can include a decimal point (.), but you cannot include any other special characters. The value is truncated to the correct number of decimal places. #### DCC with a Third-Party Provider Set this field to the converted amount that was returned by the DCC provider. You must include either the 1st line item in the order and this field, or the request-level field `orderInformation.amountDetails.totalAmount` in your request. #### Tax Calculation Required field for U.S., Canadian, international and value added taxes. #### Zero Amount Authorizations 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. #### Maximum Field Lengths For GPN and JCN Gateway: Decimal (10) All other processors: Decimal (15)
29
- attr_accessor :unit_price
30
-
31
- # Unit of measure, or unit of measure code, for the item.
32
- attr_accessor :unit_of_measure
33
-
34
- # Total amount for the item. Normally calculated as the unit price times quantity. When `orderInformation.lineItems[].productCode` is \"gift_card\", this is the purchase amount total for prepaid gift cards in major units. Example: 123.45 USD = 123
35
- attr_accessor :total_amount
36
-
37
- # Total tax to apply to the product. This value cannot be negative. The tax amount and the offer amount must be in the same currency. The tax amount field is additive. The following example uses a two-exponent currency such as USD: 1. You include each line item in your request. ..- 1st line item has amount=10.00, quantity=1, and taxAmount=0.80 ..- 2nd line item has amount=20.00, quantity=1, and taxAmount=1.60 2. The total amount authorized will be 32.40, not 30.00 with 2.40 of tax included. Optional field. #### Airlines processing Tax portion of the order amount. This value cannot exceed 99999999999999 (fourteen 9s). Format: English characters only. Optional request field for a line item. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. Note if you send this field in your tax request, the value in the field will override the tax engine
38
- attr_accessor :tax_amount
39
-
40
- # Tax rate applied to the item. **Visa**: Valid range is 0.01 to 0.99 (1% to 99%, with only whole percentage values accepted; values with additional decimal places will be truncated). **Mastercard**: Valid range is 0.00001 to 0.99999 (0.001% to 99.999%).
41
- attr_accessor :tax_rate
42
-
43
- # Flag to indicate how you handle discount at the line item level. - 0: no line level discount provided - 1: tax was calculated on the post-discount line item total - 2: tax was calculated on the pre-discount line item total `Note` Visa will inset 0 (zero) if an invalid value is included in this field. This field relates to the value in the _lineItems[].discountAmount_ field.
44
- attr_accessor :tax_applied_after_discount
45
-
46
- # Flag to indicate whether tax is exempted or not included. - 0: tax not included - 1: tax included - 2: transaction is not subject to tax
47
- attr_accessor :tax_status_indicator
48
-
49
- # Type of tax being applied to the item. #### FDC Nashville Global - `alternate_tax_type_applied` - `alternate_tax_type_identifier` #### Worldpay VAP - `alternate_tax_type_identifier` #### RBS WorldPay Atlanta - `tax_type_applied` #### TSYS Acquiring Solutions - `tax_type_applied` - `local_tax_indicator` #### Chase Paymentech Solutions - `tax_type_applied` #### Elavon Americas - `local_tax_indicator` #### FDC Compass - `tax_type_applied` #### OmniPay Direct - `local_tax_indicator`
50
- attr_accessor :tax_type_code
51
-
52
- # Flag that indicates whether the tax amount is included in the Line Item Total. Possible values: - **true** - **false**
53
- attr_accessor :amount_includes_tax
54
-
55
- # Flag to indicate whether the purchase is categorized as goods or services. Possible values: - 00: goods - 01: services
56
- attr_accessor :type_of_supply
57
-
58
- # Commodity code or International description code used to classify the item. Contact your acquirer for a list of codes.
59
- attr_accessor :commodity_code
60
-
61
- # Discount applied to the item.
62
- attr_accessor :discount_amount
63
-
64
- # Flag that indicates whether the amount is discounted. If you do not provide a value but you set Discount Amount to a value greater than zero, then CyberSource sets this field to **true**. Possible values: - **true** - **false**
65
- attr_accessor :discount_applied
66
-
67
- # Rate the item is discounted. Maximum of 2 decimal places. Example 5.25 (=5.25%)
68
- attr_accessor :discount_rate
69
-
70
- # Field to support an invoice number for a transaction. You must specify the number of line items that will include an invoice number. By default, the first line item will include an invoice number field. The invoice number field can be included for up to 10 line items.
71
- attr_accessor :invoice_number
72
-
73
- attr_accessor :tax_details
74
-
75
- # Information about the product code used for the line item. Possible values: - `E`: The product code is `electronic_software`. - `P`: The product code is not `electronic_software`. For details, see the `fulfillmentType` field description in [Business Center Reporting User Guide.] (https://apps.cybersource.com/library/documentation/dev_guides/reporting_and_reconciliation/Reporting_User/html/)
76
- attr_accessor :fulfillment_type
77
-
78
- # Weight of the item.
79
- attr_accessor :weight
80
-
81
- # Type of weight. Possible values: - B: Billed weight - N: Actual net weight
82
- attr_accessor :weight_identifier
83
-
84
- # Code that specifies the unit of measurement for the weight amount. For example, `OZ` specifies ounce and `LB` specifies pound. The possible values are defined by the ANSI Accredited Standards Committee (ASC).
85
- attr_accessor :weight_unit
86
-
87
- # Code that identifies the value of the corresponding `orderInformation.lineItems[].referenceDataNumber` field. Possible values: - AN: Client-defined asset code - MG: Manufacturer's part number - PO: Purchase order number - SK: Supplier stock keeping unit number - UP: Universal product code - VC: Supplier catalog number - VP: Vendor part number This field is a pass-through, which means that CyberSource does not verify the value or modify it in any way before sending it to the processor.
88
- attr_accessor :reference_data_code
89
-
90
- # Reference number. The meaning of this value is identified by the value of the corresponding `referenceDataCode` field. See Numbered Elements. The maximum length for this field depends on the value of the corresponding `referenceDataCode` field: - When the code is `PO`, the maximum length for the reference number is 22. - When the code is `VC`, the maximum length for the reference number is 20. - For all other codes, the maximum length for the reference number is 30. This field is a pass-through, which means that CyberSource does not verify the value or modify it in any way before sending it to the processor.
91
- attr_accessor :reference_data_number
92
-
93
- # Per-item tax amount of the product. Note The amount value must be a non-negative number containing 2 decimal places and limited to 7 digits before the decimal point.
94
- attr_accessor :unit_tax_amount
95
-
96
- # Brief description of item.
97
- attr_accessor :product_description
98
-
99
- # When `orderInformation.lineItems[].productCode` is \"gift_card\", this is the currency used for the gift card purchase. For the possible values, see the [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/currencies.pdf)
100
- attr_accessor :gift_card_currency
101
-
102
- # Destination to where the item will be shipped. Example: Commercial, Residential, Store
103
- attr_accessor :shipping_destination_types
104
-
105
- # This field is only used in DM service. Determines whether to assign risk to the order if the billing and shipping addresses specify different cities, states, or countries. This field can contain one of the following values: - true: Orders are assigned only slight additional risk if billing and shipping addresses are different. - false: Orders are assigned higher additional risk if billing and shipping addresses are different.
106
- attr_accessor :gift
107
-
108
- attr_accessor :passenger
109
-
110
- attr_accessor :allowed_export_countries
111
-
112
- attr_accessor :restricted_export_countries
113
-
114
- # Attribute mapping from ruby-style variable name to JSON key.
115
- def self.attribute_map
116
- {
117
- :'product_code' => :'productCode',
118
- :'product_name' => :'productName',
119
- :'product_sku' => :'productSku',
120
- :'quantity' => :'quantity',
121
- :'unit_price' => :'unitPrice',
122
- :'unit_of_measure' => :'unitOfMeasure',
123
- :'total_amount' => :'totalAmount',
124
- :'tax_amount' => :'taxAmount',
125
- :'tax_rate' => :'taxRate',
126
- :'tax_applied_after_discount' => :'taxAppliedAfterDiscount',
127
- :'tax_status_indicator' => :'taxStatusIndicator',
128
- :'tax_type_code' => :'taxTypeCode',
129
- :'amount_includes_tax' => :'amountIncludesTax',
130
- :'type_of_supply' => :'typeOfSupply',
131
- :'commodity_code' => :'commodityCode',
132
- :'discount_amount' => :'discountAmount',
133
- :'discount_applied' => :'discountApplied',
134
- :'discount_rate' => :'discountRate',
135
- :'invoice_number' => :'invoiceNumber',
136
- :'tax_details' => :'taxDetails',
137
- :'fulfillment_type' => :'fulfillmentType',
138
- :'weight' => :'weight',
139
- :'weight_identifier' => :'weightIdentifier',
140
- :'weight_unit' => :'weightUnit',
141
- :'reference_data_code' => :'referenceDataCode',
142
- :'reference_data_number' => :'referenceDataNumber',
143
- :'unit_tax_amount' => :'unitTaxAmount',
144
- :'product_description' => :'productDescription',
145
- :'gift_card_currency' => :'giftCardCurrency',
146
- :'shipping_destination_types' => :'shippingDestinationTypes',
147
- :'gift' => :'gift',
148
- :'passenger' => :'passenger',
149
- :'allowed_export_countries' => :'allowedExportCountries',
150
- :'restricted_export_countries' => :'restrictedExportCountries'
151
- }
152
- end
153
-
154
- # Attribute mapping from JSON key to ruby-style variable name.
155
- def self.json_map
156
- {
157
- :'product_code' => :'product_code',
158
- :'product_name' => :'product_name',
159
- :'product_sku' => :'product_sku',
160
- :'quantity' => :'quantity',
161
- :'unit_price' => :'unit_price',
162
- :'unit_of_measure' => :'unit_of_measure',
163
- :'total_amount' => :'total_amount',
164
- :'tax_amount' => :'tax_amount',
165
- :'tax_rate' => :'tax_rate',
166
- :'tax_applied_after_discount' => :'tax_applied_after_discount',
167
- :'tax_status_indicator' => :'tax_status_indicator',
168
- :'tax_type_code' => :'tax_type_code',
169
- :'amount_includes_tax' => :'amount_includes_tax',
170
- :'type_of_supply' => :'type_of_supply',
171
- :'commodity_code' => :'commodity_code',
172
- :'discount_amount' => :'discount_amount',
173
- :'discount_applied' => :'discount_applied',
174
- :'discount_rate' => :'discount_rate',
175
- :'invoice_number' => :'invoice_number',
176
- :'tax_details' => :'tax_details',
177
- :'fulfillment_type' => :'fulfillment_type',
178
- :'weight' => :'weight',
179
- :'weight_identifier' => :'weight_identifier',
180
- :'weight_unit' => :'weight_unit',
181
- :'reference_data_code' => :'reference_data_code',
182
- :'reference_data_number' => :'reference_data_number',
183
- :'unit_tax_amount' => :'unit_tax_amount',
184
- :'product_description' => :'product_description',
185
- :'gift_card_currency' => :'gift_card_currency',
186
- :'shipping_destination_types' => :'shipping_destination_types',
187
- :'gift' => :'gift',
188
- :'passenger' => :'passenger',
189
- :'allowed_export_countries' => :'allowed_export_countries',
190
- :'restricted_export_countries' => :'restricted_export_countries'
191
- }
192
- end
193
-
194
- # Attribute type mapping.
195
- def self.swagger_types
196
- {
197
- :'product_code' => :'String',
198
- :'product_name' => :'String',
199
- :'product_sku' => :'String',
200
- :'quantity' => :'Integer',
201
- :'unit_price' => :'String',
202
- :'unit_of_measure' => :'String',
203
- :'total_amount' => :'String',
204
- :'tax_amount' => :'String',
205
- :'tax_rate' => :'String',
206
- :'tax_applied_after_discount' => :'String',
207
- :'tax_status_indicator' => :'String',
208
- :'tax_type_code' => :'String',
209
- :'amount_includes_tax' => :'BOOLEAN',
210
- :'type_of_supply' => :'String',
211
- :'commodity_code' => :'String',
212
- :'discount_amount' => :'String',
213
- :'discount_applied' => :'BOOLEAN',
214
- :'discount_rate' => :'String',
215
- :'invoice_number' => :'String',
216
- :'tax_details' => :'Array<Ptsv2paymentsOrderInformationAmountDetailsTaxDetails>',
217
- :'fulfillment_type' => :'String',
218
- :'weight' => :'String',
219
- :'weight_identifier' => :'String',
220
- :'weight_unit' => :'String',
221
- :'reference_data_code' => :'String',
222
- :'reference_data_number' => :'String',
223
- :'unit_tax_amount' => :'String',
224
- :'product_description' => :'String',
225
- :'gift_card_currency' => :'Integer',
226
- :'shipping_destination_types' => :'String',
227
- :'gift' => :'BOOLEAN',
228
- :'passenger' => :'Ptsv2paymentsOrderInformationPassenger',
229
- :'allowed_export_countries' => :'Array<String>',
230
- :'restricted_export_countries' => :'Array<String>'
231
- }
232
- end
233
-
234
- # Initializes the object
235
- # @param [Hash] attributes Model attributes in the form of hash
236
- def initialize(attributes = {})
237
- return unless attributes.is_a?(Hash)
238
-
239
- # convert string to symbol for hash key
240
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
241
-
242
- if attributes.has_key?(:'productCode')
243
- self.product_code = attributes[:'productCode']
244
- end
245
-
246
- if attributes.has_key?(:'productName')
247
- self.product_name = attributes[:'productName']
248
- end
249
-
250
- if attributes.has_key?(:'productSku')
251
- self.product_sku = attributes[:'productSku']
252
- end
253
-
254
- if attributes.has_key?(:'quantity')
255
- self.quantity = attributes[:'quantity']
256
- end
257
-
258
- if attributes.has_key?(:'unitPrice')
259
- self.unit_price = attributes[:'unitPrice']
260
- end
261
-
262
- if attributes.has_key?(:'unitOfMeasure')
263
- self.unit_of_measure = attributes[:'unitOfMeasure']
264
- end
265
-
266
- if attributes.has_key?(:'totalAmount')
267
- self.total_amount = attributes[:'totalAmount']
268
- end
269
-
270
- if attributes.has_key?(:'taxAmount')
271
- self.tax_amount = attributes[:'taxAmount']
272
- end
273
-
274
- if attributes.has_key?(:'taxRate')
275
- self.tax_rate = attributes[:'taxRate']
276
- end
277
-
278
- if attributes.has_key?(:'taxAppliedAfterDiscount')
279
- self.tax_applied_after_discount = attributes[:'taxAppliedAfterDiscount']
280
- end
281
-
282
- if attributes.has_key?(:'taxStatusIndicator')
283
- self.tax_status_indicator = attributes[:'taxStatusIndicator']
284
- end
285
-
286
- if attributes.has_key?(:'taxTypeCode')
287
- self.tax_type_code = attributes[:'taxTypeCode']
288
- end
289
-
290
- if attributes.has_key?(:'amountIncludesTax')
291
- self.amount_includes_tax = attributes[:'amountIncludesTax']
292
- end
293
-
294
- if attributes.has_key?(:'typeOfSupply')
295
- self.type_of_supply = attributes[:'typeOfSupply']
296
- end
297
-
298
- if attributes.has_key?(:'commodityCode')
299
- self.commodity_code = attributes[:'commodityCode']
300
- end
301
-
302
- if attributes.has_key?(:'discountAmount')
303
- self.discount_amount = attributes[:'discountAmount']
304
- end
305
-
306
- if attributes.has_key?(:'discountApplied')
307
- self.discount_applied = attributes[:'discountApplied']
308
- end
309
-
310
- if attributes.has_key?(:'discountRate')
311
- self.discount_rate = attributes[:'discountRate']
312
- end
313
-
314
- if attributes.has_key?(:'invoiceNumber')
315
- self.invoice_number = attributes[:'invoiceNumber']
316
- end
317
-
318
- if attributes.has_key?(:'taxDetails')
319
- if (value = attributes[:'taxDetails']).is_a?(Array)
320
- self.tax_details = value
321
- end
322
- end
323
-
324
- if attributes.has_key?(:'fulfillmentType')
325
- self.fulfillment_type = attributes[:'fulfillmentType']
326
- end
327
-
328
- if attributes.has_key?(:'weight')
329
- self.weight = attributes[:'weight']
330
- end
331
-
332
- if attributes.has_key?(:'weightIdentifier')
333
- self.weight_identifier = attributes[:'weightIdentifier']
334
- end
335
-
336
- if attributes.has_key?(:'weightUnit')
337
- self.weight_unit = attributes[:'weightUnit']
338
- end
339
-
340
- if attributes.has_key?(:'referenceDataCode')
341
- self.reference_data_code = attributes[:'referenceDataCode']
342
- end
343
-
344
- if attributes.has_key?(:'referenceDataNumber')
345
- self.reference_data_number = attributes[:'referenceDataNumber']
346
- end
347
-
348
- if attributes.has_key?(:'unitTaxAmount')
349
- self.unit_tax_amount = attributes[:'unitTaxAmount']
350
- end
351
-
352
- if attributes.has_key?(:'productDescription')
353
- self.product_description = attributes[:'productDescription']
354
- end
355
-
356
- if attributes.has_key?(:'giftCardCurrency')
357
- self.gift_card_currency = attributes[:'giftCardCurrency']
358
- end
359
-
360
- if attributes.has_key?(:'shippingDestinationTypes')
361
- self.shipping_destination_types = attributes[:'shippingDestinationTypes']
362
- end
363
-
364
- if attributes.has_key?(:'gift')
365
- self.gift = attributes[:'gift']
366
- end
367
-
368
- if attributes.has_key?(:'passenger')
369
- self.passenger = attributes[:'passenger']
370
- end
371
-
372
- if attributes.has_key?(:'allowedExportCountries')
373
- if (value = attributes[:'allowedExportCountries']).is_a?(Array)
374
- self.allowed_export_countries = value
375
- end
376
- end
377
-
378
- if attributes.has_key?(:'restrictedExportCountries')
379
- if (value = attributes[:'restrictedExportCountries']).is_a?(Array)
380
- self.restricted_export_countries = value
381
- end
382
- end
383
- end
384
-
385
- # Show invalid properties with the reasons. Usually used together with valid?
386
- # @return Array for valid properties with the reasons
387
- def list_invalid_properties
388
- invalid_properties = Array.new
389
- invalid_properties
390
- end
391
-
392
- # Check to see if the all the properties in the model are valid
393
- # @return true if the model is valid
394
- def valid?
395
- true
396
- end
397
-
398
- # Custom attribute writer method with validation
399
- # @param [Object] product_code Value to be assigned
400
- def product_code=(product_code)
401
- @product_code = product_code
402
- end
403
-
404
- # Custom attribute writer method with validation
405
- # @param [Object] product_name Value to be assigned
406
- def product_name=(product_name)
407
- @product_name = product_name
408
- end
409
-
410
- # Custom attribute writer method with validation
411
- # @param [Object] product_sku Value to be assigned
412
- def product_sku=(product_sku)
413
- @product_sku = product_sku
414
- end
415
-
416
- # Custom attribute writer method with validation
417
- # @param [Object] quantity Value to be assigned
418
- def quantity=(quantity)
419
- @quantity = quantity
420
- end
421
-
422
- # Custom attribute writer method with validation
423
- # @param [Object] unit_price Value to be assigned
424
- def unit_price=(unit_price)
425
- @unit_price = unit_price
426
- end
427
-
428
- # Custom attribute writer method with validation
429
- # @param [Object] unit_of_measure Value to be assigned
430
- def unit_of_measure=(unit_of_measure)
431
- @unit_of_measure = unit_of_measure
432
- end
433
-
434
- # Custom attribute writer method with validation
435
- # @param [Object] total_amount Value to be assigned
436
- def total_amount=(total_amount)
437
- @total_amount = total_amount
438
- end
439
-
440
- # Custom attribute writer method with validation
441
- # @param [Object] tax_amount Value to be assigned
442
- def tax_amount=(tax_amount)
443
- @tax_amount = tax_amount
444
- end
445
-
446
- # Custom attribute writer method with validation
447
- # @param [Object] tax_rate Value to be assigned
448
- def tax_rate=(tax_rate)
449
- @tax_rate = tax_rate
450
- end
451
-
452
- # Custom attribute writer method with validation
453
- # @param [Object] tax_applied_after_discount Value to be assigned
454
- def tax_applied_after_discount=(tax_applied_after_discount)
455
- @tax_applied_after_discount = tax_applied_after_discount
456
- end
457
-
458
- # Custom attribute writer method with validation
459
- # @param [Object] tax_status_indicator Value to be assigned
460
- def tax_status_indicator=(tax_status_indicator)
461
- @tax_status_indicator = tax_status_indicator
462
- end
463
-
464
- # Custom attribute writer method with validation
465
- # @param [Object] tax_type_code Value to be assigned
466
- def tax_type_code=(tax_type_code)
467
- @tax_type_code = tax_type_code
468
- end
469
-
470
- # Custom attribute writer method with validation
471
- # @param [Object] type_of_supply Value to be assigned
472
- def type_of_supply=(type_of_supply)
473
- @type_of_supply = type_of_supply
474
- end
475
-
476
- # Custom attribute writer method with validation
477
- # @param [Object] commodity_code Value to be assigned
478
- def commodity_code=(commodity_code)
479
- @commodity_code = commodity_code
480
- end
481
-
482
- # Custom attribute writer method with validation
483
- # @param [Object] discount_amount Value to be assigned
484
- def discount_amount=(discount_amount)
485
- @discount_amount = discount_amount
486
- end
487
-
488
- # Custom attribute writer method with validation
489
- # @param [Object] discount_rate Value to be assigned
490
- def discount_rate=(discount_rate)
491
- @discount_rate = discount_rate
492
- end
493
-
494
- # Custom attribute writer method with validation
495
- # @param [Object] invoice_number Value to be assigned
496
- def invoice_number=(invoice_number)
497
- @invoice_number = invoice_number
498
- end
499
-
500
- # Custom attribute writer method with validation
501
- # @param [Object] weight Value to be assigned
502
- def weight=(weight)
503
- @weight = weight
504
- end
505
-
506
- # Custom attribute writer method with validation
507
- # @param [Object] weight_identifier Value to be assigned
508
- def weight_identifier=(weight_identifier)
509
- @weight_identifier = weight_identifier
510
- end
511
-
512
- # Custom attribute writer method with validation
513
- # @param [Object] weight_unit Value to be assigned
514
- def weight_unit=(weight_unit)
515
- @weight_unit = weight_unit
516
- end
517
-
518
- # Custom attribute writer method with validation
519
- # @param [Object] reference_data_code Value to be assigned
520
- def reference_data_code=(reference_data_code)
521
- @reference_data_code = reference_data_code
522
- end
523
-
524
- # Custom attribute writer method with validation
525
- # @param [Object] reference_data_number Value to be assigned
526
- def reference_data_number=(reference_data_number)
527
- @reference_data_number = reference_data_number
528
- end
529
-
530
- # Custom attribute writer method with validation
531
- # @param [Object] unit_tax_amount Value to be assigned
532
- def unit_tax_amount=(unit_tax_amount)
533
- @unit_tax_amount = unit_tax_amount
534
- end
535
-
536
- # Custom attribute writer method with validation
537
- # @param [Object] shipping_destination_types Value to be assigned
538
- def shipping_destination_types=(shipping_destination_types)
539
- @shipping_destination_types = shipping_destination_types
540
- end
541
-
542
- # Checks equality by comparing each attribute.
543
- # @param [Object] Object to be compared
544
- def ==(o)
545
- return true if self.equal?(o)
546
- self.class == o.class &&
547
- product_code == o.product_code &&
548
- product_name == o.product_name &&
549
- product_sku == o.product_sku &&
550
- quantity == o.quantity &&
551
- unit_price == o.unit_price &&
552
- unit_of_measure == o.unit_of_measure &&
553
- total_amount == o.total_amount &&
554
- tax_amount == o.tax_amount &&
555
- tax_rate == o.tax_rate &&
556
- tax_applied_after_discount == o.tax_applied_after_discount &&
557
- tax_status_indicator == o.tax_status_indicator &&
558
- tax_type_code == o.tax_type_code &&
559
- amount_includes_tax == o.amount_includes_tax &&
560
- type_of_supply == o.type_of_supply &&
561
- commodity_code == o.commodity_code &&
562
- discount_amount == o.discount_amount &&
563
- discount_applied == o.discount_applied &&
564
- discount_rate == o.discount_rate &&
565
- invoice_number == o.invoice_number &&
566
- tax_details == o.tax_details &&
567
- fulfillment_type == o.fulfillment_type &&
568
- weight == o.weight &&
569
- weight_identifier == o.weight_identifier &&
570
- weight_unit == o.weight_unit &&
571
- reference_data_code == o.reference_data_code &&
572
- reference_data_number == o.reference_data_number &&
573
- unit_tax_amount == o.unit_tax_amount &&
574
- product_description == o.product_description &&
575
- gift_card_currency == o.gift_card_currency &&
576
- shipping_destination_types == o.shipping_destination_types &&
577
- gift == o.gift &&
578
- passenger == o.passenger &&
579
- allowed_export_countries == o.allowed_export_countries &&
580
- restricted_export_countries == o.restricted_export_countries
581
- end
582
-
583
- # @see the `==` method
584
- # @param [Object] Object to be compared
585
- def eql?(o)
586
- self == o
587
- end
588
-
589
- # Calculates hash code according to all attributes.
590
- # @return [Fixnum] Hash code
591
- def hash
592
- [product_code, product_name, product_sku, quantity, unit_price, unit_of_measure, total_amount, tax_amount, tax_rate, tax_applied_after_discount, tax_status_indicator, tax_type_code, amount_includes_tax, type_of_supply, commodity_code, discount_amount, discount_applied, discount_rate, invoice_number, tax_details, fulfillment_type, weight, weight_identifier, weight_unit, reference_data_code, reference_data_number, unit_tax_amount, product_description, gift_card_currency, shipping_destination_types, gift, passenger, allowed_export_countries, restricted_export_countries].hash
593
- end
594
-
595
- # Builds the object from hash
596
- # @param [Hash] attributes Model attributes in the form of hash
597
- # @return [Object] Returns the model itself
598
- def build_from_hash(attributes)
599
- return nil unless attributes.is_a?(Hash)
600
- self.class.swagger_types.each_pair do |key, type|
601
- if type =~ /\AArray<(.*)>/i
602
- # check to ensure the input is an array given that the the attribute
603
- # is documented as an array but the input is not
604
- if attributes[self.class.attribute_map[key]].is_a?(Array)
605
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
606
- end
607
- elsif !attributes[self.class.attribute_map[key]].nil?
608
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
609
- end # or else data not found in attributes(hash), not an issue as the data can be optional
610
- end
611
-
612
- self
613
- end
614
-
615
- # Deserializes the data based on type
616
- # @param string type Data type
617
- # @param string value Value to be deserialized
618
- # @return [Object] Deserialized data
619
- def _deserialize(type, value)
620
- case type.to_sym
621
- when :DateTime
622
- DateTime.parse(value)
623
- when :Date
624
- Date.parse(value)
625
- when :String
626
- value.to_s
627
- when :Integer
628
- value.to_i
629
- when :Float
630
- value.to_f
631
- when :BOOLEAN
632
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
633
- true
634
- else
635
- false
636
- end
637
- when :Object
638
- # generic object (usually a Hash), return directly
639
- value
640
- when /\AArray<(?<inner_type>.+)>\z/
641
- inner_type = Regexp.last_match[:inner_type]
642
- value.map { |v| _deserialize(inner_type, v) }
643
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
644
- k_type = Regexp.last_match[:k_type]
645
- v_type = Regexp.last_match[:v_type]
646
- {}.tap do |hash|
647
- value.each do |k, v|
648
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
649
- end
650
- end
651
- else # model
652
- temp_model = CyberSource.const_get(type).new
653
- temp_model.build_from_hash(value)
654
- end
655
- end
656
-
657
- # Returns the string representation of the object
658
- # @return [String] String presentation of the object
659
- def to_s
660
- to_hash.to_s
661
- end
662
-
663
- # to_body is an alias to to_hash (backward compatibility)
664
- # @return [Hash] Returns the object in the form of hash
665
- def to_body
666
- to_hash
667
- end
668
-
669
- # Returns the object in the form of hash
670
- # @return [Hash] Returns the object in the form of hash
671
- def to_hash
672
- hash = {}
673
- self.class.attribute_map.each_pair do |attr, param|
674
- value = self.send(attr)
675
- next if value.nil?
676
- hash[param] = _to_hash(value)
677
- end
678
- hash
679
- end
680
-
681
- # Outputs non-array value in the form of hash
682
- # For object, use to_hash. Otherwise, just return the value
683
- # @param [Object] value Any valid value
684
- # @return [Hash] Returns the value in the form of hash
685
- def _to_hash(value)
686
- if value.is_a?(Array)
687
- value.compact.map { |v| _to_hash(v) }
688
- elsif value.is_a?(Hash)
689
- {}.tap do |hash|
690
- value.each { |k, v| hash[k] = _to_hash(v) }
691
- end
692
- elsif value.respond_to? :to_hash
693
- value.to_hash
694
- else
695
- value
696
- end
697
- end
698
- end
699
- end
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.38
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module CyberSource
15
+ class Ptsv2paymentsOrderInformationLineItems
16
+ # Type of product. The value for this field is used to identify the product category (electronic, handling, physical, service, or shipping). The default value is `default`. If you are performing an authorization transaction (`processingOptions.capture` is set to `false`), and you set this field to a value other than `default` or one of the values related to shipping and/or handling, then `orderInformation.lineItems[].quantity`, `orderInformation.lineItems[].productName`, and `orderInformation.lineItems[].productSku` fields are required. Optional field. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. The Product Codes for the tax service are located in the Cybersource Tax Codes guide. Contact Customer Support to request the guide. If you don't send a tax service Product Code in your tax request, product-based rules or exemptions will not be applied and the transaction will default to fully taxable in the locations where you've indicated you need to collect tax [by way of nexus, no nexus, or seller registration number fields].
17
+ attr_accessor :product_code
18
+
19
+ # For an authorization or capture transaction (`processingOptions.capture` is `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the other values that are related to shipping and/or handling. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes.
20
+ attr_accessor :product_name
21
+
22
+ # Product identifier code. Also known as the Stock Keeping Unit (SKU) code for the product. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not set to **default** or one of the other values that are related to shipping and/or handling. #### Tax Calculation Optional field for U.S. and Canadian taxes. Not applicable to international and value added taxes. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the values related to shipping and/or handling.
23
+ attr_accessor :product_sku
24
+
25
+ # Number of units for this order. Must be a non-negative integer. The default is `1`. For an authorization or capture transaction (`processingOptions.capture` is set to `true` or `false`), this field is required when `orderInformation.lineItems[].productCode` is not `default` or one of the other values related to shipping and/or handling. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes.
26
+ attr_accessor :quantity
27
+
28
+ # Per-item price of the product. This value for this field cannot be negative. You must include either this field or the request-level field `orderInformation.amountDetails.totalAmount` in your request. You can include a decimal point (.), but you cannot include any other special characters. The value is truncated to the correct number of decimal places. #### DCC with a Third-Party Provider Set this field to the converted amount that was returned by the DCC provider. You must include either the 1st line item in the order and this field, or the request-level field `orderInformation.amountDetails.totalAmount` in your request. #### Tax Calculation Required field for U.S., Canadian, international and value added taxes. #### Zero Amount Authorizations 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. #### Maximum Field Lengths For GPN and JCN Gateway: Decimal (10) All other processors: Decimal (15)
29
+ attr_accessor :unit_price
30
+
31
+ # Unit of measure, or unit of measure code, for the item.
32
+ attr_accessor :unit_of_measure
33
+
34
+ # Total amount for the item. Normally calculated as the unit price times quantity. When `orderInformation.lineItems[].productCode` is \"gift_card\", this is the purchase amount total for prepaid gift cards in major units. Example: 123.45 USD = 123
35
+ attr_accessor :total_amount
36
+
37
+ # Total tax to apply to the product. This value cannot be negative. The tax amount and the offer amount must be in the same currency. The tax amount field is additive. The following example uses a two-exponent currency such as USD: 1. You include each line item in your request. ..- 1st line item has amount=10.00, quantity=1, and taxAmount=0.80 ..- 2nd line item has amount=20.00, quantity=1, and taxAmount=1.60 2. The total amount authorized will be 32.40, not 30.00 with 2.40 of tax included. Optional field. #### Airlines processing Tax portion of the order amount. This value cannot exceed 99999999999999 (fourteen 9s). Format: English characters only. Optional request field for a line item. #### Tax Calculation Optional field for U.S., Canadian, international tax, and value added taxes. Note if you send this field in your tax request, the value in the field will override the tax engine
38
+ attr_accessor :tax_amount
39
+
40
+ # Tax rate applied to the item. **Visa**: Valid range is 0.01 to 0.99 (1% to 99%, with only whole percentage values accepted; values with additional decimal places will be truncated). **Mastercard**: Valid range is 0.00001 to 0.99999 (0.001% to 99.999%).
41
+ attr_accessor :tax_rate
42
+
43
+ # Flag to indicate how you handle discount at the line item level. - 0: no line level discount provided - 1: tax was calculated on the post-discount line item total - 2: tax was calculated on the pre-discount line item total `Note` Visa will inset 0 (zero) if an invalid value is included in this field. This field relates to the value in the _lineItems[].discountAmount_ field.
44
+ attr_accessor :tax_applied_after_discount
45
+
46
+ # Flag to indicate whether tax is exempted or not included. - 0: tax not included - 1: tax included - 2: transaction is not subject to tax
47
+ attr_accessor :tax_status_indicator
48
+
49
+ # Type of tax being applied to the item. #### FDC Nashville Global - `alternate_tax_type_applied` - `alternate_tax_type_identifier` #### Worldpay VAP - `alternate_tax_type_identifier` #### RBS WorldPay Atlanta - `tax_type_applied` #### TSYS Acquiring Solutions - `tax_type_applied` - `local_tax_indicator` #### Chase Paymentech Solutions - `tax_type_applied` #### Elavon Americas - `local_tax_indicator` #### FDC Compass - `tax_type_applied` #### OmniPay Direct - `local_tax_indicator`
50
+ attr_accessor :tax_type_code
51
+
52
+ # Flag that indicates whether the tax amount is included in the Line Item Total. Possible values: - **true** - **false**
53
+ attr_accessor :amount_includes_tax
54
+
55
+ # Flag to indicate whether the purchase is categorized as goods or services. Possible values: - 00: goods - 01: services
56
+ attr_accessor :type_of_supply
57
+
58
+ # Commodity code or International description code used to classify the item. Contact your acquirer for a list of codes.
59
+ attr_accessor :commodity_code
60
+
61
+ # Discount applied to the item.
62
+ attr_accessor :discount_amount
63
+
64
+ # Flag that indicates whether the amount is discounted. If you do not provide a value but you set Discount Amount to a value greater than zero, then CyberSource sets this field to **true**. Possible values: - **true** - **false**
65
+ attr_accessor :discount_applied
66
+
67
+ # Rate the item is discounted. Maximum of 2 decimal places. Example 5.25 (=5.25%)
68
+ attr_accessor :discount_rate
69
+
70
+ # Field to support an invoice number for a transaction. You must specify the number of line items that will include an invoice number. By default, the first line item will include an invoice number field. The invoice number field can be included for up to 10 line items.
71
+ attr_accessor :invoice_number
72
+
73
+ attr_accessor :tax_details
74
+
75
+ # Information about the product code used for the line item. Possible values: - `E`: The product code is `electronic_software`. - `P`: The product code is not `electronic_software`. For details, see the `fulfillmentType` field description in [Business Center Reporting User Guide.] (https://apps.cybersource.com/library/documentation/dev_guides/reporting_and_reconciliation/Reporting_User/html/)
76
+ attr_accessor :fulfillment_type
77
+
78
+ # Weight of the item.
79
+ attr_accessor :weight
80
+
81
+ # Type of weight. Possible values: - B: Billed weight - N: Actual net weight
82
+ attr_accessor :weight_identifier
83
+
84
+ # Code that specifies the unit of measurement for the weight amount. For example, `OZ` specifies ounce and `LB` specifies pound. The possible values are defined by the ANSI Accredited Standards Committee (ASC).
85
+ attr_accessor :weight_unit
86
+
87
+ # Code that identifies the value of the corresponding `orderInformation.lineItems[].referenceDataNumber` field. Possible values: - AN: Client-defined asset code - MG: Manufacturer's part number - PO: Purchase order number - SK: Supplier stock keeping unit number - UP: Universal product code - VC: Supplier catalog number - VP: Vendor part number This field is a pass-through, which means that CyberSource does not verify the value or modify it in any way before sending it to the processor.
88
+ attr_accessor :reference_data_code
89
+
90
+ # Reference number. The meaning of this value is identified by the value of the corresponding `referenceDataCode` field. See Numbered Elements. The maximum length for this field depends on the value of the corresponding `referenceDataCode` field: - When the code is `PO`, the maximum length for the reference number is 22. - When the code is `VC`, the maximum length for the reference number is 20. - For all other codes, the maximum length for the reference number is 30. This field is a pass-through, which means that CyberSource does not verify the value or modify it in any way before sending it to the processor.
91
+ attr_accessor :reference_data_number
92
+
93
+ # Per-item tax amount of the product. Note The amount value must be a non-negative number containing 2 decimal places and limited to 7 digits before the decimal point.
94
+ attr_accessor :unit_tax_amount
95
+
96
+ # This field would contain measurement of a line item.
97
+ attr_accessor :measurement
98
+
99
+ # Brief description of item.
100
+ attr_accessor :product_description
101
+
102
+ # When `orderInformation.lineItems[].productCode` is \"gift_card\", this is the currency used for the gift card purchase. For the possible values, see the [ISO Standard Currency Codes.](http://apps.cybersource.com/library/documentation/sbc/quickref/currencies.pdf)
103
+ attr_accessor :gift_card_currency
104
+
105
+ # Destination to where the item will be shipped. Example: Commercial, Residential, Store
106
+ attr_accessor :shipping_destination_types
107
+
108
+ # This field is only used in DM service. Determines whether to assign risk to the order if the billing and shipping addresses specify different cities, states, or countries. This field can contain one of the following values: - true: Orders are assigned only slight additional risk if billing and shipping addresses are different. - false: Orders are assigned higher additional risk if billing and shipping addresses are different.
109
+ attr_accessor :gift
110
+
111
+ attr_accessor :passenger
112
+
113
+ attr_accessor :allowed_export_countries
114
+
115
+ attr_accessor :restricted_export_countries
116
+
117
+ # Attribute mapping from ruby-style variable name to JSON key.
118
+ def self.attribute_map
119
+ {
120
+ :'product_code' => :'productCode',
121
+ :'product_name' => :'productName',
122
+ :'product_sku' => :'productSku',
123
+ :'quantity' => :'quantity',
124
+ :'unit_price' => :'unitPrice',
125
+ :'unit_of_measure' => :'unitOfMeasure',
126
+ :'total_amount' => :'totalAmount',
127
+ :'tax_amount' => :'taxAmount',
128
+ :'tax_rate' => :'taxRate',
129
+ :'tax_applied_after_discount' => :'taxAppliedAfterDiscount',
130
+ :'tax_status_indicator' => :'taxStatusIndicator',
131
+ :'tax_type_code' => :'taxTypeCode',
132
+ :'amount_includes_tax' => :'amountIncludesTax',
133
+ :'type_of_supply' => :'typeOfSupply',
134
+ :'commodity_code' => :'commodityCode',
135
+ :'discount_amount' => :'discountAmount',
136
+ :'discount_applied' => :'discountApplied',
137
+ :'discount_rate' => :'discountRate',
138
+ :'invoice_number' => :'invoiceNumber',
139
+ :'tax_details' => :'taxDetails',
140
+ :'fulfillment_type' => :'fulfillmentType',
141
+ :'weight' => :'weight',
142
+ :'weight_identifier' => :'weightIdentifier',
143
+ :'weight_unit' => :'weightUnit',
144
+ :'reference_data_code' => :'referenceDataCode',
145
+ :'reference_data_number' => :'referenceDataNumber',
146
+ :'unit_tax_amount' => :'unitTaxAmount',
147
+ :'measurement' => :'measurement',
148
+ :'product_description' => :'productDescription',
149
+ :'gift_card_currency' => :'giftCardCurrency',
150
+ :'shipping_destination_types' => :'shippingDestinationTypes',
151
+ :'gift' => :'gift',
152
+ :'passenger' => :'passenger',
153
+ :'allowed_export_countries' => :'allowedExportCountries',
154
+ :'restricted_export_countries' => :'restrictedExportCountries'
155
+ }
156
+ end
157
+
158
+ # Attribute mapping from JSON key to ruby-style variable name.
159
+ def self.json_map
160
+ {
161
+ :'product_code' => :'product_code',
162
+ :'product_name' => :'product_name',
163
+ :'product_sku' => :'product_sku',
164
+ :'quantity' => :'quantity',
165
+ :'unit_price' => :'unit_price',
166
+ :'unit_of_measure' => :'unit_of_measure',
167
+ :'total_amount' => :'total_amount',
168
+ :'tax_amount' => :'tax_amount',
169
+ :'tax_rate' => :'tax_rate',
170
+ :'tax_applied_after_discount' => :'tax_applied_after_discount',
171
+ :'tax_status_indicator' => :'tax_status_indicator',
172
+ :'tax_type_code' => :'tax_type_code',
173
+ :'amount_includes_tax' => :'amount_includes_tax',
174
+ :'type_of_supply' => :'type_of_supply',
175
+ :'commodity_code' => :'commodity_code',
176
+ :'discount_amount' => :'discount_amount',
177
+ :'discount_applied' => :'discount_applied',
178
+ :'discount_rate' => :'discount_rate',
179
+ :'invoice_number' => :'invoice_number',
180
+ :'tax_details' => :'tax_details',
181
+ :'fulfillment_type' => :'fulfillment_type',
182
+ :'weight' => :'weight',
183
+ :'weight_identifier' => :'weight_identifier',
184
+ :'weight_unit' => :'weight_unit',
185
+ :'reference_data_code' => :'reference_data_code',
186
+ :'reference_data_number' => :'reference_data_number',
187
+ :'unit_tax_amount' => :'unit_tax_amount',
188
+ :'measurement' => :'measurement',
189
+ :'product_description' => :'product_description',
190
+ :'gift_card_currency' => :'gift_card_currency',
191
+ :'shipping_destination_types' => :'shipping_destination_types',
192
+ :'gift' => :'gift',
193
+ :'passenger' => :'passenger',
194
+ :'allowed_export_countries' => :'allowed_export_countries',
195
+ :'restricted_export_countries' => :'restricted_export_countries'
196
+ }
197
+ end
198
+
199
+ # Attribute type mapping.
200
+ def self.swagger_types
201
+ {
202
+ :'product_code' => :'String',
203
+ :'product_name' => :'String',
204
+ :'product_sku' => :'String',
205
+ :'quantity' => :'Integer',
206
+ :'unit_price' => :'String',
207
+ :'unit_of_measure' => :'String',
208
+ :'total_amount' => :'String',
209
+ :'tax_amount' => :'String',
210
+ :'tax_rate' => :'String',
211
+ :'tax_applied_after_discount' => :'String',
212
+ :'tax_status_indicator' => :'String',
213
+ :'tax_type_code' => :'String',
214
+ :'amount_includes_tax' => :'BOOLEAN',
215
+ :'type_of_supply' => :'String',
216
+ :'commodity_code' => :'String',
217
+ :'discount_amount' => :'String',
218
+ :'discount_applied' => :'BOOLEAN',
219
+ :'discount_rate' => :'String',
220
+ :'invoice_number' => :'String',
221
+ :'tax_details' => :'Array<Ptsv2paymentsOrderInformationAmountDetailsTaxDetails>',
222
+ :'fulfillment_type' => :'String',
223
+ :'weight' => :'String',
224
+ :'weight_identifier' => :'String',
225
+ :'weight_unit' => :'String',
226
+ :'reference_data_code' => :'String',
227
+ :'reference_data_number' => :'String',
228
+ :'unit_tax_amount' => :'String',
229
+ :'measurement' => :'String',
230
+ :'product_description' => :'String',
231
+ :'gift_card_currency' => :'Integer',
232
+ :'shipping_destination_types' => :'String',
233
+ :'gift' => :'BOOLEAN',
234
+ :'passenger' => :'Ptsv2paymentsOrderInformationPassenger',
235
+ :'allowed_export_countries' => :'Array<String>',
236
+ :'restricted_export_countries' => :'Array<String>'
237
+ }
238
+ end
239
+
240
+ # Initializes the object
241
+ # @param [Hash] attributes Model attributes in the form of hash
242
+ def initialize(attributes = {})
243
+ return unless attributes.is_a?(Hash)
244
+
245
+ # convert string to symbol for hash key
246
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
247
+
248
+ if attributes.has_key?(:'productCode')
249
+ self.product_code = attributes[:'productCode']
250
+ end
251
+
252
+ if attributes.has_key?(:'productName')
253
+ self.product_name = attributes[:'productName']
254
+ end
255
+
256
+ if attributes.has_key?(:'productSku')
257
+ self.product_sku = attributes[:'productSku']
258
+ end
259
+
260
+ if attributes.has_key?(:'quantity')
261
+ self.quantity = attributes[:'quantity']
262
+ end
263
+
264
+ if attributes.has_key?(:'unitPrice')
265
+ self.unit_price = attributes[:'unitPrice']
266
+ end
267
+
268
+ if attributes.has_key?(:'unitOfMeasure')
269
+ self.unit_of_measure = attributes[:'unitOfMeasure']
270
+ end
271
+
272
+ if attributes.has_key?(:'totalAmount')
273
+ self.total_amount = attributes[:'totalAmount']
274
+ end
275
+
276
+ if attributes.has_key?(:'taxAmount')
277
+ self.tax_amount = attributes[:'taxAmount']
278
+ end
279
+
280
+ if attributes.has_key?(:'taxRate')
281
+ self.tax_rate = attributes[:'taxRate']
282
+ end
283
+
284
+ if attributes.has_key?(:'taxAppliedAfterDiscount')
285
+ self.tax_applied_after_discount = attributes[:'taxAppliedAfterDiscount']
286
+ end
287
+
288
+ if attributes.has_key?(:'taxStatusIndicator')
289
+ self.tax_status_indicator = attributes[:'taxStatusIndicator']
290
+ end
291
+
292
+ if attributes.has_key?(:'taxTypeCode')
293
+ self.tax_type_code = attributes[:'taxTypeCode']
294
+ end
295
+
296
+ if attributes.has_key?(:'amountIncludesTax')
297
+ self.amount_includes_tax = attributes[:'amountIncludesTax']
298
+ end
299
+
300
+ if attributes.has_key?(:'typeOfSupply')
301
+ self.type_of_supply = attributes[:'typeOfSupply']
302
+ end
303
+
304
+ if attributes.has_key?(:'commodityCode')
305
+ self.commodity_code = attributes[:'commodityCode']
306
+ end
307
+
308
+ if attributes.has_key?(:'discountAmount')
309
+ self.discount_amount = attributes[:'discountAmount']
310
+ end
311
+
312
+ if attributes.has_key?(:'discountApplied')
313
+ self.discount_applied = attributes[:'discountApplied']
314
+ end
315
+
316
+ if attributes.has_key?(:'discountRate')
317
+ self.discount_rate = attributes[:'discountRate']
318
+ end
319
+
320
+ if attributes.has_key?(:'invoiceNumber')
321
+ self.invoice_number = attributes[:'invoiceNumber']
322
+ end
323
+
324
+ if attributes.has_key?(:'taxDetails')
325
+ if (value = attributes[:'taxDetails']).is_a?(Array)
326
+ self.tax_details = value
327
+ end
328
+ end
329
+
330
+ if attributes.has_key?(:'fulfillmentType')
331
+ self.fulfillment_type = attributes[:'fulfillmentType']
332
+ end
333
+
334
+ if attributes.has_key?(:'weight')
335
+ self.weight = attributes[:'weight']
336
+ end
337
+
338
+ if attributes.has_key?(:'weightIdentifier')
339
+ self.weight_identifier = attributes[:'weightIdentifier']
340
+ end
341
+
342
+ if attributes.has_key?(:'weightUnit')
343
+ self.weight_unit = attributes[:'weightUnit']
344
+ end
345
+
346
+ if attributes.has_key?(:'referenceDataCode')
347
+ self.reference_data_code = attributes[:'referenceDataCode']
348
+ end
349
+
350
+ if attributes.has_key?(:'referenceDataNumber')
351
+ self.reference_data_number = attributes[:'referenceDataNumber']
352
+ end
353
+
354
+ if attributes.has_key?(:'unitTaxAmount')
355
+ self.unit_tax_amount = attributes[:'unitTaxAmount']
356
+ end
357
+
358
+ if attributes.has_key?(:'measurement')
359
+ self.measurement = attributes[:'measurement']
360
+ end
361
+
362
+ if attributes.has_key?(:'productDescription')
363
+ self.product_description = attributes[:'productDescription']
364
+ end
365
+
366
+ if attributes.has_key?(:'giftCardCurrency')
367
+ self.gift_card_currency = attributes[:'giftCardCurrency']
368
+ end
369
+
370
+ if attributes.has_key?(:'shippingDestinationTypes')
371
+ self.shipping_destination_types = attributes[:'shippingDestinationTypes']
372
+ end
373
+
374
+ if attributes.has_key?(:'gift')
375
+ self.gift = attributes[:'gift']
376
+ end
377
+
378
+ if attributes.has_key?(:'passenger')
379
+ self.passenger = attributes[:'passenger']
380
+ end
381
+
382
+ if attributes.has_key?(:'allowedExportCountries')
383
+ if (value = attributes[:'allowedExportCountries']).is_a?(Array)
384
+ self.allowed_export_countries = value
385
+ end
386
+ end
387
+
388
+ if attributes.has_key?(:'restrictedExportCountries')
389
+ if (value = attributes[:'restrictedExportCountries']).is_a?(Array)
390
+ self.restricted_export_countries = value
391
+ end
392
+ end
393
+ end
394
+
395
+ # Show invalid properties with the reasons. Usually used together with valid?
396
+ # @return Array for valid properties with the reasons
397
+ def list_invalid_properties
398
+ invalid_properties = Array.new
399
+ invalid_properties
400
+ end
401
+
402
+ # Check to see if the all the properties in the model are valid
403
+ # @return true if the model is valid
404
+ def valid?
405
+ true
406
+ end
407
+
408
+ # Custom attribute writer method with validation
409
+ # @param [Object] product_code Value to be assigned
410
+ def product_code=(product_code)
411
+ @product_code = product_code
412
+ end
413
+
414
+ # Custom attribute writer method with validation
415
+ # @param [Object] product_name Value to be assigned
416
+ def product_name=(product_name)
417
+ @product_name = product_name
418
+ end
419
+
420
+ # Custom attribute writer method with validation
421
+ # @param [Object] product_sku Value to be assigned
422
+ def product_sku=(product_sku)
423
+ @product_sku = product_sku
424
+ end
425
+
426
+ # Custom attribute writer method with validation
427
+ # @param [Object] quantity Value to be assigned
428
+ def quantity=(quantity)
429
+ @quantity = quantity
430
+ end
431
+
432
+ # Custom attribute writer method with validation
433
+ # @param [Object] unit_price Value to be assigned
434
+ def unit_price=(unit_price)
435
+ @unit_price = unit_price
436
+ end
437
+
438
+ # Custom attribute writer method with validation
439
+ # @param [Object] unit_of_measure Value to be assigned
440
+ def unit_of_measure=(unit_of_measure)
441
+ @unit_of_measure = unit_of_measure
442
+ end
443
+
444
+ # Custom attribute writer method with validation
445
+ # @param [Object] total_amount Value to be assigned
446
+ def total_amount=(total_amount)
447
+ @total_amount = total_amount
448
+ end
449
+
450
+ # Custom attribute writer method with validation
451
+ # @param [Object] tax_amount Value to be assigned
452
+ def tax_amount=(tax_amount)
453
+ @tax_amount = tax_amount
454
+ end
455
+
456
+ # Custom attribute writer method with validation
457
+ # @param [Object] tax_rate Value to be assigned
458
+ def tax_rate=(tax_rate)
459
+ @tax_rate = tax_rate
460
+ end
461
+
462
+ # Custom attribute writer method with validation
463
+ # @param [Object] tax_applied_after_discount Value to be assigned
464
+ def tax_applied_after_discount=(tax_applied_after_discount)
465
+ @tax_applied_after_discount = tax_applied_after_discount
466
+ end
467
+
468
+ # Custom attribute writer method with validation
469
+ # @param [Object] tax_status_indicator Value to be assigned
470
+ def tax_status_indicator=(tax_status_indicator)
471
+ @tax_status_indicator = tax_status_indicator
472
+ end
473
+
474
+ # Custom attribute writer method with validation
475
+ # @param [Object] tax_type_code Value to be assigned
476
+ def tax_type_code=(tax_type_code)
477
+ @tax_type_code = tax_type_code
478
+ end
479
+
480
+ # Custom attribute writer method with validation
481
+ # @param [Object] type_of_supply Value to be assigned
482
+ def type_of_supply=(type_of_supply)
483
+ @type_of_supply = type_of_supply
484
+ end
485
+
486
+ # Custom attribute writer method with validation
487
+ # @param [Object] commodity_code Value to be assigned
488
+ def commodity_code=(commodity_code)
489
+ @commodity_code = commodity_code
490
+ end
491
+
492
+ # Custom attribute writer method with validation
493
+ # @param [Object] discount_amount Value to be assigned
494
+ def discount_amount=(discount_amount)
495
+ @discount_amount = discount_amount
496
+ end
497
+
498
+ # Custom attribute writer method with validation
499
+ # @param [Object] discount_rate Value to be assigned
500
+ def discount_rate=(discount_rate)
501
+ @discount_rate = discount_rate
502
+ end
503
+
504
+ # Custom attribute writer method with validation
505
+ # @param [Object] invoice_number Value to be assigned
506
+ def invoice_number=(invoice_number)
507
+ @invoice_number = invoice_number
508
+ end
509
+
510
+ # Custom attribute writer method with validation
511
+ # @param [Object] weight Value to be assigned
512
+ def weight=(weight)
513
+ @weight = weight
514
+ end
515
+
516
+ # Custom attribute writer method with validation
517
+ # @param [Object] weight_identifier Value to be assigned
518
+ def weight_identifier=(weight_identifier)
519
+ @weight_identifier = weight_identifier
520
+ end
521
+
522
+ # Custom attribute writer method with validation
523
+ # @param [Object] weight_unit Value to be assigned
524
+ def weight_unit=(weight_unit)
525
+ @weight_unit = weight_unit
526
+ end
527
+
528
+ # Custom attribute writer method with validation
529
+ # @param [Object] reference_data_code Value to be assigned
530
+ def reference_data_code=(reference_data_code)
531
+ @reference_data_code = reference_data_code
532
+ end
533
+
534
+ # Custom attribute writer method with validation
535
+ # @param [Object] reference_data_number Value to be assigned
536
+ def reference_data_number=(reference_data_number)
537
+ @reference_data_number = reference_data_number
538
+ end
539
+
540
+ # Custom attribute writer method with validation
541
+ # @param [Object] unit_tax_amount Value to be assigned
542
+ def unit_tax_amount=(unit_tax_amount)
543
+ @unit_tax_amount = unit_tax_amount
544
+ end
545
+
546
+ # Custom attribute writer method with validation
547
+ # @param [Object] measurement Value to be assigned
548
+ def measurement=(measurement)
549
+ @measurement = measurement
550
+ end
551
+
552
+ # Custom attribute writer method with validation
553
+ # @param [Object] shipping_destination_types Value to be assigned
554
+ def shipping_destination_types=(shipping_destination_types)
555
+ @shipping_destination_types = shipping_destination_types
556
+ end
557
+
558
+ # Checks equality by comparing each attribute.
559
+ # @param [Object] Object to be compared
560
+ def ==(o)
561
+ return true if self.equal?(o)
562
+ self.class == o.class &&
563
+ product_code == o.product_code &&
564
+ product_name == o.product_name &&
565
+ product_sku == o.product_sku &&
566
+ quantity == o.quantity &&
567
+ unit_price == o.unit_price &&
568
+ unit_of_measure == o.unit_of_measure &&
569
+ total_amount == o.total_amount &&
570
+ tax_amount == o.tax_amount &&
571
+ tax_rate == o.tax_rate &&
572
+ tax_applied_after_discount == o.tax_applied_after_discount &&
573
+ tax_status_indicator == o.tax_status_indicator &&
574
+ tax_type_code == o.tax_type_code &&
575
+ amount_includes_tax == o.amount_includes_tax &&
576
+ type_of_supply == o.type_of_supply &&
577
+ commodity_code == o.commodity_code &&
578
+ discount_amount == o.discount_amount &&
579
+ discount_applied == o.discount_applied &&
580
+ discount_rate == o.discount_rate &&
581
+ invoice_number == o.invoice_number &&
582
+ tax_details == o.tax_details &&
583
+ fulfillment_type == o.fulfillment_type &&
584
+ weight == o.weight &&
585
+ weight_identifier == o.weight_identifier &&
586
+ weight_unit == o.weight_unit &&
587
+ reference_data_code == o.reference_data_code &&
588
+ reference_data_number == o.reference_data_number &&
589
+ unit_tax_amount == o.unit_tax_amount &&
590
+ measurement == o.measurement &&
591
+ product_description == o.product_description &&
592
+ gift_card_currency == o.gift_card_currency &&
593
+ shipping_destination_types == o.shipping_destination_types &&
594
+ gift == o.gift &&
595
+ passenger == o.passenger &&
596
+ allowed_export_countries == o.allowed_export_countries &&
597
+ restricted_export_countries == o.restricted_export_countries
598
+ end
599
+
600
+ # @see the `==` method
601
+ # @param [Object] Object to be compared
602
+ def eql?(o)
603
+ self == o
604
+ end
605
+
606
+ # Calculates hash code according to all attributes.
607
+ # @return [Fixnum] Hash code
608
+ def hash
609
+ [product_code, product_name, product_sku, quantity, unit_price, unit_of_measure, total_amount, tax_amount, tax_rate, tax_applied_after_discount, tax_status_indicator, tax_type_code, amount_includes_tax, type_of_supply, commodity_code, discount_amount, discount_applied, discount_rate, invoice_number, tax_details, fulfillment_type, weight, weight_identifier, weight_unit, reference_data_code, reference_data_number, unit_tax_amount, measurement, product_description, gift_card_currency, shipping_destination_types, gift, passenger, allowed_export_countries, restricted_export_countries].hash
610
+ end
611
+
612
+ # Builds the object from hash
613
+ # @param [Hash] attributes Model attributes in the form of hash
614
+ # @return [Object] Returns the model itself
615
+ def build_from_hash(attributes)
616
+ return nil unless attributes.is_a?(Hash)
617
+ self.class.swagger_types.each_pair do |key, type|
618
+ if type =~ /\AArray<(.*)>/i
619
+ # check to ensure the input is an array given that the the attribute
620
+ # is documented as an array but the input is not
621
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
622
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
623
+ end
624
+ elsif !attributes[self.class.attribute_map[key]].nil?
625
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
626
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
627
+ end
628
+
629
+ self
630
+ end
631
+
632
+ # Deserializes the data based on type
633
+ # @param string type Data type
634
+ # @param string value Value to be deserialized
635
+ # @return [Object] Deserialized data
636
+ def _deserialize(type, value)
637
+ case type.to_sym
638
+ when :DateTime
639
+ DateTime.parse(value)
640
+ when :Date
641
+ Date.parse(value)
642
+ when :String
643
+ value.to_s
644
+ when :Integer
645
+ value.to_i
646
+ when :Float
647
+ value.to_f
648
+ when :BOOLEAN
649
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
650
+ true
651
+ else
652
+ false
653
+ end
654
+ when :Object
655
+ # generic object (usually a Hash), return directly
656
+ value
657
+ when /\AArray<(?<inner_type>.+)>\z/
658
+ inner_type = Regexp.last_match[:inner_type]
659
+ value.map { |v| _deserialize(inner_type, v) }
660
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
661
+ k_type = Regexp.last_match[:k_type]
662
+ v_type = Regexp.last_match[:v_type]
663
+ {}.tap do |hash|
664
+ value.each do |k, v|
665
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
666
+ end
667
+ end
668
+ else # model
669
+ temp_model = CyberSource.const_get(type).new
670
+ temp_model.build_from_hash(value)
671
+ end
672
+ end
673
+
674
+ # Returns the string representation of the object
675
+ # @return [String] String presentation of the object
676
+ def to_s
677
+ to_hash.to_s
678
+ end
679
+
680
+ # to_body is an alias to to_hash (backward compatibility)
681
+ # @return [Hash] Returns the object in the form of hash
682
+ def to_body
683
+ to_hash
684
+ end
685
+
686
+ # Returns the object in the form of hash
687
+ # @return [Hash] Returns the object in the form of hash
688
+ def to_hash
689
+ hash = {}
690
+ self.class.attribute_map.each_pair do |attr, param|
691
+ value = self.send(attr)
692
+ next if value.nil?
693
+ hash[param] = _to_hash(value)
694
+ end
695
+ hash
696
+ end
697
+
698
+ # Outputs non-array value in the form of hash
699
+ # For object, use to_hash. Otherwise, just return the value
700
+ # @param [Object] value Any valid value
701
+ # @return [Hash] Returns the value in the form of hash
702
+ def _to_hash(value)
703
+ if value.is_a?(Array)
704
+ value.compact.map { |v| _to_hash(v) }
705
+ elsif value.is_a?(Hash)
706
+ {}.tap do |hash|
707
+ value.each { |k, v| hash[k] = _to_hash(v) }
708
+ end
709
+ elsif value.respond_to? :to_hash
710
+ value.to_hash
711
+ else
712
+ value
713
+ end
714
+ end
715
+ end
716
+ end