cybersource_rest_client 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/AuthenticationSDK/Cybersource.gemspec +23 -0
- data/AuthenticationSDK/authentication/http/GetSignatureParameter.rb +62 -0
- data/AuthenticationSDK/authentication/http/HttpSignatureHeader.rb +50 -0
- data/AuthenticationSDK/authentication/jwt/JwtToken.rb +62 -0
- data/AuthenticationSDK/authentication/payloadDigest/digest.rb +10 -0
- data/AuthenticationSDK/core/Authorization.rb +24 -0
- data/AuthenticationSDK/core/ITokenGeneration.rb +4 -0
- data/AuthenticationSDK/core/Logger.rb +26 -0
- data/AuthenticationSDK/core/MerchantConfig.rb +181 -0
- data/AuthenticationSDK/util/ApiException.rb +19 -0
- data/AuthenticationSDK/util/Cache.rb +36 -0
- data/AuthenticationSDK/util/Constants.rb +134 -0
- data/AuthenticationSDK/util/PropertiesUtil.rb +21 -0
- data/AuthenticationSDK/util/Utility.rb +31 -0
- data/lib/cyberSource_client.rb +286 -0
- data/lib/cyberSource_client/api/capture_api.rb +133 -0
- data/lib/cyberSource_client/api/credit_api.rb +127 -0
- data/lib/cyberSource_client/api/default_api.rb +75 -0
- data/lib/cyberSource_client/api/instrument_identifier_api.rb +393 -0
- data/lib/cyberSource_client/api/key_generation_api.rb +75 -0
- data/lib/cyberSource_client/api/payment_api.rb +127 -0
- data/lib/cyberSource_client/api/payment_instrument_api.rb +312 -0
- data/lib/cyberSource_client/api/refund_api.rb +191 -0
- data/lib/cyberSource_client/api/reversal_api.rb +133 -0
- data/lib/cyberSource_client/api/tokenization_api.rb +71 -0
- data/lib/cyberSource_client/api/void_api.rb +307 -0
- data/lib/cyberSource_client/api_client.rb +437 -0
- data/lib/cyberSource_client/api_error.rb +38 -0
- data/lib/cyberSource_client/configuration.rb +202 -0
- data/lib/cyberSource_client/models/auth_reversal_request.rb +219 -0
- data/lib/cyberSource_client/models/body.rb +295 -0
- data/lib/cyberSource_client/models/body_1.rb +183 -0
- data/lib/cyberSource_client/models/body_2.rb +331 -0
- data/lib/cyberSource_client/models/body_3.rb +331 -0
- data/lib/cyberSource_client/models/capture_payment_request.rb +267 -0
- data/lib/cyberSource_client/models/card_info.rb +214 -0
- data/lib/cyberSource_client/models/create_credit_request.rb +267 -0
- data/lib/cyberSource_client/models/create_payment_request.rb +285 -0
- data/lib/cyberSource_client/models/der_public_key.rb +205 -0
- data/lib/cyberSource_client/models/error.rb +192 -0
- data/lib/cyberSource_client/models/error_links.rb +205 -0
- data/lib/cyberSource_client/models/error_response.rb +192 -0
- data/lib/cyberSource_client/models/generate_public_key_request.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200.rb +202 -0
- data/lib/cyberSource_client/models/inline_response_200_1.rb +255 -0
- data/lib/cyberSource_client/models/inline_response_200_2.rb +377 -0
- data/lib/cyberSource_client/models/inline_response_200_2_buyer_information.rb +270 -0
- data/lib/cyberSource_client/models/inline_response_200_2_device_information.rb +219 -0
- data/lib/cyberSource_client/models/inline_response_200_2_merchant_information.rb +233 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information.rb +230 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_amount_details.rb +385 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_bill_to.rb +459 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_invoice_details.rb +315 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_line_items.rb +564 -0
- data/lib/cyberSource_client/models/inline_response_200_2_order_information_ship_to.rb +429 -0
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information_card.rb +274 -0
- data/lib/cyberSource_client/models/inline_response_200_2_payment_information_tokenized_card.rb +299 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processing_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information.rb +227 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information_avs.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_2_processor_information_card_verification.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_3.rb +314 -0
- data/lib/cyberSource_client/models/inline_response_200_4.rb +350 -0
- data/lib/cyberSource_client/models/inline_response_200_4_device_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information.rb +230 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_amount_details.rb +360 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_invoice_details.rb +305 -0
- data/lib/cyberSource_client/models/inline_response_200_4_order_information_ship_to.rb +249 -0
- data/lib/cyberSource_client/models/inline_response_200_4_processing_information.rb +208 -0
- data/lib/cyberSource_client/models/inline_response_200_4_processing_information_authorization_options.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_200_5.rb +305 -0
- data/lib/cyberSource_client/models/inline_response_200_6.rb +305 -0
- data/lib/cyberSource_client/models/inline_response_200_7.rb +295 -0
- data/lib/cyberSource_client/models/inline_response_200_8.rb +277 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links.rb +219 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_first.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_last.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_next.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_prev.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_8__links_self.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_200_der.rb +205 -0
- data/lib/cyberSource_client/models/inline_response_200_jwk.rb +225 -0
- data/lib/cyberSource_client/models/inline_response_201.rb +350 -0
- data/lib/cyberSource_client/models/inline_response_201_1.rb +332 -0
- data/lib/cyberSource_client/models/inline_response_201_1_authorization_information.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_1_processor_information.rb +324 -0
- data/lib/cyberSource_client/models/inline_response_201_1_reversal_amount_details.rb +249 -0
- data/lib/cyberSource_client/models/inline_response_201_2.rb +314 -0
- data/lib/cyberSource_client/models/inline_response_201_2__links.rb +201 -0
- data/lib/cyberSource_client/models/inline_response_201_2_order_information.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_201_2_order_information_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_2_processor_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_3.rb +323 -0
- data/lib/cyberSource_client/models/inline_response_201_3__links.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_201_3_order_information.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_201_3_processor_information.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_3_refund_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_4.rb +323 -0
- data/lib/cyberSource_client/models/inline_response_201_4_credit_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_5.rb +280 -0
- data/lib/cyberSource_client/models/inline_response_201_5_void_amount_details.rb +219 -0
- data/lib/cyberSource_client/models/inline_response_201_6.rb +331 -0
- data/lib/cyberSource_client/models/inline_response_201__embedded.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_201__embedded_capture.rb +193 -0
- data/lib/cyberSource_client/models/inline_response_201__embedded_capture__links.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_201__links.rb +201 -0
- data/lib/cyberSource_client/models/inline_response_201__links_self.rb +194 -0
- data/lib/cyberSource_client/models/inline_response_201_client_reference_information.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_error_information.rb +239 -0
- data/lib/cyberSource_client/models/inline_response_201_error_information_details.rb +228 -0
- data/lib/cyberSource_client/models/inline_response_201_order_information.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_201_order_information_amount_details.rb +249 -0
- data/lib/cyberSource_client/models/inline_response_201_order_information_invoice_details.rb +184 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information.rb +201 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information_account_features.rb +623 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information_card.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_payment_information_tokenized_card.rb +349 -0
- data/lib/cyberSource_client/models/inline_response_201_point_of_sale_information.rb +208 -0
- data/lib/cyberSource_client/models/inline_response_201_point_of_sale_information_emv.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information.rb +642 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_avs.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_card_verification.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_consumer_authentication_response.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_customer.rb +199 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_electronic_verification_results.rb +474 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_issuer.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_201_processor_information_merchant_advice.rb +224 -0
- data/lib/cyberSource_client/models/inline_response_400.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_1.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_2.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_3.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_4.rb +271 -0
- data/lib/cyberSource_client/models/inline_response_400_5.rb +259 -0
- data/lib/cyberSource_client/models/inline_response_400_6.rb +202 -0
- data/lib/cyberSource_client/models/inline_response_409.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_409__links.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_409__links_payment_instruments.rb +183 -0
- data/lib/cyberSource_client/models/inline_response_502.rb +260 -0
- data/lib/cyberSource_client/models/inline_response_default.rb +192 -0
- data/lib/cyberSource_client/models/inline_response_default__links.rb +205 -0
- data/lib/cyberSource_client/models/inline_response_default__links_next.rb +204 -0
- data/lib/cyberSource_client/models/inline_response_default_response_status.rb +225 -0
- data/lib/cyberSource_client/models/inline_response_default_response_status_details.rb +194 -0
- data/lib/cyberSource_client/models/instrumentidentifiers__links.rb +201 -0
- data/lib/cyberSource_client/models/instrumentidentifiers__links_self.rb +183 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_authorization_options_merchant_initiated_transaction.rb +184 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_bank_account.rb +194 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_card.rb +184 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_details.rb +194 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_metadata.rb +184 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information.rb +183 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information_authorization_options.rb +183 -0
- data/lib/cyberSource_client/models/instrumentidentifiers_processing_information_authorization_options_initiator.rb +183 -0
- data/lib/cyberSource_client/models/json_web_key.rb +225 -0
- data/lib/cyberSource_client/models/key_parameters.rb +184 -0
- data/lib/cyberSource_client/models/key_result.rb +202 -0
- data/lib/cyberSource_client/models/link.rb +204 -0
- data/lib/cyberSource_client/models/links.rb +205 -0
- data/lib/cyberSource_client/models/oct_create_payment_request.rb +237 -0
- data/lib/cyberSource_client/models/paymentinstruments_bank_account.rb +184 -0
- data/lib/cyberSource_client/models/paymentinstruments_bill_to.rb +284 -0
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information.rb +215 -0
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information_issued_by.rb +184 -0
- data/lib/cyberSource_client/models/paymentinstruments_buyer_information_personal_identification.rb +203 -0
- data/lib/cyberSource_client/models/paymentinstruments_card.rb +278 -0
- data/lib/cyberSource_client/models/paymentinstruments_instrument_identifier.rb +295 -0
- data/lib/cyberSource_client/models/paymentinstruments_merchant_information.rb +183 -0
- data/lib/cyberSource_client/models/paymentinstruments_merchant_information_merchant_descriptor.rb +184 -0
- data/lib/cyberSource_client/models/paymentinstruments_processing_information.rb +193 -0
- data/lib/cyberSource_client/models/paymentinstruments_processing_information_bank_transfer_options.rb +184 -0
- data/lib/cyberSource_client/models/paymentsflexv1tokens_card_info.rb +214 -0
- data/lib/cyberSource_client/models/refund_capture_request.rb +267 -0
- data/lib/cyberSource_client/models/refund_payment_request.rb +267 -0
- data/lib/cyberSource_client/models/response_status.rb +225 -0
- data/lib/cyberSource_client/models/response_status_details.rb +194 -0
- data/lib/cyberSource_client/models/tokenize_parameters.rb +193 -0
- data/lib/cyberSource_client/models/tokenize_request.rb +193 -0
- data/lib/cyberSource_client/models/tokenize_result.rb +255 -0
- data/lib/cyberSource_client/models/v2credits_point_of_sale_information.rb +183 -0
- data/lib/cyberSource_client/models/v2credits_point_of_sale_information_emv.rb +221 -0
- data/lib/cyberSource_client/models/v2credits_processing_information.rb +383 -0
- data/lib/cyberSource_client/models/v2payments_aggregator_information.rb +233 -0
- data/lib/cyberSource_client/models/v2payments_aggregator_information_sub_merchant.rb +424 -0
- data/lib/cyberSource_client/models/v2payments_buyer_information.rb +285 -0
- data/lib/cyberSource_client/models/v2payments_buyer_information_personal_identification.rb +252 -0
- data/lib/cyberSource_client/models/v2payments_client_reference_information.rb +219 -0
- data/lib/cyberSource_client/models/v2payments_consumer_authentication_information.rb +374 -0
- data/lib/cyberSource_client/models/v2payments_device_information.rb +249 -0
- data/lib/cyberSource_client/models/v2payments_merchant_defined_information.rb +224 -0
- data/lib/cyberSource_client/models/v2payments_merchant_information.rb +308 -0
- data/lib/cyberSource_client/models/v2payments_merchant_information_merchant_descriptor.rb +374 -0
- data/lib/cyberSource_client/models/v2payments_order_information.rb +230 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details.rb +605 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_amex_additional_amounts.rb +224 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_surcharge.rb +209 -0
- data/lib/cyberSource_client/models/v2payments_order_information_amount_details_tax_details.rb +328 -0
- data/lib/cyberSource_client/models/v2payments_order_information_bill_to.rb +618 -0
- data/lib/cyberSource_client/models/v2payments_order_information_invoice_details.rb +330 -0
- data/lib/cyberSource_client/models/v2payments_order_information_invoice_details_transaction_advice_addendum.rb +199 -0
- data/lib/cyberSource_client/models/v2payments_order_information_line_items.rb +649 -0
- data/lib/cyberSource_client/models/v2payments_order_information_ship_to.rb +474 -0
- data/lib/cyberSource_client/models/v2payments_order_information_shipping_details.rb +234 -0
- data/lib/cyberSource_client/models/v2payments_payment_information.rb +210 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_card.rb +474 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_customer.rb +202 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_fluid_data.rb +259 -0
- data/lib/cyberSource_client/models/v2payments_payment_information_tokenized_card.rb +424 -0
- data/lib/cyberSource_client/models/v2payments_point_of_sale_information.rb +440 -0
- data/lib/cyberSource_client/models/v2payments_point_of_sale_information_emv.rb +256 -0
- data/lib/cyberSource_client/models/v2payments_processing_information.rb +432 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options.rb +361 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options_initiator.rb +247 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_authorization_options_merchant_initiated_transaction.rb +224 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_capture_options.rb +267 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_issuer.rb +199 -0
- data/lib/cyberSource_client/models/v2payments_processing_information_recurring_options.rb +198 -0
- data/lib/cyberSource_client/models/v2payments_recipient_information.rb +249 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_aggregator_information.rb +233 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_aggregator_information_sub_merchant.rb +374 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_buyer_information.rb +224 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_merchant_information.rb +258 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information.rb +230 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_amount_details.rb +546 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_bill_to.rb +449 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_invoice_details.rb +320 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_ship_to.rb +249 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_order_information_shipping_details.rb +199 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_payment_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_point_of_sale_information.rb +208 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_point_of_sale_information_emv.rb +211 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information.rb +351 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information_authorization_options.rb +249 -0
- data/lib/cyberSource_client/models/v2paymentsidcaptures_processing_information_capture_options.rb +242 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_merchant_information.rb +258 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_order_information.rb +230 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_order_information_line_items.rb +639 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_payment_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_payment_information_card.rb +374 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_point_of_sale_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_processing_information.rb +333 -0
- data/lib/cyberSource_client/models/v2paymentsidrefunds_processing_information_recurring_options.rb +186 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_client_reference_information.rb +209 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_order_information.rb +185 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_order_information_line_items.rb +233 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_point_of_sale_information.rb +183 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_processing_information.rb +308 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_reversal_information.rb +211 -0
- data/lib/cyberSource_client/models/v2paymentsidreversals_reversal_information_amount_details.rb +224 -0
- data/lib/cyberSource_client/models/v2payouts_merchant_information.rb +258 -0
- data/lib/cyberSource_client/models/v2payouts_merchant_information_merchant_descriptor.rb +324 -0
- data/lib/cyberSource_client/models/v2payouts_order_information.rb +192 -0
- data/lib/cyberSource_client/models/v2payouts_order_information_amount_details.rb +249 -0
- data/lib/cyberSource_client/models/v2payouts_order_information_bill_to.rb +443 -0
- data/lib/cyberSource_client/models/v2payouts_payment_information.rb +183 -0
- data/lib/cyberSource_client/models/v2payouts_payment_information_card.rb +299 -0
- data/lib/cyberSource_client/models/v2payouts_processing_information.rb +283 -0
- data/lib/cyberSource_client/models/v2payouts_processing_information_payouts_options.rb +274 -0
- data/lib/cyberSource_client/models/v2payouts_recipient_information.rb +433 -0
- data/lib/cyberSource_client/models/v2payouts_sender_information.rb +517 -0
- data/lib/cyberSource_client/models/v2payouts_sender_information_account.rb +233 -0
- data/lib/cyberSource_client/models/void_capture_request.rb +183 -0
- data/lib/cyberSource_client/models/void_credit_request.rb +183 -0
- data/lib/cyberSource_client/models/void_payment_request.rb +183 -0
- data/lib/cyberSource_client/models/void_refund_request.rb +183 -0
- data/lib/cyberSource_client/version.rb +15 -0
- metadata +572 -0
@@ -0,0 +1,202 @@
|
|
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 'uri'
|
14
|
+
|
15
|
+
module CyberSource
|
16
|
+
class Configuration
|
17
|
+
# Defines url scheme
|
18
|
+
attr_accessor :scheme
|
19
|
+
|
20
|
+
# Defines url host
|
21
|
+
attr_accessor :host
|
22
|
+
|
23
|
+
# Defines url base path
|
24
|
+
attr_accessor :base_path
|
25
|
+
|
26
|
+
# Defines API keys used with API Key authentications.
|
27
|
+
#
|
28
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
29
|
+
#
|
30
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
31
|
+
# config.api_key['api_key'] = 'xxx'
|
32
|
+
attr_accessor :api_key
|
33
|
+
|
34
|
+
# Defines API key prefixes used with API Key authentications.
|
35
|
+
#
|
36
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
37
|
+
#
|
38
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
39
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
40
|
+
attr_accessor :api_key_prefix
|
41
|
+
|
42
|
+
# Defines the username used with HTTP basic authentication.
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
attr_accessor :username
|
46
|
+
|
47
|
+
# Defines the password used with HTTP basic authentication.
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :password
|
51
|
+
|
52
|
+
# Defines the access token (Bearer) used with OAuth2.
|
53
|
+
attr_accessor :access_token
|
54
|
+
|
55
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
56
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
57
|
+
# Default to false.
|
58
|
+
#
|
59
|
+
# @return [true, false]
|
60
|
+
attr_accessor :debugging
|
61
|
+
|
62
|
+
# Defines the logger used for debugging.
|
63
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
64
|
+
#
|
65
|
+
# @return [#debug]
|
66
|
+
attr_accessor :logger
|
67
|
+
|
68
|
+
# Defines the temporary folder to store downloaded files
|
69
|
+
# (for API endpoints that have file response).
|
70
|
+
# Default to use `Tempfile`.
|
71
|
+
#
|
72
|
+
# @return [String]
|
73
|
+
attr_accessor :temp_folder_path
|
74
|
+
|
75
|
+
# The time limit for HTTP request in seconds.
|
76
|
+
# Default to 0 (never times out).
|
77
|
+
attr_accessor :timeout
|
78
|
+
|
79
|
+
# Set this to false to skip client side validation in the operation.
|
80
|
+
# Default to true.
|
81
|
+
# @return [true, false]
|
82
|
+
attr_accessor :client_side_validation
|
83
|
+
|
84
|
+
### TLS/SSL setting
|
85
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
86
|
+
# Default to true.
|
87
|
+
#
|
88
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
89
|
+
#
|
90
|
+
# @return [true, false]
|
91
|
+
attr_accessor :verify_ssl
|
92
|
+
|
93
|
+
### TLS/SSL setting
|
94
|
+
# Set this to false to skip verifying SSL host name
|
95
|
+
# Default to true.
|
96
|
+
#
|
97
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
98
|
+
#
|
99
|
+
# @return [true, false]
|
100
|
+
attr_accessor :verify_ssl_host
|
101
|
+
|
102
|
+
### TLS/SSL setting
|
103
|
+
# Set this to customize the certificate file to verify the peer.
|
104
|
+
#
|
105
|
+
# @return [String] the path to the certificate file
|
106
|
+
#
|
107
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
108
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
109
|
+
attr_accessor :ssl_ca_cert
|
110
|
+
|
111
|
+
### TLS/SSL setting
|
112
|
+
# Client certificate file (for client certificate)
|
113
|
+
attr_accessor :cert_file
|
114
|
+
|
115
|
+
### TLS/SSL setting
|
116
|
+
# Client private key file (for client certificate)
|
117
|
+
attr_accessor :key_file
|
118
|
+
|
119
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
120
|
+
# Default to nil.
|
121
|
+
#
|
122
|
+
# @see The params_encoding option of Ethon. Related source code:
|
123
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
124
|
+
attr_accessor :params_encoding
|
125
|
+
|
126
|
+
attr_accessor :inject_format
|
127
|
+
|
128
|
+
attr_accessor :force_ending_format
|
129
|
+
|
130
|
+
def initialize
|
131
|
+
@scheme = 'https'
|
132
|
+
@host = 'apitest.cybersource.com'
|
133
|
+
@base_path = '/'
|
134
|
+
@api_key = {}
|
135
|
+
@api_key_prefix = {}
|
136
|
+
@timeout = 0
|
137
|
+
@client_side_validation = true
|
138
|
+
@verify_ssl = false
|
139
|
+
@verify_ssl_host = false
|
140
|
+
@params_encoding = nil
|
141
|
+
@cert_file = nil
|
142
|
+
@key_file = nil
|
143
|
+
@debugging = false
|
144
|
+
@inject_format = false
|
145
|
+
@force_ending_format = false
|
146
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
147
|
+
|
148
|
+
yield(self) if block_given?
|
149
|
+
end
|
150
|
+
|
151
|
+
# The default Configuration object.
|
152
|
+
def self.default
|
153
|
+
@@default ||= Configuration.new
|
154
|
+
end
|
155
|
+
|
156
|
+
def configure
|
157
|
+
yield(self) if block_given?
|
158
|
+
end
|
159
|
+
|
160
|
+
def scheme=(scheme)
|
161
|
+
# remove :// from scheme
|
162
|
+
@scheme = scheme.sub(/:\/\//, '')
|
163
|
+
end
|
164
|
+
|
165
|
+
def host=(host)
|
166
|
+
# remove http(s):// and anything after a slash
|
167
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
168
|
+
end
|
169
|
+
|
170
|
+
def base_path=(base_path)
|
171
|
+
# Add leading and trailing slashes to base_path
|
172
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
173
|
+
@base_path = '' if @base_path == '/'
|
174
|
+
end
|
175
|
+
|
176
|
+
def base_url
|
177
|
+
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
178
|
+
URI.encode(url)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Gets API key (with prefix if set).
|
182
|
+
# @param [String] param_name the parameter name of API key auth
|
183
|
+
def api_key_with_prefix(param_name)
|
184
|
+
if @api_key_prefix[param_name]
|
185
|
+
"#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
|
186
|
+
else
|
187
|
+
@api_key[param_name]
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Gets Basic Auth token string
|
192
|
+
def basic_auth_token
|
193
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns Auth Settings hash for api client.
|
197
|
+
def auth_settings
|
198
|
+
{
|
199
|
+
}
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
@@ -0,0 +1,219 @@
|
|
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 AuthReversalRequest
|
17
|
+
attr_accessor :client_reference_information
|
18
|
+
|
19
|
+
attr_accessor :reversal_information
|
20
|
+
|
21
|
+
attr_accessor :processing_information
|
22
|
+
|
23
|
+
attr_accessor :order_information
|
24
|
+
|
25
|
+
attr_accessor :point_of_sale_information
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'client_reference_information' => :'clientReferenceInformation',
|
31
|
+
:'reversal_information' => :'reversalInformation',
|
32
|
+
:'processing_information' => :'processingInformation',
|
33
|
+
:'order_information' => :'orderInformation',
|
34
|
+
:'point_of_sale_information' => :'pointOfSaleInformation'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'client_reference_information' => :'V2paymentsidreversalsClientReferenceInformation',
|
42
|
+
:'reversal_information' => :'V2paymentsidreversalsReversalInformation',
|
43
|
+
:'processing_information' => :'V2paymentsidreversalsProcessingInformation',
|
44
|
+
:'order_information' => :'V2paymentsidreversalsOrderInformation',
|
45
|
+
:'point_of_sale_information' => :'V2paymentsidreversalsPointOfSaleInformation'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
56
|
+
|
57
|
+
if attributes.has_key?(:'clientReferenceInformation')
|
58
|
+
self.client_reference_information = attributes[:'clientReferenceInformation']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'reversalInformation')
|
62
|
+
self.reversal_information = attributes[:'reversalInformation']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'processingInformation')
|
66
|
+
self.processing_information = attributes[:'processingInformation']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'orderInformation')
|
70
|
+
self.order_information = attributes[:'orderInformation']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'pointOfSaleInformation')
|
74
|
+
self.point_of_sale_information = attributes[:'pointOfSaleInformation']
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properties with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
invalid_properties = Array.new
|
82
|
+
invalid_properties
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check to see if the all the properties in the model are valid
|
86
|
+
# @return true if the model is valid
|
87
|
+
def valid?
|
88
|
+
true
|
89
|
+
end
|
90
|
+
|
91
|
+
# Checks equality by comparing each attribute.
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def ==(o)
|
94
|
+
return true if self.equal?(o)
|
95
|
+
self.class == o.class &&
|
96
|
+
client_reference_information == o.client_reference_information &&
|
97
|
+
reversal_information == o.reversal_information &&
|
98
|
+
processing_information == o.processing_information &&
|
99
|
+
order_information == o.order_information &&
|
100
|
+
point_of_sale_information == o.point_of_sale_information
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Fixnum] Hash code
|
111
|
+
def hash
|
112
|
+
[client_reference_information, reversal_information, processing_information, order_information, point_of_sale_information].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
120
|
+
self.class.swagger_types.each_pair do |key, type|
|
121
|
+
if type =~ /\AArray<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
126
|
+
end
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
# Deserializes the data based on type
|
136
|
+
# @param string type Data type
|
137
|
+
# @param string value Value to be deserialized
|
138
|
+
# @return [Object] Deserialized data
|
139
|
+
def _deserialize(type, value)
|
140
|
+
case type.to_sym
|
141
|
+
when :DateTime
|
142
|
+
DateTime.parse(value)
|
143
|
+
when :Date
|
144
|
+
Date.parse(value)
|
145
|
+
when :String
|
146
|
+
value.to_s
|
147
|
+
when :Integer
|
148
|
+
value.to_i
|
149
|
+
when :Float
|
150
|
+
value.to_f
|
151
|
+
when :BOOLEAN
|
152
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
153
|
+
true
|
154
|
+
else
|
155
|
+
false
|
156
|
+
end
|
157
|
+
when :Object
|
158
|
+
# generic object (usually a Hash), return directly
|
159
|
+
value
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
163
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each do |k, v|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else # model
|
172
|
+
temp_model = CyberSource.const_get(type).new
|
173
|
+
temp_model.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
next if value.nil?
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
@@ -0,0 +1,295 @@
|
|
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 Body
|
17
|
+
attr_accessor :_links
|
18
|
+
|
19
|
+
# Unique identification number assigned by CyberSource to the submitted request.
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# Describes type of token. For example: customer, paymentInstrument or instrumentIdentifier.
|
23
|
+
attr_accessor :object
|
24
|
+
|
25
|
+
# Current state of the token.
|
26
|
+
attr_accessor :state
|
27
|
+
|
28
|
+
attr_accessor :card
|
29
|
+
|
30
|
+
attr_accessor :bank_account
|
31
|
+
|
32
|
+
attr_accessor :processing_information
|
33
|
+
|
34
|
+
attr_accessor :metadata
|
35
|
+
|
36
|
+
class EnumAttributeValidator
|
37
|
+
attr_reader :datatype
|
38
|
+
attr_reader :allowable_values
|
39
|
+
|
40
|
+
def initialize(datatype, allowable_values)
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
42
|
+
case datatype.to_s
|
43
|
+
when /Integer/i
|
44
|
+
value.to_i
|
45
|
+
when /Float/i
|
46
|
+
value.to_f
|
47
|
+
else
|
48
|
+
value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def valid?(value)
|
54
|
+
!value || allowable_values.include?(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'_links' => :'_links',
|
62
|
+
:'id' => :'id',
|
63
|
+
:'object' => :'object',
|
64
|
+
:'state' => :'state',
|
65
|
+
:'card' => :'card',
|
66
|
+
:'bank_account' => :'bankAccount',
|
67
|
+
:'processing_information' => :'processingInformation',
|
68
|
+
:'metadata' => :'metadata'
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.swagger_types
|
74
|
+
{
|
75
|
+
:'_links' => :'InstrumentidentifiersLinks',
|
76
|
+
:'id' => :'String',
|
77
|
+
:'object' => :'String',
|
78
|
+
:'state' => :'String',
|
79
|
+
:'card' => :'InstrumentidentifiersCard',
|
80
|
+
:'bank_account' => :'InstrumentidentifiersBankAccount',
|
81
|
+
:'processing_information' => :'InstrumentidentifiersProcessingInformation',
|
82
|
+
:'metadata' => :'InstrumentidentifiersMetadata'
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Initializes the object
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
def initialize(attributes = {})
|
89
|
+
return unless attributes.is_a?(Hash)
|
90
|
+
|
91
|
+
# convert string to symbol for hash key
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
93
|
+
|
94
|
+
if attributes.has_key?(:'_links')
|
95
|
+
self._links = attributes[:'_links']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'id')
|
99
|
+
self.id = attributes[:'id']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.has_key?(:'object')
|
103
|
+
self.object = attributes[:'object']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'state')
|
107
|
+
self.state = attributes[:'state']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'card')
|
111
|
+
self.card = attributes[:'card']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'bankAccount')
|
115
|
+
self.bank_account = attributes[:'bankAccount']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'processingInformation')
|
119
|
+
self.processing_information = attributes[:'processingInformation']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'metadata')
|
123
|
+
self.metadata = attributes[:'metadata']
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
128
|
+
# @return Array for valid properties with the reasons
|
129
|
+
def list_invalid_properties
|
130
|
+
invalid_properties = Array.new
|
131
|
+
invalid_properties
|
132
|
+
end
|
133
|
+
|
134
|
+
# Check to see if the all the properties in the model are valid
|
135
|
+
# @return true if the model is valid
|
136
|
+
def valid?
|
137
|
+
object_validator = EnumAttributeValidator.new('String', ['instrumentIdentifier'])
|
138
|
+
return false unless object_validator.valid?(@object)
|
139
|
+
state_validator = EnumAttributeValidator.new('String', ['ACTIVE', 'CLOSED'])
|
140
|
+
return false unless state_validator.valid?(@state)
|
141
|
+
true
|
142
|
+
end
|
143
|
+
|
144
|
+
# Custom attribute writer method checking allowed values (enum).
|
145
|
+
# @param [Object] object Object to be assigned
|
146
|
+
def object=(object)
|
147
|
+
validator = EnumAttributeValidator.new('String', ['instrumentIdentifier'])
|
148
|
+
unless validator.valid?(object)
|
149
|
+
fail ArgumentError, 'invalid value for "object", must be one of #{validator.allowable_values}.'
|
150
|
+
end
|
151
|
+
@object = object
|
152
|
+
end
|
153
|
+
|
154
|
+
# Custom attribute writer method checking allowed values (enum).
|
155
|
+
# @param [Object] state Object to be assigned
|
156
|
+
def state=(state)
|
157
|
+
validator = EnumAttributeValidator.new('String', ['ACTIVE', 'CLOSED'])
|
158
|
+
unless validator.valid?(state)
|
159
|
+
fail ArgumentError, 'invalid value for "state", must be one of #{validator.allowable_values}.'
|
160
|
+
end
|
161
|
+
@state = state
|
162
|
+
end
|
163
|
+
|
164
|
+
# Checks equality by comparing each attribute.
|
165
|
+
# @param [Object] Object to be compared
|
166
|
+
def ==(o)
|
167
|
+
return true if self.equal?(o)
|
168
|
+
self.class == o.class &&
|
169
|
+
_links == o._links &&
|
170
|
+
id == o.id &&
|
171
|
+
object == o.object &&
|
172
|
+
state == o.state &&
|
173
|
+
card == o.card &&
|
174
|
+
bank_account == o.bank_account &&
|
175
|
+
processing_information == o.processing_information &&
|
176
|
+
metadata == o.metadata
|
177
|
+
end
|
178
|
+
|
179
|
+
# @see the `==` method
|
180
|
+
# @param [Object] Object to be compared
|
181
|
+
def eql?(o)
|
182
|
+
self == o
|
183
|
+
end
|
184
|
+
|
185
|
+
# Calculates hash code according to all attributes.
|
186
|
+
# @return [Fixnum] Hash code
|
187
|
+
def hash
|
188
|
+
[_links, id, object, state, card, bank_account, processing_information, metadata].hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Builds the object from hash
|
192
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
193
|
+
# @return [Object] Returns the model itself
|
194
|
+
def build_from_hash(attributes)
|
195
|
+
return nil unless attributes.is_a?(Hash)
|
196
|
+
self.class.swagger_types.each_pair do |key, type|
|
197
|
+
if type =~ /\AArray<(.*)>/i
|
198
|
+
# check to ensure the input is an array given that the the attribute
|
199
|
+
# is documented as an array but the input is not
|
200
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
201
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
202
|
+
end
|
203
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
204
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
205
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
206
|
+
end
|
207
|
+
|
208
|
+
self
|
209
|
+
end
|
210
|
+
|
211
|
+
# Deserializes the data based on type
|
212
|
+
# @param string type Data type
|
213
|
+
# @param string value Value to be deserialized
|
214
|
+
# @return [Object] Deserialized data
|
215
|
+
def _deserialize(type, value)
|
216
|
+
case type.to_sym
|
217
|
+
when :DateTime
|
218
|
+
DateTime.parse(value)
|
219
|
+
when :Date
|
220
|
+
Date.parse(value)
|
221
|
+
when :String
|
222
|
+
value.to_s
|
223
|
+
when :Integer
|
224
|
+
value.to_i
|
225
|
+
when :Float
|
226
|
+
value.to_f
|
227
|
+
when :BOOLEAN
|
228
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
229
|
+
true
|
230
|
+
else
|
231
|
+
false
|
232
|
+
end
|
233
|
+
when :Object
|
234
|
+
# generic object (usually a Hash), return directly
|
235
|
+
value
|
236
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
237
|
+
inner_type = Regexp.last_match[:inner_type]
|
238
|
+
value.map { |v| _deserialize(inner_type, v) }
|
239
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
240
|
+
k_type = Regexp.last_match[:k_type]
|
241
|
+
v_type = Regexp.last_match[:v_type]
|
242
|
+
{}.tap do |hash|
|
243
|
+
value.each do |k, v|
|
244
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
245
|
+
end
|
246
|
+
end
|
247
|
+
else # model
|
248
|
+
temp_model = CyberSource.const_get(type).new
|
249
|
+
temp_model.build_from_hash(value)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
# Returns the string representation of the object
|
254
|
+
# @return [String] String presentation of the object
|
255
|
+
def to_s
|
256
|
+
to_hash.to_s
|
257
|
+
end
|
258
|
+
|
259
|
+
# to_body is an alias to to_hash (backward compatibility)
|
260
|
+
# @return [Hash] Returns the object in the form of hash
|
261
|
+
def to_body
|
262
|
+
to_hash
|
263
|
+
end
|
264
|
+
|
265
|
+
# Returns the object in the form of hash
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
267
|
+
def to_hash
|
268
|
+
hash = {}
|
269
|
+
self.class.attribute_map.each_pair do |attr, param|
|
270
|
+
value = self.send(attr)
|
271
|
+
next if value.nil?
|
272
|
+
hash[param] = _to_hash(value)
|
273
|
+
end
|
274
|
+
hash
|
275
|
+
end
|
276
|
+
|
277
|
+
# Outputs non-array value in the form of hash
|
278
|
+
# For object, use to_hash. Otherwise, just return the value
|
279
|
+
# @param [Object] value Any valid value
|
280
|
+
# @return [Hash] Returns the value in the form of hash
|
281
|
+
def _to_hash(value)
|
282
|
+
if value.is_a?(Array)
|
283
|
+
value.compact.map { |v| _to_hash(v) }
|
284
|
+
elsif value.is_a?(Hash)
|
285
|
+
{}.tap do |hash|
|
286
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
287
|
+
end
|
288
|
+
elsif value.respond_to? :to_hash
|
289
|
+
value.to_hash
|
290
|
+
else
|
291
|
+
value
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|