cyberSource_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/AuthenticationSDK/Cybersource.gemspec +23 -23
- data/AuthenticationSDK/authentication/http/GetSignatureParameter.rb +62 -62
- data/AuthenticationSDK/authentication/http/HttpSignatureHeader.rb +50 -50
- data/AuthenticationSDK/authentication/jwt/JwtToken.rb +62 -62
- data/AuthenticationSDK/authentication/payloadDigest/digest.rb +10 -10
- data/AuthenticationSDK/core/Authorization.rb +24 -24
- data/AuthenticationSDK/core/ITokenGeneration.rb +4 -4
- data/AuthenticationSDK/core/Logger.rb +26 -26
- data/AuthenticationSDK/core/MerchantConfig.rb +181 -181
- data/AuthenticationSDK/util/ApiException.rb +18 -18
- data/AuthenticationSDK/util/Cache.rb +36 -36
- data/AuthenticationSDK/util/Constants.rb +133 -133
- data/AuthenticationSDK/util/PropertiesUtil.rb +21 -21
- data/AuthenticationSDK/util/Utility.rb +30 -30
- data/lib/cyberSource_client.rb +286 -286
- data/lib/cyberSource_client/api/capture_api.rb +133 -133
- data/lib/cyberSource_client/api/credit_api.rb +127 -127
- data/lib/cyberSource_client/api/default_api.rb +75 -75
- data/lib/cyberSource_client/api/instrument_identifier_api.rb +393 -393
- data/lib/cyberSource_client/api/key_generation_api.rb +75 -75
- data/lib/cyberSource_client/api/payment_api.rb +127 -127
- data/lib/cyberSource_client/api/payment_instrument_api.rb +312 -312
- data/lib/cyberSource_client/api/refund_api.rb +191 -191
- data/lib/cyberSource_client/api/reversal_api.rb +133 -133
- data/lib/cyberSource_client/api/tokenization_api.rb +71 -71
- data/lib/cyberSource_client/api/void_api.rb +307 -307
- data/lib/cyberSource_client/api_client.rb +437 -437
- data/lib/cyberSource_client/api_error.rb +38 -38
- data/lib/cyberSource_client/configuration.rb +202 -202
- data/lib/cyberSource_client/models/auth_reversal_request.rb +219 -219
- data/lib/cyberSource_client/models/body.rb +295 -295
- data/lib/cyberSource_client/models/body_1.rb +183 -183
- data/lib/cyberSource_client/models/body_2.rb +331 -331
- data/lib/cyberSource_client/models/body_3.rb +331 -331
- data/lib/cyberSource_client/models/capture_payment_request.rb +267 -267
- data/lib/cyberSource_client/models/card_info.rb +214 -214
- data/lib/cyberSource_client/models/create_credit_request.rb +267 -267
- data/lib/cyberSource_client/models/create_payment_request.rb +285 -285
- data/lib/cyberSource_client/models/der_public_key.rb +205 -205
- data/lib/cyberSource_client/models/error.rb +192 -192
- data/lib/cyberSource_client/models/error_links.rb +205 -205
- data/lib/cyberSource_client/models/error_response.rb +192 -192
- data/lib/cyberSource_client/models/generate_public_key_request.rb +184 -184
- data/lib/cyberSource_client/models/inline_response_200.rb +202 -202
- data/lib/cyberSource_client/models/inline_response_200_1.rb +255 -255
- data/lib/cyberSource_client/models/inline_response_200_2.rb +377 -377
- data/lib/cyberSource_client/models/inline_response_200_2_buyer_information.rb +270 -270
- data/lib/cyberSource_client/models/inline_response_200_2_device_information.rb +219 -219
- data/lib/cyberSource_client/models/inline_response_200_2_merchant_information.rb +233 -233
- data/lib/cyberSource_client/models/inline_response_200_2_order_information.rb +230 -230
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_amount_details.rb +385 -385
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_bill_to.rb +459 -459
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_invoice_details.rb +315 -315
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_line_items.rb +564 -564
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_ship_to.rb +429 -429
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information.rb +192 -192
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information_card.rb +274 -274
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information_tokenized_card.rb +299 -299
- data/lib/cyberSource_client/models/inline_response_200_2_processing_information.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information.rb +227 -227
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information_avs.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information_card_verification.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_200_3.rb +314 -314
- data/lib/cyberSource_client/models/inline_response_200_4.rb +350 -350
- data/lib/cyberSource_client/models/inline_response_200_4_device_information.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_200_4_order_information.rb +230 -230
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_amount_details.rb +360 -360
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_invoice_details.rb +305 -305
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_ship_to.rb +249 -249
- data/lib/cyberSource_client/models/inline_response_200_4_processing_information.rb +208 -208
- data/lib/cyberSource_client/models/inline_response_200_4_processing_information_authorization_options.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_200_5.rb +305 -305
- data/lib/cyberSource_client/models/inline_response_200_6.rb +305 -305
- data/lib/cyberSource_client/models/inline_response_200_7.rb +295 -295
- data/lib/cyberSource_client/models/inline_response_200_8.rb +277 -277
- data/lib/cyberSource_client/models/inline_response_200_8__links.rb +219 -219
- data/lib/cyberSource_client/models/inline_response_200_8__links_first.rb +184 -184
- data/lib/cyberSource_client/models/inline_response_200_8__links_last.rb +184 -184
- data/lib/cyberSource_client/models/inline_response_200_8__links_next.rb +184 -184
- data/lib/cyberSource_client/models/inline_response_200_8__links_prev.rb +184 -184
- data/lib/cyberSource_client/models/inline_response_200_8__links_self.rb +184 -184
- data/lib/cyberSource_client/models/inline_response_200_der.rb +205 -205
- data/lib/cyberSource_client/models/inline_response_200_jwk.rb +225 -225
- data/lib/cyberSource_client/models/inline_response_201.rb +350 -350
- data/lib/cyberSource_client/models/inline_response_201_1.rb +332 -332
- data/lib/cyberSource_client/models/inline_response_201_1_authorization_information.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_1_processor_information.rb +324 -324
- data/lib/cyberSource_client/models/inline_response_201_1_reversal_amount_details.rb +249 -249
- data/lib/cyberSource_client/models/inline_response_201_2.rb +314 -314
- data/lib/cyberSource_client/models/inline_response_201_2__links.rb +201 -201
- data/lib/cyberSource_client/models/inline_response_201_2_order_information.rb +192 -192
- data/lib/cyberSource_client/models/inline_response_201_2_order_information_amount_details.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_2_processor_information.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_201_3.rb +323 -323
- data/lib/cyberSource_client/models/inline_response_201_3__links.rb +192 -192
- data/lib/cyberSource_client/models/inline_response_201_3_order_information.rb +183 -183
- data/lib/cyberSource_client/models/inline_response_201_3_processor_information.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_3_refund_amount_details.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_4.rb +323 -323
- data/lib/cyberSource_client/models/inline_response_201_4_credit_amount_details.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_5.rb +280 -280
- data/lib/cyberSource_client/models/inline_response_201_5_void_amount_details.rb +219 -219
- data/lib/cyberSource_client/models/inline_response_201_6.rb +331 -331
- data/lib/cyberSource_client/models/inline_response_201__embedded.rb +183 -183
- data/lib/cyberSource_client/models/inline_response_201__embedded_capture.rb +193 -193
- data/lib/cyberSource_client/models/inline_response_201__embedded_capture__links.rb +183 -183
- data/lib/cyberSource_client/models/inline_response_201__links.rb +201 -201
- data/lib/cyberSource_client/models/inline_response_201__links_self.rb +194 -194
- data/lib/cyberSource_client/models/inline_response_201_client_reference_information.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_201_error_information.rb +239 -239
- data/lib/cyberSource_client/models/inline_response_201_error_information_details.rb +228 -228
- data/lib/cyberSource_client/models/inline_response_201_order_information.rb +192 -192
- data/lib/cyberSource_client/models/inline_response_201_order_information_amount_details.rb +249 -249
- data/lib/cyberSource_client/models/inline_response_201_order_information_invoice_details.rb +184 -184
- data/lib/cyberSource_client/models/inline_response_201_payment_information.rb +201 -201
- data/lib/cyberSource_client/models/inline_response_201_payment_information_account_features.rb +623 -623
- data/lib/cyberSource_client/models/inline_response_201_payment_information_card.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_201_payment_information_tokenized_card.rb +349 -349
- data/lib/cyberSource_client/models/inline_response_201_point_of_sale_information.rb +208 -208
- data/lib/cyberSource_client/models/inline_response_201_point_of_sale_information_emv.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_201_processor_information.rb +642 -642
- data/lib/cyberSource_client/models/inline_response_201_processor_information_avs.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_processor_information_card_verification.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_processor_information_consumer_authentication_response.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_processor_information_customer.rb +199 -199
- data/lib/cyberSource_client/models/inline_response_201_processor_information_electronic_verification_results.rb +474 -474
- data/lib/cyberSource_client/models/inline_response_201_processor_information_issuer.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_201_processor_information_merchant_advice.rb +224 -224
- data/lib/cyberSource_client/models/inline_response_400.rb +271 -271
- data/lib/cyberSource_client/models/inline_response_400_1.rb +271 -271
- data/lib/cyberSource_client/models/inline_response_400_2.rb +271 -271
- data/lib/cyberSource_client/models/inline_response_400_3.rb +271 -271
- data/lib/cyberSource_client/models/inline_response_400_4.rb +271 -271
- data/lib/cyberSource_client/models/inline_response_400_5.rb +259 -259
- data/lib/cyberSource_client/models/inline_response_400_6.rb +202 -202
- data/lib/cyberSource_client/models/inline_response_409.rb +183 -183
- data/lib/cyberSource_client/models/inline_response_409__links.rb +183 -183
- data/lib/cyberSource_client/models/inline_response_409__links_payment_instruments.rb +183 -183
- data/lib/cyberSource_client/models/inline_response_502.rb +260 -260
- data/lib/cyberSource_client/models/inline_response_default.rb +192 -192
- data/lib/cyberSource_client/models/inline_response_default__links.rb +205 -205
- data/lib/cyberSource_client/models/inline_response_default__links_next.rb +204 -204
- data/lib/cyberSource_client/models/inline_response_default_response_status.rb +225 -225
- data/lib/cyberSource_client/models/inline_response_default_response_status_details.rb +194 -194
- data/lib/cyberSource_client/models/instrumentidentifiers__links.rb +201 -201
- data/lib/cyberSource_client/models/instrumentidentifiers__links_self.rb +183 -183
- data/lib/cyberSource_client/models/instrumentidentifiers_authorization_options_merchant_initiated_transaction.rb +184 -184
- data/lib/cyberSource_client/models/instrumentidentifiers_bank_account.rb +194 -194
- data/lib/cyberSource_client/models/instrumentidentifiers_card.rb +184 -184
- data/lib/cyberSource_client/models/instrumentidentifiers_details.rb +194 -194
- data/lib/cyberSource_client/models/instrumentidentifiers_metadata.rb +184 -184
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information.rb +183 -183
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information_authorization_options.rb +183 -183
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information_authorization_options_initiator.rb +183 -183
- data/lib/cyberSource_client/models/json_web_key.rb +225 -225
- data/lib/cyberSource_client/models/key_parameters.rb +184 -184
- data/lib/cyberSource_client/models/key_result.rb +202 -202
- data/lib/cyberSource_client/models/link.rb +204 -204
- data/lib/cyberSource_client/models/links.rb +205 -205
- data/lib/cyberSource_client/models/oct_create_payment_request.rb +237 -237
- data/lib/cyberSource_client/models/paymentinstruments_bank_account.rb +184 -184
- data/lib/cyberSource_client/models/paymentinstruments_bill_to.rb +284 -284
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information.rb +215 -215
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information_issued_by.rb +184 -184
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information_personal_identification.rb +203 -203
- data/lib/cyberSource_client/models/paymentinstruments_card.rb +278 -278
- data/lib/cyberSource_client/models/paymentinstruments_instrument_identifier.rb +295 -295
- data/lib/cyberSource_client/models/paymentinstruments_merchant_information.rb +183 -183
- data/lib/cyberSource_client/models/paymentinstruments_merchant_information_merchant_descriptor.rb +184 -184
- data/lib/cyberSource_client/models/paymentinstruments_processing_information.rb +193 -193
- data/lib/cyberSource_client/models/paymentinstruments_processing_information_bank_transfer_options.rb +184 -184
- data/lib/cyberSource_client/models/paymentsflexv1tokens_card_info.rb +214 -214
- data/lib/cyberSource_client/models/refund_capture_request.rb +267 -267
- data/lib/cyberSource_client/models/refund_payment_request.rb +267 -267
- data/lib/cyberSource_client/models/response_status.rb +225 -225
- data/lib/cyberSource_client/models/response_status_details.rb +194 -194
- data/lib/cyberSource_client/models/tokenize_parameters.rb +193 -193
- data/lib/cyberSource_client/models/tokenize_request.rb +193 -193
- data/lib/cyberSource_client/models/tokenize_result.rb +255 -255
- data/lib/cyberSource_client/models/v2credits_point_of_sale_information.rb +183 -183
- data/lib/cyberSource_client/models/v2credits_point_of_sale_information_emv.rb +221 -221
- data/lib/cyberSource_client/models/v2credits_processing_information.rb +383 -383
- data/lib/cyberSource_client/models/v2payments_aggregator_information.rb +233 -233
- data/lib/cyberSource_client/models/v2payments_aggregator_information_sub_merchant.rb +424 -424
- data/lib/cyberSource_client/models/v2payments_buyer_information.rb +285 -285
- data/lib/cyberSource_client/models/v2payments_buyer_information_personal_identification.rb +252 -252
- data/lib/cyberSource_client/models/v2payments_client_reference_information.rb +219 -219
- data/lib/cyberSource_client/models/v2payments_consumer_authentication_information.rb +374 -374
- data/lib/cyberSource_client/models/v2payments_device_information.rb +249 -249
- data/lib/cyberSource_client/models/v2payments_merchant_defined_information.rb +224 -224
- data/lib/cyberSource_client/models/v2payments_merchant_information.rb +308 -308
- data/lib/cyberSource_client/models/v2payments_merchant_information_merchant_descriptor.rb +374 -374
- data/lib/cyberSource_client/models/v2payments_order_information.rb +230 -230
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details.rb +605 -605
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_amex_additional_amounts.rb +224 -224
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_surcharge.rb +209 -209
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_tax_details.rb +328 -328
- data/lib/cyberSource_client/models/v2payments_order_information_bill_to.rb +618 -618
- data/lib/cyberSource_client/models/v2payments_order_information_invoice_details.rb +330 -330
- data/lib/cyberSource_client/models/v2payments_order_information_invoice_details_transaction_advice_addendum.rb +199 -199
- data/lib/cyberSource_client/models/v2payments_order_information_line_items.rb +649 -649
- data/lib/cyberSource_client/models/v2payments_order_information_ship_to.rb +474 -474
- data/lib/cyberSource_client/models/v2payments_order_information_shipping_details.rb +234 -234
- data/lib/cyberSource_client/models/v2payments_payment_information.rb +210 -210
- data/lib/cyberSource_client/models/v2payments_payment_information_card.rb +474 -474
- data/lib/cyberSource_client/models/v2payments_payment_information_customer.rb +202 -202
- data/lib/cyberSource_client/models/v2payments_payment_information_fluid_data.rb +259 -259
- data/lib/cyberSource_client/models/v2payments_payment_information_tokenized_card.rb +424 -424
- data/lib/cyberSource_client/models/v2payments_point_of_sale_information.rb +440 -440
- data/lib/cyberSource_client/models/v2payments_point_of_sale_information_emv.rb +256 -256
- data/lib/cyberSource_client/models/v2payments_processing_information.rb +432 -432
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options.rb +361 -361
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options_initiator.rb +247 -247
- data/lib/cyberSource_client/models/{v2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction.rb → v2payments_processing_information_authorization_options_merchant_initiated_transaction.rb} +224 -224
- data/lib/cyberSource_client/models/v2payments_processing_information_capture_options.rb +267 -267
- data/lib/cyberSource_client/models/v2payments_processing_information_issuer.rb +199 -199
- data/lib/cyberSource_client/models/v2payments_processing_information_recurring_options.rb +198 -198
- data/lib/cyberSource_client/models/v2payments_recipient_information.rb +249 -249
- data/lib/cyberSource_client/models/v2paymentsidcaptures_aggregator_information.rb +233 -233
- data/lib/cyberSource_client/models/v2paymentsidcaptures_aggregator_information_sub_merchant.rb +374 -374
- data/lib/cyberSource_client/models/v2paymentsidcaptures_buyer_information.rb +224 -224
- data/lib/cyberSource_client/models/v2paymentsidcaptures_merchant_information.rb +258 -258
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information.rb +230 -230
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_amount_details.rb +546 -546
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_bill_to.rb +449 -449
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_invoice_details.rb +320 -320
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_ship_to.rb +249 -249
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_shipping_details.rb +199 -199
- data/lib/cyberSource_client/models/v2paymentsidcaptures_payment_information.rb +183 -183
- data/lib/cyberSource_client/models/v2paymentsidcaptures_point_of_sale_information.rb +208 -208
- data/lib/cyberSource_client/models/v2paymentsidcaptures_point_of_sale_information_emv.rb +211 -211
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information.rb +351 -351
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information_authorization_options.rb +249 -249
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information_capture_options.rb +242 -242
- data/lib/cyberSource_client/models/v2paymentsidrefunds_merchant_information.rb +258 -258
- data/lib/cyberSource_client/models/v2paymentsidrefunds_order_information.rb +230 -230
- data/lib/cyberSource_client/models/v2paymentsidrefunds_order_information_line_items.rb +639 -639
- data/lib/cyberSource_client/models/v2paymentsidrefunds_payment_information.rb +183 -183
- data/lib/cyberSource_client/models/v2paymentsidrefunds_payment_information_card.rb +374 -374
- data/lib/cyberSource_client/models/v2paymentsidrefunds_point_of_sale_information.rb +183 -183
- data/lib/cyberSource_client/models/v2paymentsidrefunds_processing_information.rb +333 -333
- data/lib/cyberSource_client/models/v2paymentsidrefunds_processing_information_recurring_options.rb +186 -186
- data/lib/cyberSource_client/models/v2paymentsidreversals_client_reference_information.rb +209 -209
- data/lib/cyberSource_client/models/v2paymentsidreversals_order_information.rb +185 -185
- data/lib/cyberSource_client/models/v2paymentsidreversals_order_information_line_items.rb +233 -233
- data/lib/cyberSource_client/models/v2paymentsidreversals_point_of_sale_information.rb +183 -183
- data/lib/cyberSource_client/models/v2paymentsidreversals_processing_information.rb +308 -308
- data/lib/cyberSource_client/models/v2paymentsidreversals_reversal_information.rb +211 -211
- data/lib/cyberSource_client/models/v2paymentsidreversals_reversal_information_amount_details.rb +224 -224
- data/lib/cyberSource_client/models/v2payouts_merchant_information.rb +258 -258
- data/lib/cyberSource_client/models/v2payouts_merchant_information_merchant_descriptor.rb +324 -324
- data/lib/cyberSource_client/models/v2payouts_order_information.rb +192 -192
- data/lib/cyberSource_client/models/v2payouts_order_information_amount_details.rb +249 -249
- data/lib/cyberSource_client/models/v2payouts_order_information_bill_to.rb +443 -443
- data/lib/cyberSource_client/models/v2payouts_payment_information.rb +183 -183
- data/lib/cyberSource_client/models/v2payouts_payment_information_card.rb +299 -299
- data/lib/cyberSource_client/models/v2payouts_processing_information.rb +283 -283
- data/lib/cyberSource_client/models/v2payouts_processing_information_payouts_options.rb +274 -274
- data/lib/cyberSource_client/models/v2payouts_recipient_information.rb +433 -433
- data/lib/cyberSource_client/models/v2payouts_sender_information.rb +517 -517
- data/lib/cyberSource_client/models/v2payouts_sender_information_account.rb +233 -233
- data/lib/cyberSource_client/models/void_capture_request.rb +183 -183
- data/lib/cyberSource_client/models/void_credit_request.rb +183 -183
- data/lib/cyberSource_client/models/void_payment_request.rb +183 -183
- data/lib/cyberSource_client/models/void_refund_request.rb +183 -183
- data/lib/cyberSource_client/version.rb +15 -15
- metadata +4 -4
@@ -1,639 +1,639 @@
|
|
1
|
-
=begin
|
2
|
-
#CyberSource Flex API
|
3
|
-
|
4
|
-
#Simple PAN tokenization service
|
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.2.3
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module CyberSource
|
16
|
-
class V2paymentsidrefundsOrderInformationLineItems
|
17
|
-
# Type of product. This value is used to determine the category that the product is in: electronic, handling, physical, service, or shipping. The default value is **default**. For a payment, when you set this field to a value other than default or any of the values related to shipping and handling, below fields _quantity_, _productName_, and _productSKU_ are required.
|
18
|
-
attr_accessor :product_code
|
19
|
-
|
20
|
-
# For PAYMENT and CAPTURE API, this field is required when above _productCode_ is not **default** or one of the values related to shipping and handling.
|
21
|
-
attr_accessor :product_name
|
22
|
-
|
23
|
-
# Identification code for the product. For PAYMENT and CAPTURE API, this field is required when above _productCode_ is not **default** or one of the values related to shipping and/or handling.
|
24
|
-
attr_accessor :product_sku
|
25
|
-
|
26
|
-
# For a payment or capture, this field is required when _productCode_ is not **default** or one of the values related to shipping and handling.
|
27
|
-
attr_accessor :quantity
|
28
|
-
|
29
|
-
# Per-item price of the product. This value cannot be negative. You can include a decimal point (.), but you cannot include any other special characters. CyberSource truncates the amount to the correct number of decimal places. For processor-specific information, see the amount field in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
|
30
|
-
attr_accessor :unit_price
|
31
|
-
|
32
|
-
# Unit of measure, or unit of measure code, for the item.
|
33
|
-
attr_accessor :unit_of_measure
|
34
|
-
|
35
|
-
# Total amount for the item. Normally calculated as the unit price x quantity.
|
36
|
-
attr_accessor :total_amount
|
37
|
-
|
38
|
-
# 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. This field is frequently used for Level II and Level III transactions.
|
39
|
-
attr_accessor :tax_amount
|
40
|
-
|
41
|
-
# Tax rate applied to the item. See \"Numbered Elements,\" page 14. 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%).
|
42
|
-
attr_accessor :tax_rate
|
43
|
-
|
44
|
-
# 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.
|
45
|
-
attr_accessor :tax_applied_after_discount
|
46
|
-
|
47
|
-
# Flag to indicate whether tax is exempted or not included. - 0: tax not included - 1: tax included - 2: transaction is not subject to tax
|
48
|
-
attr_accessor :tax_status_indicator
|
49
|
-
|
50
|
-
# Type of tax being applied to the item. Possible values: Below values are used by **RBS WorldPay Atlanta**, **FDC Nashville Global**, **Litle** - 0000: unknown tax type - 0001: federal/national sales tax - 0002: state sales tax - 0003: city sales tax - 0004: local sales tax - 0005: municipal sales tax - 0006: other tax - 0010: value-added tax - 0011: goods and services tax - 0012: provincial sales tax - 0013: harmonized sales tax - 0014: Quebec sales tax (QST) - 0020: room tax - 0021: occupancy tax - 0022: energy tax - Blank: Tax not supported on line item.
|
51
|
-
attr_accessor :tax_type_code
|
52
|
-
|
53
|
-
# Flag that indicates whether the tax amount is included in the Line Item Total.
|
54
|
-
attr_accessor :amount_includes_tax
|
55
|
-
|
56
|
-
# Flag to indicate whether the purchase is categorized as goods or services. Possible values: - 00: goods - 01: services
|
57
|
-
attr_accessor :type_of_supply
|
58
|
-
|
59
|
-
# Commodity code or International description code used to classify the item. Contact your acquirer for a list of codes.
|
60
|
-
attr_accessor :commodity_code
|
61
|
-
|
62
|
-
# Discount applied to the item.
|
63
|
-
attr_accessor :discount_amount
|
64
|
-
|
65
|
-
# 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**.
|
66
|
-
attr_accessor :discount_applied
|
67
|
-
|
68
|
-
# Rate the item is discounted. Maximum of 2 decimal places. Example 5.25 (=5.25%)
|
69
|
-
attr_accessor :discount_rate
|
70
|
-
|
71
|
-
# 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.
|
72
|
-
attr_accessor :invoice_number
|
73
|
-
|
74
|
-
attr_accessor :tax_details
|
75
|
-
|
76
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
77
|
-
def self.attribute_map
|
78
|
-
{
|
79
|
-
:'product_code' => :'productCode',
|
80
|
-
:'product_name' => :'productName',
|
81
|
-
:'product_sku' => :'productSku',
|
82
|
-
:'quantity' => :'quantity',
|
83
|
-
:'unit_price' => :'unitPrice',
|
84
|
-
:'unit_of_measure' => :'unitOfMeasure',
|
85
|
-
:'total_amount' => :'totalAmount',
|
86
|
-
:'tax_amount' => :'taxAmount',
|
87
|
-
:'tax_rate' => :'taxRate',
|
88
|
-
:'tax_applied_after_discount' => :'taxAppliedAfterDiscount',
|
89
|
-
:'tax_status_indicator' => :'taxStatusIndicator',
|
90
|
-
:'tax_type_code' => :'taxTypeCode',
|
91
|
-
:'amount_includes_tax' => :'amountIncludesTax',
|
92
|
-
:'type_of_supply' => :'typeOfSupply',
|
93
|
-
:'commodity_code' => :'commodityCode',
|
94
|
-
:'discount_amount' => :'discountAmount',
|
95
|
-
:'discount_applied' => :'discountApplied',
|
96
|
-
:'discount_rate' => :'discountRate',
|
97
|
-
:'invoice_number' => :'invoiceNumber',
|
98
|
-
:'tax_details' => :'taxDetails'
|
99
|
-
}
|
100
|
-
end
|
101
|
-
|
102
|
-
# Attribute type mapping.
|
103
|
-
def self.swagger_types
|
104
|
-
{
|
105
|
-
:'product_code' => :'String',
|
106
|
-
:'product_name' => :'String',
|
107
|
-
:'product_sku' => :'String',
|
108
|
-
:'quantity' => :'Float',
|
109
|
-
:'unit_price' => :'String',
|
110
|
-
:'unit_of_measure' => :'String',
|
111
|
-
:'total_amount' => :'String',
|
112
|
-
:'tax_amount' => :'String',
|
113
|
-
:'tax_rate' => :'String',
|
114
|
-
:'tax_applied_after_discount' => :'String',
|
115
|
-
:'tax_status_indicator' => :'String',
|
116
|
-
:'tax_type_code' => :'String',
|
117
|
-
:'amount_includes_tax' => :'BOOLEAN',
|
118
|
-
:'type_of_supply' => :'String',
|
119
|
-
:'commodity_code' => :'String',
|
120
|
-
:'discount_amount' => :'String',
|
121
|
-
:'discount_applied' => :'BOOLEAN',
|
122
|
-
:'discount_rate' => :'String',
|
123
|
-
:'invoice_number' => :'String',
|
124
|
-
:'tax_details' => :'Array<V2paymentsOrderInformationAmountDetailsTaxDetails>'
|
125
|
-
}
|
126
|
-
end
|
127
|
-
|
128
|
-
# Initializes the object
|
129
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
130
|
-
def initialize(attributes = {})
|
131
|
-
return unless attributes.is_a?(Hash)
|
132
|
-
|
133
|
-
# convert string to symbol for hash key
|
134
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
135
|
-
|
136
|
-
if attributes.has_key?(:'productCode')
|
137
|
-
self.product_code = attributes[:'productCode']
|
138
|
-
end
|
139
|
-
|
140
|
-
if attributes.has_key?(:'productName')
|
141
|
-
self.product_name = attributes[:'productName']
|
142
|
-
end
|
143
|
-
|
144
|
-
if attributes.has_key?(:'productSku')
|
145
|
-
self.product_sku = attributes[:'productSku']
|
146
|
-
end
|
147
|
-
|
148
|
-
if attributes.has_key?(:'quantity')
|
149
|
-
self.quantity = attributes[:'quantity']
|
150
|
-
end
|
151
|
-
|
152
|
-
if attributes.has_key?(:'unitPrice')
|
153
|
-
self.unit_price = attributes[:'unitPrice']
|
154
|
-
end
|
155
|
-
|
156
|
-
if attributes.has_key?(:'unitOfMeasure')
|
157
|
-
self.unit_of_measure = attributes[:'unitOfMeasure']
|
158
|
-
end
|
159
|
-
|
160
|
-
if attributes.has_key?(:'totalAmount')
|
161
|
-
self.total_amount = attributes[:'totalAmount']
|
162
|
-
end
|
163
|
-
|
164
|
-
if attributes.has_key?(:'taxAmount')
|
165
|
-
self.tax_amount = attributes[:'taxAmount']
|
166
|
-
end
|
167
|
-
|
168
|
-
if attributes.has_key?(:'taxRate')
|
169
|
-
self.tax_rate = attributes[:'taxRate']
|
170
|
-
end
|
171
|
-
|
172
|
-
if attributes.has_key?(:'taxAppliedAfterDiscount')
|
173
|
-
self.tax_applied_after_discount = attributes[:'taxAppliedAfterDiscount']
|
174
|
-
end
|
175
|
-
|
176
|
-
if attributes.has_key?(:'taxStatusIndicator')
|
177
|
-
self.tax_status_indicator = attributes[:'taxStatusIndicator']
|
178
|
-
end
|
179
|
-
|
180
|
-
if attributes.has_key?(:'taxTypeCode')
|
181
|
-
self.tax_type_code = attributes[:'taxTypeCode']
|
182
|
-
end
|
183
|
-
|
184
|
-
if attributes.has_key?(:'amountIncludesTax')
|
185
|
-
self.amount_includes_tax = attributes[:'amountIncludesTax']
|
186
|
-
end
|
187
|
-
|
188
|
-
if attributes.has_key?(:'typeOfSupply')
|
189
|
-
self.type_of_supply = attributes[:'typeOfSupply']
|
190
|
-
end
|
191
|
-
|
192
|
-
if attributes.has_key?(:'commodityCode')
|
193
|
-
self.commodity_code = attributes[:'commodityCode']
|
194
|
-
end
|
195
|
-
|
196
|
-
if attributes.has_key?(:'discountAmount')
|
197
|
-
self.discount_amount = attributes[:'discountAmount']
|
198
|
-
end
|
199
|
-
|
200
|
-
if attributes.has_key?(:'discountApplied')
|
201
|
-
self.discount_applied = attributes[:'discountApplied']
|
202
|
-
end
|
203
|
-
|
204
|
-
if attributes.has_key?(:'discountRate')
|
205
|
-
self.discount_rate = attributes[:'discountRate']
|
206
|
-
end
|
207
|
-
|
208
|
-
if attributes.has_key?(:'invoiceNumber')
|
209
|
-
self.invoice_number = attributes[:'invoiceNumber']
|
210
|
-
end
|
211
|
-
|
212
|
-
if attributes.has_key?(:'taxDetails')
|
213
|
-
if (value = attributes[:'taxDetails']).is_a?(Array)
|
214
|
-
self.tax_details = value
|
215
|
-
end
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
220
|
-
# @return Array for valid properties with the reasons
|
221
|
-
def list_invalid_properties
|
222
|
-
invalid_properties = Array.new
|
223
|
-
if !@product_code.nil? && @product_code.to_s.length > 255
|
224
|
-
invalid_properties.push('invalid value for "product_code", the character length must be smaller than or equal to 255.')
|
225
|
-
end
|
226
|
-
|
227
|
-
if !@product_name.nil? && @product_name.to_s.length > 255
|
228
|
-
invalid_properties.push('invalid value for "product_name", the character length must be smaller than or equal to 255.')
|
229
|
-
end
|
230
|
-
|
231
|
-
if !@product_sku.nil? && @product_sku.to_s.length > 255
|
232
|
-
invalid_properties.push('invalid value for "product_sku", the character length must be smaller than or equal to 255.')
|
233
|
-
end
|
234
|
-
|
235
|
-
if !@quantity.nil? && @quantity > 9999999999
|
236
|
-
invalid_properties.push('invalid value for "quantity", must be smaller than or equal to 9999999999.')
|
237
|
-
end
|
238
|
-
|
239
|
-
if !@quantity.nil? && @quantity < 1
|
240
|
-
invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
|
241
|
-
end
|
242
|
-
|
243
|
-
if !@unit_price.nil? && @unit_price.to_s.length > 15
|
244
|
-
invalid_properties.push('invalid value for "unit_price", the character length must be smaller than or equal to 15.')
|
245
|
-
end
|
246
|
-
|
247
|
-
if !@unit_of_measure.nil? && @unit_of_measure.to_s.length > 12
|
248
|
-
invalid_properties.push('invalid value for "unit_of_measure", the character length must be smaller than or equal to 12.')
|
249
|
-
end
|
250
|
-
|
251
|
-
if !@total_amount.nil? && @total_amount.to_s.length > 13
|
252
|
-
invalid_properties.push('invalid value for "total_amount", the character length must be smaller than or equal to 13.')
|
253
|
-
end
|
254
|
-
|
255
|
-
if !@tax_amount.nil? && @tax_amount.to_s.length > 15
|
256
|
-
invalid_properties.push('invalid value for "tax_amount", the character length must be smaller than or equal to 15.')
|
257
|
-
end
|
258
|
-
|
259
|
-
if !@tax_rate.nil? && @tax_rate.to_s.length > 7
|
260
|
-
invalid_properties.push('invalid value for "tax_rate", the character length must be smaller than or equal to 7.')
|
261
|
-
end
|
262
|
-
|
263
|
-
if !@tax_applied_after_discount.nil? && @tax_applied_after_discount.to_s.length > 1
|
264
|
-
invalid_properties.push('invalid value for "tax_applied_after_discount", the character length must be smaller than or equal to 1.')
|
265
|
-
end
|
266
|
-
|
267
|
-
if !@tax_status_indicator.nil? && @tax_status_indicator.to_s.length > 1
|
268
|
-
invalid_properties.push('invalid value for "tax_status_indicator", the character length must be smaller than or equal to 1.')
|
269
|
-
end
|
270
|
-
|
271
|
-
if !@tax_type_code.nil? && @tax_type_code.to_s.length > 4
|
272
|
-
invalid_properties.push('invalid value for "tax_type_code", the character length must be smaller than or equal to 4.')
|
273
|
-
end
|
274
|
-
|
275
|
-
if !@type_of_supply.nil? && @type_of_supply.to_s.length > 2
|
276
|
-
invalid_properties.push('invalid value for "type_of_supply", the character length must be smaller than or equal to 2.')
|
277
|
-
end
|
278
|
-
|
279
|
-
if !@commodity_code.nil? && @commodity_code.to_s.length > 15
|
280
|
-
invalid_properties.push('invalid value for "commodity_code", the character length must be smaller than or equal to 15.')
|
281
|
-
end
|
282
|
-
|
283
|
-
if !@discount_amount.nil? && @discount_amount.to_s.length > 13
|
284
|
-
invalid_properties.push('invalid value for "discount_amount", the character length must be smaller than or equal to 13.')
|
285
|
-
end
|
286
|
-
|
287
|
-
if !@discount_rate.nil? && @discount_rate.to_s.length > 6
|
288
|
-
invalid_properties.push('invalid value for "discount_rate", the character length must be smaller than or equal to 6.')
|
289
|
-
end
|
290
|
-
|
291
|
-
if !@invoice_number.nil? && @invoice_number.to_s.length > 23
|
292
|
-
invalid_properties.push('invalid value for "invoice_number", the character length must be smaller than or equal to 23.')
|
293
|
-
end
|
294
|
-
|
295
|
-
invalid_properties
|
296
|
-
end
|
297
|
-
|
298
|
-
# Check to see if the all the properties in the model are valid
|
299
|
-
# @return true if the model is valid
|
300
|
-
def valid?
|
301
|
-
return false if !@product_code.nil? && @product_code.to_s.length > 255
|
302
|
-
return false if !@product_name.nil? && @product_name.to_s.length > 255
|
303
|
-
return false if !@product_sku.nil? && @product_sku.to_s.length > 255
|
304
|
-
return false if !@quantity.nil? && @quantity > 9999999999
|
305
|
-
return false if !@quantity.nil? && @quantity < 1
|
306
|
-
return false if !@unit_price.nil? && @unit_price.to_s.length > 15
|
307
|
-
return false if !@unit_of_measure.nil? && @unit_of_measure.to_s.length > 12
|
308
|
-
return false if !@total_amount.nil? && @total_amount.to_s.length > 13
|
309
|
-
return false if !@tax_amount.nil? && @tax_amount.to_s.length > 15
|
310
|
-
return false if !@tax_rate.nil? && @tax_rate.to_s.length > 7
|
311
|
-
return false if !@tax_applied_after_discount.nil? && @tax_applied_after_discount.to_s.length > 1
|
312
|
-
return false if !@tax_status_indicator.nil? && @tax_status_indicator.to_s.length > 1
|
313
|
-
return false if !@tax_type_code.nil? && @tax_type_code.to_s.length > 4
|
314
|
-
return false if !@type_of_supply.nil? && @type_of_supply.to_s.length > 2
|
315
|
-
return false if !@commodity_code.nil? && @commodity_code.to_s.length > 15
|
316
|
-
return false if !@discount_amount.nil? && @discount_amount.to_s.length > 13
|
317
|
-
return false if !@discount_rate.nil? && @discount_rate.to_s.length > 6
|
318
|
-
return false if !@invoice_number.nil? && @invoice_number.to_s.length > 23
|
319
|
-
true
|
320
|
-
end
|
321
|
-
|
322
|
-
# Custom attribute writer method with validation
|
323
|
-
# @param [Object] product_code Value to be assigned
|
324
|
-
def product_code=(product_code)
|
325
|
-
if !product_code.nil? && product_code.to_s.length > 255
|
326
|
-
fail ArgumentError, 'invalid value for "product_code", the character length must be smaller than or equal to 255.'
|
327
|
-
end
|
328
|
-
|
329
|
-
@product_code = product_code
|
330
|
-
end
|
331
|
-
|
332
|
-
# Custom attribute writer method with validation
|
333
|
-
# @param [Object] product_name Value to be assigned
|
334
|
-
def product_name=(product_name)
|
335
|
-
if !product_name.nil? && product_name.to_s.length > 255
|
336
|
-
fail ArgumentError, 'invalid value for "product_name", the character length must be smaller than or equal to 255.'
|
337
|
-
end
|
338
|
-
|
339
|
-
@product_name = product_name
|
340
|
-
end
|
341
|
-
|
342
|
-
# Custom attribute writer method with validation
|
343
|
-
# @param [Object] product_sku Value to be assigned
|
344
|
-
def product_sku=(product_sku)
|
345
|
-
if !product_sku.nil? && product_sku.to_s.length > 255
|
346
|
-
fail ArgumentError, 'invalid value for "product_sku", the character length must be smaller than or equal to 255.'
|
347
|
-
end
|
348
|
-
|
349
|
-
@product_sku = product_sku
|
350
|
-
end
|
351
|
-
|
352
|
-
# Custom attribute writer method with validation
|
353
|
-
# @param [Object] quantity Value to be assigned
|
354
|
-
def quantity=(quantity)
|
355
|
-
if !quantity.nil? && quantity > 9999999999
|
356
|
-
fail ArgumentError, 'invalid value for "quantity", must be smaller than or equal to 9999999999.'
|
357
|
-
end
|
358
|
-
|
359
|
-
if !quantity.nil? && quantity < 1
|
360
|
-
fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 1.'
|
361
|
-
end
|
362
|
-
|
363
|
-
@quantity = quantity
|
364
|
-
end
|
365
|
-
|
366
|
-
# Custom attribute writer method with validation
|
367
|
-
# @param [Object] unit_price Value to be assigned
|
368
|
-
def unit_price=(unit_price)
|
369
|
-
if !unit_price.nil? && unit_price.to_s.length > 15
|
370
|
-
fail ArgumentError, 'invalid value for "unit_price", the character length must be smaller than or equal to 15.'
|
371
|
-
end
|
372
|
-
|
373
|
-
@unit_price = unit_price
|
374
|
-
end
|
375
|
-
|
376
|
-
# Custom attribute writer method with validation
|
377
|
-
# @param [Object] unit_of_measure Value to be assigned
|
378
|
-
def unit_of_measure=(unit_of_measure)
|
379
|
-
if !unit_of_measure.nil? && unit_of_measure.to_s.length > 12
|
380
|
-
fail ArgumentError, 'invalid value for "unit_of_measure", the character length must be smaller than or equal to 12.'
|
381
|
-
end
|
382
|
-
|
383
|
-
@unit_of_measure = unit_of_measure
|
384
|
-
end
|
385
|
-
|
386
|
-
# Custom attribute writer method with validation
|
387
|
-
# @param [Object] total_amount Value to be assigned
|
388
|
-
def total_amount=(total_amount)
|
389
|
-
if !total_amount.nil? && total_amount.to_s.length > 13
|
390
|
-
fail ArgumentError, 'invalid value for "total_amount", the character length must be smaller than or equal to 13.'
|
391
|
-
end
|
392
|
-
|
393
|
-
@total_amount = total_amount
|
394
|
-
end
|
395
|
-
|
396
|
-
# Custom attribute writer method with validation
|
397
|
-
# @param [Object] tax_amount Value to be assigned
|
398
|
-
def tax_amount=(tax_amount)
|
399
|
-
if !tax_amount.nil? && tax_amount.to_s.length > 15
|
400
|
-
fail ArgumentError, 'invalid value for "tax_amount", the character length must be smaller than or equal to 15.'
|
401
|
-
end
|
402
|
-
|
403
|
-
@tax_amount = tax_amount
|
404
|
-
end
|
405
|
-
|
406
|
-
# Custom attribute writer method with validation
|
407
|
-
# @param [Object] tax_rate Value to be assigned
|
408
|
-
def tax_rate=(tax_rate)
|
409
|
-
if !tax_rate.nil? && tax_rate.to_s.length > 7
|
410
|
-
fail ArgumentError, 'invalid value for "tax_rate", the character length must be smaller than or equal to 7.'
|
411
|
-
end
|
412
|
-
|
413
|
-
@tax_rate = tax_rate
|
414
|
-
end
|
415
|
-
|
416
|
-
# Custom attribute writer method with validation
|
417
|
-
# @param [Object] tax_applied_after_discount Value to be assigned
|
418
|
-
def tax_applied_after_discount=(tax_applied_after_discount)
|
419
|
-
if !tax_applied_after_discount.nil? && tax_applied_after_discount.to_s.length > 1
|
420
|
-
fail ArgumentError, 'invalid value for "tax_applied_after_discount", the character length must be smaller than or equal to 1.'
|
421
|
-
end
|
422
|
-
|
423
|
-
@tax_applied_after_discount = tax_applied_after_discount
|
424
|
-
end
|
425
|
-
|
426
|
-
# Custom attribute writer method with validation
|
427
|
-
# @param [Object] tax_status_indicator Value to be assigned
|
428
|
-
def tax_status_indicator=(tax_status_indicator)
|
429
|
-
if !tax_status_indicator.nil? && tax_status_indicator.to_s.length > 1
|
430
|
-
fail ArgumentError, 'invalid value for "tax_status_indicator", the character length must be smaller than or equal to 1.'
|
431
|
-
end
|
432
|
-
|
433
|
-
@tax_status_indicator = tax_status_indicator
|
434
|
-
end
|
435
|
-
|
436
|
-
# Custom attribute writer method with validation
|
437
|
-
# @param [Object] tax_type_code Value to be assigned
|
438
|
-
def tax_type_code=(tax_type_code)
|
439
|
-
if !tax_type_code.nil? && tax_type_code.to_s.length > 4
|
440
|
-
fail ArgumentError, 'invalid value for "tax_type_code", the character length must be smaller than or equal to 4.'
|
441
|
-
end
|
442
|
-
|
443
|
-
@tax_type_code = tax_type_code
|
444
|
-
end
|
445
|
-
|
446
|
-
# Custom attribute writer method with validation
|
447
|
-
# @param [Object] type_of_supply Value to be assigned
|
448
|
-
def type_of_supply=(type_of_supply)
|
449
|
-
if !type_of_supply.nil? && type_of_supply.to_s.length > 2
|
450
|
-
fail ArgumentError, 'invalid value for "type_of_supply", the character length must be smaller than or equal to 2.'
|
451
|
-
end
|
452
|
-
|
453
|
-
@type_of_supply = type_of_supply
|
454
|
-
end
|
455
|
-
|
456
|
-
# Custom attribute writer method with validation
|
457
|
-
# @param [Object] commodity_code Value to be assigned
|
458
|
-
def commodity_code=(commodity_code)
|
459
|
-
if !commodity_code.nil? && commodity_code.to_s.length > 15
|
460
|
-
fail ArgumentError, 'invalid value for "commodity_code", the character length must be smaller than or equal to 15.'
|
461
|
-
end
|
462
|
-
|
463
|
-
@commodity_code = commodity_code
|
464
|
-
end
|
465
|
-
|
466
|
-
# Custom attribute writer method with validation
|
467
|
-
# @param [Object] discount_amount Value to be assigned
|
468
|
-
def discount_amount=(discount_amount)
|
469
|
-
if !discount_amount.nil? && discount_amount.to_s.length > 13
|
470
|
-
fail ArgumentError, 'invalid value for "discount_amount", the character length must be smaller than or equal to 13.'
|
471
|
-
end
|
472
|
-
|
473
|
-
@discount_amount = discount_amount
|
474
|
-
end
|
475
|
-
|
476
|
-
# Custom attribute writer method with validation
|
477
|
-
# @param [Object] discount_rate Value to be assigned
|
478
|
-
def discount_rate=(discount_rate)
|
479
|
-
if !discount_rate.nil? && discount_rate.to_s.length > 6
|
480
|
-
fail ArgumentError, 'invalid value for "discount_rate", the character length must be smaller than or equal to 6.'
|
481
|
-
end
|
482
|
-
|
483
|
-
@discount_rate = discount_rate
|
484
|
-
end
|
485
|
-
|
486
|
-
# Custom attribute writer method with validation
|
487
|
-
# @param [Object] invoice_number Value to be assigned
|
488
|
-
def invoice_number=(invoice_number)
|
489
|
-
if !invoice_number.nil? && invoice_number.to_s.length > 23
|
490
|
-
fail ArgumentError, 'invalid value for "invoice_number", the character length must be smaller than or equal to 23.'
|
491
|
-
end
|
492
|
-
|
493
|
-
@invoice_number = invoice_number
|
494
|
-
end
|
495
|
-
|
496
|
-
# Checks equality by comparing each attribute.
|
497
|
-
# @param [Object] Object to be compared
|
498
|
-
def ==(o)
|
499
|
-
return true if self.equal?(o)
|
500
|
-
self.class == o.class &&
|
501
|
-
product_code == o.product_code &&
|
502
|
-
product_name == o.product_name &&
|
503
|
-
product_sku == o.product_sku &&
|
504
|
-
quantity == o.quantity &&
|
505
|
-
unit_price == o.unit_price &&
|
506
|
-
unit_of_measure == o.unit_of_measure &&
|
507
|
-
total_amount == o.total_amount &&
|
508
|
-
tax_amount == o.tax_amount &&
|
509
|
-
tax_rate == o.tax_rate &&
|
510
|
-
tax_applied_after_discount == o.tax_applied_after_discount &&
|
511
|
-
tax_status_indicator == o.tax_status_indicator &&
|
512
|
-
tax_type_code == o.tax_type_code &&
|
513
|
-
amount_includes_tax == o.amount_includes_tax &&
|
514
|
-
type_of_supply == o.type_of_supply &&
|
515
|
-
commodity_code == o.commodity_code &&
|
516
|
-
discount_amount == o.discount_amount &&
|
517
|
-
discount_applied == o.discount_applied &&
|
518
|
-
discount_rate == o.discount_rate &&
|
519
|
-
invoice_number == o.invoice_number &&
|
520
|
-
tax_details == o.tax_details
|
521
|
-
end
|
522
|
-
|
523
|
-
# @see the `==` method
|
524
|
-
# @param [Object] Object to be compared
|
525
|
-
def eql?(o)
|
526
|
-
self == o
|
527
|
-
end
|
528
|
-
|
529
|
-
# Calculates hash code according to all attributes.
|
530
|
-
# @return [Fixnum] Hash code
|
531
|
-
def hash
|
532
|
-
[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].hash
|
533
|
-
end
|
534
|
-
|
535
|
-
# Builds the object from hash
|
536
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
537
|
-
# @return [Object] Returns the model itself
|
538
|
-
def build_from_hash(attributes)
|
539
|
-
return nil unless attributes.is_a?(Hash)
|
540
|
-
self.class.swagger_types.each_pair do |key, type|
|
541
|
-
if type =~ /\AArray<(.*)>/i
|
542
|
-
# check to ensure the input is an array given that the the attribute
|
543
|
-
# is documented as an array but the input is not
|
544
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
545
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
546
|
-
end
|
547
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
548
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
549
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
550
|
-
end
|
551
|
-
|
552
|
-
self
|
553
|
-
end
|
554
|
-
|
555
|
-
# Deserializes the data based on type
|
556
|
-
# @param string type Data type
|
557
|
-
# @param string value Value to be deserialized
|
558
|
-
# @return [Object] Deserialized data
|
559
|
-
def _deserialize(type, value)
|
560
|
-
case type.to_sym
|
561
|
-
when :DateTime
|
562
|
-
DateTime.parse(value)
|
563
|
-
when :Date
|
564
|
-
Date.parse(value)
|
565
|
-
when :String
|
566
|
-
value.to_s
|
567
|
-
when :Integer
|
568
|
-
value.to_i
|
569
|
-
when :Float
|
570
|
-
value.to_f
|
571
|
-
when :BOOLEAN
|
572
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
573
|
-
true
|
574
|
-
else
|
575
|
-
false
|
576
|
-
end
|
577
|
-
when :Object
|
578
|
-
# generic object (usually a Hash), return directly
|
579
|
-
value
|
580
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
581
|
-
inner_type = Regexp.last_match[:inner_type]
|
582
|
-
value.map { |v| _deserialize(inner_type, v) }
|
583
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
584
|
-
k_type = Regexp.last_match[:k_type]
|
585
|
-
v_type = Regexp.last_match[:v_type]
|
586
|
-
{}.tap do |hash|
|
587
|
-
value.each do |k, v|
|
588
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
589
|
-
end
|
590
|
-
end
|
591
|
-
else # model
|
592
|
-
temp_model = CyberSource.const_get(type).new
|
593
|
-
temp_model.build_from_hash(value)
|
594
|
-
end
|
595
|
-
end
|
596
|
-
|
597
|
-
# Returns the string representation of the object
|
598
|
-
# @return [String] String presentation of the object
|
599
|
-
def to_s
|
600
|
-
to_hash.to_s
|
601
|
-
end
|
602
|
-
|
603
|
-
# to_body is an alias to to_hash (backward compatibility)
|
604
|
-
# @return [Hash] Returns the object in the form of hash
|
605
|
-
def to_body
|
606
|
-
to_hash
|
607
|
-
end
|
608
|
-
|
609
|
-
# Returns the object in the form of hash
|
610
|
-
# @return [Hash] Returns the object in the form of hash
|
611
|
-
def to_hash
|
612
|
-
hash = {}
|
613
|
-
self.class.attribute_map.each_pair do |attr, param|
|
614
|
-
value = self.send(attr)
|
615
|
-
next if value.nil?
|
616
|
-
hash[param] = _to_hash(value)
|
617
|
-
end
|
618
|
-
hash
|
619
|
-
end
|
620
|
-
|
621
|
-
# Outputs non-array value in the form of hash
|
622
|
-
# For object, use to_hash. Otherwise, just return the value
|
623
|
-
# @param [Object] value Any valid value
|
624
|
-
# @return [Hash] Returns the value in the form of hash
|
625
|
-
def _to_hash(value)
|
626
|
-
if value.is_a?(Array)
|
627
|
-
value.compact.map { |v| _to_hash(v) }
|
628
|
-
elsif value.is_a?(Hash)
|
629
|
-
{}.tap do |hash|
|
630
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
631
|
-
end
|
632
|
-
elsif value.respond_to? :to_hash
|
633
|
-
value.to_hash
|
634
|
-
else
|
635
|
-
value
|
636
|
-
end
|
637
|
-
end
|
638
|
-
end
|
639
|
-
end
|
1
|
+
=begin
|
2
|
+
#CyberSource Flex API
|
3
|
+
|
4
|
+
#Simple PAN tokenization service
|
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.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CyberSource
|
16
|
+
class V2paymentsidrefundsOrderInformationLineItems
|
17
|
+
# Type of product. This value is used to determine the category that the product is in: electronic, handling, physical, service, or shipping. The default value is **default**. For a payment, when you set this field to a value other than default or any of the values related to shipping and handling, below fields _quantity_, _productName_, and _productSKU_ are required.
|
18
|
+
attr_accessor :product_code
|
19
|
+
|
20
|
+
# For PAYMENT and CAPTURE API, this field is required when above _productCode_ is not **default** or one of the values related to shipping and handling.
|
21
|
+
attr_accessor :product_name
|
22
|
+
|
23
|
+
# Identification code for the product. For PAYMENT and CAPTURE API, this field is required when above _productCode_ is not **default** or one of the values related to shipping and/or handling.
|
24
|
+
attr_accessor :product_sku
|
25
|
+
|
26
|
+
# For a payment or capture, this field is required when _productCode_ is not **default** or one of the values related to shipping and handling.
|
27
|
+
attr_accessor :quantity
|
28
|
+
|
29
|
+
# Per-item price of the product. This value cannot be negative. You can include a decimal point (.), but you cannot include any other special characters. CyberSource truncates the amount to the correct number of decimal places. For processor-specific information, see the amount field in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
|
30
|
+
attr_accessor :unit_price
|
31
|
+
|
32
|
+
# Unit of measure, or unit of measure code, for the item.
|
33
|
+
attr_accessor :unit_of_measure
|
34
|
+
|
35
|
+
# Total amount for the item. Normally calculated as the unit price x quantity.
|
36
|
+
attr_accessor :total_amount
|
37
|
+
|
38
|
+
# 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. This field is frequently used for Level II and Level III transactions.
|
39
|
+
attr_accessor :tax_amount
|
40
|
+
|
41
|
+
# Tax rate applied to the item. See \"Numbered Elements,\" page 14. 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%).
|
42
|
+
attr_accessor :tax_rate
|
43
|
+
|
44
|
+
# 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.
|
45
|
+
attr_accessor :tax_applied_after_discount
|
46
|
+
|
47
|
+
# Flag to indicate whether tax is exempted or not included. - 0: tax not included - 1: tax included - 2: transaction is not subject to tax
|
48
|
+
attr_accessor :tax_status_indicator
|
49
|
+
|
50
|
+
# Type of tax being applied to the item. Possible values: Below values are used by **RBS WorldPay Atlanta**, **FDC Nashville Global**, **Litle** - 0000: unknown tax type - 0001: federal/national sales tax - 0002: state sales tax - 0003: city sales tax - 0004: local sales tax - 0005: municipal sales tax - 0006: other tax - 0010: value-added tax - 0011: goods and services tax - 0012: provincial sales tax - 0013: harmonized sales tax - 0014: Quebec sales tax (QST) - 0020: room tax - 0021: occupancy tax - 0022: energy tax - Blank: Tax not supported on line item.
|
51
|
+
attr_accessor :tax_type_code
|
52
|
+
|
53
|
+
# Flag that indicates whether the tax amount is included in the Line Item Total.
|
54
|
+
attr_accessor :amount_includes_tax
|
55
|
+
|
56
|
+
# Flag to indicate whether the purchase is categorized as goods or services. Possible values: - 00: goods - 01: services
|
57
|
+
attr_accessor :type_of_supply
|
58
|
+
|
59
|
+
# Commodity code or International description code used to classify the item. Contact your acquirer for a list of codes.
|
60
|
+
attr_accessor :commodity_code
|
61
|
+
|
62
|
+
# Discount applied to the item.
|
63
|
+
attr_accessor :discount_amount
|
64
|
+
|
65
|
+
# 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**.
|
66
|
+
attr_accessor :discount_applied
|
67
|
+
|
68
|
+
# Rate the item is discounted. Maximum of 2 decimal places. Example 5.25 (=5.25%)
|
69
|
+
attr_accessor :discount_rate
|
70
|
+
|
71
|
+
# 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.
|
72
|
+
attr_accessor :invoice_number
|
73
|
+
|
74
|
+
attr_accessor :tax_details
|
75
|
+
|
76
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
77
|
+
def self.attribute_map
|
78
|
+
{
|
79
|
+
:'product_code' => :'productCode',
|
80
|
+
:'product_name' => :'productName',
|
81
|
+
:'product_sku' => :'productSku',
|
82
|
+
:'quantity' => :'quantity',
|
83
|
+
:'unit_price' => :'unitPrice',
|
84
|
+
:'unit_of_measure' => :'unitOfMeasure',
|
85
|
+
:'total_amount' => :'totalAmount',
|
86
|
+
:'tax_amount' => :'taxAmount',
|
87
|
+
:'tax_rate' => :'taxRate',
|
88
|
+
:'tax_applied_after_discount' => :'taxAppliedAfterDiscount',
|
89
|
+
:'tax_status_indicator' => :'taxStatusIndicator',
|
90
|
+
:'tax_type_code' => :'taxTypeCode',
|
91
|
+
:'amount_includes_tax' => :'amountIncludesTax',
|
92
|
+
:'type_of_supply' => :'typeOfSupply',
|
93
|
+
:'commodity_code' => :'commodityCode',
|
94
|
+
:'discount_amount' => :'discountAmount',
|
95
|
+
:'discount_applied' => :'discountApplied',
|
96
|
+
:'discount_rate' => :'discountRate',
|
97
|
+
:'invoice_number' => :'invoiceNumber',
|
98
|
+
:'tax_details' => :'taxDetails'
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
# Attribute type mapping.
|
103
|
+
def self.swagger_types
|
104
|
+
{
|
105
|
+
:'product_code' => :'String',
|
106
|
+
:'product_name' => :'String',
|
107
|
+
:'product_sku' => :'String',
|
108
|
+
:'quantity' => :'Float',
|
109
|
+
:'unit_price' => :'String',
|
110
|
+
:'unit_of_measure' => :'String',
|
111
|
+
:'total_amount' => :'String',
|
112
|
+
:'tax_amount' => :'String',
|
113
|
+
:'tax_rate' => :'String',
|
114
|
+
:'tax_applied_after_discount' => :'String',
|
115
|
+
:'tax_status_indicator' => :'String',
|
116
|
+
:'tax_type_code' => :'String',
|
117
|
+
:'amount_includes_tax' => :'BOOLEAN',
|
118
|
+
:'type_of_supply' => :'String',
|
119
|
+
:'commodity_code' => :'String',
|
120
|
+
:'discount_amount' => :'String',
|
121
|
+
:'discount_applied' => :'BOOLEAN',
|
122
|
+
:'discount_rate' => :'String',
|
123
|
+
:'invoice_number' => :'String',
|
124
|
+
:'tax_details' => :'Array<V2paymentsOrderInformationAmountDetailsTaxDetails>'
|
125
|
+
}
|
126
|
+
end
|
127
|
+
|
128
|
+
# Initializes the object
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
130
|
+
def initialize(attributes = {})
|
131
|
+
return unless attributes.is_a?(Hash)
|
132
|
+
|
133
|
+
# convert string to symbol for hash key
|
134
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
135
|
+
|
136
|
+
if attributes.has_key?(:'productCode')
|
137
|
+
self.product_code = attributes[:'productCode']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.has_key?(:'productName')
|
141
|
+
self.product_name = attributes[:'productName']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.has_key?(:'productSku')
|
145
|
+
self.product_sku = attributes[:'productSku']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.has_key?(:'quantity')
|
149
|
+
self.quantity = attributes[:'quantity']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.has_key?(:'unitPrice')
|
153
|
+
self.unit_price = attributes[:'unitPrice']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.has_key?(:'unitOfMeasure')
|
157
|
+
self.unit_of_measure = attributes[:'unitOfMeasure']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.has_key?(:'totalAmount')
|
161
|
+
self.total_amount = attributes[:'totalAmount']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.has_key?(:'taxAmount')
|
165
|
+
self.tax_amount = attributes[:'taxAmount']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.has_key?(:'taxRate')
|
169
|
+
self.tax_rate = attributes[:'taxRate']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.has_key?(:'taxAppliedAfterDiscount')
|
173
|
+
self.tax_applied_after_discount = attributes[:'taxAppliedAfterDiscount']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.has_key?(:'taxStatusIndicator')
|
177
|
+
self.tax_status_indicator = attributes[:'taxStatusIndicator']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.has_key?(:'taxTypeCode')
|
181
|
+
self.tax_type_code = attributes[:'taxTypeCode']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.has_key?(:'amountIncludesTax')
|
185
|
+
self.amount_includes_tax = attributes[:'amountIncludesTax']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.has_key?(:'typeOfSupply')
|
189
|
+
self.type_of_supply = attributes[:'typeOfSupply']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.has_key?(:'commodityCode')
|
193
|
+
self.commodity_code = attributes[:'commodityCode']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.has_key?(:'discountAmount')
|
197
|
+
self.discount_amount = attributes[:'discountAmount']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.has_key?(:'discountApplied')
|
201
|
+
self.discount_applied = attributes[:'discountApplied']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.has_key?(:'discountRate')
|
205
|
+
self.discount_rate = attributes[:'discountRate']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.has_key?(:'invoiceNumber')
|
209
|
+
self.invoice_number = attributes[:'invoiceNumber']
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.has_key?(:'taxDetails')
|
213
|
+
if (value = attributes[:'taxDetails']).is_a?(Array)
|
214
|
+
self.tax_details = value
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
220
|
+
# @return Array for valid properties with the reasons
|
221
|
+
def list_invalid_properties
|
222
|
+
invalid_properties = Array.new
|
223
|
+
if !@product_code.nil? && @product_code.to_s.length > 255
|
224
|
+
invalid_properties.push('invalid value for "product_code", the character length must be smaller than or equal to 255.')
|
225
|
+
end
|
226
|
+
|
227
|
+
if !@product_name.nil? && @product_name.to_s.length > 255
|
228
|
+
invalid_properties.push('invalid value for "product_name", the character length must be smaller than or equal to 255.')
|
229
|
+
end
|
230
|
+
|
231
|
+
if !@product_sku.nil? && @product_sku.to_s.length > 255
|
232
|
+
invalid_properties.push('invalid value for "product_sku", the character length must be smaller than or equal to 255.')
|
233
|
+
end
|
234
|
+
|
235
|
+
if !@quantity.nil? && @quantity > 9999999999
|
236
|
+
invalid_properties.push('invalid value for "quantity", must be smaller than or equal to 9999999999.')
|
237
|
+
end
|
238
|
+
|
239
|
+
if !@quantity.nil? && @quantity < 1
|
240
|
+
invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
|
241
|
+
end
|
242
|
+
|
243
|
+
if !@unit_price.nil? && @unit_price.to_s.length > 15
|
244
|
+
invalid_properties.push('invalid value for "unit_price", the character length must be smaller than or equal to 15.')
|
245
|
+
end
|
246
|
+
|
247
|
+
if !@unit_of_measure.nil? && @unit_of_measure.to_s.length > 12
|
248
|
+
invalid_properties.push('invalid value for "unit_of_measure", the character length must be smaller than or equal to 12.')
|
249
|
+
end
|
250
|
+
|
251
|
+
if !@total_amount.nil? && @total_amount.to_s.length > 13
|
252
|
+
invalid_properties.push('invalid value for "total_amount", the character length must be smaller than or equal to 13.')
|
253
|
+
end
|
254
|
+
|
255
|
+
if !@tax_amount.nil? && @tax_amount.to_s.length > 15
|
256
|
+
invalid_properties.push('invalid value for "tax_amount", the character length must be smaller than or equal to 15.')
|
257
|
+
end
|
258
|
+
|
259
|
+
if !@tax_rate.nil? && @tax_rate.to_s.length > 7
|
260
|
+
invalid_properties.push('invalid value for "tax_rate", the character length must be smaller than or equal to 7.')
|
261
|
+
end
|
262
|
+
|
263
|
+
if !@tax_applied_after_discount.nil? && @tax_applied_after_discount.to_s.length > 1
|
264
|
+
invalid_properties.push('invalid value for "tax_applied_after_discount", the character length must be smaller than or equal to 1.')
|
265
|
+
end
|
266
|
+
|
267
|
+
if !@tax_status_indicator.nil? && @tax_status_indicator.to_s.length > 1
|
268
|
+
invalid_properties.push('invalid value for "tax_status_indicator", the character length must be smaller than or equal to 1.')
|
269
|
+
end
|
270
|
+
|
271
|
+
if !@tax_type_code.nil? && @tax_type_code.to_s.length > 4
|
272
|
+
invalid_properties.push('invalid value for "tax_type_code", the character length must be smaller than or equal to 4.')
|
273
|
+
end
|
274
|
+
|
275
|
+
if !@type_of_supply.nil? && @type_of_supply.to_s.length > 2
|
276
|
+
invalid_properties.push('invalid value for "type_of_supply", the character length must be smaller than or equal to 2.')
|
277
|
+
end
|
278
|
+
|
279
|
+
if !@commodity_code.nil? && @commodity_code.to_s.length > 15
|
280
|
+
invalid_properties.push('invalid value for "commodity_code", the character length must be smaller than or equal to 15.')
|
281
|
+
end
|
282
|
+
|
283
|
+
if !@discount_amount.nil? && @discount_amount.to_s.length > 13
|
284
|
+
invalid_properties.push('invalid value for "discount_amount", the character length must be smaller than or equal to 13.')
|
285
|
+
end
|
286
|
+
|
287
|
+
if !@discount_rate.nil? && @discount_rate.to_s.length > 6
|
288
|
+
invalid_properties.push('invalid value for "discount_rate", the character length must be smaller than or equal to 6.')
|
289
|
+
end
|
290
|
+
|
291
|
+
if !@invoice_number.nil? && @invoice_number.to_s.length > 23
|
292
|
+
invalid_properties.push('invalid value for "invoice_number", the character length must be smaller than or equal to 23.')
|
293
|
+
end
|
294
|
+
|
295
|
+
invalid_properties
|
296
|
+
end
|
297
|
+
|
298
|
+
# Check to see if the all the properties in the model are valid
|
299
|
+
# @return true if the model is valid
|
300
|
+
def valid?
|
301
|
+
return false if !@product_code.nil? && @product_code.to_s.length > 255
|
302
|
+
return false if !@product_name.nil? && @product_name.to_s.length > 255
|
303
|
+
return false if !@product_sku.nil? && @product_sku.to_s.length > 255
|
304
|
+
return false if !@quantity.nil? && @quantity > 9999999999
|
305
|
+
return false if !@quantity.nil? && @quantity < 1
|
306
|
+
return false if !@unit_price.nil? && @unit_price.to_s.length > 15
|
307
|
+
return false if !@unit_of_measure.nil? && @unit_of_measure.to_s.length > 12
|
308
|
+
return false if !@total_amount.nil? && @total_amount.to_s.length > 13
|
309
|
+
return false if !@tax_amount.nil? && @tax_amount.to_s.length > 15
|
310
|
+
return false if !@tax_rate.nil? && @tax_rate.to_s.length > 7
|
311
|
+
return false if !@tax_applied_after_discount.nil? && @tax_applied_after_discount.to_s.length > 1
|
312
|
+
return false if !@tax_status_indicator.nil? && @tax_status_indicator.to_s.length > 1
|
313
|
+
return false if !@tax_type_code.nil? && @tax_type_code.to_s.length > 4
|
314
|
+
return false if !@type_of_supply.nil? && @type_of_supply.to_s.length > 2
|
315
|
+
return false if !@commodity_code.nil? && @commodity_code.to_s.length > 15
|
316
|
+
return false if !@discount_amount.nil? && @discount_amount.to_s.length > 13
|
317
|
+
return false if !@discount_rate.nil? && @discount_rate.to_s.length > 6
|
318
|
+
return false if !@invoice_number.nil? && @invoice_number.to_s.length > 23
|
319
|
+
true
|
320
|
+
end
|
321
|
+
|
322
|
+
# Custom attribute writer method with validation
|
323
|
+
# @param [Object] product_code Value to be assigned
|
324
|
+
def product_code=(product_code)
|
325
|
+
if !product_code.nil? && product_code.to_s.length > 255
|
326
|
+
fail ArgumentError, 'invalid value for "product_code", the character length must be smaller than or equal to 255.'
|
327
|
+
end
|
328
|
+
|
329
|
+
@product_code = product_code
|
330
|
+
end
|
331
|
+
|
332
|
+
# Custom attribute writer method with validation
|
333
|
+
# @param [Object] product_name Value to be assigned
|
334
|
+
def product_name=(product_name)
|
335
|
+
if !product_name.nil? && product_name.to_s.length > 255
|
336
|
+
fail ArgumentError, 'invalid value for "product_name", the character length must be smaller than or equal to 255.'
|
337
|
+
end
|
338
|
+
|
339
|
+
@product_name = product_name
|
340
|
+
end
|
341
|
+
|
342
|
+
# Custom attribute writer method with validation
|
343
|
+
# @param [Object] product_sku Value to be assigned
|
344
|
+
def product_sku=(product_sku)
|
345
|
+
if !product_sku.nil? && product_sku.to_s.length > 255
|
346
|
+
fail ArgumentError, 'invalid value for "product_sku", the character length must be smaller than or equal to 255.'
|
347
|
+
end
|
348
|
+
|
349
|
+
@product_sku = product_sku
|
350
|
+
end
|
351
|
+
|
352
|
+
# Custom attribute writer method with validation
|
353
|
+
# @param [Object] quantity Value to be assigned
|
354
|
+
def quantity=(quantity)
|
355
|
+
if !quantity.nil? && quantity > 9999999999
|
356
|
+
fail ArgumentError, 'invalid value for "quantity", must be smaller than or equal to 9999999999.'
|
357
|
+
end
|
358
|
+
|
359
|
+
if !quantity.nil? && quantity < 1
|
360
|
+
fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 1.'
|
361
|
+
end
|
362
|
+
|
363
|
+
@quantity = quantity
|
364
|
+
end
|
365
|
+
|
366
|
+
# Custom attribute writer method with validation
|
367
|
+
# @param [Object] unit_price Value to be assigned
|
368
|
+
def unit_price=(unit_price)
|
369
|
+
if !unit_price.nil? && unit_price.to_s.length > 15
|
370
|
+
fail ArgumentError, 'invalid value for "unit_price", the character length must be smaller than or equal to 15.'
|
371
|
+
end
|
372
|
+
|
373
|
+
@unit_price = unit_price
|
374
|
+
end
|
375
|
+
|
376
|
+
# Custom attribute writer method with validation
|
377
|
+
# @param [Object] unit_of_measure Value to be assigned
|
378
|
+
def unit_of_measure=(unit_of_measure)
|
379
|
+
if !unit_of_measure.nil? && unit_of_measure.to_s.length > 12
|
380
|
+
fail ArgumentError, 'invalid value for "unit_of_measure", the character length must be smaller than or equal to 12.'
|
381
|
+
end
|
382
|
+
|
383
|
+
@unit_of_measure = unit_of_measure
|
384
|
+
end
|
385
|
+
|
386
|
+
# Custom attribute writer method with validation
|
387
|
+
# @param [Object] total_amount Value to be assigned
|
388
|
+
def total_amount=(total_amount)
|
389
|
+
if !total_amount.nil? && total_amount.to_s.length > 13
|
390
|
+
fail ArgumentError, 'invalid value for "total_amount", the character length must be smaller than or equal to 13.'
|
391
|
+
end
|
392
|
+
|
393
|
+
@total_amount = total_amount
|
394
|
+
end
|
395
|
+
|
396
|
+
# Custom attribute writer method with validation
|
397
|
+
# @param [Object] tax_amount Value to be assigned
|
398
|
+
def tax_amount=(tax_amount)
|
399
|
+
if !tax_amount.nil? && tax_amount.to_s.length > 15
|
400
|
+
fail ArgumentError, 'invalid value for "tax_amount", the character length must be smaller than or equal to 15.'
|
401
|
+
end
|
402
|
+
|
403
|
+
@tax_amount = tax_amount
|
404
|
+
end
|
405
|
+
|
406
|
+
# Custom attribute writer method with validation
|
407
|
+
# @param [Object] tax_rate Value to be assigned
|
408
|
+
def tax_rate=(tax_rate)
|
409
|
+
if !tax_rate.nil? && tax_rate.to_s.length > 7
|
410
|
+
fail ArgumentError, 'invalid value for "tax_rate", the character length must be smaller than or equal to 7.'
|
411
|
+
end
|
412
|
+
|
413
|
+
@tax_rate = tax_rate
|
414
|
+
end
|
415
|
+
|
416
|
+
# Custom attribute writer method with validation
|
417
|
+
# @param [Object] tax_applied_after_discount Value to be assigned
|
418
|
+
def tax_applied_after_discount=(tax_applied_after_discount)
|
419
|
+
if !tax_applied_after_discount.nil? && tax_applied_after_discount.to_s.length > 1
|
420
|
+
fail ArgumentError, 'invalid value for "tax_applied_after_discount", the character length must be smaller than or equal to 1.'
|
421
|
+
end
|
422
|
+
|
423
|
+
@tax_applied_after_discount = tax_applied_after_discount
|
424
|
+
end
|
425
|
+
|
426
|
+
# Custom attribute writer method with validation
|
427
|
+
# @param [Object] tax_status_indicator Value to be assigned
|
428
|
+
def tax_status_indicator=(tax_status_indicator)
|
429
|
+
if !tax_status_indicator.nil? && tax_status_indicator.to_s.length > 1
|
430
|
+
fail ArgumentError, 'invalid value for "tax_status_indicator", the character length must be smaller than or equal to 1.'
|
431
|
+
end
|
432
|
+
|
433
|
+
@tax_status_indicator = tax_status_indicator
|
434
|
+
end
|
435
|
+
|
436
|
+
# Custom attribute writer method with validation
|
437
|
+
# @param [Object] tax_type_code Value to be assigned
|
438
|
+
def tax_type_code=(tax_type_code)
|
439
|
+
if !tax_type_code.nil? && tax_type_code.to_s.length > 4
|
440
|
+
fail ArgumentError, 'invalid value for "tax_type_code", the character length must be smaller than or equal to 4.'
|
441
|
+
end
|
442
|
+
|
443
|
+
@tax_type_code = tax_type_code
|
444
|
+
end
|
445
|
+
|
446
|
+
# Custom attribute writer method with validation
|
447
|
+
# @param [Object] type_of_supply Value to be assigned
|
448
|
+
def type_of_supply=(type_of_supply)
|
449
|
+
if !type_of_supply.nil? && type_of_supply.to_s.length > 2
|
450
|
+
fail ArgumentError, 'invalid value for "type_of_supply", the character length must be smaller than or equal to 2.'
|
451
|
+
end
|
452
|
+
|
453
|
+
@type_of_supply = type_of_supply
|
454
|
+
end
|
455
|
+
|
456
|
+
# Custom attribute writer method with validation
|
457
|
+
# @param [Object] commodity_code Value to be assigned
|
458
|
+
def commodity_code=(commodity_code)
|
459
|
+
if !commodity_code.nil? && commodity_code.to_s.length > 15
|
460
|
+
fail ArgumentError, 'invalid value for "commodity_code", the character length must be smaller than or equal to 15.'
|
461
|
+
end
|
462
|
+
|
463
|
+
@commodity_code = commodity_code
|
464
|
+
end
|
465
|
+
|
466
|
+
# Custom attribute writer method with validation
|
467
|
+
# @param [Object] discount_amount Value to be assigned
|
468
|
+
def discount_amount=(discount_amount)
|
469
|
+
if !discount_amount.nil? && discount_amount.to_s.length > 13
|
470
|
+
fail ArgumentError, 'invalid value for "discount_amount", the character length must be smaller than or equal to 13.'
|
471
|
+
end
|
472
|
+
|
473
|
+
@discount_amount = discount_amount
|
474
|
+
end
|
475
|
+
|
476
|
+
# Custom attribute writer method with validation
|
477
|
+
# @param [Object] discount_rate Value to be assigned
|
478
|
+
def discount_rate=(discount_rate)
|
479
|
+
if !discount_rate.nil? && discount_rate.to_s.length > 6
|
480
|
+
fail ArgumentError, 'invalid value for "discount_rate", the character length must be smaller than or equal to 6.'
|
481
|
+
end
|
482
|
+
|
483
|
+
@discount_rate = discount_rate
|
484
|
+
end
|
485
|
+
|
486
|
+
# Custom attribute writer method with validation
|
487
|
+
# @param [Object] invoice_number Value to be assigned
|
488
|
+
def invoice_number=(invoice_number)
|
489
|
+
if !invoice_number.nil? && invoice_number.to_s.length > 23
|
490
|
+
fail ArgumentError, 'invalid value for "invoice_number", the character length must be smaller than or equal to 23.'
|
491
|
+
end
|
492
|
+
|
493
|
+
@invoice_number = invoice_number
|
494
|
+
end
|
495
|
+
|
496
|
+
# Checks equality by comparing each attribute.
|
497
|
+
# @param [Object] Object to be compared
|
498
|
+
def ==(o)
|
499
|
+
return true if self.equal?(o)
|
500
|
+
self.class == o.class &&
|
501
|
+
product_code == o.product_code &&
|
502
|
+
product_name == o.product_name &&
|
503
|
+
product_sku == o.product_sku &&
|
504
|
+
quantity == o.quantity &&
|
505
|
+
unit_price == o.unit_price &&
|
506
|
+
unit_of_measure == o.unit_of_measure &&
|
507
|
+
total_amount == o.total_amount &&
|
508
|
+
tax_amount == o.tax_amount &&
|
509
|
+
tax_rate == o.tax_rate &&
|
510
|
+
tax_applied_after_discount == o.tax_applied_after_discount &&
|
511
|
+
tax_status_indicator == o.tax_status_indicator &&
|
512
|
+
tax_type_code == o.tax_type_code &&
|
513
|
+
amount_includes_tax == o.amount_includes_tax &&
|
514
|
+
type_of_supply == o.type_of_supply &&
|
515
|
+
commodity_code == o.commodity_code &&
|
516
|
+
discount_amount == o.discount_amount &&
|
517
|
+
discount_applied == o.discount_applied &&
|
518
|
+
discount_rate == o.discount_rate &&
|
519
|
+
invoice_number == o.invoice_number &&
|
520
|
+
tax_details == o.tax_details
|
521
|
+
end
|
522
|
+
|
523
|
+
# @see the `==` method
|
524
|
+
# @param [Object] Object to be compared
|
525
|
+
def eql?(o)
|
526
|
+
self == o
|
527
|
+
end
|
528
|
+
|
529
|
+
# Calculates hash code according to all attributes.
|
530
|
+
# @return [Fixnum] Hash code
|
531
|
+
def hash
|
532
|
+
[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].hash
|
533
|
+
end
|
534
|
+
|
535
|
+
# Builds the object from hash
|
536
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
537
|
+
# @return [Object] Returns the model itself
|
538
|
+
def build_from_hash(attributes)
|
539
|
+
return nil unless attributes.is_a?(Hash)
|
540
|
+
self.class.swagger_types.each_pair do |key, type|
|
541
|
+
if type =~ /\AArray<(.*)>/i
|
542
|
+
# check to ensure the input is an array given that the the attribute
|
543
|
+
# is documented as an array but the input is not
|
544
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
545
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
546
|
+
end
|
547
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
548
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
549
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
550
|
+
end
|
551
|
+
|
552
|
+
self
|
553
|
+
end
|
554
|
+
|
555
|
+
# Deserializes the data based on type
|
556
|
+
# @param string type Data type
|
557
|
+
# @param string value Value to be deserialized
|
558
|
+
# @return [Object] Deserialized data
|
559
|
+
def _deserialize(type, value)
|
560
|
+
case type.to_sym
|
561
|
+
when :DateTime
|
562
|
+
DateTime.parse(value)
|
563
|
+
when :Date
|
564
|
+
Date.parse(value)
|
565
|
+
when :String
|
566
|
+
value.to_s
|
567
|
+
when :Integer
|
568
|
+
value.to_i
|
569
|
+
when :Float
|
570
|
+
value.to_f
|
571
|
+
when :BOOLEAN
|
572
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
573
|
+
true
|
574
|
+
else
|
575
|
+
false
|
576
|
+
end
|
577
|
+
when :Object
|
578
|
+
# generic object (usually a Hash), return directly
|
579
|
+
value
|
580
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
581
|
+
inner_type = Regexp.last_match[:inner_type]
|
582
|
+
value.map { |v| _deserialize(inner_type, v) }
|
583
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
584
|
+
k_type = Regexp.last_match[:k_type]
|
585
|
+
v_type = Regexp.last_match[:v_type]
|
586
|
+
{}.tap do |hash|
|
587
|
+
value.each do |k, v|
|
588
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
589
|
+
end
|
590
|
+
end
|
591
|
+
else # model
|
592
|
+
temp_model = CyberSource.const_get(type).new
|
593
|
+
temp_model.build_from_hash(value)
|
594
|
+
end
|
595
|
+
end
|
596
|
+
|
597
|
+
# Returns the string representation of the object
|
598
|
+
# @return [String] String presentation of the object
|
599
|
+
def to_s
|
600
|
+
to_hash.to_s
|
601
|
+
end
|
602
|
+
|
603
|
+
# to_body is an alias to to_hash (backward compatibility)
|
604
|
+
# @return [Hash] Returns the object in the form of hash
|
605
|
+
def to_body
|
606
|
+
to_hash
|
607
|
+
end
|
608
|
+
|
609
|
+
# Returns the object in the form of hash
|
610
|
+
# @return [Hash] Returns the object in the form of hash
|
611
|
+
def to_hash
|
612
|
+
hash = {}
|
613
|
+
self.class.attribute_map.each_pair do |attr, param|
|
614
|
+
value = self.send(attr)
|
615
|
+
next if value.nil?
|
616
|
+
hash[param] = _to_hash(value)
|
617
|
+
end
|
618
|
+
hash
|
619
|
+
end
|
620
|
+
|
621
|
+
# Outputs non-array value in the form of hash
|
622
|
+
# For object, use to_hash. Otherwise, just return the value
|
623
|
+
# @param [Object] value Any valid value
|
624
|
+
# @return [Hash] Returns the value in the form of hash
|
625
|
+
def _to_hash(value)
|
626
|
+
if value.is_a?(Array)
|
627
|
+
value.compact.map { |v| _to_hash(v) }
|
628
|
+
elsif value.is_a?(Hash)
|
629
|
+
{}.tap do |hash|
|
630
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
631
|
+
end
|
632
|
+
elsif value.respond_to? :to_hash
|
633
|
+
value.to_hash
|
634
|
+
else
|
635
|
+
value
|
636
|
+
end
|
637
|
+
end
|
638
|
+
end
|
639
|
+
end
|