cybersource_rest_client 0.0.83 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb +46 -27
- data/lib/AuthenticationSDK/core/MerchantConfig.rb +82 -48
- data/lib/AuthenticationSDK/util/Cache.rb +7 -4
- data/lib/AuthenticationSDK/util/Constants.rb +6 -0
- data/lib/AuthenticationSDK/util/MLEUtility.rb +9 -0
- data/lib/cybersource_rest_client/api/batches_api.rb +1 -1
- data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +14 -22
- data/lib/cybersource_rest_client/api/credentials_api.rb +104 -0
- data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +3 -3
- data/lib/cybersource_rest_client/api/enrollment_api.rb +2 -2
- data/lib/cybersource_rest_client/api/instructions_api.rb +10 -10
- data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +3 -3
- data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +20 -28
- data/lib/cybersource_rest_client/api/network_tokens_api.rb +654 -0
- data/lib/cybersource_rest_client/api/plans_api.rb +1 -1
- data/lib/cybersource_rest_client/api/subscriptions_api.rb +183 -1
- data/lib/cybersource_rest_client/api/subscriptions_follow_ons_api.rb +1 -1
- data/lib/cybersource_rest_client/api_client.rb +4 -0
- data/lib/cybersource_rest_client/models/account_validations_request.rb +15 -5
- data/lib/cybersource_rest_client/models/acpv1instructions_decline_threshold.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1instructions_mandates.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1instructions_recurring_payment_information.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idconfirmations_processor_information_payment_instrument.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1instructionsinstruction_idcredentials_order_information_amount_detail.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1mppcredentials_challenge.rb +369 -0
- data/lib/cybersource_rest_client/models/acpv1mppcredentials_challenge_encryption_jwk.rb +336 -0
- data/lib/cybersource_rest_client/models/acpv1tokens_assurance_data.rb +7 -7
- data/lib/cybersource_rest_client/models/acpv1tokens_authenticated_identities.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1tokens_authentication_context.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1tokens_bill_to.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1tokens_buyer_information.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1tokens_consumer_identity.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1tokens_device_information.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1tokens_enrollment_reference_data.rb +1 -1
- data/lib/cybersource_rest_client/models/acpv1tokens_payment_information.rb +1 -1
- data/lib/cybersource_rest_client/models/auth_reversal_request.rb +11 -1
- data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information.rb +32 -6
- data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_bank.rb +1 -1
- data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_bank_account.rb +1 -1
- data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_customer.rb +196 -0
- data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_instrument_identifier.rb +196 -0
- data/lib/cybersource_rest_client/models/bavsv1accountvalidations_payment_information_payment_instrument.rb +196 -0
- data/lib/cybersource_rest_client/models/bavsv1accountvalidations_token_information.rb +208 -0
- data/lib/cybersource_rest_client/models/card_processing_config_common_processors.rb +105 -1
- data/lib/cybersource_rest_client/models/commerce_solutions_products.rb +15 -5
- data/lib/cybersource_rest_client/models/create_credit_request.rb +15 -5
- data/lib/cybersource_rest_client/models/get_all_subscriptions_response_order_information_amount_details_surcharge.rb +22 -5
- data/lib/cybersource_rest_client/models/get_subscriptions_payments_response.rb +247 -0
- data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_1.rb +224 -0
- data/lib/cybersource_rest_client/models/{pbl_payment_links_post201_response__links.rb → get_subscriptions_payments_response_1__links.rb} +1 -1
- data/lib/cybersource_rest_client/models/get_subscriptions_payments_response__links.rb +209 -0
- data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_cycles_completed_count.rb +191 -0
- data/lib/cybersource_rest_client/models/get_subscriptions_payments_response_subscription_payment.rb +356 -0
- data/lib/cybersource_rest_client/models/inline_response_201_1_tokenized_card.rb +26 -5
- data/lib/cybersource_rest_client/models/inline_response_201_4_setups_commerce_solutions.rb +15 -5
- data/lib/cybersource_rest_client/models/inline_response_201_4_setups_payments.rb +25 -5
- data/lib/cybersource_rest_client/models/inline_response_201_4_setups_risk.rb +15 -5
- data/lib/cybersource_rest_client/models/inline_response_201_4_setups_value_added_services.rb +25 -5
- data/lib/cybersource_rest_client/models/inline_response_400_10.rb +30 -75
- data/lib/cybersource_rest_client/models/{inline_response_400_8_details.rb → inline_response_400_10_details.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_400_11.rb +235 -0
- data/lib/cybersource_rest_client/models/{inline_response_400_7_details.rb → inline_response_400_11_details.rb} +3 -3
- data/lib/cybersource_rest_client/models/inline_response_400_12.rb +281 -0
- data/lib/cybersource_rest_client/models/inline_response_400_6.rb +37 -60
- data/lib/cybersource_rest_client/models/inline_response_400_7.rb +6 -6
- data/lib/cybersource_rest_client/models/inline_response_400_8.rb +58 -36
- data/lib/cybersource_rest_client/models/{inline_response_400_6_fields.rb → inline_response_400_8_fields.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_400_9.rb +16 -16
- data/lib/cybersource_rest_client/models/inline_response_400_9_details.rb +2 -2
- data/lib/cybersource_rest_client/models/inline_response_404_3.rb +1 -1
- data/lib/cybersource_rest_client/models/inline_response_422_1.rb +1 -1
- data/lib/cybersource_rest_client/models/iplv2paymentlinks_order_information_line_items.rb +73 -5
- data/lib/cybersource_rest_client/models/mit_reversal_request.rb +11 -1
- data/lib/cybersource_rest_client/models/mpp_credentials_request.rb +221 -0
- data/lib/cybersource_rest_client/models/mpp_credentials_response200.rb +338 -0
- data/lib/cybersource_rest_client/models/patch_customer_payment_instrument_request.rb +1 -1
- data/lib/cybersource_rest_client/models/patch_customer_request.rb +1 -1
- data/lib/cybersource_rest_client/models/patch_payment_instrument_request.rb +1 -1
- data/lib/cybersource_rest_client/models/payment_instrument_list_1__embedded.rb +1 -1
- data/lib/cybersource_rest_client/models/payment_instrument_list__embedded.rb +1 -1
- data/lib/cybersource_rest_client/models/{payment_instrument_list_1__embedded__embedded.rb → payment_instrument_list__embedded__embedded.rb} +1 -1
- data/lib/cybersource_rest_client/models/{payment_instrument_list_1__embedded_payment_instruments.rb → payment_instrument_list__embedded_payment_instruments.rb} +2 -2
- data/lib/cybersource_rest_client/models/payments_products.rb +25 -5
- data/lib/cybersource_rest_client/models/payments_products_currency_conversion_configuration_information_configurations_processors.rb +14 -2
- data/lib/cybersource_rest_client/models/payments_products_microform.rb +199 -0
- data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information.rb +199 -0
- data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations.rb +189 -0
- data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations_features.rb +189 -0
- data/lib/cybersource_rest_client/models/payments_products_microform_configuration_information_configurations_features_gateway_agnostic.rb +189 -0
- data/lib/cybersource_rest_client/models/payments_products_microform_subscription_information.rb +227 -0
- data/lib/cybersource_rest_client/models/pbl_payment_links_get200_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pbl_payment_links_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/post_customer_payment_instrument_request.rb +1 -1
- data/lib/cybersource_rest_client/models/post_customer_request.rb +1 -1
- data/lib/cybersource_rest_client/models/post_payment_instrument_request.rb +1 -1
- data/lib/cybersource_rest_client/models/post_tokenized_card_request.rb +15 -5
- data/lib/cybersource_rest_client/models/pts_v2_create_billing_agreement_post201_response_agreement_information.rb +80 -1
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response.rb +41 -1
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_merchant_information.rb +196 -0
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_account_information.rb +189 -0
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_information.rb +15 -5
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_payment_information_account_features.rb +196 -0
- data/lib/cybersource_rest_client/models/pts_v2_credits_post201_response_token_information.rb +189 -0
- data/lib/cybersource_rest_client/models/pts_v2_modify_billing_agreement_post201_response_agreement_information.rb +35 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_point_of_sale_information.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_captures_post201_response_processor_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_order_post201_response_order_information_shipping_details.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information.rb +106 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_strong_authentication.rb +22 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information.rb +15 -5
- data/lib/cybersource_rest_client/models/{pts_v2_payments_post201_response_payment_information_tokenized_card.rb → pts_v2_payments_post201_response_payment_account_information_tokenized_card.rb} +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processing_information.rb +18 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information.rb +23 -6
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_token_information.rb +15 -5
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_token_information_third_party_token.rb +213 -0
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_error_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_order_information_amount_details.rb +18 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_refund_post201_response_processor_information.rb +19 -2
- data/lib/cybersource_rest_client/models/pts_v2_payments_reversals_post201_response_processor_information.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_voids_post201_response_processor_information.rb +7 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information.rb +45 -5
- data/lib/cybersource_rest_client/models/{pull_funds201_response_processor_information_avs.rb → pts_v2_payouts_post201_response_processor_information_avs.rb} +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information_customer.rb +196 -0
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_processor_information_electronic_verification_results.rb +281 -0
- data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_buyer_information.rb +196 -0
- data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_order_information_amount_details.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv1pullfundstransfer_processing_information.rb +18 -5
- data/lib/cybersource_rest_client/models/ptsv1pushfundstransfer_processing_information.rb +19 -6
- data/lib/cybersource_rest_client/models/ptsv2billingagreements_agreement_information.rb +84 -5
- data/lib/cybersource_rest_client/models/ptsv2billingagreements_order_information.rb +12 -2
- data/lib/cybersource_rest_client/models/ptsv2billingagreements_order_information_amount_details.rb +230 -0
- data/lib/cybersource_rest_client/models/{ptsv2intents_order_information_invoice_details.rb → ptsv2billingagreements_order_information_invoice_details.rb} +1 -1
- data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_bank.rb +15 -5
- data/lib/cybersource_rest_client/models/ptsv2billingagreements_payment_information_bank_account_alias.rb +207 -0
- data/lib/cybersource_rest_client/models/ptsv2billingagreements_processing_information.rb +18 -1
- data/lib/cybersource_rest_client/models/ptsv2billingagreementsid_agreement_information.rb +56 -5
- data/lib/cybersource_rest_client/models/ptsv2billingagreementsid_processing_information.rb +18 -1
- data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +35 -5
- data/lib/cybersource_rest_client/models/ptsv2credits_token_information.rb +228 -0
- data/lib/cybersource_rest_client/models/ptsv2intents_order_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2intentsid_order_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +15 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_consumer_authentication_information.rb +16 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information.rb +28 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_digital_currency.rb +231 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_shipping_details.rb +23 -6
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information.rb +32 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank.rb +15 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_bank_account_alias.rb +207 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_third_party_token.rb +196 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +18 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +72 -6
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_program_indicators.rb +202 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_processor_information.rb +56 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_recipient_information.rb +16 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_sender_information.rb +16 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_token_information.rb +32 -5
- data/lib/cybersource_rest_client/models/ptsv2payments_token_information_token_authentication_information.rb +193 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_token_information_token_authentication_information_authenticated_identities.rb +252 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +15 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_shipping_details.rb +100 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information.rb +22 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +18 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processor_information.rb +39 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information.rb +15 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_order_information_shipping_details.rb +196 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information.rb +32 -5
- data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_device_information.rb +196 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidreversals_payment_information.rb +22 -5
- data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +18 -5
- data/lib/cybersource_rest_client/models/pull_funds201_response_processor_information.rb +36 -6
- data/lib/cybersource_rest_client/models/pull_funds_request.rb +11 -1
- data/lib/cybersource_rest_client/models/push_funds201_response_processor_information.rb +45 -5
- data/lib/cybersource_rest_client/models/risk_products.rb +15 -5
- data/lib/cybersource_rest_client/models/riskv1decisions_order_information_ship_to.rb +39 -5
- data/lib/cybersource_rest_client/models/riskv1decisions_order_information_shipping_details.rb +1 -1
- data/lib/cybersource_rest_client/models/tms_card_art.rb +23 -1
- data/lib/cybersource_rest_client/models/tms_embedded_instrument_identifier_bill_to.rb +22 -5
- data/lib/cybersource_rest_client/models/tms_tokenized_card_delete_request.rb +189 -0
- data/lib/cybersource_rest_client/models/tmsv1paymentinstruments__embedded.rb +190 -0
- data/lib/cybersource_rest_client/models/tmsv2_tokenized_card.rb +22 -1
- data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_card.rb +1 -1
- data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata.rb +16 -5
- data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer.rb +41 -8
- data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer_bank_applications.rb +201 -0
- data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_metadata_issuer_capabilities.rb +257 -0
- data/lib/cybersource_rest_client/models/tmsv2_tokenized_card_verification_results.rb +202 -0
- data/lib/cybersource_rest_client/models/tmsv2customers__embedded.rb +200 -0
- data/lib/cybersource_rest_client/models/{tmsv3tokenstoken_idpaymentcredentials_order_information_bill_to.rb → tmsv2tokenizedcards_bill_to.rb} +1 -1
- data/lib/cybersource_rest_client/models/tmsv2tokenizedcardstokenized_card_iddelete_reason.rb +208 -0
- data/lib/cybersource_rest_client/models/tmsv3tokenstoken_idpaymentcredentials_order_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_shipping_details.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_sender_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ucv1sessions_data.rb +44 -14
- data/lib/cybersource_rest_client/models/ucv1sessions_data_aggregator_information.rb +325 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_aggregator_information_sub_merchant.rb +366 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_consumer_authentication_information.rb +22 -5
- data/lib/cybersource_rest_client/models/ucv1sessions_data_installment_information.rb +196 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_merchant_information.rb +22 -5
- data/lib/cybersource_rest_client/models/ucv1sessions_data_merchant_information_merchant_descriptor.rb +18 -1
- data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information.rb +16 -6
- data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_amount_details.rb +86 -12
- data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_invoice_details.rb +242 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_invoice_details_transaction_advice_addendum.rb +196 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_line_items.rb +702 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_order_information_shipping_details.rb +213 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information.rb +38 -1
- data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information_bank_transfer_options.rb +196 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_processing_information_recurring_options.rb +192 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_recipient_information.rb +107 -53
- data/lib/cybersource_rest_client/models/ucv1sessions_data_sender_information.rb +376 -0
- data/lib/cybersource_rest_client/models/ucv1sessions_data_sender_information_account.rb +213 -0
- data/lib/cybersource_rest_client/models/update_payments.rb +192 -0
- data/lib/cybersource_rest_client/models/value_added_services_products.rb +25 -5
- data/lib/cybersource_rest_client.rb +71 -12
- metadata +78 -19
- data/lib/cybersource_rest_client/api/token_api.rb +0 -306
- data/lib/cybersource_rest_client/api/tokenized_card_api.rb +0 -371
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CyberSource Merged Spec
|
|
3
|
+
|
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.38
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
module CyberSource
|
|
15
|
+
# MPP challenge context received from the merchant's 402 response.
|
|
16
|
+
class Acpv1mppcredentialsChallenge
|
|
17
|
+
# Unique challenge identifier issued by the merchant server.
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# Merchant realm (typically the API domain).
|
|
21
|
+
attr_accessor :realm
|
|
22
|
+
|
|
23
|
+
# Amount in the smallest currency unit (e.g., '4999' = $49.99).
|
|
24
|
+
attr_accessor :amount
|
|
25
|
+
|
|
26
|
+
# Three-letter ISO 4217 currency code, lowercase (e.g., 'usd').
|
|
27
|
+
attr_accessor :currency
|
|
28
|
+
|
|
29
|
+
# Card networks accepted by the merchant (e.g., ['visa', 'mastercard']).
|
|
30
|
+
attr_accessor :accepted_networks
|
|
31
|
+
|
|
32
|
+
# Merchant identifier (maps to 'recipient' in MPP spec request object).
|
|
33
|
+
attr_accessor :merchant_id
|
|
34
|
+
|
|
35
|
+
# Human-readable merchant name.
|
|
36
|
+
attr_accessor :merchant_name
|
|
37
|
+
|
|
38
|
+
attr_accessor :encryption_jwk
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'id' => :'id',
|
|
44
|
+
:'realm' => :'realm',
|
|
45
|
+
:'amount' => :'amount',
|
|
46
|
+
:'currency' => :'currency',
|
|
47
|
+
:'accepted_networks' => :'acceptedNetworks',
|
|
48
|
+
:'merchant_id' => :'merchantId',
|
|
49
|
+
:'merchant_name' => :'merchantName',
|
|
50
|
+
:'encryption_jwk' => :'encryption_jwk'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from JSON key to ruby-style variable name.
|
|
55
|
+
def self.json_map
|
|
56
|
+
{
|
|
57
|
+
:'id' => :'id',
|
|
58
|
+
:'realm' => :'realm',
|
|
59
|
+
:'amount' => :'amount',
|
|
60
|
+
:'currency' => :'currency',
|
|
61
|
+
:'accepted_networks' => :'accepted_networks',
|
|
62
|
+
:'merchant_id' => :'merchant_id',
|
|
63
|
+
:'merchant_name' => :'merchant_name',
|
|
64
|
+
:'encryption_jwk' => :'encryption_jwk'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.swagger_types
|
|
70
|
+
{
|
|
71
|
+
:'id' => :'String',
|
|
72
|
+
:'realm' => :'String',
|
|
73
|
+
:'amount' => :'String',
|
|
74
|
+
:'currency' => :'String',
|
|
75
|
+
:'accepted_networks' => :'Array<String>',
|
|
76
|
+
:'merchant_id' => :'String',
|
|
77
|
+
:'merchant_name' => :'String',
|
|
78
|
+
:'encryption_jwk' => :'Acpv1mppcredentialsChallengeEncryptionJwk'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Initializes the object
|
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
84
|
+
def initialize(attributes = {})
|
|
85
|
+
return unless attributes.is_a?(Hash)
|
|
86
|
+
|
|
87
|
+
# convert string to symbol for hash key
|
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
89
|
+
|
|
90
|
+
if attributes.has_key?(:'id')
|
|
91
|
+
self.id = attributes[:'id']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.has_key?(:'realm')
|
|
95
|
+
self.realm = attributes[:'realm']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.has_key?(:'amount')
|
|
99
|
+
self.amount = attributes[:'amount']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.has_key?(:'currency')
|
|
103
|
+
self.currency = attributes[:'currency']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.has_key?(:'acceptedNetworks')
|
|
107
|
+
if (value = attributes[:'acceptedNetworks']).is_a?(Array)
|
|
108
|
+
self.accepted_networks = value
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.has_key?(:'merchantId')
|
|
113
|
+
self.merchant_id = attributes[:'merchantId']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.has_key?(:'merchantName')
|
|
117
|
+
self.merchant_name = attributes[:'merchantName']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.has_key?(:'encryption_jwk')
|
|
121
|
+
self.encryption_jwk = attributes[:'encryption_jwk']
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
126
|
+
# @return Array for valid properties with the reasons
|
|
127
|
+
def list_invalid_properties
|
|
128
|
+
invalid_properties = Array.new
|
|
129
|
+
if @id.nil?
|
|
130
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if @realm.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "realm", realm cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if @amount.nil?
|
|
138
|
+
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if @currency.nil?
|
|
142
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if @accepted_networks.nil?
|
|
146
|
+
invalid_properties.push('invalid value for "accepted_networks", accepted_networks cannot be nil.')
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if @merchant_id.nil?
|
|
150
|
+
invalid_properties.push('invalid value for "merchant_id", merchant_id cannot be nil.')
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if @merchant_name.nil?
|
|
154
|
+
invalid_properties.push('invalid value for "merchant_name", merchant_name cannot be nil.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if @encryption_jwk.nil?
|
|
158
|
+
invalid_properties.push('invalid value for "encryption_jwk", encryption_jwk cannot be nil.')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
invalid_properties
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Check to see if the all the properties in the model are valid
|
|
165
|
+
# @return true if the model is valid
|
|
166
|
+
def valid?
|
|
167
|
+
return false if @id.nil?
|
|
168
|
+
return false if @realm.nil?
|
|
169
|
+
return false if @amount.nil?
|
|
170
|
+
return false if @currency.nil?
|
|
171
|
+
return false if @accepted_networks.nil?
|
|
172
|
+
return false if @merchant_id.nil?
|
|
173
|
+
return false if @merchant_name.nil?
|
|
174
|
+
return false if @encryption_jwk.nil?
|
|
175
|
+
true
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Custom attribute writer method with validation
|
|
179
|
+
# @param [Object] id Value to be assigned
|
|
180
|
+
def id=(id)
|
|
181
|
+
#if id.nil?
|
|
182
|
+
#fail ArgumentError, 'id cannot be nil'
|
|
183
|
+
#end
|
|
184
|
+
|
|
185
|
+
@id = id
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Custom attribute writer method with validation
|
|
189
|
+
# @param [Object] realm Value to be assigned
|
|
190
|
+
def realm=(realm)
|
|
191
|
+
#if realm.nil?
|
|
192
|
+
#fail ArgumentError, 'realm cannot be nil'
|
|
193
|
+
#end
|
|
194
|
+
|
|
195
|
+
@realm = realm
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Custom attribute writer method with validation
|
|
199
|
+
# @param [Object] amount Value to be assigned
|
|
200
|
+
def amount=(amount)
|
|
201
|
+
#if amount.nil?
|
|
202
|
+
#fail ArgumentError, 'amount cannot be nil'
|
|
203
|
+
#end
|
|
204
|
+
|
|
205
|
+
@amount = amount
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Custom attribute writer method with validation
|
|
209
|
+
# @param [Object] currency Value to be assigned
|
|
210
|
+
def currency=(currency)
|
|
211
|
+
#if currency.nil?
|
|
212
|
+
#fail ArgumentError, 'currency cannot be nil'
|
|
213
|
+
#end
|
|
214
|
+
|
|
215
|
+
@currency = currency
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] merchant_id Value to be assigned
|
|
220
|
+
def merchant_id=(merchant_id)
|
|
221
|
+
#if merchant_id.nil?
|
|
222
|
+
#fail ArgumentError, 'merchant_id cannot be nil'
|
|
223
|
+
#end
|
|
224
|
+
|
|
225
|
+
@merchant_id = merchant_id
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] merchant_name Value to be assigned
|
|
230
|
+
def merchant_name=(merchant_name)
|
|
231
|
+
#if merchant_name.nil?
|
|
232
|
+
#fail ArgumentError, 'merchant_name cannot be nil'
|
|
233
|
+
#end
|
|
234
|
+
|
|
235
|
+
@merchant_name = merchant_name
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Checks equality by comparing each attribute.
|
|
239
|
+
# @param [Object] Object to be compared
|
|
240
|
+
def ==(o)
|
|
241
|
+
return true if self.equal?(o)
|
|
242
|
+
self.class == o.class &&
|
|
243
|
+
id == o.id &&
|
|
244
|
+
realm == o.realm &&
|
|
245
|
+
amount == o.amount &&
|
|
246
|
+
currency == o.currency &&
|
|
247
|
+
accepted_networks == o.accepted_networks &&
|
|
248
|
+
merchant_id == o.merchant_id &&
|
|
249
|
+
merchant_name == o.merchant_name &&
|
|
250
|
+
encryption_jwk == o.encryption_jwk
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# @see the `==` method
|
|
254
|
+
# @param [Object] Object to be compared
|
|
255
|
+
def eql?(o)
|
|
256
|
+
self == o
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Calculates hash code according to all attributes.
|
|
260
|
+
# @return [Fixnum] Hash code
|
|
261
|
+
def hash
|
|
262
|
+
[id, realm, amount, currency, accepted_networks, merchant_id, merchant_name, encryption_jwk].hash
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Builds the object from hash
|
|
266
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
267
|
+
# @return [Object] Returns the model itself
|
|
268
|
+
def build_from_hash(attributes)
|
|
269
|
+
return nil unless attributes.is_a?(Hash)
|
|
270
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
271
|
+
if type =~ /\AArray<(.*)>/i
|
|
272
|
+
# check to ensure the input is an array given that the the attribute
|
|
273
|
+
# is documented as an array but the input is not
|
|
274
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
275
|
+
self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
276
|
+
end
|
|
277
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
278
|
+
self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
279
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
self
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Deserializes the data based on type
|
|
286
|
+
# @param string type Data type
|
|
287
|
+
# @param string value Value to be deserialized
|
|
288
|
+
# @return [Object] Deserialized data
|
|
289
|
+
def _deserialize(type, value)
|
|
290
|
+
case type.to_sym
|
|
291
|
+
when :DateTime
|
|
292
|
+
DateTime.parse(value)
|
|
293
|
+
when :Date
|
|
294
|
+
Date.parse(value)
|
|
295
|
+
when :String
|
|
296
|
+
value.to_s
|
|
297
|
+
when :Integer
|
|
298
|
+
value.to_i
|
|
299
|
+
when :Float
|
|
300
|
+
value.to_f
|
|
301
|
+
when :BOOLEAN
|
|
302
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
303
|
+
true
|
|
304
|
+
else
|
|
305
|
+
false
|
|
306
|
+
end
|
|
307
|
+
when :Object
|
|
308
|
+
# generic object (usually a Hash), return directly
|
|
309
|
+
value
|
|
310
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
311
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
312
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
313
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
314
|
+
k_type = Regexp.last_match[:k_type]
|
|
315
|
+
v_type = Regexp.last_match[:v_type]
|
|
316
|
+
{}.tap do |hash|
|
|
317
|
+
value.each do |k, v|
|
|
318
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
else # model
|
|
322
|
+
temp_model = CyberSource.const_get(type).new
|
|
323
|
+
temp_model.build_from_hash(value)
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Returns the string representation of the object
|
|
328
|
+
# @return [String] String presentation of the object
|
|
329
|
+
def to_s
|
|
330
|
+
to_hash.to_s
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
334
|
+
# @return [Hash] Returns the object in the form of hash
|
|
335
|
+
def to_body
|
|
336
|
+
to_hash
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
# Returns the object in the form of hash
|
|
340
|
+
# @return [Hash] Returns the object in the form of hash
|
|
341
|
+
def to_hash
|
|
342
|
+
hash = {}
|
|
343
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
344
|
+
value = self.send(attr)
|
|
345
|
+
next if value.nil?
|
|
346
|
+
hash[param] = _to_hash(value)
|
|
347
|
+
end
|
|
348
|
+
hash
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
# Outputs non-array value in the form of hash
|
|
352
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
353
|
+
# @param [Object] value Any valid value
|
|
354
|
+
# @return [Hash] Returns the value in the form of hash
|
|
355
|
+
def _to_hash(value)
|
|
356
|
+
if value.is_a?(Array)
|
|
357
|
+
value.compact.map { |v| _to_hash(v) }
|
|
358
|
+
elsif value.is_a?(Hash)
|
|
359
|
+
{}.tap do |hash|
|
|
360
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
361
|
+
end
|
|
362
|
+
elsif value.respond_to? :to_hash
|
|
363
|
+
value.to_hash
|
|
364
|
+
else
|
|
365
|
+
value
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
end
|
|
369
|
+
end
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CyberSource Merged Spec
|
|
3
|
+
|
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.38
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
module CyberSource
|
|
15
|
+
# Merchant RSA public encryption key as a JSON Web Key (JWK, RFC 7517). Must be RSA (kty=RSA), alg=RSA-OAEP-256, use=enc. Used to encrypt the token payload using RSA-OAEP with SHA-256 per MPP spec Section 7.4.
|
|
16
|
+
class Acpv1mppcredentialsChallengeEncryptionJwk
|
|
17
|
+
# Key type. MUST be 'RSA'.
|
|
18
|
+
attr_accessor :kty
|
|
19
|
+
|
|
20
|
+
# Key ID. Identifies the key within a JWKS.
|
|
21
|
+
attr_accessor :kid
|
|
22
|
+
|
|
23
|
+
# Public key use. MUST be 'enc'.
|
|
24
|
+
attr_accessor :use
|
|
25
|
+
|
|
26
|
+
# Algorithm. MUST be 'RSA-OAEP-256'.
|
|
27
|
+
attr_accessor :alg
|
|
28
|
+
|
|
29
|
+
# RSA modulus (Base64urlUInt-encoded per RFC 7518 Section 6.3.1.1).
|
|
30
|
+
attr_accessor :n
|
|
31
|
+
|
|
32
|
+
# RSA public exponent (Base64urlUInt-encoded per RFC 7518 Section 6.3.1.2).
|
|
33
|
+
attr_accessor :e
|
|
34
|
+
|
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
36
|
+
def self.attribute_map
|
|
37
|
+
{
|
|
38
|
+
:'kty' => :'kty',
|
|
39
|
+
:'kid' => :'kid',
|
|
40
|
+
:'use' => :'use',
|
|
41
|
+
:'alg' => :'alg',
|
|
42
|
+
:'n' => :'n',
|
|
43
|
+
:'e' => :'e'
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute mapping from JSON key to ruby-style variable name.
|
|
48
|
+
def self.json_map
|
|
49
|
+
{
|
|
50
|
+
:'kty' => :'kty',
|
|
51
|
+
:'kid' => :'kid',
|
|
52
|
+
:'use' => :'use',
|
|
53
|
+
:'alg' => :'alg',
|
|
54
|
+
:'n' => :'n',
|
|
55
|
+
:'e' => :'e'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.swagger_types
|
|
61
|
+
{
|
|
62
|
+
:'kty' => :'String',
|
|
63
|
+
:'kid' => :'String',
|
|
64
|
+
:'use' => :'String',
|
|
65
|
+
:'alg' => :'String',
|
|
66
|
+
:'n' => :'String',
|
|
67
|
+
:'e' => :'String'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
return unless attributes.is_a?(Hash)
|
|
75
|
+
|
|
76
|
+
# convert string to symbol for hash key
|
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
78
|
+
|
|
79
|
+
if attributes.has_key?(:'kty')
|
|
80
|
+
self.kty = attributes[:'kty']
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.has_key?(:'kid')
|
|
84
|
+
self.kid = attributes[:'kid']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.has_key?(:'use')
|
|
88
|
+
self.use = attributes[:'use']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.has_key?(:'alg')
|
|
92
|
+
self.alg = attributes[:'alg']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.has_key?(:'n')
|
|
96
|
+
self.n = attributes[:'n']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.has_key?(:'e')
|
|
100
|
+
self.e = attributes[:'e']
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
|
+
# @return Array for valid properties with the reasons
|
|
106
|
+
def list_invalid_properties
|
|
107
|
+
invalid_properties = Array.new
|
|
108
|
+
if @kty.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "kty", kty cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @kid.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "kid", kid cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @use.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "use", use cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @alg.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "alg", alg cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if @n.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "n", n cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if @e.nil?
|
|
129
|
+
invalid_properties.push('invalid value for "e", e cannot be nil.')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
invalid_properties
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Check to see if the all the properties in the model are valid
|
|
136
|
+
# @return true if the model is valid
|
|
137
|
+
def valid?
|
|
138
|
+
return false if @kty.nil?
|
|
139
|
+
return false if @kid.nil?
|
|
140
|
+
return false if @use.nil?
|
|
141
|
+
return false if @alg.nil?
|
|
142
|
+
return false if @n.nil?
|
|
143
|
+
return false if @e.nil?
|
|
144
|
+
true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] kty Value to be assigned
|
|
149
|
+
def kty=(kty)
|
|
150
|
+
#if kty.nil?
|
|
151
|
+
#fail ArgumentError, 'kty cannot be nil'
|
|
152
|
+
#end
|
|
153
|
+
|
|
154
|
+
@kty = kty
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] kid Value to be assigned
|
|
159
|
+
def kid=(kid)
|
|
160
|
+
#if kid.nil?
|
|
161
|
+
#fail ArgumentError, 'kid cannot be nil'
|
|
162
|
+
#end
|
|
163
|
+
|
|
164
|
+
@kid = kid
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Custom attribute writer method with validation
|
|
168
|
+
# @param [Object] use Value to be assigned
|
|
169
|
+
def use=(use)
|
|
170
|
+
#if use.nil?
|
|
171
|
+
#fail ArgumentError, 'use cannot be nil'
|
|
172
|
+
#end
|
|
173
|
+
|
|
174
|
+
@use = use
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Custom attribute writer method with validation
|
|
178
|
+
# @param [Object] alg Value to be assigned
|
|
179
|
+
def alg=(alg)
|
|
180
|
+
#if alg.nil?
|
|
181
|
+
#fail ArgumentError, 'alg cannot be nil'
|
|
182
|
+
#end
|
|
183
|
+
|
|
184
|
+
@alg = alg
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] n Value to be assigned
|
|
189
|
+
def n=(n)
|
|
190
|
+
#if n.nil?
|
|
191
|
+
#fail ArgumentError, 'n cannot be nil'
|
|
192
|
+
#end
|
|
193
|
+
|
|
194
|
+
@n = n
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] e Value to be assigned
|
|
199
|
+
def e=(e)
|
|
200
|
+
#if e.nil?
|
|
201
|
+
#fail ArgumentError, 'e cannot be nil'
|
|
202
|
+
#end
|
|
203
|
+
|
|
204
|
+
@e = e
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Checks equality by comparing each attribute.
|
|
208
|
+
# @param [Object] Object to be compared
|
|
209
|
+
def ==(o)
|
|
210
|
+
return true if self.equal?(o)
|
|
211
|
+
self.class == o.class &&
|
|
212
|
+
kty == o.kty &&
|
|
213
|
+
kid == o.kid &&
|
|
214
|
+
use == o.use &&
|
|
215
|
+
alg == o.alg &&
|
|
216
|
+
n == o.n &&
|
|
217
|
+
e == o.e
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# @see the `==` method
|
|
221
|
+
# @param [Object] Object to be compared
|
|
222
|
+
def eql?(o)
|
|
223
|
+
self == o
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Calculates hash code according to all attributes.
|
|
227
|
+
# @return [Fixnum] Hash code
|
|
228
|
+
def hash
|
|
229
|
+
[kty, kid, use, alg, n, e].hash
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Builds the object from hash
|
|
233
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
234
|
+
# @return [Object] Returns the model itself
|
|
235
|
+
def build_from_hash(attributes)
|
|
236
|
+
return nil unless attributes.is_a?(Hash)
|
|
237
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
238
|
+
if type =~ /\AArray<(.*)>/i
|
|
239
|
+
# check to ensure the input is an array given that the the attribute
|
|
240
|
+
# is documented as an array but the input is not
|
|
241
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
242
|
+
self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
243
|
+
end
|
|
244
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
245
|
+
self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
246
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
self
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Deserializes the data based on type
|
|
253
|
+
# @param string type Data type
|
|
254
|
+
# @param string value Value to be deserialized
|
|
255
|
+
# @return [Object] Deserialized data
|
|
256
|
+
def _deserialize(type, value)
|
|
257
|
+
case type.to_sym
|
|
258
|
+
when :DateTime
|
|
259
|
+
DateTime.parse(value)
|
|
260
|
+
when :Date
|
|
261
|
+
Date.parse(value)
|
|
262
|
+
when :String
|
|
263
|
+
value.to_s
|
|
264
|
+
when :Integer
|
|
265
|
+
value.to_i
|
|
266
|
+
when :Float
|
|
267
|
+
value.to_f
|
|
268
|
+
when :BOOLEAN
|
|
269
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
270
|
+
true
|
|
271
|
+
else
|
|
272
|
+
false
|
|
273
|
+
end
|
|
274
|
+
when :Object
|
|
275
|
+
# generic object (usually a Hash), return directly
|
|
276
|
+
value
|
|
277
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
278
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
279
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
280
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
281
|
+
k_type = Regexp.last_match[:k_type]
|
|
282
|
+
v_type = Regexp.last_match[:v_type]
|
|
283
|
+
{}.tap do |hash|
|
|
284
|
+
value.each do |k, v|
|
|
285
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
else # model
|
|
289
|
+
temp_model = CyberSource.const_get(type).new
|
|
290
|
+
temp_model.build_from_hash(value)
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Returns the string representation of the object
|
|
295
|
+
# @return [String] String presentation of the object
|
|
296
|
+
def to_s
|
|
297
|
+
to_hash.to_s
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
301
|
+
# @return [Hash] Returns the object in the form of hash
|
|
302
|
+
def to_body
|
|
303
|
+
to_hash
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Returns the object in the form of hash
|
|
307
|
+
# @return [Hash] Returns the object in the form of hash
|
|
308
|
+
def to_hash
|
|
309
|
+
hash = {}
|
|
310
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
311
|
+
value = self.send(attr)
|
|
312
|
+
next if value.nil?
|
|
313
|
+
hash[param] = _to_hash(value)
|
|
314
|
+
end
|
|
315
|
+
hash
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Outputs non-array value in the form of hash
|
|
319
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
320
|
+
# @param [Object] value Any valid value
|
|
321
|
+
# @return [Hash] Returns the value in the form of hash
|
|
322
|
+
def _to_hash(value)
|
|
323
|
+
if value.is_a?(Array)
|
|
324
|
+
value.compact.map { |v| _to_hash(v) }
|
|
325
|
+
elsif value.is_a?(Hash)
|
|
326
|
+
{}.tap do |hash|
|
|
327
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
328
|
+
end
|
|
329
|
+
elsif value.respond_to? :to_hash
|
|
330
|
+
value.to_hash
|
|
331
|
+
else
|
|
332
|
+
value
|
|
333
|
+
end
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
end
|