cybersource_rest_client 0.0.79 → 0.0.80
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/core/MerchantConfig.rb +1 -0
- data/lib/AuthenticationSDK/util/Cache.rb +14 -0
- data/lib/AuthenticationSDK/util/Constants.rb +2 -0
- data/lib/AuthenticationSDK/util/JWT/JWTExceptions.rb +81 -0
- data/lib/AuthenticationSDK/util/JWT/JWTUtility.rb +154 -0
- data/lib/cybersource_rest_client/api/bank_account_validation_api.rb +8 -4
- data/lib/cybersource_rest_client/api/batches_api.rb +29 -13
- data/lib/cybersource_rest_client/api/billing_agreements_api.rb +15 -3
- data/lib/cybersource_rest_client/api/bin_lookup_api.rb +5 -1
- data/lib/cybersource_rest_client/api/capture_api.rb +5 -1
- data/lib/cybersource_rest_client/api/chargeback_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/chargeback_summaries_api.rb +5 -1
- data/lib/cybersource_rest_client/api/conversion_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +18 -6
- data/lib/cybersource_rest_client/api/credit_api.rb +5 -1
- data/lib/cybersource_rest_client/api/customer_api.rb +22 -6
- data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +27 -7
- data/lib/cybersource_rest_client/api/customer_shipping_address_api.rb +27 -7
- data/lib/cybersource_rest_client/api/decision_manager_api.rb +28 -8
- data/lib/cybersource_rest_client/api/device_de_association_api.rb +13 -5
- data/lib/cybersource_rest_client/api/device_search_api.rb +16 -8
- data/lib/cybersource_rest_client/api/download_dtd_api.rb +5 -1
- data/lib/cybersource_rest_client/api/download_xsd_api.rb +5 -1
- data/lib/cybersource_rest_client/api/emv_tag_details_api.rb +10 -2
- data/lib/cybersource_rest_client/api/flex_api_api.rb +5 -1
- data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +33 -9
- data/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/invoice_settings_api.rb +10 -2
- data/lib/cybersource_rest_client/api/invoices_api.rb +35 -7
- data/lib/cybersource_rest_client/api/manage_webhooks_api.rb +41 -13
- data/lib/cybersource_rest_client/api/merchant_boarding_api.rb +13 -5
- data/lib/cybersource_rest_client/api/merchant_defined_fields_api.rb +29 -13
- data/lib/cybersource_rest_client/api/microform_integration_api.rb +5 -1
- data/lib/cybersource_rest_client/api/net_fundings_api.rb +5 -1
- data/lib/cybersource_rest_client/api/notification_of_changes_api.rb +5 -1
- data/lib/cybersource_rest_client/api/offers_api.rb +13 -5
- data/lib/cybersource_rest_client/api/orders_api.rb +10 -2
- data/lib/cybersource_rest_client/api/payer_authentication_api.rb +15 -3
- data/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb +5 -1
- data/lib/cybersource_rest_client/api/payment_instrument_api.rb +22 -6
- data/lib/cybersource_rest_client/api/payment_links_api.rb +20 -4
- data/lib/cybersource_rest_client/api/payment_tokens_api.rb +5 -1
- data/lib/cybersource_rest_client/api/payments_api.rb +30 -6
- data/lib/cybersource_rest_client/api/payouts_api.rb +5 -1
- data/lib/cybersource_rest_client/api/plans_api.rb +40 -8
- data/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/push_funds_api.rb +5 -1
- data/lib/cybersource_rest_client/api/refund_api.rb +10 -2
- data/lib/cybersource_rest_client/api/report_definitions_api.rb +10 -2
- data/lib/cybersource_rest_client/api/report_downloads_api.rb +5 -1
- data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +25 -5
- data/lib/cybersource_rest_client/api/reports_api.rb +15 -3
- data/lib/cybersource_rest_client/api/retrieval_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/retrieval_summaries_api.rb +5 -1
- data/lib/cybersource_rest_client/api/reversal_api.rb +10 -2
- data/lib/cybersource_rest_client/api/search_transactions_api.rb +10 -2
- data/lib/cybersource_rest_client/api/secure_file_share_api.rb +10 -2
- data/lib/cybersource_rest_client/api/subscriptions_api.rb +49 -17
- data/lib/cybersource_rest_client/api/subscriptions_follow_ons_api.rb +10 -2
- data/lib/cybersource_rest_client/api/taxes_api.rb +10 -2
- data/lib/cybersource_rest_client/api/token_api.rb +14 -6
- data/lib/cybersource_rest_client/api/tokenize_api.rb +103 -0
- data/lib/cybersource_rest_client/api/tokenized_card_api.rb +105 -4
- data/lib/cybersource_rest_client/api/transaction_batches_api.rb +20 -4
- data/lib/cybersource_rest_client/api/transaction_details_api.rb +5 -1
- data/lib/cybersource_rest_client/api/transient_token_data_api.rb +10 -2
- data/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb +5 -1
- data/lib/cybersource_rest_client/api/user_management_api.rb +5 -1
- data/lib/cybersource_rest_client/api/user_management_search_api.rb +5 -1
- data/lib/cybersource_rest_client/api/verification_api.rb +10 -2
- data/lib/cybersource_rest_client/api/void_api.rb +25 -5
- data/lib/cybersource_rest_client/models/create_plan_request.rb +1 -11
- data/lib/cybersource_rest_client/models/create_subscription_request.rb +1 -1
- data/lib/cybersource_rest_client/models/create_subscription_request_1.rb +1 -1
- data/lib/cybersource_rest_client/models/create_subscription_response.rb +15 -5
- data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +13 -2
- data/lib/cybersource_rest_client/models/get_all_subscriptions_response_client_reference_information.rb +196 -0
- data/lib/cybersource_rest_client/models/get_all_subscriptions_response_subscriptions.rb +11 -1
- data/lib/cybersource_rest_client/models/get_subscription_response.rb +11 -1
- data/lib/cybersource_rest_client/models/get_subscription_response_1_payment_instrument.rb +1 -1
- data/lib/cybersource_rest_client/models/get_subscription_response_1_payment_instrument_buyer_information.rb +1 -1
- data/lib/cybersource_rest_client/models/get_subscription_response_1_shipping_address.rb +1 -1
- data/lib/cybersource_rest_client/models/get_subscription_response_reactivation_information.rb +22 -22
- data/lib/cybersource_rest_client/models/inline_response_200.rb +9 -44
- data/lib/cybersource_rest_client/models/inline_response_200_1.rb +29 -31
- data/lib/cybersource_rest_client/models/inline_response_200_10.rb +33 -37
- data/lib/cybersource_rest_client/models/{inline_response_200_9_devices.rb → inline_response_200_10_devices.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_9_payment_processor_to_terminal_map.rb → inline_response_200_10_payment_processor_to_terminal_map.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_11.rb +47 -86
- data/lib/cybersource_rest_client/models/{inline_response_200_10__embedded.rb → inline_response_200_11__embedded.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_10__embedded__links.rb → inline_response_200_11__embedded__links.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_10__embedded__links_reports.rb → inline_response_200_11__embedded__links_reports.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_200_10__embedded_batches.rb → inline_response_200_11__embedded_batches.rb} +3 -3
- data/lib/cybersource_rest_client/models/{inline_response_200_10__embedded_totals.rb → inline_response_200_11__embedded_totals.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_11__links.rb +16 -17
- data/lib/cybersource_rest_client/models/inline_response_200_12.rb +47 -49
- data/lib/cybersource_rest_client/models/inline_response_200_12__links.rb +201 -0
- data/lib/cybersource_rest_client/models/{inline_response_200_11__links_report.rb → inline_response_200_12__links_report.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_200_11_billing.rb → inline_response_200_12_billing.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_13.rb +102 -31
- data/lib/cybersource_rest_client/models/{inline_response_200_12_records.rb → inline_response_200_13_records.rb} +3 -3
- data/lib/cybersource_rest_client/models/{inline_response_200_12_response_record.rb → inline_response_200_13_response_record.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_12_response_record_additional_updates.rb → inline_response_200_13_response_record_additional_updates.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_200_12_source_record.rb → inline_response_200_13_source_record.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_14.rb +18 -84
- data/lib/cybersource_rest_client/models/inline_response_200_15.rb +287 -0
- data/lib/cybersource_rest_client/models/{inline_response_200_14_client_reference_information.rb → inline_response_200_15_client_reference_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_200_content.rb → inline_response_200_1_content.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_2.rb +32 -103
- data/lib/cybersource_rest_client/models/{inline_response_200_1__embedded.rb → inline_response_200_2__embedded.rb} +3 -3
- data/lib/cybersource_rest_client/models/{inline_response_200_1__embedded_capture.rb → inline_response_200_2__embedded_capture.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_1__embedded_capture__links.rb → inline_response_200_2__embedded_capture__links.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_1__embedded_capture__links_self.rb → inline_response_200_2__embedded_capture__links_self.rb} +1 -1
- data/lib/cybersource_rest_client/models/{inline_response_200_1__embedded_reversal.rb → inline_response_200_2__embedded_reversal.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_1__embedded_reversal__links.rb → inline_response_200_2__embedded_reversal__links.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_1__embedded_reversal__links_self.rb → inline_response_200_2__embedded_reversal__links_self.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_3.rb +100 -54
- data/lib/cybersource_rest_client/models/inline_response_200_4.rb +65 -25
- data/lib/cybersource_rest_client/models/{inline_response_200_3_integration_information.rb → inline_response_200_4_integration_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{inline_response_200_3_integration_information_tenant_configurations.rb → inline_response_200_4_integration_information_tenant_configurations.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_5.rb +25 -126
- data/lib/cybersource_rest_client/models/inline_response_200_6.rb +1 -12
- data/lib/cybersource_rest_client/models/inline_response_200_7.rb +129 -51
- data/lib/cybersource_rest_client/models/inline_response_200_8.rb +55 -10
- data/lib/cybersource_rest_client/models/{inline_response_200_7_devices.rb → inline_response_200_8_devices.rb} +1 -1
- data/lib/cybersource_rest_client/models/inline_response_200_9.rb +10 -55
- data/lib/cybersource_rest_client/models/{inline_response_200_10__links.rb → inline_response_200_details.rb} +18 -17
- data/lib/cybersource_rest_client/models/inline_response_200_errors.rb +213 -0
- data/lib/cybersource_rest_client/models/inline_response_200_responses.rb +224 -0
- data/lib/cybersource_rest_client/models/inline_response_201_3_setups_payments.rb +15 -5
- data/lib/cybersource_rest_client/models/patch_customer_payment_instrument_request.rb +9 -9
- data/lib/cybersource_rest_client/models/patch_customer_request.rb +9 -9
- data/lib/cybersource_rest_client/models/patch_customer_shipping_address_request.rb +3 -3
- data/lib/cybersource_rest_client/models/patch_payment_instrument_request.rb +9 -9
- data/lib/cybersource_rest_client/models/payment_instrument_list_1__embedded_payment_instruments.rb +8 -8
- data/lib/cybersource_rest_client/models/payment_instrument_list__embedded.rb +1 -1
- data/lib/cybersource_rest_client/models/payments_products.rb +15 -5
- data/lib/cybersource_rest_client/models/post_customer_payment_instrument_request.rb +9 -9
- data/lib/cybersource_rest_client/models/post_customer_request.rb +9 -9
- data/lib/cybersource_rest_client/models/post_customer_shipping_address_request.rb +3 -3
- data/lib/cybersource_rest_client/models/post_issuer_life_cycle_simulation_request.rb +211 -0
- data/lib/cybersource_rest_client/models/post_payment_instrument_request.rb +9 -9
- data/lib/cybersource_rest_client/models/post_tokenize_request.rb +199 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information.rb +22 -5
- data/lib/cybersource_rest_client/models/shipping_address_list_for_customer__embedded.rb +1 -1
- data/lib/cybersource_rest_client/models/tms_issuerlifecycleeventsimulations_metadata_card_art_combined_asset.rb +190 -0
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_merchant_information.rb → tms_merchant_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_merchant_information_merchant_descriptor.rb → tms_merchant_information_merchant_descriptor.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_buyer_information_issued_by.rb → tmsv2tokenize_default_payment_instrument_buyer_info_issued_by.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_buyer_information_personal_identification.rb → tmsv2tokenize_default_payment_instrument_buyer_info_personal_identification.rb} +2 -2
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_card_tokenized_information.rb → tmsv2tokenize_default_payment_instrument_card_tokenized_info.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_instrument_identifier.rb → tmsv2tokenize_default_payment_instrument_instrument_identifier.rb} +1 -1
- data/lib/cybersource_rest_client/models/tmsv2tokenize_processing_information.rb +205 -0
- data/lib/cybersource_rest_client/models/tmsv2tokenize_token_information.rb +247 -0
- data/lib/cybersource_rest_client/models/tmsv2tokenize_token_information_customer.rb +289 -0
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded.rb → tmsv2tokenize_token_information_customer__embedded.rb} +3 -3
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument.rb} +10 -10
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument__embedded.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument__embedded.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument__links.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument__links.rb} +3 -3
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument__links_self.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument__links_self.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_bank_account.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument_bank_account.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_bill_to.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument_bill_to.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_buyer_information.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument_buyer_information.rb} +2 -2
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_card.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument_card.rb} +2 -2
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_payment_instrument_metadata.rb → tmsv2tokenize_token_information_customer__embedded_default_payment_instrument_metadata.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_shipping_address.rb → tmsv2tokenize_token_information_customer__embedded_default_shipping_address.rb} +4 -4
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_shipping_address__links.rb → tmsv2tokenize_token_information_customer__embedded_default_shipping_address__links.rb} +3 -3
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_shipping_address__links_customer.rb → tmsv2tokenize_token_information_customer__embedded_default_shipping_address__links_customer.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_shipping_address__links_self.rb → tmsv2tokenize_token_information_customer__embedded_default_shipping_address__links_self.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_shipping_address_metadata.rb → tmsv2tokenize_token_information_customer__embedded_default_shipping_address_metadata.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__embedded_default_shipping_address_ship_to.rb → tmsv2tokenize_token_information_customer__embedded_default_shipping_address_ship_to.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__links.rb → tmsv2tokenize_token_information_customer__links.rb} +4 -4
- data/lib/cybersource_rest_client/models/{tmsv2customers__links_payment_instruments.rb → tmsv2tokenize_token_information_customer__links_payment_instruments.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__links_self.rb → tmsv2tokenize_token_information_customer__links_self.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers__links_shipping_address.rb → tmsv2tokenize_token_information_customer__links_shipping_address.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers_buyer_information.rb → tmsv2tokenize_token_information_customer_buyer_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers_client_reference_information.rb → tmsv2tokenize_token_information_customer_client_reference_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers_default_payment_instrument.rb → tmsv2tokenize_token_information_customer_default_payment_instrument.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers_default_shipping_address.rb → tmsv2tokenize_token_information_customer_default_shipping_address.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers_merchant_defined_information.rb → tmsv2tokenize_token_information_customer_merchant_defined_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers_metadata.rb → tmsv2tokenize_token_information_customer_metadata.rb} +1 -1
- data/lib/cybersource_rest_client/models/{tmsv2customers_object_information.rb → tmsv2tokenize_token_information_customer_object_information.rb} +1 -1
- data/lib/cybersource_rest_client/models/{rbsv1subscriptions_client_reference_information_partner.rb → tmsv2tokenizedcardstokenized_card_idissuerlifecycleeventsimulations_card.rb} +41 -24
- data/lib/cybersource_rest_client/models/tmsv2tokenizedcardstokenized_card_idissuerlifecycleeventsimulations_metadata.rb +189 -0
- data/lib/cybersource_rest_client/models/tmsv2tokenizedcardstokenized_card_idissuerlifecycleeventsimulations_metadata_card_art.rb +189 -0
- data/lib/cybersource_rest_client/models/update_subscription.rb +1 -1
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data.rb +25 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_buyer_information.rb +41 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_buyer_information_personal_identification.rb +1 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_client_reference_information_partner.rb +3 -3
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_consumer_authentication_information.rb +24 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_device_information.rb +196 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_merchant_information_merchant_descriptor.rb +124 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_order_information.rb +15 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_order_information_amount_details.rb +15 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_order_information_amount_details_tax_details.rb +213 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_order_information_invoice_details.rb +213 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_order_information_line_items.rb +30 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_order_information_line_items_passenger.rb +8 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_order_information_line_items_tax_details.rb +7 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_payment_information.rb +189 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_payment_information_card.rb +196 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_processing_information.rb +1 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_processing_information_authorization_options.rb +74 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_processing_information_authorization_options_initiator.rb +1 -0
- data/lib/cybersource_rest_client/models/upv1capturecontexts_data_recipient_information.rb +39 -5
- data/lib/cybersource_rest_client/models/upv1capturecontexts_order_information.rb +1 -0
- data/lib/cybersource_rest_client/utilities/capture_context/capture_context_parsing_utility.rb +113 -0
- data/lib/cybersource_rest_client/utilities/capture_context/public_key_fetcher.rb +131 -0
- data/lib/cybersource_rest_client.rb +80 -62
- metadata +85 -64
- data/lib/cybersource_rest_client/models/rbsv1plans_client_reference_information.rb +0 -239
- data/lib/cybersource_rest_client/models/rbsv1subscriptions_client_reference_information.rb +0 -256
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CyberSource Merged Spec
|
|
3
|
+
|
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 0.0.1
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.4.38
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
module CyberSource
|
|
15
|
+
class Upv1capturecontextsDataPaymentInformationCard
|
|
16
|
+
# The card type selection indicator
|
|
17
|
+
attr_accessor :type_selection_indicator
|
|
18
|
+
|
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
20
|
+
def self.attribute_map
|
|
21
|
+
{
|
|
22
|
+
:'type_selection_indicator' => :'typeSelectionIndicator'
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from JSON key to ruby-style variable name.
|
|
27
|
+
def self.json_map
|
|
28
|
+
{
|
|
29
|
+
:'type_selection_indicator' => :'type_selection_indicator'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.swagger_types
|
|
35
|
+
{
|
|
36
|
+
:'type_selection_indicator' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Initializes the object
|
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
42
|
+
def initialize(attributes = {})
|
|
43
|
+
return unless attributes.is_a?(Hash)
|
|
44
|
+
|
|
45
|
+
# convert string to symbol for hash key
|
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
47
|
+
|
|
48
|
+
if attributes.has_key?(:'typeSelectionIndicator')
|
|
49
|
+
self.type_selection_indicator = attributes[:'typeSelectionIndicator']
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
54
|
+
# @return Array for valid properties with the reasons
|
|
55
|
+
def list_invalid_properties
|
|
56
|
+
invalid_properties = Array.new
|
|
57
|
+
invalid_properties
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Check to see if the all the properties in the model are valid
|
|
61
|
+
# @return true if the model is valid
|
|
62
|
+
def valid?
|
|
63
|
+
true
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Custom attribute writer method with validation
|
|
67
|
+
# @param [Object] type_selection_indicator Value to be assigned
|
|
68
|
+
def type_selection_indicator=(type_selection_indicator)
|
|
69
|
+
@type_selection_indicator = type_selection_indicator
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Checks equality by comparing each attribute.
|
|
73
|
+
# @param [Object] Object to be compared
|
|
74
|
+
def ==(o)
|
|
75
|
+
return true if self.equal?(o)
|
|
76
|
+
self.class == o.class &&
|
|
77
|
+
type_selection_indicator == o.type_selection_indicator
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @see the `==` method
|
|
81
|
+
# @param [Object] Object to be compared
|
|
82
|
+
def eql?(o)
|
|
83
|
+
self == o
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Calculates hash code according to all attributes.
|
|
87
|
+
# @return [Fixnum] Hash code
|
|
88
|
+
def hash
|
|
89
|
+
[type_selection_indicator].hash
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Builds the object from hash
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
# @return [Object] Returns the model itself
|
|
95
|
+
def build_from_hash(attributes)
|
|
96
|
+
return nil unless attributes.is_a?(Hash)
|
|
97
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
98
|
+
if type =~ /\AArray<(.*)>/i
|
|
99
|
+
# check to ensure the input is an array given that the the attribute
|
|
100
|
+
# is documented as an array but the input is not
|
|
101
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
102
|
+
self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
103
|
+
end
|
|
104
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
105
|
+
self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
106
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
self
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Deserializes the data based on type
|
|
113
|
+
# @param string type Data type
|
|
114
|
+
# @param string value Value to be deserialized
|
|
115
|
+
# @return [Object] Deserialized data
|
|
116
|
+
def _deserialize(type, value)
|
|
117
|
+
case type.to_sym
|
|
118
|
+
when :DateTime
|
|
119
|
+
DateTime.parse(value)
|
|
120
|
+
when :Date
|
|
121
|
+
Date.parse(value)
|
|
122
|
+
when :String
|
|
123
|
+
value.to_s
|
|
124
|
+
when :Integer
|
|
125
|
+
value.to_i
|
|
126
|
+
when :Float
|
|
127
|
+
value.to_f
|
|
128
|
+
when :BOOLEAN
|
|
129
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
130
|
+
true
|
|
131
|
+
else
|
|
132
|
+
false
|
|
133
|
+
end
|
|
134
|
+
when :Object
|
|
135
|
+
# generic object (usually a Hash), return directly
|
|
136
|
+
value
|
|
137
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
138
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
139
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
140
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
141
|
+
k_type = Regexp.last_match[:k_type]
|
|
142
|
+
v_type = Regexp.last_match[:v_type]
|
|
143
|
+
{}.tap do |hash|
|
|
144
|
+
value.each do |k, v|
|
|
145
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
else # model
|
|
149
|
+
temp_model = CyberSource.const_get(type).new
|
|
150
|
+
temp_model.build_from_hash(value)
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Returns the string representation of the object
|
|
155
|
+
# @return [String] String presentation of the object
|
|
156
|
+
def to_s
|
|
157
|
+
to_hash.to_s
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
|
162
|
+
def to_body
|
|
163
|
+
to_hash
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns the object in the form of hash
|
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
|
168
|
+
def to_hash
|
|
169
|
+
hash = {}
|
|
170
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
171
|
+
value = self.send(attr)
|
|
172
|
+
next if value.nil?
|
|
173
|
+
hash[param] = _to_hash(value)
|
|
174
|
+
end
|
|
175
|
+
hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Outputs non-array value in the form of hash
|
|
179
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
180
|
+
# @param [Object] value Any valid value
|
|
181
|
+
# @return [Hash] Returns the value in the form of hash
|
|
182
|
+
def _to_hash(value)
|
|
183
|
+
if value.is_a?(Array)
|
|
184
|
+
value.compact.map { |v| _to_hash(v) }
|
|
185
|
+
elsif value.is_a?(Hash)
|
|
186
|
+
{}.tap do |hash|
|
|
187
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
188
|
+
end
|
|
189
|
+
elsif value.respond_to? :to_hash
|
|
190
|
+
value.to_hash
|
|
191
|
+
else
|
|
192
|
+
value
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
@@ -13,18 +13,40 @@ require 'date'
|
|
|
13
13
|
|
|
14
14
|
module CyberSource
|
|
15
15
|
class Upv1capturecontextsDataProcessingInformationAuthorizationOptions
|
|
16
|
+
# The AFT indicator
|
|
16
17
|
attr_accessor :aft_indicator
|
|
17
18
|
|
|
19
|
+
# The authorization indicator
|
|
20
|
+
attr_accessor :auth_indicator
|
|
21
|
+
|
|
22
|
+
# Ignore the CV result
|
|
23
|
+
attr_accessor :ignore_cv_result
|
|
24
|
+
|
|
25
|
+
# Ignore the AVS result
|
|
26
|
+
attr_accessor :ignore_avs_result
|
|
27
|
+
|
|
18
28
|
attr_accessor :initiator
|
|
19
29
|
|
|
30
|
+
# The business application Id
|
|
20
31
|
attr_accessor :business_application_id
|
|
21
32
|
|
|
33
|
+
# The commerce indicator
|
|
34
|
+
attr_accessor :commerce_indicator
|
|
35
|
+
|
|
36
|
+
# The processing instruction
|
|
37
|
+
attr_accessor :processing_instruction
|
|
38
|
+
|
|
22
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
40
|
def self.attribute_map
|
|
24
41
|
{
|
|
25
42
|
:'aft_indicator' => :'aftIndicator',
|
|
43
|
+
:'auth_indicator' => :'authIndicator',
|
|
44
|
+
:'ignore_cv_result' => :'ignoreCvResult',
|
|
45
|
+
:'ignore_avs_result' => :'ignoreAvsResult',
|
|
26
46
|
:'initiator' => :'initiator',
|
|
27
|
-
:'business_application_id' => :'businessApplicationId'
|
|
47
|
+
:'business_application_id' => :'businessApplicationId',
|
|
48
|
+
:'commerce_indicator' => :'commerceIndicator',
|
|
49
|
+
:'processing_instruction' => :'processingInstruction'
|
|
28
50
|
}
|
|
29
51
|
end
|
|
30
52
|
|
|
@@ -32,8 +54,13 @@ module CyberSource
|
|
|
32
54
|
def self.json_map
|
|
33
55
|
{
|
|
34
56
|
:'aft_indicator' => :'aft_indicator',
|
|
57
|
+
:'auth_indicator' => :'auth_indicator',
|
|
58
|
+
:'ignore_cv_result' => :'ignore_cv_result',
|
|
59
|
+
:'ignore_avs_result' => :'ignore_avs_result',
|
|
35
60
|
:'initiator' => :'initiator',
|
|
36
|
-
:'business_application_id' => :'business_application_id'
|
|
61
|
+
:'business_application_id' => :'business_application_id',
|
|
62
|
+
:'commerce_indicator' => :'commerce_indicator',
|
|
63
|
+
:'processing_instruction' => :'processing_instruction'
|
|
37
64
|
}
|
|
38
65
|
end
|
|
39
66
|
|
|
@@ -41,8 +68,13 @@ module CyberSource
|
|
|
41
68
|
def self.swagger_types
|
|
42
69
|
{
|
|
43
70
|
:'aft_indicator' => :'BOOLEAN',
|
|
71
|
+
:'auth_indicator' => :'String',
|
|
72
|
+
:'ignore_cv_result' => :'BOOLEAN',
|
|
73
|
+
:'ignore_avs_result' => :'BOOLEAN',
|
|
44
74
|
:'initiator' => :'Upv1capturecontextsDataProcessingInformationAuthorizationOptionsInitiator',
|
|
45
|
-
:'business_application_id' => :'String'
|
|
75
|
+
:'business_application_id' => :'String',
|
|
76
|
+
:'commerce_indicator' => :'String',
|
|
77
|
+
:'processing_instruction' => :'String'
|
|
46
78
|
}
|
|
47
79
|
end
|
|
48
80
|
|
|
@@ -58,6 +90,18 @@ module CyberSource
|
|
|
58
90
|
self.aft_indicator = attributes[:'aftIndicator']
|
|
59
91
|
end
|
|
60
92
|
|
|
93
|
+
if attributes.has_key?(:'authIndicator')
|
|
94
|
+
self.auth_indicator = attributes[:'authIndicator']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.has_key?(:'ignoreCvResult')
|
|
98
|
+
self.ignore_cv_result = attributes[:'ignoreCvResult']
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.has_key?(:'ignoreAvsResult')
|
|
102
|
+
self.ignore_avs_result = attributes[:'ignoreAvsResult']
|
|
103
|
+
end
|
|
104
|
+
|
|
61
105
|
if attributes.has_key?(:'initiator')
|
|
62
106
|
self.initiator = attributes[:'initiator']
|
|
63
107
|
end
|
|
@@ -65,6 +109,14 @@ module CyberSource
|
|
|
65
109
|
if attributes.has_key?(:'businessApplicationId')
|
|
66
110
|
self.business_application_id = attributes[:'businessApplicationId']
|
|
67
111
|
end
|
|
112
|
+
|
|
113
|
+
if attributes.has_key?(:'commerceIndicator')
|
|
114
|
+
self.commerce_indicator = attributes[:'commerceIndicator']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.has_key?(:'processingInstruction')
|
|
118
|
+
self.processing_instruction = attributes[:'processingInstruction']
|
|
119
|
+
end
|
|
68
120
|
end
|
|
69
121
|
|
|
70
122
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -86,14 +138,31 @@ module CyberSource
|
|
|
86
138
|
@business_application_id = business_application_id
|
|
87
139
|
end
|
|
88
140
|
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] commerce_indicator Value to be assigned
|
|
143
|
+
def commerce_indicator=(commerce_indicator)
|
|
144
|
+
@commerce_indicator = commerce_indicator
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Custom attribute writer method with validation
|
|
148
|
+
# @param [Object] processing_instruction Value to be assigned
|
|
149
|
+
def processing_instruction=(processing_instruction)
|
|
150
|
+
@processing_instruction = processing_instruction
|
|
151
|
+
end
|
|
152
|
+
|
|
89
153
|
# Checks equality by comparing each attribute.
|
|
90
154
|
# @param [Object] Object to be compared
|
|
91
155
|
def ==(o)
|
|
92
156
|
return true if self.equal?(o)
|
|
93
157
|
self.class == o.class &&
|
|
94
158
|
aft_indicator == o.aft_indicator &&
|
|
159
|
+
auth_indicator == o.auth_indicator &&
|
|
160
|
+
ignore_cv_result == o.ignore_cv_result &&
|
|
161
|
+
ignore_avs_result == o.ignore_avs_result &&
|
|
95
162
|
initiator == o.initiator &&
|
|
96
|
-
business_application_id == o.business_application_id
|
|
163
|
+
business_application_id == o.business_application_id &&
|
|
164
|
+
commerce_indicator == o.commerce_indicator &&
|
|
165
|
+
processing_instruction == o.processing_instruction
|
|
97
166
|
end
|
|
98
167
|
|
|
99
168
|
# @see the `==` method
|
|
@@ -105,7 +174,7 @@ module CyberSource
|
|
|
105
174
|
# Calculates hash code according to all attributes.
|
|
106
175
|
# @return [Fixnum] Hash code
|
|
107
176
|
def hash
|
|
108
|
-
[aft_indicator, initiator, business_application_id].hash
|
|
177
|
+
[aft_indicator, auth_indicator, ignore_cv_result, ignore_avs_result, initiator, business_application_id, commerce_indicator, processing_instruction].hash
|
|
109
178
|
end
|
|
110
179
|
|
|
111
180
|
# Builds the object from hash
|
|
@@ -31,6 +31,12 @@ module CyberSource
|
|
|
31
31
|
# The account type of the recipient
|
|
32
32
|
attr_accessor :account_type
|
|
33
33
|
|
|
34
|
+
# The date of birth of the recipient
|
|
35
|
+
attr_accessor :date_of_birth
|
|
36
|
+
|
|
37
|
+
# The postal code of the recipient
|
|
38
|
+
attr_accessor :postal_code
|
|
39
|
+
|
|
34
40
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
35
41
|
def self.attribute_map
|
|
36
42
|
{
|
|
@@ -40,7 +46,9 @@ module CyberSource
|
|
|
40
46
|
:'country' => :'country',
|
|
41
47
|
:'account_id' => :'accountId',
|
|
42
48
|
:'administrative_area' => :'administrativeArea',
|
|
43
|
-
:'account_type' => :'accountType'
|
|
49
|
+
:'account_type' => :'accountType',
|
|
50
|
+
:'date_of_birth' => :'dateOfBirth',
|
|
51
|
+
:'postal_code' => :'postalCode'
|
|
44
52
|
}
|
|
45
53
|
end
|
|
46
54
|
|
|
@@ -53,7 +61,9 @@ module CyberSource
|
|
|
53
61
|
:'country' => :'country',
|
|
54
62
|
:'account_id' => :'account_id',
|
|
55
63
|
:'administrative_area' => :'administrative_area',
|
|
56
|
-
:'account_type' => :'account_type'
|
|
64
|
+
:'account_type' => :'account_type',
|
|
65
|
+
:'date_of_birth' => :'date_of_birth',
|
|
66
|
+
:'postal_code' => :'postal_code'
|
|
57
67
|
}
|
|
58
68
|
end
|
|
59
69
|
|
|
@@ -66,7 +76,9 @@ module CyberSource
|
|
|
66
76
|
:'country' => :'String',
|
|
67
77
|
:'account_id' => :'String',
|
|
68
78
|
:'administrative_area' => :'String',
|
|
69
|
-
:'account_type' => :'String'
|
|
79
|
+
:'account_type' => :'String',
|
|
80
|
+
:'date_of_birth' => :'String',
|
|
81
|
+
:'postal_code' => :'String'
|
|
70
82
|
}
|
|
71
83
|
end
|
|
72
84
|
|
|
@@ -105,6 +117,14 @@ module CyberSource
|
|
|
105
117
|
if attributes.has_key?(:'accountType')
|
|
106
118
|
self.account_type = attributes[:'accountType']
|
|
107
119
|
end
|
|
120
|
+
|
|
121
|
+
if attributes.has_key?(:'dateOfBirth')
|
|
122
|
+
self.date_of_birth = attributes[:'dateOfBirth']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.has_key?(:'postalCode')
|
|
126
|
+
self.postal_code = attributes[:'postalCode']
|
|
127
|
+
end
|
|
108
128
|
end
|
|
109
129
|
|
|
110
130
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -162,6 +182,18 @@ module CyberSource
|
|
|
162
182
|
@account_type = account_type
|
|
163
183
|
end
|
|
164
184
|
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] date_of_birth Value to be assigned
|
|
187
|
+
def date_of_birth=(date_of_birth)
|
|
188
|
+
@date_of_birth = date_of_birth
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] postal_code Value to be assigned
|
|
193
|
+
def postal_code=(postal_code)
|
|
194
|
+
@postal_code = postal_code
|
|
195
|
+
end
|
|
196
|
+
|
|
165
197
|
# Checks equality by comparing each attribute.
|
|
166
198
|
# @param [Object] Object to be compared
|
|
167
199
|
def ==(o)
|
|
@@ -173,7 +205,9 @@ module CyberSource
|
|
|
173
205
|
country == o.country &&
|
|
174
206
|
account_id == o.account_id &&
|
|
175
207
|
administrative_area == o.administrative_area &&
|
|
176
|
-
account_type == o.account_type
|
|
208
|
+
account_type == o.account_type &&
|
|
209
|
+
date_of_birth == o.date_of_birth &&
|
|
210
|
+
postal_code == o.postal_code
|
|
177
211
|
end
|
|
178
212
|
|
|
179
213
|
# @see the `==` method
|
|
@@ -185,7 +219,7 @@ module CyberSource
|
|
|
185
219
|
# Calculates hash code according to all attributes.
|
|
186
220
|
# @return [Fixnum] Hash code
|
|
187
221
|
def hash
|
|
188
|
-
[first_name, middle_name, last_name, country, account_id, administrative_area, account_type].hash
|
|
222
|
+
[first_name, middle_name, last_name, country, account_id, administrative_area, account_type, date_of_birth, postal_code].hash
|
|
189
223
|
end
|
|
190
224
|
|
|
191
225
|
# Builds the object from hash
|
|
@@ -12,6 +12,7 @@ Swagger Codegen version: 2.4.38
|
|
|
12
12
|
require 'date'
|
|
13
13
|
|
|
14
14
|
module CyberSource
|
|
15
|
+
# If you need to include any fields within the data object, you must use the orderInformation object that is nested inside the data object. This ensures proper structure and compliance with the Unified Checkout schema. This top-level orderInformation field is not intended for use when working with the data object.
|
|
15
16
|
class Upv1capturecontextsOrderInformation
|
|
16
17
|
attr_accessor :amount_details
|
|
17
18
|
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
require_relative '../../../AuthenticationSDK/util/JWT/JWTUtility'
|
|
2
|
+
require_relative '../../../AuthenticationSDK/util/JWT/JWTExceptions'
|
|
3
|
+
require_relative '../../../AuthenticationSDK/util/Cache'
|
|
4
|
+
require_relative 'public_key_fetcher'
|
|
5
|
+
|
|
6
|
+
module CyberSource
|
|
7
|
+
module Utilities
|
|
8
|
+
module CaptureContext
|
|
9
|
+
# CaptureContextParser Class
|
|
10
|
+
#
|
|
11
|
+
# Parses and validates capture context JWT responses from CyberSource.
|
|
12
|
+
# Provides functionality to parse JWT tokens and optionally verify their
|
|
13
|
+
# signatures using public keys fetched from the CyberSource API.
|
|
14
|
+
#
|
|
15
|
+
# @category Class
|
|
16
|
+
# @package CyberSource::Authentication::Util::CaptureContext
|
|
17
|
+
# @author CyberSource
|
|
18
|
+
class CaptureContextParser
|
|
19
|
+
class << self
|
|
20
|
+
# Parses a capture context JWT response and optionally verifies its signature
|
|
21
|
+
#
|
|
22
|
+
# @param jwt_value [String] The JWT token to parse
|
|
23
|
+
# @param merchant_config [Object] The merchant configuration object
|
|
24
|
+
# @return [Hash] The parsed JWT payload
|
|
25
|
+
# @raise [CyberSource::Authentication::Util::JWT::InvalidJwtException] If JWT is invalid
|
|
26
|
+
# @raise [CyberSource::Authentication::Util::JWT::JwtSignatureValidationException] If signature verification fails
|
|
27
|
+
# @raise [ArgumentError] If required parameters are missing
|
|
28
|
+
# @raise [StandardError] For other errors during processing
|
|
29
|
+
#
|
|
30
|
+
# @example Parse with verification
|
|
31
|
+
# payload = CaptureContextParser.parse_capture_context_response(jwt_token, config)
|
|
32
|
+
def parse_capture_context_response(jwt_value, merchant_config)
|
|
33
|
+
verify_jwt = true
|
|
34
|
+
# Always validate JWT value first
|
|
35
|
+
if jwt_value.nil? || jwt_value.strip.empty?
|
|
36
|
+
raise CyberSource::Authentication::Util::JWT::InvalidJwtException.new('JWT value is null or undefined')
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Validate verification requirements before parsing
|
|
40
|
+
if verify_jwt
|
|
41
|
+
raise ArgumentError, 'merchantConfig is required' unless merchant_config
|
|
42
|
+
|
|
43
|
+
run_environment = merchant_config.runEnvironment
|
|
44
|
+
raise ArgumentError, 'Run environment not found in merchant config' if run_environment.nil? || run_environment.strip.empty?
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Parse JWT (actual operation)
|
|
48
|
+
parsed_jwt = CyberSource::Authentication::Util::JWT::JWTUtility.parse(jwt_value)
|
|
49
|
+
|
|
50
|
+
# Return early if no verification needed
|
|
51
|
+
return parsed_jwt[:payload] unless verify_jwt
|
|
52
|
+
|
|
53
|
+
# Validate kid exists in parsed JWT
|
|
54
|
+
kid = parsed_jwt[:header]['kid']
|
|
55
|
+
if kid.nil? || kid.strip.empty?
|
|
56
|
+
raise CyberSource::Authentication::Util::JWT::JwtSignatureValidationException.new(
|
|
57
|
+
'JWT header missing or empty key ID (kid) field'
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Verify signature (actual operation)
|
|
62
|
+
verify_jwt_signature(jwt_value, parsed_jwt[:payload], kid, run_environment)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
|
|
67
|
+
def verify_jwt_signature(jwt_value, payload, kid, run_environment)
|
|
68
|
+
public_key = get_public_key(kid, run_environment)
|
|
69
|
+
|
|
70
|
+
begin
|
|
71
|
+
CyberSource::Authentication::Util::JWT::JWTUtility.verify_jwt(jwt_value, public_key)
|
|
72
|
+
payload
|
|
73
|
+
rescue CyberSource::Authentication::Util::JWT::JwtSignatureValidationException => e
|
|
74
|
+
# If verification failed with cached key, try once more with fresh key from API
|
|
75
|
+
public_key = fetch_public_key_from_api(kid, run_environment)
|
|
76
|
+
cache = Cache.new
|
|
77
|
+
cache.addPublicKeyToCache(run_environment, kid, public_key) rescue nil
|
|
78
|
+
|
|
79
|
+
CyberSource::Authentication::Util::JWT::JWTUtility.verify_jwt(jwt_value, public_key)
|
|
80
|
+
payload
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def get_public_key(kid, run_environment)
|
|
85
|
+
cache = Cache.new
|
|
86
|
+
cached_key = cache.getPublicKeyFromCache(run_environment, kid) rescue nil
|
|
87
|
+
return cached_key if cached_key
|
|
88
|
+
|
|
89
|
+
public_key = fetch_public_key_from_api(kid, run_environment)
|
|
90
|
+
|
|
91
|
+
cache.addPublicKeyToCache(run_environment, kid, public_key) rescue nil
|
|
92
|
+
|
|
93
|
+
public_key
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def fetch_public_key_from_api(kid, run_environment)
|
|
97
|
+
PublicKeyFetcher.fetch_public_key(kid, run_environment)
|
|
98
|
+
rescue ArgumentError => e
|
|
99
|
+
if e.message.include?('Invalid Runtime URL') || e.message.include?('run_environment')
|
|
100
|
+
raise ArgumentError.new('Invalid Runtime URL in Merchant Config', e)
|
|
101
|
+
else
|
|
102
|
+
raise
|
|
103
|
+
end
|
|
104
|
+
rescue CyberSource::Authentication::Util::JWT::InvalidJwkException
|
|
105
|
+
raise
|
|
106
|
+
rescue StandardError => e
|
|
107
|
+
raise StandardError.new('Error while trying to retrieve public key from server', e)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|