diff --git a/CyberSource/__init__.py b/CyberSource/__init__.py index da656a00..ee2c973d 100644 --- a/CyberSource/__init__.py +++ b/CyberSource/__init__.py @@ -310,9 +310,14 @@ from .models.kmsegressv2keyssym_client_reference_information import Kmsegressv2keyssymClientReferenceInformation from .models.kmsegressv2keyssym_key_information import Kmsegressv2keyssymKeyInformation from .models.merchant_initiated_transaction_object import MerchantInitiatedTransactionObject +from .models.microformv2sessions_transient_token_response_options import Microformv2sessionsTransientTokenResponseOptions from .models.mit_reversal_request import MitReversalRequest from .models.mit_void_request import MitVoidRequest from .models.modify_billing_agreement import ModifyBillingAgreement +from .models.network_token_enrollment import NetworkTokenEnrollment +from .models.network_token_services_enablement import NetworkTokenServicesEnablement +from .models.network_token_services_enablement_mastercard_digital_enablement_service import NetworkTokenServicesEnablementMastercardDigitalEnablementService +from .models.network_token_services_enablement_visa_token_service import NetworkTokenServicesEnablementVisaTokenService from .models.notificationsubscriptionsv1productsorganization_id_event_types import Notificationsubscriptionsv1productsorganizationIdEventTypes from .models.notificationsubscriptionsv1webhooks_notification_scope import Notificationsubscriptionsv1webhooksNotificationScope from .models.notificationsubscriptionsv1webhooks_products import Notificationsubscriptionsv1webhooksProducts @@ -1148,6 +1153,9 @@ from .models.tms_bin_lookup_payment_account_information_card_brands import TmsBinLookupPaymentAccountInformationCardBrands from .models.tms_bin_lookup_payment_account_information_features import TmsBinLookupPaymentAccountInformationFeatures from .models.tms_bin_lookup_payment_account_information_network import TmsBinLookupPaymentAccountInformationNetwork +from .models.tms_business_information import TmsBusinessInformation +from .models.tms_business_information_acquirer import TmsBusinessInformationAcquirer +from .models.tms_business_information_address import TmsBusinessInformationAddress from .models.tms_card_art import TmsCardArt from .models.tms_card_art_brand_logo_asset import TmsCardArtBrandLogoAsset from .models.tms_card_art_brand_logo_asset_links import TmsCardArtBrandLogoAssetLinks diff --git a/CyberSource/api/batches_api.py b/CyberSource/api/batches_api.py index f1c88c95..cbeb1e65 100644 --- a/CyberSource/api/batches_api.py +++ b/CyberSource/api/batches_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class BatchesApi(object): @@ -133,6 +136,14 @@ def get_batch_report_with_http_info(self, batch_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_batch_report,get_batch_report_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -246,6 +257,14 @@ def get_batch_status_with_http_info(self, batch_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_batch_status,get_batch_status_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -365,6 +384,14 @@ def get_batches_list_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_batches_list,get_batches_list_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -478,6 +505,14 @@ def post_batch_with_http_info(self, body, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'body', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_batch,post_batch_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/billing_agreements_api.py b/CyberSource/api/billing_agreements_api.py index 6c09fa55..d05fdab7 100644 --- a/CyberSource/api/billing_agreements_api.py +++ b/CyberSource/api/billing_agreements_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class BillingAgreementsApi(object): @@ -143,6 +146,14 @@ def billing_agreements_de_registration_with_http_info(self, modify_billing_agree sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'modify_billing_agreement', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "billing_agreements_de_registration,billing_agreements_de_registration_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -266,6 +277,14 @@ def billing_agreements_intimation_with_http_info(self, intimate_billing_agreemen sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'intimate_billing_agreement', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "billing_agreements_intimation,billing_agreements_intimation_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -379,6 +398,14 @@ def billing_agreements_registration_with_http_info(self, create_billing_agreemen sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_billing_agreement', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "billing_agreements_registration,billing_agreements_registration_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/bin_lookup_api.py b/CyberSource/api/bin_lookup_api.py index 4411742e..020bc768 100644 --- a/CyberSource/api/bin_lookup_api.py +++ b/CyberSource/api/bin_lookup_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class BinLookupApi(object): @@ -136,6 +139,14 @@ def get_account_info_with_http_info(self, create_bin_lookup_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_bin_lookup_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_account_info,get_account_info_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/capture_api.py b/CyberSource/api/capture_api.py index 50915892..85b0d317 100644 --- a/CyberSource/api/capture_api.py +++ b/CyberSource/api/capture_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class CaptureApi(object): @@ -143,6 +146,14 @@ def capture_payment_with_http_info(self, capture_payment_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'capture_payment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "capture_payment,capture_payment_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/chargeback_details_api.py b/CyberSource/api/chargeback_details_api.py index 4c6a2ab2..d800277b 100644 --- a/CyberSource/api/chargeback_details_api.py +++ b/CyberSource/api/chargeback_details_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ChargebackDetailsApi(object): @@ -145,6 +148,14 @@ def get_chargeback_details_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_chargeback_details,get_chargeback_details_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) diff --git a/CyberSource/api/chargeback_summaries_api.py b/CyberSource/api/chargeback_summaries_api.py index d0cd8bcb..0c4c1b8e 100644 --- a/CyberSource/api/chargeback_summaries_api.py +++ b/CyberSource/api/chargeback_summaries_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ChargebackSummariesApi(object): @@ -145,6 +148,14 @@ def get_chargeback_summaries_with_http_info(self, start_time, end_time, **kwargs body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_chargeback_summaries,get_chargeback_summaries_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) diff --git a/CyberSource/api/conversion_details_api.py b/CyberSource/api/conversion_details_api.py index 1c2a6b9c..8ccfb69d 100644 --- a/CyberSource/api/conversion_details_api.py +++ b/CyberSource/api/conversion_details_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ConversionDetailsApi(object): @@ -145,6 +148,14 @@ def get_conversion_detail_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_conversion_detail,get_conversion_detail_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) diff --git a/CyberSource/api/create_new_webhooks_api.py b/CyberSource/api/create_new_webhooks_api.py index c985b944..1bfe8506 100644 --- a/CyberSource/api/create_new_webhooks_api.py +++ b/CyberSource/api/create_new_webhooks_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class CreateNewWebhooksApi(object): @@ -131,6 +134,14 @@ def create_webhook_subscription_with_http_info(self, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_webhook_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_webhook_subscription,create_webhook_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -247,6 +258,14 @@ def find_products_to_subscribe_with_http_info(self, organization_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "find_products_to_subscribe,find_products_to_subscribe_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -380,6 +399,14 @@ def save_sym_egress_key_with_http_info(self, v_c_sender_organization_id, v_c_per sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'save_sym_egress_key', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "save_sym_egress_key,save_sym_egress_key_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/credit_api.py b/CyberSource/api/credit_api.py index 9fbcebff..0760c3ce 100644 --- a/CyberSource/api/credit_api.py +++ b/CyberSource/api/credit_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class CreditApi(object): @@ -133,6 +136,14 @@ def create_credit_with_http_info(self, create_credit_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_credit_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_credit,create_credit_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/customer_api.py b/CyberSource/api/customer_api.py index 004e410b..981daa2f 100644 --- a/CyberSource/api/customer_api.py +++ b/CyberSource/api/customer_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class CustomerApi(object): @@ -137,6 +140,14 @@ def delete_customer_with_http_info(self, customer_id, **kwargs): body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_customer,delete_customer_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -254,6 +265,14 @@ def get_customer_with_http_info(self, customer_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_customer,get_customer_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -385,6 +404,14 @@ def patch_customer_with_http_info(self, customer_id, patch_customer_request, **k sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'patch_customer_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "patch_customer,patch_customer_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -502,6 +529,14 @@ def post_customer_with_http_info(self, post_customer_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_customer_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_customer,post_customer_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/customer_payment_instrument_api.py b/CyberSource/api/customer_payment_instrument_api.py index 419ecae4..59941161 100644 --- a/CyberSource/api/customer_payment_instrument_api.py +++ b/CyberSource/api/customer_payment_instrument_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class CustomerPaymentInstrumentApi(object): @@ -147,6 +150,14 @@ def delete_customer_payment_instrument_with_http_info(self, customer_id, payment body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_customer_payment_instrument,delete_customer_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -274,6 +285,14 @@ def get_customer_payment_instrument_with_http_info(self, customer_id, payment_in body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_customer_payment_instrument,get_customer_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -399,6 +418,14 @@ def get_customer_payment_instruments_list_with_http_info(self, customer_id, **kw body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_customer_payment_instruments_list,get_customer_payment_instruments_list_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -540,6 +567,14 @@ def patch_customers_payment_instrument_with_http_info(self, customer_id, payment sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'patch_customer_payment_instrument_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "patch_customers_payment_instrument,patch_customers_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -667,6 +702,14 @@ def post_customer_payment_instrument_with_http_info(self, customer_id, post_cust sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_customer_payment_instrument_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_customer_payment_instrument,post_customer_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/customer_shipping_address_api.py b/CyberSource/api/customer_shipping_address_api.py index 3de863c1..443d9d1b 100644 --- a/CyberSource/api/customer_shipping_address_api.py +++ b/CyberSource/api/customer_shipping_address_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class CustomerShippingAddressApi(object): @@ -147,6 +150,14 @@ def delete_customer_shipping_address_with_http_info(self, customer_id, shipping_ body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_customer_shipping_address,delete_customer_shipping_address_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -274,6 +285,14 @@ def get_customer_shipping_address_with_http_info(self, customer_id, shipping_add body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_customer_shipping_address,get_customer_shipping_address_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -399,6 +418,14 @@ def get_customer_shipping_addresses_list_with_http_info(self, customer_id, **kwa body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_customer_shipping_addresses_list,get_customer_shipping_addresses_list_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -540,6 +567,14 @@ def patch_customers_shipping_address_with_http_info(self, customer_id, shipping_ sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'patch_customer_shipping_address_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "patch_customers_shipping_address,patch_customers_shipping_address_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -667,6 +702,14 @@ def post_customer_shipping_address_with_http_info(self, customer_id, post_custom sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_customer_shipping_address_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_customer_shipping_address,post_customer_shipping_address_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/decision_manager_api.py b/CyberSource/api/decision_manager_api.py index b5264cd6..b3c86214 100644 --- a/CyberSource/api/decision_manager_api.py +++ b/CyberSource/api/decision_manager_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class DecisionManagerApi(object): @@ -143,6 +146,14 @@ def action_decision_manager_case_with_http_info(self, id, case_management_action sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'case_management_actions_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "action_decision_manager_case,action_decision_manager_case_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json']) @@ -266,6 +277,14 @@ def add_negative_with_http_info(self, type, add_negative_list_request, **kwargs) sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'add_negative_list_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "add_negative,add_negative_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -389,6 +408,14 @@ def comment_decision_manager_case_with_http_info(self, id, case_management_comme sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'case_management_comments_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "comment_decision_manager_case,comment_decision_manager_case_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json']) @@ -502,6 +529,14 @@ def create_bundled_decision_manager_case_with_http_info(self, create_bundled_dec sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_bundled_decision_manager_case_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_bundled_decision_manager_case,create_bundled_decision_manager_case_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -625,6 +660,14 @@ def fraud_update_with_http_info(self, id, fraud_marking_action_request, **kwargs sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'fraud_marking_action_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "fraud_update,fraud_update_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/download_dtd_api.py b/CyberSource/api/download_dtd_api.py index 55fad3cd..094f0e8f 100644 --- a/CyberSource/api/download_dtd_api.py +++ b/CyberSource/api/download_dtd_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class DownloadDTDApi(object): @@ -133,6 +136,14 @@ def get_dtdv2_with_http_info(self, report_definition_name_version, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_dtdv2,get_dtdv2_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/xml-dtd']) diff --git a/CyberSource/api/download_xsd_api.py b/CyberSource/api/download_xsd_api.py index 513922c1..7f05d3d6 100644 --- a/CyberSource/api/download_xsd_api.py +++ b/CyberSource/api/download_xsd_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class DownloadXSDApi(object): @@ -133,6 +136,14 @@ def get_xsdv2_with_http_info(self, report_definition_name_version, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_xsdv2,get_xsdv2_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['text/xml']) diff --git a/CyberSource/api/emv_tag_details_api.py b/CyberSource/api/emv_tag_details_api.py index a96c4de9..c4eff6d9 100644 --- a/CyberSource/api/emv_tag_details_api.py +++ b/CyberSource/api/emv_tag_details_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class EMVTagDetailsApi(object): @@ -122,6 +125,14 @@ def get_emv_tags_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_emv_tags,get_emv_tags_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -235,6 +246,14 @@ def parse_emv_tags_with_http_info(self, body, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'body', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "parse_emv_tags,parse_emv_tags_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/flex_api_api.py b/CyberSource/api/flex_api_api.py index 3086ca7a..2e1b8bdb 100644 --- a/CyberSource/api/flex_api_api.py +++ b/CyberSource/api/flex_api_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class FlexAPIApi(object): @@ -133,6 +136,14 @@ def generate_flex_api_capture_context_with_http_info(self, generate_flex_api_cap sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'generate_flex_api_capture_context_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "generate_flex_api_capture_context,generate_flex_api_capture_context_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/jwt']) diff --git a/CyberSource/api/instrument_identifier_api.py b/CyberSource/api/instrument_identifier_api.py index 9b0aa01d..40a3656c 100644 --- a/CyberSource/api/instrument_identifier_api.py +++ b/CyberSource/api/instrument_identifier_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class InstrumentIdentifierApi(object): @@ -137,6 +140,14 @@ def delete_instrument_identifier_with_http_info(self, instrument_identifier_id, body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_instrument_identifier,delete_instrument_identifier_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -258,6 +269,14 @@ def get_instrument_identifier_with_http_info(self, instrument_identifier_id, **k body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_instrument_identifier,get_instrument_identifier_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -387,6 +406,14 @@ def get_instrument_identifier_payment_instruments_list_with_http_info(self, inst body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_instrument_identifier_payment_instruments_list,get_instrument_identifier_payment_instruments_list_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -522,6 +549,14 @@ def patch_instrument_identifier_with_http_info(self, instrument_identifier_id, p sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'patch_instrument_identifier_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "patch_instrument_identifier,patch_instrument_identifier_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -643,6 +678,14 @@ def post_instrument_identifier_with_http_info(self, post_instrument_identifier_r sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_instrument_identifier_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_instrument_identifier,post_instrument_identifier_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -770,6 +813,14 @@ def post_instrument_identifier_enrollment_with_http_info(self, instrument_identi sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_instrument_identifier_enrollment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_instrument_identifier_enrollment,post_instrument_identifier_enrollment_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/interchange_clearing_level_details_api.py b/CyberSource/api/interchange_clearing_level_details_api.py index d2119800..239e93ad 100644 --- a/CyberSource/api/interchange_clearing_level_details_api.py +++ b/CyberSource/api/interchange_clearing_level_details_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class InterchangeClearingLevelDetailsApi(object): @@ -145,6 +148,14 @@ def get_interchange_clearing_level_details_with_http_info(self, start_time, end_ body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_interchange_clearing_level_details,get_interchange_clearing_level_details_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) diff --git a/CyberSource/api/invoice_settings_api.py b/CyberSource/api/invoice_settings_api.py index cb06e1b6..8d689075 100644 --- a/CyberSource/api/invoice_settings_api.py +++ b/CyberSource/api/invoice_settings_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class InvoiceSettingsApi(object): @@ -122,6 +125,14 @@ def get_invoice_settings_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_invoice_settings,get_invoice_settings_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -235,6 +246,14 @@ def update_invoice_settings_with_http_info(self, invoice_settings_request, **kwa sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'invoice_settings_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PUT' == GlobalLabelParameters.POST or 'PUT' == GlobalLabelParameters.PUT or 'PUT' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "update_invoice_settings,update_invoice_settings_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/invoices_api.py b/CyberSource/api/invoices_api.py index df752ff9..96576be4 100644 --- a/CyberSource/api/invoices_api.py +++ b/CyberSource/api/invoices_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class InvoicesApi(object): @@ -133,6 +136,14 @@ def create_invoice_with_http_info(self, create_invoice_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_invoice_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_invoice,create_invoice_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -258,6 +269,14 @@ def get_all_invoices_with_http_info(self, offset, limit, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_all_invoices,get_all_invoices_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -371,6 +390,14 @@ def get_invoice_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_invoice,get_invoice_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -484,6 +511,14 @@ def perform_cancel_action_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): body_params = '{}' + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "perform_cancel_action,perform_cancel_action_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -597,6 +632,14 @@ def perform_send_action_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): body_params = '{}' + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "perform_send_action,perform_send_action_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -720,6 +763,14 @@ def update_invoice_with_http_info(self, id, update_invoice_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'update_invoice_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PUT' == GlobalLabelParameters.POST or 'PUT' == GlobalLabelParameters.PUT or 'PUT' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "update_invoice,update_invoice_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/manage_webhooks_api.py b/CyberSource/api/manage_webhooks_api.py index 74d1bba3..5c93c0f7 100644 --- a/CyberSource/api/manage_webhooks_api.py +++ b/CyberSource/api/manage_webhooks_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ManageWebhooksApi(object): @@ -136,6 +139,14 @@ def delete_webhook_subscription_with_http_info(self, webhook_id, **kwargs): body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_webhook_subscription,delete_webhook_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -252,6 +263,14 @@ def get_webhook_subscription_by_id_with_http_info(self, webhook_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_webhook_subscription_by_id,get_webhook_subscription_by_id_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -385,6 +404,14 @@ def get_webhook_subscriptions_by_org_with_http_info(self, organization_id, produ body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_webhook_subscriptions_by_org,get_webhook_subscriptions_by_org_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -523,6 +550,14 @@ def save_asym_egress_key_with_http_info(self, v_c_sender_organization_id, v_c_pe sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'save_asym_egress_key', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "save_asym_egress_key,save_asym_egress_key_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -644,6 +679,14 @@ def update_webhook_subscription_with_http_info(self, webhook_id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'update_webhook_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "update_webhook_subscription,update_webhook_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/merchant_boarding_api.py b/CyberSource/api/merchant_boarding_api.py index 30a871e6..5c514ee5 100644 --- a/CyberSource/api/merchant_boarding_api.py +++ b/CyberSource/api/merchant_boarding_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class MerchantBoardingApi(object): @@ -133,6 +136,14 @@ def get_registration_with_http_info(self, registration_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_registration,get_registration_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json']) @@ -250,6 +261,14 @@ def post_registration_with_http_info(self, post_registration_body, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_registration_body', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_registration,post_registration_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json']) diff --git a/CyberSource/api/microform_integration_api.py b/CyberSource/api/microform_integration_api.py index c2d9f1d9..421777d3 100644 --- a/CyberSource/api/microform_integration_api.py +++ b/CyberSource/api/microform_integration_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class MicroformIntegrationApi(object): @@ -133,6 +136,14 @@ def generate_capture_context_with_http_info(self, generate_capture_context_reque sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'generate_capture_context_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "generate_capture_context,generate_capture_context_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/jwt']) diff --git a/CyberSource/api/net_fundings_api.py b/CyberSource/api/net_fundings_api.py index c4174bab..db7881bb 100644 --- a/CyberSource/api/net_fundings_api.py +++ b/CyberSource/api/net_fundings_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class NetFundingsApi(object): @@ -149,6 +152,14 @@ def get_net_funding_details_with_http_info(self, start_time, end_time, **kwargs) body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_net_funding_details,get_net_funding_details_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) diff --git a/CyberSource/api/notification_of_changes_api.py b/CyberSource/api/notification_of_changes_api.py index c6916e36..81fd84a8 100644 --- a/CyberSource/api/notification_of_changes_api.py +++ b/CyberSource/api/notification_of_changes_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class NotificationOfChangesApi(object): @@ -141,6 +144,14 @@ def get_notification_of_change_report_with_http_info(self, start_time, end_time, body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_notification_of_change_report,get_notification_of_change_report_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'text/csv', 'application/xml']) diff --git a/CyberSource/api/orders_api.py b/CyberSource/api/orders_api.py index d633c71b..112bc63d 100644 --- a/CyberSource/api/orders_api.py +++ b/CyberSource/api/orders_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class OrdersApi(object): @@ -133,6 +136,14 @@ def create_order_with_http_info(self, create_order_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_order_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_order,create_order_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -256,6 +267,14 @@ def update_order_with_http_info(self, id, update_order_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'update_order_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "update_order,update_order_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/payer_authentication_api.py b/CyberSource/api/payer_authentication_api.py index 331bac84..fce491fe 100644 --- a/CyberSource/api/payer_authentication_api.py +++ b/CyberSource/api/payer_authentication_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PayerAuthenticationApi(object): @@ -133,6 +136,14 @@ def check_payer_auth_enrollment_with_http_info(self, check_payer_auth_enrollment sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'check_payer_auth_enrollment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "check_payer_auth_enrollment,check_payer_auth_enrollment_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -246,6 +257,14 @@ def payer_auth_setup_with_http_info(self, payer_auth_setup_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'payer_auth_setup_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "payer_auth_setup,payer_auth_setup_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -359,6 +378,14 @@ def validate_authentication_results_with_http_info(self, validate_request, **kwa sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'validate_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "validate_authentication_results,validate_authentication_results_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/payment_batch_summaries_api.py b/CyberSource/api/payment_batch_summaries_api.py index 60ed561c..9ccec274 100644 --- a/CyberSource/api/payment_batch_summaries_api.py +++ b/CyberSource/api/payment_batch_summaries_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PaymentBatchSummariesApi(object): @@ -157,6 +160,14 @@ def get_payment_batch_summary_with_http_info(self, start_time, end_time, **kwarg body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_payment_batch_summary,get_payment_batch_summary_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'text/csv', 'application/xml']) diff --git a/CyberSource/api/payment_instrument_api.py b/CyberSource/api/payment_instrument_api.py index 0aa59c57..1b286f3c 100644 --- a/CyberSource/api/payment_instrument_api.py +++ b/CyberSource/api/payment_instrument_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PaymentInstrumentApi(object): @@ -137,6 +140,14 @@ def delete_payment_instrument_with_http_info(self, payment_instrument_id, **kwar body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_payment_instrument,delete_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -258,6 +269,14 @@ def get_payment_instrument_with_http_info(self, payment_instrument_id, **kwargs) body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_payment_instrument,get_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -393,6 +412,14 @@ def patch_payment_instrument_with_http_info(self, payment_instrument_id, patch_p sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'patch_payment_instrument_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "patch_payment_instrument,patch_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -514,6 +541,14 @@ def post_payment_instrument_with_http_info(self, post_payment_instrument_request sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_payment_instrument_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_payment_instrument,post_payment_instrument_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/payments_api.py b/CyberSource/api/payments_api.py index 3de95df9..b421022b 100644 --- a/CyberSource/api/payments_api.py +++ b/CyberSource/api/payments_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PaymentsApi(object): @@ -143,6 +146,14 @@ def create_order_request_with_http_info(self, order_payment_request, id, **kwarg sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'order_payment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_order_request,create_order_request_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -256,6 +267,14 @@ def create_payment_with_http_info(self, create_payment_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_payment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_payment,create_payment_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -369,6 +388,14 @@ def create_session_request_with_http_info(self, create_session_req, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_session_req', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_session_request,create_session_request_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -492,6 +519,14 @@ def increment_auth_with_http_info(self, id, increment_auth_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'increment_auth_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "increment_auth,increment_auth_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -615,6 +650,14 @@ def refresh_payment_status_with_http_info(self, id, refresh_payment_status_reque sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'refresh_payment_status_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "refresh_payment_status,refresh_payment_status_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -738,6 +781,14 @@ def update_session_req_with_http_info(self, create_session_request, id, **kwargs sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_session_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "update_session_req,update_session_req_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/payouts_api.py b/CyberSource/api/payouts_api.py index c5efcbdb..b5afc074 100644 --- a/CyberSource/api/payouts_api.py +++ b/CyberSource/api/payouts_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PayoutsApi(object): @@ -133,6 +136,14 @@ def oct_create_payment_with_http_info(self, oct_create_payment_request, **kwargs sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'oct_create_payment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "oct_create_payment,oct_create_payment_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/plans_api.py b/CyberSource/api/plans_api.py index f04f4dcf..890c8430 100644 --- a/CyberSource/api/plans_api.py +++ b/CyberSource/api/plans_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PlansApi(object): @@ -133,6 +136,14 @@ def activate_plan_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): body_params = '{}' + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "activate_plan,activate_plan_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -246,6 +257,14 @@ def create_plan_with_http_info(self, create_plan_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_plan_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_plan,create_plan_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -359,6 +378,14 @@ def deactivate_plan_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): body_params = '{}' + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "deactivate_plan,deactivate_plan_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -472,6 +499,14 @@ def delete_plan_with_http_info(self, id, **kwargs): body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_plan,delete_plan_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -585,6 +620,14 @@ def get_plan_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_plan,get_plan_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -687,6 +730,14 @@ def get_plan_code_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_plan_code,get_plan_code_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -810,6 +861,14 @@ def get_plans_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_plans,get_plans_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -933,6 +992,14 @@ def update_plan_with_http_info(self, id, update_plan_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'update_plan_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "update_plan,update_plan_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/purchase_and_refund_details_api.py b/CyberSource/api/purchase_and_refund_details_api.py index 295813dd..458a7aa3 100644 --- a/CyberSource/api/purchase_and_refund_details_api.py +++ b/CyberSource/api/purchase_and_refund_details_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PurchaseAndRefundDetailsApi(object): @@ -165,6 +168,14 @@ def get_purchase_and_refund_details_with_http_info(self, start_time, end_time, * body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_purchase_and_refund_details,get_purchase_and_refund_details_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml', 'text/csv']) diff --git a/CyberSource/api/push_funds_api.py b/CyberSource/api/push_funds_api.py index dc1bc64e..a4283a1e 100644 --- a/CyberSource/api/push_funds_api.py +++ b/CyberSource/api/push_funds_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class PushFundsApi(object): @@ -187,6 +190,14 @@ def create_push_funds_transfer_with_http_info(self, push_funds_request, content_ sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'push_funds_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_push_funds_transfer,create_push_funds_transfer_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/refund_api.py b/CyberSource/api/refund_api.py index e06c40a2..30a28be4 100644 --- a/CyberSource/api/refund_api.py +++ b/CyberSource/api/refund_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class RefundApi(object): @@ -143,6 +146,14 @@ def refund_capture_with_http_info(self, refund_capture_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'refund_capture_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "refund_capture,refund_capture_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -266,6 +277,14 @@ def refund_payment_with_http_info(self, refund_payment_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'refund_payment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "refund_payment,refund_payment_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/replay_webhooks_api.py b/CyberSource/api/replay_webhooks_api.py index 3f499611..57cd8630 100644 --- a/CyberSource/api/replay_webhooks_api.py +++ b/CyberSource/api/replay_webhooks_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ReplayWebhooksApi(object): @@ -141,6 +144,14 @@ def replay_previous_webhooks_with_http_info(self, webhook_id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'replay_webhooks_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "replay_previous_webhooks,replay_previous_webhooks_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) diff --git a/CyberSource/api/report_definitions_api.py b/CyberSource/api/report_definitions_api.py index aeebc41c..fff617e2 100644 --- a/CyberSource/api/report_definitions_api.py +++ b/CyberSource/api/report_definitions_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ReportDefinitionsApi(object): @@ -145,6 +148,14 @@ def get_resource_info_by_report_definition_with_http_info(self, report_definitio body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_resource_info_by_report_definition,get_resource_info_by_report_definition_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) @@ -256,6 +267,14 @@ def get_resource_v2_info_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_resource_v2_info,get_resource_v2_info_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) diff --git a/CyberSource/api/report_downloads_api.py b/CyberSource/api/report_downloads_api.py index 48e7700a..2852d2c0 100644 --- a/CyberSource/api/report_downloads_api.py +++ b/CyberSource/api/report_downloads_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ReportDownloadsApi(object): @@ -145,6 +148,14 @@ def download_report_with_http_info(self, report_date, report_name, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "download_report,download_report_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/xml', 'text/csv']) diff --git a/CyberSource/api/report_subscriptions_api.py b/CyberSource/api/report_subscriptions_api.py index 4800da38..5ba94d37 100644 --- a/CyberSource/api/report_subscriptions_api.py +++ b/CyberSource/api/report_subscriptions_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ReportSubscriptionsApi(object): @@ -137,6 +140,14 @@ def create_standard_or_classic_subscription_with_http_info(self, predefined_subs sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'predefined_subscription_request_bean', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PUT' == GlobalLabelParameters.POST or 'PUT' == GlobalLabelParameters.PUT or 'PUT' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_standard_or_classic_subscription,create_standard_or_classic_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) @@ -254,6 +265,14 @@ def create_subscription_with_http_info(self, create_report_subscription_request, sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_report_subscription_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PUT' == GlobalLabelParameters.POST or 'PUT' == GlobalLabelParameters.PUT or 'PUT' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_subscription,create_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) @@ -371,6 +390,14 @@ def delete_subscription_with_http_info(self, report_name, **kwargs): body_params = None if 'DELETE' in ('POST'): body_params = '{}' + + if 'DELETE' == GlobalLabelParameters.POST or 'DELETE' == GlobalLabelParameters.PUT or 'DELETE' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "delete_subscription,delete_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) @@ -478,6 +505,14 @@ def get_all_subscriptions_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_all_subscriptions,get_all_subscriptions_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) @@ -595,6 +630,14 @@ def get_subscription_with_http_info(self, report_name, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_subscription,get_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) diff --git a/CyberSource/api/reports_api.py b/CyberSource/api/reports_api.py index f5f3802e..36e10ba8 100644 --- a/CyberSource/api/reports_api.py +++ b/CyberSource/api/reports_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ReportsApi(object): @@ -137,6 +140,14 @@ def create_report_with_http_info(self, create_adhoc_report_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_adhoc_report_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_report,create_report_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) @@ -254,6 +265,14 @@ def get_report_by_report_id_with_http_info(self, report_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_report_by_report_id,get_report_by_report_id_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) @@ -408,6 +427,14 @@ def search_reports_with_http_info(self, start_time, end_time, time_query_type, * body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "search_reports,search_reports_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) diff --git a/CyberSource/api/retrieval_details_api.py b/CyberSource/api/retrieval_details_api.py index dd146f4d..6b09f910 100644 --- a/CyberSource/api/retrieval_details_api.py +++ b/CyberSource/api/retrieval_details_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class RetrievalDetailsApi(object): @@ -145,6 +148,14 @@ def get_retrieval_details_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_retrieval_details,get_retrieval_details_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) diff --git a/CyberSource/api/retrieval_summaries_api.py b/CyberSource/api/retrieval_summaries_api.py index 08bc3b79..945b3035 100644 --- a/CyberSource/api/retrieval_summaries_api.py +++ b/CyberSource/api/retrieval_summaries_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class RetrievalSummariesApi(object): @@ -145,6 +148,14 @@ def get_retrieval_summary_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_retrieval_summary,get_retrieval_summary_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json', 'application/xml']) diff --git a/CyberSource/api/reversal_api.py b/CyberSource/api/reversal_api.py index b0b89634..d9bac785 100644 --- a/CyberSource/api/reversal_api.py +++ b/CyberSource/api/reversal_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class ReversalApi(object): @@ -143,6 +146,14 @@ def auth_reversal_with_http_info(self, id, auth_reversal_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'auth_reversal_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "auth_reversal,auth_reversal_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -256,6 +267,14 @@ def mit_reversal_with_http_info(self, mit_reversal_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'mit_reversal_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "mit_reversal,mit_reversal_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/search_transactions_api.py b/CyberSource/api/search_transactions_api.py index 8a178431..18cc3d0d 100644 --- a/CyberSource/api/search_transactions_api.py +++ b/CyberSource/api/search_transactions_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class SearchTransactionsApi(object): @@ -133,6 +136,14 @@ def create_search_with_http_info(self, create_search_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_search_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_search,create_search_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json;charset=utf-8']) @@ -246,6 +257,14 @@ def get_search_with_http_info(self, search_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_search,get_search_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['*/*']) diff --git a/CyberSource/api/secure_file_share_api.py b/CyberSource/api/secure_file_share_api.py index eeccfec6..4e1cd656 100644 --- a/CyberSource/api/secure_file_share_api.py +++ b/CyberSource/api/secure_file_share_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class SecureFileShareApi(object): @@ -137,6 +140,14 @@ def get_file_with_http_info(self, file_id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_file,get_file_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/xml', 'text/csv', 'application/pdf']) @@ -266,6 +277,14 @@ def get_file_detail_with_http_info(self, start_date, end_date, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_file_detail,get_file_detail_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) diff --git a/CyberSource/api/subscriptions_api.py b/CyberSource/api/subscriptions_api.py index fa11c1aa..225717d1 100644 --- a/CyberSource/api/subscriptions_api.py +++ b/CyberSource/api/subscriptions_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class SubscriptionsApi(object): @@ -133,6 +136,14 @@ def activate_subscription_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): body_params = '{}' + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "activate_subscription,activate_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -246,6 +257,14 @@ def cancel_subscription_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): body_params = '{}' + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "cancel_subscription,cancel_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -359,6 +378,14 @@ def create_subscription_with_http_info(self, create_subscription_request, **kwar sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'create_subscription_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "create_subscription,create_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -478,6 +505,14 @@ def get_all_subscriptions_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_all_subscriptions,get_all_subscriptions_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -591,6 +626,14 @@ def get_subscription_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_subscription,get_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -693,6 +736,14 @@ def get_subscription_code_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_subscription_code,get_subscription_code_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -806,6 +857,14 @@ def suspend_subscription_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): body_params = '{}' + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "suspend_subscription,suspend_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) @@ -929,6 +988,14 @@ def update_subscription_with_http_info(self, id, update_subscription, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'update_subscription', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "update_subscription,update_subscription_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json', 'application/hal+json', 'application/json;charset=utf-8', 'application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/taxes_api.py b/CyberSource/api/taxes_api.py index 9474dab6..8d1a3c6f 100644 --- a/CyberSource/api/taxes_api.py +++ b/CyberSource/api/taxes_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class TaxesApi(object): @@ -133,6 +136,14 @@ def calculate_tax_with_http_info(self, tax_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'tax_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "calculate_tax,calculate_tax_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -256,6 +267,14 @@ def void_tax_with_http_info(self, void_tax_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'void_tax_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'PATCH' == GlobalLabelParameters.POST or 'PATCH' == GlobalLabelParameters.PUT or 'PATCH' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "void_tax,void_tax_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/token_api.py b/CyberSource/api/token_api.py index 4aa010da..0389a80f 100644 --- a/CyberSource/api/token_api.py +++ b/CyberSource/api/token_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class TokenApi(object): @@ -147,6 +150,14 @@ def post_token_payment_credentials_with_http_info(self, token_id, post_payment_c sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'post_payment_credentials_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "post_token_payment_credentials,post_token_payment_credentials_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/jose;charset=utf-8']) diff --git a/CyberSource/api/transaction_batches_api.py b/CyberSource/api/transaction_batches_api.py index 490dbbe7..afdec6a9 100644 --- a/CyberSource/api/transaction_batches_api.py +++ b/CyberSource/api/transaction_batches_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class TransactionBatchesApi(object): @@ -141,6 +144,14 @@ def get_transaction_batch_details_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_transaction_batch_details,get_transaction_batch_details_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['text/csv', 'application/xml', 'text/vnd.cybersource.map-csv']) @@ -254,6 +265,14 @@ def get_transaction_batch_id_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_transaction_batch_id,get_transaction_batch_id_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) @@ -375,6 +394,14 @@ def get_transaction_batches_with_http_info(self, start_time, end_time, **kwargs) body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_transaction_batches,get_transaction_batches_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json']) diff --git a/CyberSource/api/transaction_details_api.py b/CyberSource/api/transaction_details_api.py index 44fc6e35..1af7fc22 100644 --- a/CyberSource/api/transaction_details_api.py +++ b/CyberSource/api/transaction_details_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class TransactionDetailsApi(object): @@ -133,6 +136,14 @@ def get_transaction_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_transaction,get_transaction_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/transient_token_data_api.py b/CyberSource/api/transient_token_data_api.py index 398972e1..d695dadf 100644 --- a/CyberSource/api/transient_token_data_api.py +++ b/CyberSource/api/transient_token_data_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class TransientTokenDataApi(object): @@ -133,6 +136,14 @@ def get_payment_credentials_for_transient_token_with_http_info(self, payment_cre body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_payment_credentials_for_transient_token,get_payment_credentials_for_transient_token_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json']) @@ -246,6 +257,14 @@ def get_transaction_for_transient_token_with_http_info(self, transient_token, ** body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_transaction_for_transient_token,get_transaction_for_transient_token_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/json']) diff --git a/CyberSource/api/unified_checkout_capture_context_api.py b/CyberSource/api/unified_checkout_capture_context_api.py index 1dd64162..46e6b3a4 100644 --- a/CyberSource/api/unified_checkout_capture_context_api.py +++ b/CyberSource/api/unified_checkout_capture_context_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class UnifiedCheckoutCaptureContextApi(object): @@ -133,6 +136,14 @@ def generate_unified_checkout_capture_context_with_http_info(self, generate_unif sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'generate_unified_checkout_capture_context_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "generate_unified_checkout_capture_context,generate_unified_checkout_capture_context_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/jwt']) diff --git a/CyberSource/api/user_management_api.py b/CyberSource/api/user_management_api.py index 7d1350a0..51eea808 100644 --- a/CyberSource/api/user_management_api.py +++ b/CyberSource/api/user_management_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class UserManagementApi(object): @@ -139,6 +142,14 @@ def get_users_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): body_params = '{}' + + if 'GET' == GlobalLabelParameters.POST or 'GET' == GlobalLabelParameters.PUT or 'GET' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "get_users,get_users_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/user_management_search_api.py b/CyberSource/api/user_management_search_api.py index defe44a6..672d211e 100644 --- a/CyberSource/api/user_management_search_api.py +++ b/CyberSource/api/user_management_search_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class UserManagementSearchApi(object): @@ -133,6 +136,14 @@ def search_users_with_http_info(self, search_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'search_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "search_users,search_users_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/verification_api.py b/CyberSource/api/verification_api.py index 87622727..a98c48ee 100644 --- a/CyberSource/api/verification_api.py +++ b/CyberSource/api/verification_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class VerificationApi(object): @@ -133,6 +136,14 @@ def validate_export_compliance_with_http_info(self, validate_export_compliance_r sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'validate_export_compliance_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "validate_export_compliance,validate_export_compliance_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -246,6 +257,14 @@ def verify_customer_address_with_http_info(self, verify_customer_address_request sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'verify_customer_address_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = False + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "verify_customer_address,verify_customer_address_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api/void_api.py b/CyberSource/api/void_api.py index 9eb89bcf..a96b6dd8 100644 --- a/CyberSource/api/void_api.py +++ b/CyberSource/api/void_api.py @@ -22,6 +22,9 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker class VoidApi(object): @@ -133,6 +136,14 @@ def mit_void_with_http_info(self, mit_void_request, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'mit_void_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "mit_void,mit_void_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -256,6 +267,14 @@ def void_capture_with_http_info(self, void_capture_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'void_capture_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "void_capture,void_capture_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -379,6 +398,14 @@ def void_credit_with_http_info(self, void_credit_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'void_credit_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "void_credit,void_credit_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -502,6 +529,14 @@ def void_payment_with_http_info(self, void_payment_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'void_payment_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "void_payment,void_payment_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -625,6 +660,14 @@ def void_refund_with_http_info(self, void_refund_request, id, **kwargs): sdkTracker = SdkTracker() body_params = sdkTracker.insert_developer_id_tracker(body_params, 'void_refund_request', self.api_client.mconfig.run_environment, self.api_client.mconfig.defaultDeveloperId) + + if 'POST' == GlobalLabelParameters.POST or 'POST' == GlobalLabelParameters.PUT or 'POST' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = True + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "void_refund,void_refund_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) diff --git a/CyberSource/api_client.py b/CyberSource/api_client.py index 54a6544d..b0a24770 100644 --- a/CyberSource/api_client.py +++ b/CyberSource/api_client.py @@ -429,12 +429,12 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in iteritems(data)} @@ -465,13 +465,6 @@ def call_api(self, resource_path, method, if header_params['Content-Type'] == 'application/x-www-form-urlencoded': post_params = body - if method.upper() == GlobalLabelParameters.POST or method.upper() == GlobalLabelParameters.PUT or method.upper() == GlobalLabelParameters.PATCH: - temp_body = body.replace("\"_", "\"") - request_body = self.replace_underscore(json.loads(temp_body)) - body = json.dumps(request_body) - body = body.replace("companyTaxId", "companyTaxID") - body = body.replace("productSku", "productSKU") - body = body.replace("secCode", "SECCode") query_param_path = self.set_query_params(resource_path, query_params) if query_param_path: self.mconfig.request_target = query_param_path diff --git a/CyberSource/logging/log_configuration.py b/CyberSource/logging/log_configuration.py index 04bfa47c..83f1b0a0 100644 --- a/CyberSource/logging/log_configuration.py +++ b/CyberSource/logging/log_configuration.py @@ -52,11 +52,11 @@ def set_log_level(self, value): def set_enable_masking(self, value): if value is not None and (type(value) == bool or (value.lower() == 'true' or value.lower() == 'false')): if type(value) == bool: - self.enable_masking = value + self.enable_masking = True elif value.lower() == 'true': self.enable_masking = True else: - self.enable_masking = False + self.enable_masking = True else: self.enable_masking = True diff --git a/CyberSource/logging/sensitive_formatter.py b/CyberSource/logging/sensitive_formatter.py index 5a998444..be4291a5 100644 --- a/CyberSource/logging/sensitive_formatter.py +++ b/CyberSource/logging/sensitive_formatter.py @@ -1,91 +1,84 @@ import logging +import json import re +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters class SensitiveFormatter(logging.Formatter): + sensitive_fields = [ + "securityCode", + "cardNumber", + "number", + "expirationMonth", + "expirationYear", + "routingNumber", + "email", + "firstName", + "lastName", + "phoneNumber", + "type", + "token", + "signature", + "keyid", + "encryptedRequest" + ] + """Formatter that removes sensitive information in urls.""" + @staticmethod + def is_json_string(message): + try: + json.loads(message) + return True + except ValueError: + return False + @staticmethod def _filter(s): - s = re.sub(r'"securityCode":"[0-9]{3,4}"', r'"securityCode":"xxxxx"', s) - s = re.sub(r'"expirationMonth":"[0-1][0-9]"', r'"expirationMonth":"xxxx"', s) - s = re.sub(r'"expirationYear":"2[0-9][0-9][0-9]"', r'"expirationYear":"xxxx"', s) - s = re.sub(r'"routingNumber":"[0-9]+"', r'"routingNumber":"xxxxx"', s) - s = re.sub(r'"email":"[a-z0-9!#$.%&*+\/=?^_`{|}~-]+(?:.[a-z0-9.!#$%&*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"', r'"email":"xxxxx"', s) - s = re.sub(r'"firstName":"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"firstName":"xxxxxx"', s) - s = re.sub(r'"lastName":"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"lastName":"xxxxxx"', s) - s = re.sub(r'"phoneNumber":"(\\+[0-9]{1,2})?\\([0-9]{3}\\)?[.-]?[0-9]{3}[ .-]?[0-9]{4}"', r'"phoneNumber":"xxxxxx"', s) - s = re.sub(r'"type":"[-A-Za-z0-9 ]+"', r'"type":"xxxxx"', s) - s = re.sub(r'"token":"[-.A-Za-z0-9+/= ]+"', r'"token":"xxxxx"', s) - s = re.sub(r'signature="[-.A-Za-z0-9+/= ]+"', r'signature="xxxxxxxx"', s) - s = re.sub(r'keyid="[-.A-Za-z0-9+/= ]+"', r'keyid="xxxxxxxx"', s) + if isinstance(s, str) and (s.startswith(GlobalLabelParameters.MESSAGE_BEFORE_MLE_REQUEST) or s.startswith(GlobalLabelParameters.MESSAGE_AFTER_MLE_REQUEST)): + splits = s.split(": ", 1) + new_log_message = splits[0] + ": " + SensitiveFormatter._filter(splits[1]) + return new_log_message + + if SensitiveFormatter.is_json_string(s): + json_msg = json.loads(s) + + if isinstance(json_msg, dict): + for prop in json_msg: + is_field_sensitive = prop in SensitiveFormatter.sensitive_fields + if is_field_sensitive: + if json_msg[prop] is not None: + if isinstance(json_msg[prop], str) and len(json_msg[prop]) > 0: + json_msg[prop] = 'X' * len(json_msg[prop]) + else: + json_msg[prop] = json.loads(SensitiveFormatter._filter(json.dumps(json_msg[prop]))) + else: + json_msg[prop] = json.loads(SensitiveFormatter._filter(json.dumps(json_msg[prop]))) + + return json.dumps(json_msg) - # masking cardNumber - matches = re.search(r'"cardNumber":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) - if matches: - matchedString= matches.group(0) - matchString= matchedString.replace(" ","") - matchString= matchString.replace("-","") - pats = re.findall(r'"cardNumber":"[0-9]+"', matchString) - if len(pats) > 0: - pat = pats[0] - pat = re.sub(r'[0-9](?=.*.{5})', r'x', pat) - replaceString = re.sub(r'"cardNumber":"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) + elif "Signature:" in s: + splits = s.split(" ") + start_split = splits[0] + splits = splits[1].split(",") + split_keyid = splits[0].split("=") + split_signature = splits[-1].split("=") + new_log_message = start_split + " " + split_keyid[0] + "=\"XXXXX\", " + splits[1] + ", " + splits[2] + ", " + split_signature[0] + "\"XXXXX\"" + return new_log_message - # masking number - matches = re.search(r'"number":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) - if matches: - matchedString= matches.group(0) - matchString= matchedString.replace(" ","") - matchString= matchString.replace("-","") - pats = re.findall(r'"number":"[0-9]+"', matchString) - if len(pats) > 0: - pat = pats[0] - pat = re.sub(r'[0-9](?=.*.{5})', r'x', pat) - replaceString = re.sub(r'"number":"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) + elif "Digest:" in s: + splits = s.split("=", 1) + new_log_message = splits[0] + "=XXXXX" + return new_log_message - # masking account - matches = re.search(r'"account":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) - if matches: - matchedString= matches.group(0) - matchString= matchedString.replace(" ","") - matchString= matchString.replace("-","") - pats = re.findall(r'"account":"[0-9]+"', matchString) - if len(pats) > 0: - pat = pats[0] - pat = re.sub(r'[0-9](?=.*.{5})', r'x', pat) - replaceString = re.sub(r'"account":"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) - - # masking prefix - matches = re.search(r'"prefix":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) - if matches: - matchedString= matches.group(0) - matchString= matchedString.replace(" ","") - matchString= matchString.replace("-","") - pats = re.findall(r'"prefix":"[0-9]+"', matchString) - if len(pats) > 0: - pat = pats[0] - pat = re.sub(r'(?<=["])([0-9]{6})', r'x', pat) - replaceString = re.sub(r'"prefix":"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) - - # masking bin - matches = re.search(r'"bin":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) - if matches: - matchedString= matches.group(0) - matchString= matchedString.replace(" ","") - matchString= matchString.replace("-","") - pats = re.findall(r'"bin":"[0-9]+"', matchString) - if len(pats) > 0: - pat = pats[0] - pat = re.sub(r'(?<=["])([0-9]{6})', r'x', pat) - replaceString = re.sub(r'"bin":"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) + elif "Authorization Bearer:" in s: + splits = s.split(" ") + new_log_message = splits[0] + " XXXXX" + return new_log_message - return s + else: + return s def format(self, record): - original = logging.Formatter.format(self, record) - return self._filter(original) \ No newline at end of file + new_message = self._filter(record.msg) + new_record = logging.LogRecord(record.name, record.levelno, record.pathname, record.lineno, new_message, record.args, record.exc_info) + return logging.Formatter.format(self, new_record) \ No newline at end of file diff --git a/CyberSource/models/__init__.py b/CyberSource/models/__init__.py index 76358718..29a54676 100644 --- a/CyberSource/models/__init__.py +++ b/CyberSource/models/__init__.py @@ -310,9 +310,14 @@ from .kmsegressv2keyssym_client_reference_information import Kmsegressv2keyssymClientReferenceInformation from .kmsegressv2keyssym_key_information import Kmsegressv2keyssymKeyInformation from .merchant_initiated_transaction_object import MerchantInitiatedTransactionObject +from .microformv2sessions_transient_token_response_options import Microformv2sessionsTransientTokenResponseOptions from .mit_reversal_request import MitReversalRequest from .mit_void_request import MitVoidRequest from .modify_billing_agreement import ModifyBillingAgreement +from .network_token_enrollment import NetworkTokenEnrollment +from .network_token_services_enablement import NetworkTokenServicesEnablement +from .network_token_services_enablement_mastercard_digital_enablement_service import NetworkTokenServicesEnablementMastercardDigitalEnablementService +from .network_token_services_enablement_visa_token_service import NetworkTokenServicesEnablementVisaTokenService from .notificationsubscriptionsv1productsorganization_id_event_types import Notificationsubscriptionsv1productsorganizationIdEventTypes from .notificationsubscriptionsv1webhooks_notification_scope import Notificationsubscriptionsv1webhooksNotificationScope from .notificationsubscriptionsv1webhooks_products import Notificationsubscriptionsv1webhooksProducts @@ -1148,6 +1153,9 @@ from .tms_bin_lookup_payment_account_information_card_brands import TmsBinLookupPaymentAccountInformationCardBrands from .tms_bin_lookup_payment_account_information_features import TmsBinLookupPaymentAccountInformationFeatures from .tms_bin_lookup_payment_account_information_network import TmsBinLookupPaymentAccountInformationNetwork +from .tms_business_information import TmsBusinessInformation +from .tms_business_information_acquirer import TmsBusinessInformationAcquirer +from .tms_business_information_address import TmsBusinessInformationAddress from .tms_card_art import TmsCardArt from .tms_card_art_brand_logo_asset import TmsCardArtBrandLogoAsset from .tms_card_art_brand_logo_asset_links import TmsCardArtBrandLogoAssetLinks diff --git a/CyberSource/models/commerce_solutions_products_token_management_configuration_information_configurations.py b/CyberSource/models/commerce_solutions_products_token_management_configuration_information_configurations.py index 2eb8de04..9f859685 100644 --- a/CyberSource/models/commerce_solutions_products_token_management_configuration_information_configurations.py +++ b/CyberSource/models/commerce_solutions_products_token_management_configuration_information_configurations.py @@ -31,26 +31,31 @@ class CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurat """ swagger_types = { 'parent_profile_id': 'str', - 'vault': 'CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault' + 'vault': 'CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault', + 'network_token_enrollment': 'NetworkTokenEnrollment' } attribute_map = { 'parent_profile_id': 'parentProfileId', - 'vault': 'vault' + 'vault': 'vault', + 'network_token_enrollment': 'networkTokenEnrollment' } - def __init__(self, parent_profile_id=None, vault=None): + def __init__(self, parent_profile_id=None, vault=None, network_token_enrollment=None): """ CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations - a model defined in Swagger """ self._parent_profile_id = None self._vault = None + self._network_token_enrollment = None if parent_profile_id is not None: self.parent_profile_id = parent_profile_id if vault is not None: self.vault = vault + if network_token_enrollment is not None: + self.network_token_enrollment = network_token_enrollment @property def parent_profile_id(self): @@ -96,6 +101,27 @@ def vault(self, vault): self._vault = vault + @property + def network_token_enrollment(self): + """ + Gets the network_token_enrollment of this CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations. + + :return: The network_token_enrollment of this CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations. + :rtype: NetworkTokenEnrollment + """ + return self._network_token_enrollment + + @network_token_enrollment.setter + def network_token_enrollment(self, network_token_enrollment): + """ + Sets the network_token_enrollment of this CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations. + + :param network_token_enrollment: The network_token_enrollment of this CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations. + :type: NetworkTokenEnrollment + """ + + self._network_token_enrollment = network_token_enrollment + def to_dict(self): """ Returns the model properties as a dict diff --git a/CyberSource/models/generate_capture_context_request.py b/CyberSource/models/generate_capture_context_request.py index b5f18f03..0a5849e7 100644 --- a/CyberSource/models/generate_capture_context_request.py +++ b/CyberSource/models/generate_capture_context_request.py @@ -33,17 +33,19 @@ class GenerateCaptureContextRequest(object): 'client_version': 'str', 'target_origins': 'list[str]', 'allowed_card_networks': 'list[str]', - 'allowed_payment_types': 'list[str]' + 'allowed_payment_types': 'list[str]', + 'transient_token_response_options': 'Microformv2sessionsTransientTokenResponseOptions' } attribute_map = { 'client_version': 'clientVersion', 'target_origins': 'targetOrigins', 'allowed_card_networks': 'allowedCardNetworks', - 'allowed_payment_types': 'allowedPaymentTypes' + 'allowed_payment_types': 'allowedPaymentTypes', + 'transient_token_response_options': 'transientTokenResponseOptions' } - def __init__(self, client_version=None, target_origins=None, allowed_card_networks=None, allowed_payment_types=None): + def __init__(self, client_version=None, target_origins=None, allowed_card_networks=None, allowed_payment_types=None, transient_token_response_options=None): """ GenerateCaptureContextRequest - a model defined in Swagger """ @@ -52,6 +54,7 @@ def __init__(self, client_version=None, target_origins=None, allowed_card_networ self._target_origins = None self._allowed_card_networks = None self._allowed_payment_types = None + self._transient_token_response_options = None if client_version is not None: self.client_version = client_version @@ -61,6 +64,8 @@ def __init__(self, client_version=None, target_origins=None, allowed_card_networ self.allowed_card_networks = allowed_card_networks if allowed_payment_types is not None: self.allowed_payment_types = allowed_payment_types + if transient_token_response_options is not None: + self.transient_token_response_options = transient_token_response_options @property def client_version(self): @@ -112,7 +117,7 @@ def target_origins(self, target_origins): def allowed_card_networks(self): """ Gets the allowed_card_networks of this GenerateCaptureContextRequest. - The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Accept Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (Accept Check) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Accept Card) and Microform (Accept Check) at least one card network should be specified in the allowedCardNetworks field in the capture context request. + The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (ACH/Echeck) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Card) and Microform (ACH/Echeck) at least one card network should be specified in the allowedCardNetworks field in the capture context request. :return: The allowed_card_networks of this GenerateCaptureContextRequest. :rtype: list[str] @@ -123,7 +128,7 @@ def allowed_card_networks(self): def allowed_card_networks(self, allowed_card_networks): """ Sets the allowed_card_networks of this GenerateCaptureContextRequest. - The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Accept Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (Accept Check) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Accept Card) and Microform (Accept Check) at least one card network should be specified in the allowedCardNetworks field in the capture context request. + The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (ACH/Echeck) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Card) and Microform (ACH/Echeck) at least one card network should be specified in the allowedCardNetworks field in the capture context request. :param allowed_card_networks: The allowed_card_networks of this GenerateCaptureContextRequest. :type: list[str] @@ -154,6 +159,27 @@ def allowed_payment_types(self, allowed_payment_types): self._allowed_payment_types = allowed_payment_types + @property + def transient_token_response_options(self): + """ + Gets the transient_token_response_options of this GenerateCaptureContextRequest. + + :return: The transient_token_response_options of this GenerateCaptureContextRequest. + :rtype: Microformv2sessionsTransientTokenResponseOptions + """ + return self._transient_token_response_options + + @transient_token_response_options.setter + def transient_token_response_options(self, transient_token_response_options): + """ + Sets the transient_token_response_options of this GenerateCaptureContextRequest. + + :param transient_token_response_options: The transient_token_response_options of this GenerateCaptureContextRequest. + :type: Microformv2sessionsTransientTokenResponseOptions + """ + + self._transient_token_response_options = transient_token_response_options + def to_dict(self): """ Returns the model properties as a dict diff --git a/CyberSource/models/generate_unified_checkout_capture_context_request.py b/CyberSource/models/generate_unified_checkout_capture_context_request.py index 8607f3df..32ee49dd 100644 --- a/CyberSource/models/generate_unified_checkout_capture_context_request.py +++ b/CyberSource/models/generate_unified_checkout_capture_context_request.py @@ -37,7 +37,8 @@ class GenerateUnifiedCheckoutCaptureContextRequest(object): 'country': 'str', 'locale': 'str', 'capture_mandate': 'Upv1capturecontextsCaptureMandate', - 'order_information': 'Upv1capturecontextsOrderInformation' + 'order_information': 'Upv1capturecontextsOrderInformation', + 'transient_token_response_options': 'Microformv2sessionsTransientTokenResponseOptions' } attribute_map = { @@ -48,10 +49,11 @@ class GenerateUnifiedCheckoutCaptureContextRequest(object): 'country': 'country', 'locale': 'locale', 'capture_mandate': 'captureMandate', - 'order_information': 'orderInformation' + 'order_information': 'orderInformation', + 'transient_token_response_options': 'transientTokenResponseOptions' } - def __init__(self, client_version=None, target_origins=None, allowed_card_networks=None, allowed_payment_types=None, country=None, locale=None, capture_mandate=None, order_information=None): + def __init__(self, client_version=None, target_origins=None, allowed_card_networks=None, allowed_payment_types=None, country=None, locale=None, capture_mandate=None, order_information=None, transient_token_response_options=None): """ GenerateUnifiedCheckoutCaptureContextRequest - a model defined in Swagger """ @@ -64,6 +66,7 @@ def __init__(self, client_version=None, target_origins=None, allowed_card_networ self._locale = None self._capture_mandate = None self._order_information = None + self._transient_token_response_options = None if client_version is not None: self.client_version = client_version @@ -81,6 +84,8 @@ def __init__(self, client_version=None, target_origins=None, allowed_card_networ self.capture_mandate = capture_mandate if order_information is not None: self.order_information = order_information + if transient_token_response_options is not None: + self.transient_token_response_options = transient_token_response_options @property def client_version(self): @@ -262,6 +267,27 @@ def order_information(self, order_information): self._order_information = order_information + @property + def transient_token_response_options(self): + """ + Gets the transient_token_response_options of this GenerateUnifiedCheckoutCaptureContextRequest. + + :return: The transient_token_response_options of this GenerateUnifiedCheckoutCaptureContextRequest. + :rtype: Microformv2sessionsTransientTokenResponseOptions + """ + return self._transient_token_response_options + + @transient_token_response_options.setter + def transient_token_response_options(self, transient_token_response_options): + """ + Sets the transient_token_response_options of this GenerateUnifiedCheckoutCaptureContextRequest. + + :param transient_token_response_options: The transient_token_response_options of this GenerateUnifiedCheckoutCaptureContextRequest. + :type: Microformv2sessionsTransientTokenResponseOptions + """ + + self._transient_token_response_options = transient_token_response_options + def to_dict(self): """ Returns the model properties as a dict diff --git a/CyberSource/models/microformv2sessions_transient_token_response_options.py b/CyberSource/models/microformv2sessions_transient_token_response_options.py new file mode 100644 index 00000000..f5458dc4 --- /dev/null +++ b/CyberSource/models/microformv2sessions_transient_token_response_options.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class Microformv2sessionsTransientTokenResponseOptions(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'include_card_prefix': 'bool' + } + + attribute_map = { + 'include_card_prefix': 'includeCardPrefix' + } + + def __init__(self, include_card_prefix=None): + """ + Microformv2sessionsTransientTokenResponseOptions - a model defined in Swagger + """ + + self._include_card_prefix = None + + if include_card_prefix is not None: + self.include_card_prefix = include_card_prefix + + @property + def include_card_prefix(self): + """ + Gets the include_card_prefix of this Microformv2sessionsTransientTokenResponseOptions. + Use the transientTokenResponseOptions.includeCardPrefix field to choose your preferred card number prefix length: 6-digit, 8-digit, or no card number prefix. Possible values: - True - False

To select the type of card number prefix: - No field included: A 6-digit prefix is returned (default) - True: An 8-digit prefix is returned - False: No prefix is returned

The following conditions apply: - 8-digit card number prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa brands with 16-digit card numbers or more. - Any card with less than 16-digit numbers will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay, or Visa, an 8-digit prefix will be returned if the transientTokenResponseOptions.includeCardPrefix field is set to true.

**Important:** If your application does NOT require a card number prefix for routing or identification purposes, set the transientTokenResponseOptions.includeCardPrefix field to False. This will minimize your personal data exposure. + + :return: The include_card_prefix of this Microformv2sessionsTransientTokenResponseOptions. + :rtype: bool + """ + return self._include_card_prefix + + @include_card_prefix.setter + def include_card_prefix(self, include_card_prefix): + """ + Sets the include_card_prefix of this Microformv2sessionsTransientTokenResponseOptions. + Use the transientTokenResponseOptions.includeCardPrefix field to choose your preferred card number prefix length: 6-digit, 8-digit, or no card number prefix. Possible values: - True - False

To select the type of card number prefix: - No field included: A 6-digit prefix is returned (default) - True: An 8-digit prefix is returned - False: No prefix is returned

The following conditions apply: - 8-digit card number prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa brands with 16-digit card numbers or more. - Any card with less than 16-digit numbers will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay, or Visa, an 8-digit prefix will be returned if the transientTokenResponseOptions.includeCardPrefix field is set to true.

**Important:** If your application does NOT require a card number prefix for routing or identification purposes, set the transientTokenResponseOptions.includeCardPrefix field to False. This will minimize your personal data exposure. + + :param include_card_prefix: The include_card_prefix of this Microformv2sessionsTransientTokenResponseOptions. + :type: bool + """ + + self._include_card_prefix = include_card_prefix + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, Microformv2sessionsTransientTokenResponseOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/network_token_enrollment.py b/CyberSource/models/network_token_enrollment.py new file mode 100644 index 00000000..b6a9b18f --- /dev/null +++ b/CyberSource/models/network_token_enrollment.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class NetworkTokenEnrollment(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'business_information': 'TmsBusinessInformation', + 'network_token_services': 'NetworkTokenServicesEnablement' + } + + attribute_map = { + 'business_information': 'businessInformation', + 'network_token_services': 'networkTokenServices' + } + + def __init__(self, business_information=None, network_token_services=None): + """ + NetworkTokenEnrollment - a model defined in Swagger + """ + + self._business_information = None + self._network_token_services = None + + if business_information is not None: + self.business_information = business_information + if network_token_services is not None: + self.network_token_services = network_token_services + + @property + def business_information(self): + """ + Gets the business_information of this NetworkTokenEnrollment. + + :return: The business_information of this NetworkTokenEnrollment. + :rtype: TmsBusinessInformation + """ + return self._business_information + + @business_information.setter + def business_information(self, business_information): + """ + Sets the business_information of this NetworkTokenEnrollment. + + :param business_information: The business_information of this NetworkTokenEnrollment. + :type: TmsBusinessInformation + """ + + self._business_information = business_information + + @property + def network_token_services(self): + """ + Gets the network_token_services of this NetworkTokenEnrollment. + + :return: The network_token_services of this NetworkTokenEnrollment. + :rtype: NetworkTokenServicesEnablement + """ + return self._network_token_services + + @network_token_services.setter + def network_token_services(self, network_token_services): + """ + Sets the network_token_services of this NetworkTokenEnrollment. + + :param network_token_services: The network_token_services of this NetworkTokenEnrollment. + :type: NetworkTokenServicesEnablement + """ + + self._network_token_services = network_token_services + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, NetworkTokenEnrollment): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/network_token_services_enablement.py b/CyberSource/models/network_token_services_enablement.py new file mode 100644 index 00000000..289fb3c2 --- /dev/null +++ b/CyberSource/models/network_token_services_enablement.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class NetworkTokenServicesEnablement(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'visa_token_service': 'NetworkTokenServicesEnablementVisaTokenService', + 'mastercard_digital_enablement_service': 'NetworkTokenServicesEnablementMastercardDigitalEnablementService' + } + + attribute_map = { + 'visa_token_service': 'visaTokenService', + 'mastercard_digital_enablement_service': 'mastercardDigitalEnablementService' + } + + def __init__(self, visa_token_service=None, mastercard_digital_enablement_service=None): + """ + NetworkTokenServicesEnablement - a model defined in Swagger + """ + + self._visa_token_service = None + self._mastercard_digital_enablement_service = None + + if visa_token_service is not None: + self.visa_token_service = visa_token_service + if mastercard_digital_enablement_service is not None: + self.mastercard_digital_enablement_service = mastercard_digital_enablement_service + + @property + def visa_token_service(self): + """ + Gets the visa_token_service of this NetworkTokenServicesEnablement. + + :return: The visa_token_service of this NetworkTokenServicesEnablement. + :rtype: NetworkTokenServicesEnablementVisaTokenService + """ + return self._visa_token_service + + @visa_token_service.setter + def visa_token_service(self, visa_token_service): + """ + Sets the visa_token_service of this NetworkTokenServicesEnablement. + + :param visa_token_service: The visa_token_service of this NetworkTokenServicesEnablement. + :type: NetworkTokenServicesEnablementVisaTokenService + """ + + self._visa_token_service = visa_token_service + + @property + def mastercard_digital_enablement_service(self): + """ + Gets the mastercard_digital_enablement_service of this NetworkTokenServicesEnablement. + + :return: The mastercard_digital_enablement_service of this NetworkTokenServicesEnablement. + :rtype: NetworkTokenServicesEnablementMastercardDigitalEnablementService + """ + return self._mastercard_digital_enablement_service + + @mastercard_digital_enablement_service.setter + def mastercard_digital_enablement_service(self, mastercard_digital_enablement_service): + """ + Sets the mastercard_digital_enablement_service of this NetworkTokenServicesEnablement. + + :param mastercard_digital_enablement_service: The mastercard_digital_enablement_service of this NetworkTokenServicesEnablement. + :type: NetworkTokenServicesEnablementMastercardDigitalEnablementService + """ + + self._mastercard_digital_enablement_service = mastercard_digital_enablement_service + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, NetworkTokenServicesEnablement): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/network_token_services_enablement_mastercard_digital_enablement_service.py b/CyberSource/models/network_token_services_enablement_mastercard_digital_enablement_service.py new file mode 100644 index 00000000..af7e16ec --- /dev/null +++ b/CyberSource/models/network_token_services_enablement_mastercard_digital_enablement_service.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class NetworkTokenServicesEnablementMastercardDigitalEnablementService(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enrollment': 'bool' + } + + attribute_map = { + 'enrollment': 'enrollment' + } + + def __init__(self, enrollment=None): + """ + NetworkTokenServicesEnablementMastercardDigitalEnablementService - a model defined in Swagger + """ + + self._enrollment = None + + if enrollment is not None: + self.enrollment = enrollment + + @property + def enrollment(self): + """ + Gets the enrollment of this NetworkTokenServicesEnablementMastercardDigitalEnablementService. + Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted + + :return: The enrollment of this NetworkTokenServicesEnablementMastercardDigitalEnablementService. + :rtype: bool + """ + return self._enrollment + + @enrollment.setter + def enrollment(self, enrollment): + """ + Sets the enrollment of this NetworkTokenServicesEnablementMastercardDigitalEnablementService. + Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted + + :param enrollment: The enrollment of this NetworkTokenServicesEnablementMastercardDigitalEnablementService. + :type: bool + """ + + self._enrollment = enrollment + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, NetworkTokenServicesEnablementMastercardDigitalEnablementService): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/network_token_services_enablement_visa_token_service.py b/CyberSource/models/network_token_services_enablement_visa_token_service.py new file mode 100644 index 00000000..68986c27 --- /dev/null +++ b/CyberSource/models/network_token_services_enablement_visa_token_service.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class NetworkTokenServicesEnablementVisaTokenService(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enrollment': 'bool' + } + + attribute_map = { + 'enrollment': 'enrollment' + } + + def __init__(self, enrollment=None): + """ + NetworkTokenServicesEnablementVisaTokenService - a model defined in Swagger + """ + + self._enrollment = None + + if enrollment is not None: + self.enrollment = enrollment + + @property + def enrollment(self): + """ + Gets the enrollment of this NetworkTokenServicesEnablementVisaTokenService. + Indicates if an enrollment to create a TRID for the Visa card association should be attempted + + :return: The enrollment of this NetworkTokenServicesEnablementVisaTokenService. + :rtype: bool + """ + return self._enrollment + + @enrollment.setter + def enrollment(self, enrollment): + """ + Sets the enrollment of this NetworkTokenServicesEnablementVisaTokenService. + Indicates if an enrollment to create a TRID for the Visa card association should be attempted + + :param enrollment: The enrollment of this NetworkTokenServicesEnablementVisaTokenService. + :type: bool + """ + + self._enrollment = enrollment + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, NetworkTokenServicesEnablementVisaTokenService): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/tms_business_information.py b/CyberSource/models/tms_business_information.py new file mode 100644 index 00000000..4b649b1c --- /dev/null +++ b/CyberSource/models/tms_business_information.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class TmsBusinessInformation(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'doing_business_as': 'str', + 'address': 'TmsBusinessInformationAddress', + 'website_url': 'str', + 'business_identification_type': 'str', + 'business_identification_value': 'str', + 'acquirer': 'TmsBusinessInformationAcquirer' + } + + attribute_map = { + 'name': 'name', + 'doing_business_as': 'doingBusinessAs', + 'address': 'address', + 'website_url': 'websiteUrl', + 'business_identification_type': 'businessIdentificationType', + 'business_identification_value': 'businessIdentificationValue', + 'acquirer': 'acquirer' + } + + def __init__(self, name=None, doing_business_as=None, address=None, website_url=None, business_identification_type=None, business_identification_value=None, acquirer=None): + """ + TmsBusinessInformation - a model defined in Swagger + """ + + self._name = None + self._doing_business_as = None + self._address = None + self._website_url = None + self._business_identification_type = None + self._business_identification_value = None + self._acquirer = None + + if name is not None: + self.name = name + if doing_business_as is not None: + self.doing_business_as = doing_business_as + if address is not None: + self.address = address + if website_url is not None: + self.website_url = website_url + if business_identification_type is not None: + self.business_identification_type = business_identification_type + if business_identification_value is not None: + self.business_identification_value = business_identification_value + if acquirer is not None: + self.acquirer = acquirer + + @property + def name(self): + """ + Gets the name of this TmsBusinessInformation. + Name of the network token merchant. + + :return: The name of this TmsBusinessInformation. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """ + Sets the name of this TmsBusinessInformation. + Name of the network token merchant. + + :param name: The name of this TmsBusinessInformation. + :type: str + """ + + self._name = name + + @property + def doing_business_as(self): + """ + Gets the doing_business_as of this TmsBusinessInformation. + Name the network token merchant does business as + + :return: The doing_business_as of this TmsBusinessInformation. + :rtype: str + """ + return self._doing_business_as + + @doing_business_as.setter + def doing_business_as(self, doing_business_as): + """ + Sets the doing_business_as of this TmsBusinessInformation. + Name the network token merchant does business as + + :param doing_business_as: The doing_business_as of this TmsBusinessInformation. + :type: str + """ + + self._doing_business_as = doing_business_as + + @property + def address(self): + """ + Gets the address of this TmsBusinessInformation. + + :return: The address of this TmsBusinessInformation. + :rtype: TmsBusinessInformationAddress + """ + return self._address + + @address.setter + def address(self, address): + """ + Sets the address of this TmsBusinessInformation. + + :param address: The address of this TmsBusinessInformation. + :type: TmsBusinessInformationAddress + """ + + self._address = address + + @property + def website_url(self): + """ + Gets the website_url of this TmsBusinessInformation. + Website of network token merchant. + + :return: The website_url of this TmsBusinessInformation. + :rtype: str + """ + return self._website_url + + @website_url.setter + def website_url(self, website_url): + """ + Sets the website_url of this TmsBusinessInformation. + Website of network token merchant. + + :param website_url: The website_url of this TmsBusinessInformation. + :type: str + """ + + self._website_url = website_url + + @property + def business_identification_type(self): + """ + Gets the business_identification_type of this TmsBusinessInformation. + The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided. + + :return: The business_identification_type of this TmsBusinessInformation. + :rtype: str + """ + return self._business_identification_type + + @business_identification_type.setter + def business_identification_type(self, business_identification_type): + """ + Sets the business_identification_type of this TmsBusinessInformation. + The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided. + + :param business_identification_type: The business_identification_type of this TmsBusinessInformation. + :type: str + """ + + self._business_identification_type = business_identification_type + + @property + def business_identification_value(self): + """ + Gets the business_identification_value of this TmsBusinessInformation. + The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided. + + :return: The business_identification_value of this TmsBusinessInformation. + :rtype: str + """ + return self._business_identification_value + + @business_identification_value.setter + def business_identification_value(self, business_identification_value): + """ + Sets the business_identification_value of this TmsBusinessInformation. + The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided. + + :param business_identification_value: The business_identification_value of this TmsBusinessInformation. + :type: str + """ + + self._business_identification_value = business_identification_value + + @property + def acquirer(self): + """ + Gets the acquirer of this TmsBusinessInformation. + + :return: The acquirer of this TmsBusinessInformation. + :rtype: TmsBusinessInformationAcquirer + """ + return self._acquirer + + @acquirer.setter + def acquirer(self, acquirer): + """ + Sets the acquirer of this TmsBusinessInformation. + + :param acquirer: The acquirer of this TmsBusinessInformation. + :type: TmsBusinessInformationAcquirer + """ + + self._acquirer = acquirer + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, TmsBusinessInformation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/tms_business_information_acquirer.py b/CyberSource/models/tms_business_information_acquirer.py new file mode 100644 index 00000000..fdfc42e6 --- /dev/null +++ b/CyberSource/models/tms_business_information_acquirer.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class TmsBusinessInformationAcquirer(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'acquirer_id': 'str', + 'acquirer_merchant_id': 'str' + } + + attribute_map = { + 'acquirer_id': 'acquirerId', + 'acquirer_merchant_id': 'acquirerMerchantId' + } + + def __init__(self, acquirer_id=None, acquirer_merchant_id=None): + """ + TmsBusinessInformationAcquirer - a model defined in Swagger + """ + + self._acquirer_id = None + self._acquirer_merchant_id = None + + if acquirer_id is not None: + self.acquirer_id = acquirer_id + if acquirer_merchant_id is not None: + self.acquirer_merchant_id = acquirer_merchant_id + + @property + def acquirer_id(self): + """ + Gets the acquirer_id of this TmsBusinessInformationAcquirer. + Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided. + + :return: The acquirer_id of this TmsBusinessInformationAcquirer. + :rtype: str + """ + return self._acquirer_id + + @acquirer_id.setter + def acquirer_id(self, acquirer_id): + """ + Sets the acquirer_id of this TmsBusinessInformationAcquirer. + Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided. + + :param acquirer_id: The acquirer_id of this TmsBusinessInformationAcquirer. + :type: str + """ + + self._acquirer_id = acquirer_id + + @property + def acquirer_merchant_id(self): + """ + Gets the acquirer_merchant_id of this TmsBusinessInformationAcquirer. + Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided. + + :return: The acquirer_merchant_id of this TmsBusinessInformationAcquirer. + :rtype: str + """ + return self._acquirer_merchant_id + + @acquirer_merchant_id.setter + def acquirer_merchant_id(self, acquirer_merchant_id): + """ + Sets the acquirer_merchant_id of this TmsBusinessInformationAcquirer. + Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided. + + :param acquirer_merchant_id: The acquirer_merchant_id of this TmsBusinessInformationAcquirer. + :type: str + """ + + self._acquirer_merchant_id = acquirer_merchant_id + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, TmsBusinessInformationAcquirer): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/tms_business_information_address.py b/CyberSource/models/tms_business_information_address.py new file mode 100644 index 00000000..6e65ffce --- /dev/null +++ b/CyberSource/models/tms_business_information_address.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from pprint import pformat +from six import iteritems +import re + + +class TmsBusinessInformationAddress(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'country': 'str', + 'locality': 'str' + } + + attribute_map = { + 'country': 'country', + 'locality': 'locality' + } + + def __init__(self, country=None, locality=None): + """ + TmsBusinessInformationAddress - a model defined in Swagger + """ + + self._country = None + self._locality = None + + if country is not None: + self.country = country + if locality is not None: + self.locality = locality + + @property + def country(self): + """ + Gets the country of this TmsBusinessInformationAddress. + Country of network token merchant. + + :return: The country of this TmsBusinessInformationAddress. + :rtype: str + """ + return self._country + + @country.setter + def country(self, country): + """ + Sets the country of this TmsBusinessInformationAddress. + Country of network token merchant. + + :param country: The country of this TmsBusinessInformationAddress. + :type: str + """ + + self._country = country + + @property + def locality(self): + """ + Gets the locality of this TmsBusinessInformationAddress. + City of network token merchant. + + :return: The locality of this TmsBusinessInformationAddress. + :rtype: str + """ + return self._locality + + @locality.setter + def locality(self, locality): + """ + Sets the locality of this TmsBusinessInformationAddress. + City of network token merchant. + + :param locality: The locality of this TmsBusinessInformationAddress. + :type: str + """ + + self._locality = locality + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, TmsBusinessInformationAddress): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/CyberSource/models/upv1capturecontexts_capture_mandate.py b/CyberSource/models/upv1capturecontexts_capture_mandate.py index 002cf69d..5dfaf45b 100644 --- a/CyberSource/models/upv1capturecontexts_capture_mandate.py +++ b/CyberSource/models/upv1capturecontexts_capture_mandate.py @@ -35,7 +35,9 @@ class Upv1capturecontextsCaptureMandate(object): 'request_phone': 'bool', 'request_shipping': 'bool', 'ship_to_countries': 'list[str]', - 'show_accepted_network_icons': 'bool' + 'show_accepted_network_icons': 'bool', + 'request_save_card': 'bool', + 'combo_card': 'bool' } attribute_map = { @@ -44,10 +46,12 @@ class Upv1capturecontextsCaptureMandate(object): 'request_phone': 'requestPhone', 'request_shipping': 'requestShipping', 'ship_to_countries': 'shipToCountries', - 'show_accepted_network_icons': 'showAcceptedNetworkIcons' + 'show_accepted_network_icons': 'showAcceptedNetworkIcons', + 'request_save_card': 'requestSaveCard', + 'combo_card': 'comboCard' } - def __init__(self, billing_type=None, request_email=None, request_phone=None, request_shipping=None, ship_to_countries=None, show_accepted_network_icons=None): + def __init__(self, billing_type=None, request_email=None, request_phone=None, request_shipping=None, ship_to_countries=None, show_accepted_network_icons=None, request_save_card=None, combo_card=None): """ Upv1capturecontextsCaptureMandate - a model defined in Swagger """ @@ -58,6 +62,8 @@ def __init__(self, billing_type=None, request_email=None, request_phone=None, re self._request_shipping = None self._ship_to_countries = None self._show_accepted_network_icons = None + self._request_save_card = None + self._combo_card = None if billing_type is not None: self.billing_type = billing_type @@ -71,6 +77,10 @@ def __init__(self, billing_type=None, request_email=None, request_phone=None, re self.ship_to_countries = ship_to_countries if show_accepted_network_icons is not None: self.show_accepted_network_icons = show_accepted_network_icons + if request_save_card is not None: + self.request_save_card = request_save_card + if combo_card is not None: + self.combo_card = combo_card @property def billing_type(self): @@ -210,6 +220,52 @@ def show_accepted_network_icons(self, show_accepted_network_icons): self._show_accepted_network_icons = show_accepted_network_icons + @property + def request_save_card(self): + """ + Gets the request_save_card of this Upv1capturecontextsCaptureMandate. + Configure Unified Checkout to display the \"Save card for future use\" checkbox.
Configurable check box that will show in a Manual card entry flow to allow a Cardholder to give consent to store their manually entered credential with the Merchant that they are paying.
Applicable when manually entering the details and not enrolling in Click to Pay. Possible values: - True - False

**Use Cases:** **Offer consumers option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to true. - When set to true, this will show a checkbox with the message 'Save card for future use' in Unified Checkout. - When selected this provides a response in both the Transient Token and Get Credentials API response.

**Do not offer consumers the option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to false OR omit the field from the capture context request. - When set to false, the save card option is not shown to consumers when manually entering card details. + + :return: The request_save_card of this Upv1capturecontextsCaptureMandate. + :rtype: bool + """ + return self._request_save_card + + @request_save_card.setter + def request_save_card(self, request_save_card): + """ + Sets the request_save_card of this Upv1capturecontextsCaptureMandate. + Configure Unified Checkout to display the \"Save card for future use\" checkbox.
Configurable check box that will show in a Manual card entry flow to allow a Cardholder to give consent to store their manually entered credential with the Merchant that they are paying.
Applicable when manually entering the details and not enrolling in Click to Pay. Possible values: - True - False

**Use Cases:** **Offer consumers option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to true. - When set to true, this will show a checkbox with the message 'Save card for future use' in Unified Checkout. - When selected this provides a response in both the Transient Token and Get Credentials API response.

**Do not offer consumers the option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to false OR omit the field from the capture context request. - When set to false, the save card option is not shown to consumers when manually entering card details. + + :param request_save_card: The request_save_card of this Upv1capturecontextsCaptureMandate. + :type: bool + """ + + self._request_save_card = request_save_card + + @property + def combo_card(self): + """ + Gets the combo_card of this Upv1capturecontextsCaptureMandate. + Configure Unified Checkout to display combo card at checkout.
A combo debit/credit card is a single card that functions both as a Debit/Credit card. Unified Checkout / Click to Pay Drop-in UI allows the Cardholder to choose whether they would like the transaction to be paid for using either debit or credit card. **Important:** This is applicable to Visa cards only. Possible values: - True - False

**Use Cases:** **Offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to true. - When set to true, Combo Card selection is shown at checkout

**Do not offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to false OR omit the field from the capture context request. - The Combo Card selection is not shown at checkout. + + :return: The combo_card of this Upv1capturecontextsCaptureMandate. + :rtype: bool + """ + return self._combo_card + + @combo_card.setter + def combo_card(self, combo_card): + """ + Sets the combo_card of this Upv1capturecontextsCaptureMandate. + Configure Unified Checkout to display combo card at checkout.
A combo debit/credit card is a single card that functions both as a Debit/Credit card. Unified Checkout / Click to Pay Drop-in UI allows the Cardholder to choose whether they would like the transaction to be paid for using either debit or credit card. **Important:** This is applicable to Visa cards only. Possible values: - True - False

**Use Cases:** **Offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to true. - When set to true, Combo Card selection is shown at checkout

**Do not offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to false OR omit the field from the capture context request. - The Combo Card selection is not shown at checkout. + + :param combo_card: The combo_card of this Upv1capturecontextsCaptureMandate. + :type: bool + """ + + self._combo_card = combo_card + def to_dict(self): """ Returns the model properties as a dict diff --git a/CyberSource/rest.py b/CyberSource/rest.py index 79af195d..8f6c43f6 100644 --- a/CyberSource/rest.py +++ b/CyberSource/rest.py @@ -234,9 +234,9 @@ def request(self, method, url, query_params=None, headers=None, if PY3: r.data = r.data.decode('utf-8') - # log response body - if self.enable_log: - self.logger.debug("response body: %s", r.data) + # # log response body + # if self.enable_log: + # self.logger.debug("response body: %s", r.data) if not 200 <= r.status <= 299: raise ApiException(http_resp=r) diff --git a/CyberSource/utilities/JWEResponse/JWEUtility.py b/CyberSource/utilities/JWEResponse/JWEUtility.py index 6edac296..6d73eaf5 100644 --- a/CyberSource/utilities/JWEResponse/JWEUtility.py +++ b/CyberSource/utilities/JWEResponse/JWEUtility.py @@ -1,13 +1,21 @@ from authenticationsdk.util.JWEUtility import JWEUtility as authJWEUtility from .JWEException.JWEException import JWEException - +from typing_extensions import deprecated class JWEUtility: @staticmethod + @deprecated("This method has been marked as Deprecated and will be removed in coming releases. Use decrypt_jwe_response_using_private_key(private_key, encoded_response) instead.") def decrypt_jwe_response(encoded_response, merchant_config): try: return authJWEUtility.decrypt_jwe_using_pem(merchant_config, encoded_response) except Exception as e: raise JWEException(e) + @staticmethod + def decrypt_jwe_response_using_private_key(private_key, encoded_response): + try: + return authJWEUtility.decrypt_jwe_using_private_key(private_key, encoded_response) + except Exception as e: + raise JWEException(e) + diff --git a/MLE.md b/MLE.md new file mode 100644 index 00000000..9eb0fd6e --- /dev/null +++ b/MLE.md @@ -0,0 +1,132 @@ +[![Generic badge](https://img.shields.io/badge/MLE-NEW-GREEN.svg)](https://shields.io/) + +# Message Level Encryption (MLE) Feature + +This feature provides an implementation of Message Level Encryption (MLE) for APIs provided by CyberSource, integrated within our SDK. This feature ensures secure communication by encrypting messages at the application level before they are sent over the network. + +## Configuration + +### Global MLE Configuration + +In the `merchantConfig` object, set the `useMLEGlobally` variable to enable or disable MLE for all supported APIs for the Rest SDK. + +- **Variable**: `useMLEGlobally` +- **Type**: `Boolean` +- **Default**: `false` +- **Description**: Enables MLE globally for all APIs when set to `true`. If set to `true`, it will enable MLE for all API calls that support MLE by CyberSource, unless overridden by `mapToControlMLEonAPI`. + +### API-level MLE Control + +Optionally, you can control the MLE feature at the API level using the `mapToControlMLEonAPI` variable in the `merchantConfig` object. + +- **Variable**: `mapToControlMLEonAPI` +- **Type**: `Dictionary` +- **Description**: Overrides the global MLE setting for specific APIs. The key is the function name of the API in the SDK, and the value is a boolean indicating whether MLE should be enabled (`true`) or disabled (`false`) for that specific API call. + +### MLE Key Alias + +Another optional parameter for MLE is `mleKeyAlias`, which specifies the key alias used to retrieve the MLE certificate from the JWT P12 file. + +- **Variable**: `mleKeyAlias` +- **Type**: `String` +- **Default**: `CyberSource_SJC_US` +- **Description**: By default, CyberSource uses the `CyberSource_SJC_US` public certificate to encrypt the payload. However, users can override this default value by setting their own key alias. + +## Notes + +- If `useMLEGlobally` is set to true, it will enable MLE for all API calls that support MLE by CyberSource, unless overridden by `mapToControlMLEonAPI`. +- If `mapToControlMLEonAPI` is not provided or does not contain a specific API function name, the global `useMLEGlobally` setting will be applied. +- The `mleKeyAlias` parameter is optional and defaults to `CyberSource_SJC_US` if not specified by the user. Users can override this default value by setting their own key alias. +- Example configurations contain only properties related to MLE. + +## Example Configuration + +### Option 1: Enable MLE globally for all MLE supported APIs + +```python +configuration_dictionary = { + "useMLEGlobally": True # Globally MLE will be enabled for all MLE supported APIs +} + +# OR + +class Configuration: + def __init__(self): + self.useMLEGlobally = True +``` + +### Option 2: Enable/Disable MLE for specific APIs + +```python +configuration_dictionary = { + "useMLEGlobally": True, # Globally MLE will be enabled for all MLE supported APIs + "mapToControlMLEonAPI": { + "apiFunctionName1": False, # if want to disable the particular API from list of MLE supported APIs + "apiFunctionName2": True # if want to enable MLE on API which is not in the list of supported MLE APIs for used version of REST SDK + }, + "mleKeyAlias": "Custom_Key_Alias" # Optional custom value provided by Cybs +} + +# OR + +class Configuration: + def __init__(self): + self.useMLEGlobally = True + self.mapToControlMLEonAPI = { + "apiFunctionName1": False, # if want to disable the particular API from list of MLE supported APIs + "apiFunctionName2": True # if want to enable MLE on API which is not in the list of supported MLE APIs for used version of REST SDK + } + self.mleKeyAlias = "Custom_Key_Alias" # Optional custom value provided by Cybs +``` + +### Option 3: Disable MLE globally and enable for specific APIs + +```python +configuration_dictionary = { + "useMLEGlobally": False, # Globally MLE will be disabled for all APIs + "mapToControlMLEonAPI": { + "apiFunctionName1": True, # if want to enable MLE for API1 + "apiFunctionName2": True # if want to enable MLE for API2 + }, + "mleKeyAlias": "Custom_Key_Alias" # optional if any custom value provided by Cybs +} + +# OR + +class Configuration: + def __init__(self): + self.useMLEGlobally = False # Globally MLE will be disabled for all APIs + self.mapToControlMLEonAPI = { + "apiFunctionName1": True, # if want to enable MLE for API1 + "apiFunctionName2": True # if want to enable MLE for API2 + }, + self.mleKeyAlias = "Custom_Key_Alias" # optional if any custom value provided by Cybs +``` + +In the above examples: +- MLE is enabled/disabled globally (`useMLEGlobally` is true/false). +- `apiFunctionName1` will have MLE disabled/enabled based on value provided. +- `apiFunctionName2` will have MLE enabled. +- `mleKeyAlias` is set to `Custom_Key_Alias`, overriding the default value. + +Please refer to the given link for sample codes with MLE: +https://github.com/CyberSource/cybersource-rest-samples-python/tree/master/samples/MLEFeature + +## Additional Information + +### API Support + +- MLE is initially designed to support a few APIs. +- It can be extended to support more APIs in the future based on requirements and updates. + +### Authentication Type + +- MLE is only supported with `JWT (JSON Web Token)` authentication type within the SDK. + +### Using the SDK + +To use the MLE feature in the SDK, configure the `merchantConfig` object as shown above and pass it to the SDK initialization. + +## Contact + +For any issues or further assistance, please open an issue on the GitHub repository or contact our support team. \ No newline at end of file diff --git a/README.md b/README.md index c8aaf1e8..b7e2d521 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,13 @@ More information about this new logging framework can be found in this file : [L ## Features +### Message Level Encryption (MLE) Feature +[![Generic badge](https://img.shields.io/badge/MLE-NEW-GREEN.svg)](https://shields.io/) + +This feature provides an implementation of Message Level Encryption (MLE) for APIs provided by CyberSource, integrated within our SDK. This feature ensures secure communication by encrypting messages at the application level before they are sent over the network. + +More information about this new MLE feature can be found in this file : [MLE.md](MLE.md) + ## MetaKey Support A Meta Key is a single key that can be used by one, some, or all merchants (or accounts, if created by a Portfolio user) in the portfolio. diff --git a/authenticationsdk/core/Authorization.py b/authenticationsdk/core/Authorization.py index d0198638..1e49b1ab 100644 --- a/authenticationsdk/core/Authorization.py +++ b/authenticationsdk/core/Authorization.py @@ -13,7 +13,7 @@ def __init__(self): self.logger = None # This method generates and return a encrypted signature based on the Authentication type - def get_token(self, mconfig, date_time, logger = None): + def get_token(self, mconfig, date_time, logger = None): authentication_type = mconfig.authentication_type self.validate_request_type_method(mconfig) # Initializing the logger object @@ -38,12 +38,9 @@ def get_token(self, mconfig, date_time, logger = None): # Logging the Digest when Request_type_method is Post if mconfig.request_type_method.upper() == GlobalLabelParameters.POST or mconfig.request_type_method.upper() == GlobalLabelParameters.PUT: digest_obj = DigestAndPayload() - encoded_digest = digest_obj.string_digest_generation( - mconfig.request_json_path_data) - self.logger.info( - GlobalLabelParameters.DIGEST + ":" + GlobalLabelParameters.DIGEST_PREFIX + ( - encoded_digest).decode("utf-8")) - self.logger.info("Signature: " + sig_token) + encoded_digest = digest_obj.string_digest_generation(mconfig.request_json_path_data) + # self.logger.info(GlobalLabelParameters.DIGEST + ":" + GlobalLabelParameters.DIGEST_PREFIX + (encoded_digest).decode("utf-8")) + # self.logger.info("Signature: " + sig_token) return sig_token # JWT-Call diff --git a/authenticationsdk/core/MerchantConfiguration.py b/authenticationsdk/core/MerchantConfiguration.py index 35ddeba0..202bab91 100644 --- a/authenticationsdk/core/MerchantConfiguration.py +++ b/authenticationsdk/core/MerchantConfiguration.py @@ -50,6 +50,9 @@ def __init__(self): self.solution_id = None self.log_config = None self.__jwePEMFileDirectory = None + self.useMLEGlobally = None + self.mapToControlMLEonAPI = None + self.mleKeyAlias = None self.logger = LogFactory.setup_logger(self.__class__.__name__) def set_merchant_keyid(self, value): @@ -180,6 +183,36 @@ def set_jwePEMFileDirectory(self, value): def get_jwePEMFileDirectory(self): return self.__jwePEMFileDirectory + + def set_useMLEGlobally(self, value): + if not (value.get('useMLEGlobally') is None): + self.useMLEGlobally = value['useMLEGlobally'] + else: + self.useMLEGlobally = False + + def get_useMLEGlobally(self): + return self.useMLEGlobally + + def set_mapToControlMLEonAPI(self, value): + map_to_control_mle_on_api = value.get('mapToControlMLEonAPI') + if map_to_control_mle_on_api is not None: + if isinstance(map_to_control_mle_on_api, dict) and all(isinstance(v, (str, bool)) for v in map_to_control_mle_on_api.values()): + self.mapToControlMLEonAPI = map_to_control_mle_on_api + else: + raise ValueError("mapToControlMLEonAPI in merchantConfig must be a dictionary with string : boolean values.") + + def get_mapToControlMLEonAPI(self): + return self.mapToControlMLEonAPI + + def set_mleKeyAlias(self, value): + if value.get('mleKeyAlias') is not None and value.get('mleKeyAlias').strip(): + self.mleKeyAlias = value['mleKeyAlias'].strip() + else: + self.mleKeyAlias = GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT + + def get_mleKeyAlias(self): + return self.mleKeyAlias + # This method sets the Merchant Configuration Variables to its respective values after reading from cybs.properties def set_merchantconfig(self, val): @@ -212,6 +245,9 @@ def set_merchantconfig(self, val): self.set_refresh_token(val) self.set_log_configuration(val) self.set_jwePEMFileDirectory(val) + self.set_useMLEGlobally(val) + self.set_mapToControlMLEonAPI(val) + self.set_mleKeyAlias(val) # Returns the time in format as defined by RFC7231 def get_time(self): @@ -338,6 +374,19 @@ def validate_merchant_details(self, details, mconfig = None): authenticationsdk.util.ExceptionAuth.validate_merchant_details_log(self.logger, GlobalLabelParameters.AUTH_ERROR, self.log_config) + # useMLEGlobally check for auth Type + if self.useMLEGlobally is True or self.mapToControlMLEonAPI is not None: + if self.useMLEGlobally is True and self.authentication_type.lower() != GlobalLabelParameters.JWT.lower(): + authenticationsdk.util.ExceptionAuth.validate_merchant_details_log(self.logger, + GlobalLabelParameters.MLE_AUTH_ERROR, + self.log_config) + + if self.mapToControlMLEonAPI is not None and len(self.mapToControlMLEonAPI) != 0: + has_true_value = any(value is True for value in self.mapToControlMLEonAPI.values()) + if has_true_value and self.authentication_type.lower() != GlobalLabelParameters.JWT.lower(): + authenticationsdk.util.ExceptionAuth.validate_merchant_details_log(self.logger, + GlobalLabelParameters.MLE_AUTH_ERROR, + self.log_config) log_items = GlobalLabelParameters.HIDE_MERCHANT_CONFIG_PROPS # This displays the logic for logging all cybs.json values diff --git a/authenticationsdk/http/HTTPSignatureToken.py b/authenticationsdk/http/HTTPSignatureToken.py index 5c0b08db..4d38fca3 100644 --- a/authenticationsdk/http/HTTPSignatureToken.py +++ b/authenticationsdk/http/HTTPSignatureToken.py @@ -40,9 +40,6 @@ def get_token(self): return self.signature_header() def signature_header(self): - - # Initializing the logger object - header_list = ([]) # Key id is the key obtained from EBC header_list.append( diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 8da26069..37e4620a 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -2,68 +2,95 @@ import ssl from jwcrypto import jwk +from cryptography import x509 from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import pkcs12 +from typing_extensions import deprecated + from authenticationsdk.util.GlobalLabelParameters import * class FileCache: - def __init__(self): + _instance = None + + def __new__(cls, *args, **kwargs): + if not cls._instance: + cls._instance = super(FileCache, cls).__new__(cls, *args, **kwargs) + # Initialize your cache here + cls._instance._initialize_cache() + return cls._instance + + def _initialize_cache(self): + # Your cache initialization code here self.filecache = {} + @deprecated("This method has been marked as Deprecated and will be removed in coming releases.") def get_private_key_from_pem(self, pem_file_path): with open(pem_file_path, 'r') as pem_file: cert = pem_file.read() private_key = jwk.JWK.from_pem(cert.encode('utf-8')) return private_key + + def load_certificates(self, filepath, filename, password): + return pkcs12.load_key_and_certificates( + open(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX, 'rb').read(), + password=password.encode(), + backend=default_backend() + ) + + def get_cert_based_on_key_alias(self, certificate, additional_certificates, key_alias): + target_cert = None + + # Check the main certificate + for attribute in certificate.subject: + if attribute.oid.dotted_string == '2.5.4.3': # OID for CN + cn_value = attribute.value + if cn_value == key_alias: + target_cert = certificate + break + + # Check the additional certificates if not found in the main certificate + if not target_cert: + for cert in additional_certificates: + for attribute in cert.subject: + if attribute.oid.dotted_string == '2.5.4.3': # OID for CN + cn_value = attribute.value + if cn_value == key_alias: + target_cert = cert + break + if target_cert: + break + + return target_cert + + + def update_cache(self, mconfig, filepath, filename): + file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime + private_key, certificate, additional_certificates = self.load_certificates(filepath, filename, mconfig.key_password) + + jwt_cert= self.get_cert_based_on_key_alias(certificate, additional_certificates, mconfig.key_alias) + jwt_cert_pem = jwt_cert.public_bytes(serialization.Encoding.PEM) + jwt_cert_pem_str = jwt_cert_pem.decode('utf-8') + jwt_der_cert_string = base64.b64encode(ssl.PEM_cert_to_DER_cert(jwt_cert_pem_str)) + + mle_cert = self.get_cert_based_on_key_alias(certificate, additional_certificates, mconfig.get_mleKeyAlias()) + + self.filecache[str(filename)] = [jwt_der_cert_string, private_key, file_mod_time, mle_cert] def grab_file(self, mconfig, filepath, filename): - - file_mod_time = os.stat(os.path.join(filepath, filename)+GlobalLabelParameters.P12_PREFIX).st_mtime - - if filename not in self.filecache: - - private_key, certificate, additional_certificates = pkcs12.load_key_and_certificates( - open(os.path.join(filepath, filename)+GlobalLabelParameters.P12_PREFIX,'rb').read() , - password=(mconfig.key_password).encode(), - backend=default_backend() - ) - - cert_pem = certificate.public_bytes(serialization.Encoding.PEM) - cert_pem_str = cert_pem.decode('utf-8') - der_cert_string = base64.b64encode(ssl.PEM_cert_to_DER_cert(cert_pem_str)) - - self.filecache.setdefault(str(filename), []).append(der_cert_string) - self.filecache.setdefault(str(filename), []).append(private_key) - self.filecache.setdefault(str(filename), []).append(file_mod_time) - - if file_mod_time != self.filecache[filename][2]: - private_key, certificate, additional_certificates = pkcs12.load_key_and_certificates( - open(os.path.join(filepath, filename)+GlobalLabelParameters.P12_PREFIX,'rb').read() , - password=(mconfig.key_password).encode(), - backend=default_backend() - ) - - cert_pem = certificate.public_bytes(serialization.Encoding.PEM) - cert_pem_str = cert_pem.decode('utf-8') - der_cert_string = base64.b64encode(ssl.PEM_cert_to_DER_cert(cert_pem_str)) - - self.filecache.setdefault(str(filename), []).append(der_cert_string) - self.filecache.setdefault(str(filename), []).append(private_key) - self.filecache.setdefault(str(filename), []).append(file_mod_time) - + file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime + if filename not in self.filecache or file_mod_time != self.filecache[filename][2]: + self.update_cache(mconfig, filepath, filename) return self.filecache[filename] + @deprecated("This method has been marked as Deprecated and will be removed in coming releases.") def get_cached_private_key_from_pem(self, file_path, cache_key): file_mod_time = os.stat(file_path).st_mtime if (cache_key not in self.filecache) or file_mod_time != self.filecache[str(cache_key)][1]: private_key = self.get_private_key_from_pem(file_path) - self.filecache.setdefault(str(cache_key), []).append(private_key) - self.filecache.setdefault(str(cache_key), []).append(file_mod_time) + self.filecache[str(cache_key)] = [private_key, file_mod_time] return self.filecache[str(cache_key)][0] - - diff --git a/authenticationsdk/util/GlobalLabelParameters.py b/authenticationsdk/util/GlobalLabelParameters.py index 636e9136..568958b0 100644 --- a/authenticationsdk/util/GlobalLabelParameters.py +++ b/authenticationsdk/util/GlobalLabelParameters.py @@ -75,9 +75,10 @@ class GlobalLabelParameters: REQUEST_JSON_EMPTY = "RequestJsonPath not provided" INVALID_REQUEST_TYPE_METHOD = "Entered Request Type should be (GET/POST/PUT/PATCH)" RUN_ENVIRONMENT_EMPTY = "RunEnvironment Is Mandatory." + MLE_AUTH_ERROR = "MLE is only supported in JWT auth type" DEFAULT_LOG_FILE_NAME = "Log File Name Empty/None.Using Default Value" DEFAULT_ENABLE_LOG = False - DEFAULT_ENABLE_MASKING = False + DEFAULT_ENABLE_MASKING = True DEFAULT_MAXIMUM_SIZE = 10487560 DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" DEFAULT_LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" @@ -86,9 +87,13 @@ class GlobalLabelParameters: DEFAULT_LOG_DIRECTORY =os.path.join(os.getcwd(),"Logs") DEFAULT_PROXY_PORT = 443 DEFAULT_KEY_FILE_PATH = os.path.join(os.getcwd(),"resources") + DEFAULT_MLE_ALIAS_FOR_CERT = "CyberSource_SJC_US" ENABLE_LOG_DEFAULT_MESSAGE = "Enable log value Empty/None.Using Default Value" LOG_MAXIMUM_SIZE_DEFAULT_MESSAGE = "Log Maximum Size Empty/None.Using Default Value" LOG_DIRECTORY_DEFAULT_MESSAGE = "Log Directory value Empty/None.Using Default Value" LOG_DIRECTORY_INCORRECT_MESSAGE = "Log Directory value Incorrect.Using Default Value" INVALID_CYBS_PATH = "The Cybs.Json Path Provided Is Incorrect" DEPRECATED_RUN_ENVIRONMENT = "The value provided for this field `RunEnvironment` has been deprecated and will not be used anymore.\n\nPlease refer to the README file [ https://github.com/CyberSource/cybersource-rest-samples-node/blob/master/README.md ] for information about the new values that are accepted." + CERTIFICATE_EXPIRY_DATE_WARNING_DAYS = 90 + MESSAGE_BEFORE_MLE_REQUEST = "Request before MLE: " + MESSAGE_AFTER_MLE_REQUEST = "Request after MLE: " diff --git a/authenticationsdk/util/JWEUtility.py b/authenticationsdk/util/JWEUtility.py index d8c9f8c4..2fb5be78 100644 --- a/authenticationsdk/util/JWEUtility.py +++ b/authenticationsdk/util/JWEUtility.py @@ -2,9 +2,12 @@ from authenticationsdk.util.Cache import FileCache +from typing_extensions import deprecated + class JWEUtility: @staticmethod + @deprecated("This method has been marked as Deprecated and will be removed in coming releases. Use decrypt_jwe_using_private_key(private_key, encoded_message) instead.") def decrypt_jwe_using_pem(merchant_config, jwe_base_64_data): jwe_token = jwe.JWE() cache_obj = FileCache() @@ -12,3 +15,11 @@ def decrypt_jwe_using_pem(merchant_config, jwe_base_64_data): jwe_token.deserialize(jwe_base_64_data, cached_private_key) payload = jwe_token.payload return payload.decode('utf-8') + + @staticmethod + def decrypt_jwe_using_private_key(private_key, encoded_message): + jwe_token = jwe.JWE() + jwe_token.deserialize(encoded_message, private_key) + payload = jwe_token.payload + return payload.decode('utf-8') + diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py new file mode 100644 index 00000000..ec97617c --- /dev/null +++ b/authenticationsdk/util/MLEUtility.py @@ -0,0 +1,132 @@ +import json +import time +from datetime import datetime, timezone + +from cryptography import x509 +from jwcrypto import jwk, jwe + +from authenticationsdk.util.Cache import FileCache +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +import CyberSource.logging.log_factory as LogFactory + +class MLEUtility: + class MLEException(Exception): + def __init__(self, message, errors=None): + super().__init__(message) + self.errors = errors + + @staticmethod + def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids): + + is_mle_for_api = False + if is_mle_supported_by_cybs_for_api and merchant_config.get_useMLEGlobally(): + is_mle_for_api = True + operation_array = [op_id.strip() for op_id in operation_ids.split(",")] + map_to_control_mle = merchant_config.get_mapToControlMLEonAPI() + if map_to_control_mle is not None and map_to_control_mle: + for op_id in operation_array: + if op_id in map_to_control_mle: + is_mle_for_api = map_to_control_mle[op_id] + break + return is_mle_for_api + + @staticmethod + def encrypt_request_payload(merchant_config, request_body): + if request_body is None or request_body == "": + return request_body + + logger = LogFactory.setup_logger(__name__, merchant_config.log_config) + + if merchant_config.log_config.enable_log: + logger.debug(f"{GlobalLabelParameters.MESSAGE_BEFORE_MLE_REQUEST}{request_body}") + + cert = MLEUtility.get_mle_certificate(merchant_config, logger) + + try: + serialized_jwe_token = MLEUtility.generate_token(cert, request_body, merchant_config.log_config, logger) + mleRequest = MLEUtility.create_json_object(serialized_jwe_token) + if merchant_config.log_config.enable_log: + logger.debug(f"{GlobalLabelParameters.MESSAGE_AFTER_MLE_REQUEST}{mleRequest}") + return mleRequest + + except Exception as e: + if merchant_config.log_config.enable_log: + logger.error(f"Error encrypting request payload: {str(e)}") + raise MLEUtility.MLEException(f"Error encrypting request payload: {str(e)}") + + @staticmethod + def generate_token(cert, request_body, log_config, logger): + public_key = cert.public_key() + serial_number = MLEUtility.extract_serial_number(cert, log_config, logger) + + jwk_key = jwk.JWK.from_pyca(public_key) + payload = request_body.encode('utf-8') + + header = { + "alg": "RSA-OAEP-256", + "enc": "A256GCM", + "cty": "JWT", + "kid": serial_number, + "iat": int(time.time()) + } + + jwe_token = jwe.JWE(plaintext=payload, protected=json.dumps(header)) + jwe_token.add_recipient(jwk_key) + + return jwe_token.serialize(compact=True) + + @staticmethod + def get_mle_certificate(merchant_config, logger): + cache_obj = FileCache() + try: + cert_data = cache_obj.grab_file(merchant_config, merchant_config.key_file_path, merchant_config.key_file_name) + mle_certificate_x509 = cert_data[3] + if mle_certificate_x509 is not None: + MLEUtility.validate_certificate_expiry(mle_certificate_x509, merchant_config.get_mleKeyAlias(), merchant_config.log_config, logger) + return mle_certificate_x509 + else: + if merchant_config.log_config.enable_log: + logger.error(f"No certificate found for MLE for given mleKeyAlias {merchant_config.get_mleKeyAlias()} in p12 file {merchant_config.key_file_name}.p12") + raise MLEUtility.MLEException(f"No certificate found for MLE for given mleKeyAlias {merchant_config.get_mleKeyAlias()} in p12 file {merchant_config.key_file_name}.p12") + except KeyError: + if merchant_config.log_config.enable_log: + logger.error(f"No certificate found for MLE for given mleKeyAlias {merchant_config.get_mleKeyAlias()} in p12 file {merchant_config.key_file_name}.p12") + raise MLEUtility.MLEException(f"No certificate found for MLE for given mleKeyAlias {merchant_config.get_mleKeyAlias()} in p12 file {merchant_config.key_file_name}.p12") + except Exception as e: + if merchant_config.log_config.enable_log: + logger.error(f"Unable to load certificate: {str(e)}") + raise MLEUtility.MLEException(f"Unable to load PEM file: {str(e)}") + + @staticmethod + def extract_serial_number(x509_certificate, log_config, logger): + serial_number = None + + for attribute in x509_certificate.subject: + if attribute.oid == x509.NameOID.SERIAL_NUMBER: + serial_number = attribute.value + break + if serial_number is None: + if log_config.enable_log: + logger.warning("Serial number not found in MLE certificate for alias.") + serial_number = str(x509_certificate.serial_number) + return serial_number + + @staticmethod + def create_json_object(jwe_token): + return json.dumps({"encryptedRequest": jwe_token}) + + @staticmethod + def validate_certificate_expiry(certificate, key_alias, log_config, logger): + try: + if certificate.not_valid_after_utc < datetime.now(timezone.utc): + if log_config.enable_log: + logger.warning(f"Certificate with MLE alias {key_alias} is expired as of {certificate.not_valid_after_utc}. Please update p12 file.") + # raise Exception(f"Certificate with MLE alias {key_alias} is expired.") + else: + time_to_expire = (certificate.not_valid_after_utc - datetime.now(timezone.utc)).total_seconds() + if time_to_expire < GlobalLabelParameters.CERTIFICATE_EXPIRY_DATE_WARNING_DAYS * 24 * 60 * 60: + if log_config.enable_log: + logger.warning(f"Certificate for MLE with alias {key_alias} is going to expire on {certificate.not_valid_after_utc}. Please update p12 file before that.") + except Exception as e: + if log_config.enable_log: + logger.error(f"Error while checking certificate expiry: {str(e)}") \ No newline at end of file diff --git a/authenticationsdk/util/Utility.py b/authenticationsdk/util/Utility.py index 9c6ea4c6..878d8ba4 100644 --- a/authenticationsdk/util/Utility.py +++ b/authenticationsdk/util/Utility.py @@ -1,3 +1,6 @@ +import json +import re + def get_response_code_message(response): switcher = { 200: "Transaction Successful", @@ -13,3 +16,33 @@ def get_response_code_message(response): } return switcher.get(response, "Un-Identified") + +def replace_underscore(dict_obj, deep=True): + assert type(dict_obj) == dict + converted_dict_obj = {} + for snake_case_k in dict_obj: + camel_case_k = re.sub('_([a-z])', lambda match: match.group(1).upper(), snake_case_k) + value = dict_obj[snake_case_k] + + if type(value) == dict and deep: + converted_dict_obj[camel_case_k] = replace_underscore(value, deep) + elif type(value) == list and deep: + converted_list_items = [] + for item in value: + if type(item) == str: + converted_list_items.append(item) + else: + converted_list_items.append(replace_underscore(item, deep)) + converted_dict_obj[camel_case_k] = converted_list_items + else: + converted_dict_obj[camel_case_k] = dict_obj[snake_case_k] + return converted_dict_obj + +def process_body(body): + temp_body = body.replace("\"_", "\"") + request_body = replace_underscore(json.loads(temp_body)) + body = json.dumps(request_body) + body = body.replace("companyTaxId", "companyTaxID") + body = body.replace("productSku", "productSKU") + body = body.replace("secCode", "SECCode") + return body diff --git a/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md b/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md index 8b75b2d0..301413ed 100644 --- a/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md +++ b/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **parent_profile_id** | **str** | Specify the Vault ID to which transacting MID needs to be assigned.Provide Vault ID as seen on EBC Vault management page. If not provided , transacting MID will be assigned to the existing default Vault at merchant's level. If there are no Vaults at merchant level , a new Vault will be created and transacting MID will be assigned to it. | [optional] **vault** | [**CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault**](CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault.md) | | [optional] +**network_token_enrollment** | [**NetworkTokenEnrollment**](NetworkTokenEnrollment.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GenerateCaptureContextRequest.md b/docs/GenerateCaptureContextRequest.md index 92c93974..963d3a4a 100644 --- a/docs/GenerateCaptureContextRequest.md +++ b/docs/GenerateCaptureContextRequest.md @@ -5,8 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client_version** | **str** | Specify the version of Microform that you want to use. | [optional] **target_origins** | **list[str]** | The [target origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) of the website on which you will be launching Microform is defined by the scheme (protocol), hostname (domain) and port number (if used). You must use https://hostname (unless you use http://localhost) Wildcards are NOT supported. Ensure that subdomains are included. Any valid top-level domain is supported (e.g. .com, .co.uk, .gov.br etc) Examples: - https://example.com - https://subdomain.example.com - https://example.com:8080<br><br> If you are embedding within multiple nested iframes you need to specify the origins of all the browser contexts used, for example: targetOrigins: [ \"https://example.com\", \"https://basket.example.com\", \"https://ecom.example.com\" ] | [optional] -**allowed_card_networks** | **list[str]** | The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Accept Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (Accept Check) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Accept Card) and Microform (Accept Check) at least one card network should be specified in the allowedCardNetworks field in the capture context request. | [optional] +**allowed_card_networks** | **list[str]** | The list of card networks you want to use for this Microform transaction. Microform currently supports the following card networks: - VISA - MASTERCARD - AMEX - CARNET - CARTESBANCAIRES - CUP - DINERSCLUB - DISCOVER - EFTPOS - ELO - JCB - JCREW - MADA - MAESTRO - MEEZA **Important:** - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request. - When integrating Microform (ACH/Echeck) the allowedCardNetworks field is not required in the capture context request. - When integrating both Microform (Card) and Microform (ACH/Echeck) at least one card network should be specified in the allowedCardNetworks field in the capture context request. | [optional] **allowed_payment_types** | **list[str]** | The payment types that are allowed for the merchant. Possible values when launching Microform: - CARD - CHECK <br><br> | [optional] +**transient_token_response_options** | [**Microformv2sessionsTransientTokenResponseOptions**](Microformv2sessionsTransientTokenResponseOptions.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GenerateUnifiedCheckoutCaptureContextRequest.md b/docs/GenerateUnifiedCheckoutCaptureContextRequest.md index 2b4f4e51..4bf09995 100644 --- a/docs/GenerateUnifiedCheckoutCaptureContextRequest.md +++ b/docs/GenerateUnifiedCheckoutCaptureContextRequest.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **locale** | **str** | Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code. Please refer to list of [supported locales through Unified Checkout](https://developer.cybersource.com/docs/cybs/en-us/unified-checkout/developer/all/rest/unified-checkout/uc-appendix-languages.html) | [optional] **capture_mandate** | [**Upv1capturecontextsCaptureMandate**](Upv1capturecontextsCaptureMandate.md) | | [optional] **order_information** | [**Upv1capturecontextsOrderInformation**](Upv1capturecontextsOrderInformation.md) | | [optional] +**transient_token_response_options** | [**Microformv2sessionsTransientTokenResponseOptions**](Microformv2sessionsTransientTokenResponseOptions.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Microformv2sessionsTransientTokenResponseOptions.md b/docs/Microformv2sessionsTransientTokenResponseOptions.md new file mode 100644 index 00000000..9cdb5127 --- /dev/null +++ b/docs/Microformv2sessionsTransientTokenResponseOptions.md @@ -0,0 +1,10 @@ +# Microformv2sessionsTransientTokenResponseOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**include_card_prefix** | **bool** | Use the transientTokenResponseOptions.includeCardPrefix field to choose your preferred card number prefix length: 6-digit, 8-digit, or no card number prefix. Possible values: - True - False<br><br> To select the type of card number prefix: - No field included: A 6-digit prefix is returned (default) - True: An 8-digit prefix is returned - False: No prefix is returned<br><br> The following conditions apply: - 8-digit card number prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa brands with 16-digit card numbers or more. - Any card with less than 16-digit numbers will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true. - If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay, or Visa, an 8-digit prefix will be returned if the transientTokenResponseOptions.includeCardPrefix field is set to true.<br><br> **Important:** If your application does NOT require a card number prefix for routing or identification purposes, set the transientTokenResponseOptions.includeCardPrefix field to False. This will minimize your personal data exposure. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NetworkTokenEnrollment.md b/docs/NetworkTokenEnrollment.md new file mode 100644 index 00000000..97a6da7f --- /dev/null +++ b/docs/NetworkTokenEnrollment.md @@ -0,0 +1,11 @@ +# NetworkTokenEnrollment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**business_information** | [**TmsBusinessInformation**](TmsBusinessInformation.md) | | [optional] +**network_token_services** | [**NetworkTokenServicesEnablement**](NetworkTokenServicesEnablement.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NetworkTokenServicesEnablement.md b/docs/NetworkTokenServicesEnablement.md new file mode 100644 index 00000000..d8b03b1b --- /dev/null +++ b/docs/NetworkTokenServicesEnablement.md @@ -0,0 +1,11 @@ +# NetworkTokenServicesEnablement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**visa_token_service** | [**NetworkTokenServicesEnablementVisaTokenService**](NetworkTokenServicesEnablementVisaTokenService.md) | | [optional] +**mastercard_digital_enablement_service** | [**NetworkTokenServicesEnablementMastercardDigitalEnablementService**](NetworkTokenServicesEnablementMastercardDigitalEnablementService.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NetworkTokenServicesEnablementMastercardDigitalEnablementService.md b/docs/NetworkTokenServicesEnablementMastercardDigitalEnablementService.md new file mode 100644 index 00000000..aa3275da --- /dev/null +++ b/docs/NetworkTokenServicesEnablementMastercardDigitalEnablementService.md @@ -0,0 +1,10 @@ +# NetworkTokenServicesEnablementMastercardDigitalEnablementService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enrollment** | **bool** | Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NetworkTokenServicesEnablementVisaTokenService.md b/docs/NetworkTokenServicesEnablementVisaTokenService.md new file mode 100644 index 00000000..079c604e --- /dev/null +++ b/docs/NetworkTokenServicesEnablementVisaTokenService.md @@ -0,0 +1,10 @@ +# NetworkTokenServicesEnablementVisaTokenService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enrollment** | **bool** | Indicates if an enrollment to create a TRID for the Visa card association should be attempted | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TmsBusinessInformation.md b/docs/TmsBusinessInformation.md new file mode 100644 index 00000000..cafd1cdd --- /dev/null +++ b/docs/TmsBusinessInformation.md @@ -0,0 +1,16 @@ +# TmsBusinessInformation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the network token merchant. | [optional] +**doing_business_as** | **str** | Name the network token merchant does business as | [optional] +**address** | [**TmsBusinessInformationAddress**](TmsBusinessInformationAddress.md) | | [optional] +**website_url** | **str** | Website of network token merchant. | [optional] +**business_identification_type** | **str** | The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided. | [optional] +**business_identification_value** | **str** | The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided. | [optional] +**acquirer** | [**TmsBusinessInformationAcquirer**](TmsBusinessInformationAcquirer.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TmsBusinessInformationAcquirer.md b/docs/TmsBusinessInformationAcquirer.md new file mode 100644 index 00000000..7424c2dc --- /dev/null +++ b/docs/TmsBusinessInformationAcquirer.md @@ -0,0 +1,11 @@ +# TmsBusinessInformationAcquirer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acquirer_id** | **str** | Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided. | [optional] +**acquirer_merchant_id** | **str** | Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TmsBusinessInformationAddress.md b/docs/TmsBusinessInformationAddress.md new file mode 100644 index 00000000..0f9b13dc --- /dev/null +++ b/docs/TmsBusinessInformationAddress.md @@ -0,0 +1,11 @@ +# TmsBusinessInformationAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | Country of network token merchant. | [optional] +**locality** | **str** | City of network token merchant. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Upv1capturecontextsCaptureMandate.md b/docs/Upv1capturecontextsCaptureMandate.md index 563fcf32..8dd3caac 100644 --- a/docs/Upv1capturecontextsCaptureMandate.md +++ b/docs/Upv1capturecontextsCaptureMandate.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **request_shipping** | **bool** | Configure Unified Checkout to capture customer shipping details. Possible values: - True - False | [optional] **ship_to_countries** | **list[str]** | List of countries available to ship to. Use the two-character ISO Standard Country Codes. | [optional] **show_accepted_network_icons** | **bool** | Configure Unified Checkout to display the list of accepted card networks beneath the payment button Possible values: - True - False | [optional] +**request_save_card** | **bool** | Configure Unified Checkout to display the \"Save card for future use\" checkbox.<br> Configurable check box that will show in a Manual card entry flow to allow a Cardholder to give consent to store their manually entered credential with the Merchant that they are paying.<br> Applicable when manually entering the details and not enrolling in Click to Pay. Possible values: - True - False<br><br> **Use Cases:** **Offer consumers option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to true. - When set to true, this will show a checkbox with the message 'Save card for future use' in Unified Checkout. - When selected this provides a response in both the Transient Token and Get Credentials API response.<br><br> **Do not offer consumers the option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to false OR omit the field from the capture context request. - When set to false, the save card option is not shown to consumers when manually entering card details. | [optional] +**combo_card** | **bool** | Configure Unified Checkout to display combo card at checkout.<br> A combo debit/credit card is a single card that functions both as a Debit/Credit card. Unified Checkout / Click to Pay Drop-in UI allows the Cardholder to choose whether they would like the transaction to be paid for using either debit or credit card. **Important:** This is applicable to Visa cards only. Possible values: - True - False<br><br> **Use Cases:** **Offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to true. - When set to true, Combo Card selection is shown at checkout <br><br> **Do not offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to false OR omit the field from the capture context request. - The Combo Card selection is not shown at checkout. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/generator/cybersource-python-template/api.mustache b/generator/cybersource-python-template/api.mustache index 11edc4f5..8a95894e 100644 --- a/generator/cybersource-python-template/api.mustache +++ b/generator/cybersource-python-template/api.mustache @@ -14,6 +14,9 @@ from six import iteritems from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body from ..utilities.tracking.sdk_tracker import SdkTracker {{#operations}} @@ -190,6 +193,14 @@ class {{classname}}(object): body_params = '{}' {{/bodyParam}} {{#hasProduces}} + + if '{{httpMethod}}' == GlobalLabelParameters.POST or '{{httpMethod}}' == GlobalLabelParameters.PUT or '{{httpMethod}}' == GlobalLabelParameters.PATCH: + body_params = process_body(body_params) + + is_mle_supported_by_cybs_for_api = {{#vendorExtensions.x-devcenter-metaData.isMLEsupported}}True{{/vendorExtensions.x-devcenter-metaData.isMLEsupported}}{{^vendorExtensions.x-devcenter-metaData.isMLEsupported}}False{{/vendorExtensions.x-devcenter-metaData.isMLEsupported}} + if MLEUtility.check_is_mle_for_api(self.api_client.mconfig, is_mle_supported_by_cybs_for_api, "{{operationId}},{{operationId}}_with_http_info"): + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) diff --git a/generator/cybersource-python-template/api_client.mustache b/generator/cybersource-python-template/api_client.mustache index b3cc896e..f3cd5a90 100644 --- a/generator/cybersource-python-template/api_client.mustache +++ b/generator/cybersource-python-template/api_client.mustache @@ -421,12 +421,12 @@ class ApiClient(object): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in iteritems(data)} @@ -457,13 +457,6 @@ class ApiClient(object): if header_params['Content-Type'] == 'application/x-www-form-urlencoded': post_params = body - if method.upper() == GlobalLabelParameters.POST or method.upper() == GlobalLabelParameters.PUT or method.upper() == GlobalLabelParameters.PATCH: - temp_body = body.replace("\"_", "\"") - request_body = self.replace_underscore(json.loads(temp_body)) - body = json.dumps(request_body) - body = body.replace("companyTaxId", "companyTaxID") - body = body.replace("productSku", "productSKU") - body = body.replace("secCode", "SECCode") query_param_path = self.set_query_params(resource_path, query_params) if query_param_path: self.mconfig.request_target = query_param_path diff --git a/generator/cybersource-python-template/rest.mustache b/generator/cybersource-python-template/rest.mustache index 4d3cc980..ba5bc882 100644 --- a/generator/cybersource-python-template/rest.mustache +++ b/generator/cybersource-python-template/rest.mustache @@ -226,9 +226,9 @@ class RESTClientObject(object): if PY3: r.data = r.data.decode('utf-8') - # log response body - if self.enable_log: - self.logger.debug("response body: %s", r.data) + # # log response body + # if self.enable_log: + # self.logger.debug("response body: %s", r.data) if not 200 <= r.status <= 299: raise ApiException(http_resp=r) diff --git a/generator/cybersource-rest-spec.json b/generator/cybersource-rest-spec.json index 8671afd9..e494a3c6 100644 --- a/generator/cybersource-rest-spec.json +++ b/generator/cybersource-rest-spec.json @@ -68404,7 +68404,7 @@ "items": { "type": "string" }, - "description": "The list of card networks you want to use for this Microform transaction.\n\nMicroform currently supports the following card networks:\n- VISA\n- MASTERCARD\n- AMEX\n- CARNET\n- CARTESBANCAIRES\n- CUP\n- DINERSCLUB\n- DISCOVER\n- EFTPOS\n- ELO\n- JCB\n- JCREW\n- MADA\n- MAESTRO\n- MEEZA\n\n**Important:** \n - When integrating Microform (Accept Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request.\n - When integrating Microform (Accept Check) the allowedCardNetworks field is not required in the capture context request.\n - When integrating both Microform (Accept Card) and Microform (Accept Check) at least one card network should be specified in the allowedCardNetworks field in the capture context request.\n" + "description": "The list of card networks you want to use for this Microform transaction.\n\nMicroform currently supports the following card networks:\n- VISA\n- MASTERCARD\n- AMEX\n- CARNET\n- CARTESBANCAIRES\n- CUP\n- DINERSCLUB\n- DISCOVER\n- EFTPOS\n- ELO\n- JCB\n- JCREW\n- MADA\n- MAESTRO\n- MEEZA\n\n**Important:** \n - When integrating Microform (Card) at least one card network should be specified in the allowedCardNetworks field in the capture context request.\n - When integrating Microform (ACH/Echeck) the allowedCardNetworks field is not required in the capture context request.\n - When integrating both Microform (Card) and Microform (ACH/Echeck) at least one card network should be specified in the allowedCardNetworks field in the capture context request.\n" }, "allowedPaymentTypes": { "type": "array", @@ -68412,6 +68412,15 @@ "type": "string" }, "description": "The payment types that are allowed for the merchant. \n\nPossible values when launching Microform:\n- CARD\n- CHECK

\n" + }, + "transientTokenResponseOptions": { + "type": "object", + "properties": { + "includeCardPrefix": { + "type": "boolean", + "description": "Use the transientTokenResponseOptions.includeCardPrefix field to choose your preferred card number prefix length: 6-digit, 8-digit, or no card number prefix.\n\nPossible values:\n- True\n- False

\n\nTo select the type of card number prefix:\n- No field included: A 6-digit prefix is returned (default)\n- True: An 8-digit prefix is returned\n- False: No prefix is returned

\n\nThe following conditions apply:\n- 8-digit card number prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa brands with 16-digit card numbers or more.\n- Any card with less than 16-digit numbers will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true.\n- Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true.\n- If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay, or Visa, an 8-digit prefix will be returned if the transientTokenResponseOptions.includeCardPrefix field is set to true.

\n\n**Important:** \nIf your application does NOT require a card number prefix for routing or identification purposes, set the transientTokenResponseOptions.includeCardPrefix field to False. This will minimize your personal data exposure.\n" + } + } } } } @@ -68419,7 +68428,7 @@ ], "x-example": { "example0": { - "summary": "Generate Capture Context (Accept Card)", + "summary": "Generate Capture Context (Card)", "value": { "clientVersion": "v2", "targetOrigins": [ @@ -68448,7 +68457,7 @@ } }, "example1": { - "summary": "Generate Capture Context (Accept Check)", + "summary": "Generate Capture Context (ACH/Echeck)", "value": { "clientVersion": "v2", "targetOrigins": [ @@ -68458,6 +68467,38 @@ "CHECK" ] } + }, + "example2": { + "summary": "Generate Capture Context (Card - Opt-out of receiving card number prefix)", + "value": { + "clientVersion": "v2", + "targetOrigins": [ + "https://www.test.com" + ], + "allowedCardNetworks": [ + "VISA", + "MASTERCARD", + "AMEX", + "CARNET", + "CARTESBANCAIRES", + "CUP", + "DINERSCLUB", + "DISCOVER", + "EFTPOS", + "ELO", + "JCB", + "JCREW", + "MADA", + "MAESTRO", + "MEEZA" + ], + "allowedPaymentTypes": [ + "CARD" + ], + "transientTokenResponseOptions": { + "includeCardPrefix": false + } + } } }, "responses": { @@ -107428,6 +107469,110 @@ } } } + }, + "networkTokenEnrollment": { + "title": "networkTokenEnrollment", + "type": "object", + "properties": { + "businessInformation": { + "title": "tmsBusinessInformation", + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 60, + "minLength": 1, + "pattern": "^[0-9a-zA-Z _\\-\\+\\.\\*\\\"/'&\\,\\(\\)!$;:?@\\#\u00a1-\uffff]+$", + "description": "Name of the network token merchant.", + "example": "NetworkTokenMerchant" + }, + "doingBusinessAs": { + "type": "string", + "maxLength": 60, + "pattern": "^[0-9a-zA-Z _\\-\\+\\.\\*\\\"/'&\\,\\(\\)!$;:?@\\#\u00a1-\uffff]+$", + "description": "Name the network token merchant does business as", + "example": "NetworkTokenCo1" + }, + "address": { + "type": "object", + "properties": { + "country": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "pattern": "^[\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u01ffa-zA-Z0-9().\\-_#,;/@$:!% ]{1,}$", + "description": "Country of network token merchant.", + "example": "US" + }, + "locality": { + "type": "string", + "maxLength": 50, + "minLength": 1, + "pattern": "^[0-9a-zA-Z _\\-\u00a1-\uffff]+$", + "description": "City of network token merchant.", + "example": "ORMOND BEACH" + } + } + }, + "websiteUrl": { + "type": "string", + "maxLength": 100, + "pattern": "\\b((?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?\u00c2\u00ab\u00c2\u00bb\u00e2\u20ac\u0153\u00e2\u20ac.\u00e2\u20ac\u02dc\u00e2\u20ac\u2122]))", + "description": "Website of network token merchant.", + "example": "https://www.NetworkTokenMerchant.com" + }, + "businessIdentificationType": { + "type": "string", + "description": "The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided.\n", + "maxLength": 15 + }, + "businessIdentificationValue": { + "type": "string", + "description": "The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided.\n", + "maxLength": 25 + }, + "acquirer": { + "type": "object", + "properties": { + "acquirerId": { + "type": "string", + "description": "Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided.\n", + "maxLength": 15 + }, + "acquirerMerchantId": { + "type": "string", + "description": "Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided.\n", + "maxLength": 25 + } + } + } + } + }, + "networkTokenServices": { + "title": "NetworkTokenServicesEnablement", + "type": "object", + "properties": { + "visaTokenService": { + "type": "object", + "properties": { + "enrollment": { + "type": "boolean", + "description": "Indicates if an enrollment to create a TRID for the Visa card association should be attempted" + } + } + }, + "mastercardDigitalEnablementService": { + "type": "object", + "properties": { + "enrollment": { + "type": "boolean", + "description": "Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted" + } + } + } + } + } + } } } } @@ -111323,6 +111468,109 @@ } } } + }, + "example12": { + "summary": "Merchant Boarding with TMS and Network Token TRID Enrollment (Production Only)", + "value": { + "organizationInformation": { + "parentOrganizationId": "apitester00", + "type": "MERCHANT", + "configurable": "true", + "businessInformation": { + "name": "StuartWickedFastEatz", + "address": { + "country": "US", + "address1": "123456 SandMarket", + "locality": "ORMOND BEACH", + "administrativeArea": "FL", + "postalCode": "32176" + }, + "websiteUrl": "https://www.NetworkTokenMerchant.com", + "businessContact": { + "firstName": "Token", + "lastName": "Man", + "phoneNumber": "6574567813", + "email": "networktokenman@visa.com" + } + } + }, + "productInformation": { + "selectedProducts": { + "commerceSolutions": { + "tokenManagement": { + "subscriptionInformation": { + "enabled": true + }, + "configurationInformation": { + "configurations": { + "vault": { + "defaultTokenType": "CUSTOMER", + "location": "GDC", + "tokenFormats": { + "customer": "32_HEX", + "paymentInstrument": "32_HEX", + "instrumentIdentifierCard": "19_DIGIT_LAST_4", + "instrumentIdentifierBankAccount": "32_HEX" + }, + "sensitivePrivileges": { + "cardNumberMaskingFormat": "FIRST_6_LAST_4" + }, + "networkTokenServices": { + "visaTokenService": { + "enableService": true, + "enableTransactionalTokens": true + }, + "mastercardDigitalEnablementService": { + "enableService": true, + "enableTransactionalTokens": true + }, + "americanExpressTokenService": { + "enableService": true, + "enableTransactionalTokens": true, + "tokenRequestorId": "12345678912", + "seNumber": "9876543212" + }, + "notifications": { + "enabled": true + }, + "paymentCredentials": { + "enabled": true + }, + "synchronousProvisioning": { + "enabled": false + } + } + }, + "networkTokenEnrollment": { + "businessInformation": { + "name": "NetworkTokenMerchant", + "doingBusinessAs": "NetworkTokenCo1", + "address": { + "country": "US", + "locality": "ORMOND BEACH" + }, + "websiteUrl": "https://www.NetworkTokenMerchant.com", + "acquirer": { + "acquirerId": "40010052242", + "acquirerMerchantId": "MerchantOrgID" + } + }, + "networkTokenServices": { + "visaTokenService": { + "enrollment": true + }, + "mastercardDigitalEnablementService": { + "enrollment": true + } + } + } + } + } + } + } + } + } + } } } } @@ -115856,6 +116104,110 @@ } } } + }, + "networkTokenEnrollment": { + "title": "networkTokenEnrollment", + "type": "object", + "properties": { + "businessInformation": { + "title": "tmsBusinessInformation", + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 60, + "minLength": 1, + "pattern": "^[0-9a-zA-Z _\\-\\+\\.\\*\\\"/'&\\,\\(\\)!$;:?@\\#\u00a1-\uffff]+$", + "description": "Name of the network token merchant.", + "example": "NetworkTokenMerchant" + }, + "doingBusinessAs": { + "type": "string", + "maxLength": 60, + "pattern": "^[0-9a-zA-Z _\\-\\+\\.\\*\\\"/'&\\,\\(\\)!$;:?@\\#\u00a1-\uffff]+$", + "description": "Name the network token merchant does business as", + "example": "NetworkTokenCo1" + }, + "address": { + "type": "object", + "properties": { + "country": { + "type": "string", + "maxLength": 2, + "minLength": 2, + "pattern": "^[\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u01ffa-zA-Z0-9().\\-_#,;/@$:!% ]{1,}$", + "description": "Country of network token merchant.", + "example": "US" + }, + "locality": { + "type": "string", + "maxLength": 50, + "minLength": 1, + "pattern": "^[0-9a-zA-Z _\\-\u00a1-\uffff]+$", + "description": "City of network token merchant.", + "example": "ORMOND BEACH" + } + } + }, + "websiteUrl": { + "type": "string", + "maxLength": 100, + "pattern": "\\b((?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?\u00c2\u00ab\u00c2\u00bb\u00e2\u20ac\u0153\u00e2\u20ac.\u00e2\u20ac\u02dc\u00e2\u20ac\u2122]))", + "description": "Website of network token merchant.", + "example": "https://www.NetworkTokenMerchant.com" + }, + "businessIdentificationType": { + "type": "string", + "description": "The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided.\n", + "maxLength": 15 + }, + "businessIdentificationValue": { + "type": "string", + "description": "The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided.\n", + "maxLength": 25 + }, + "acquirer": { + "type": "object", + "properties": { + "acquirerId": { + "type": "string", + "description": "Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided.\n", + "maxLength": 15 + }, + "acquirerMerchantId": { + "type": "string", + "description": "Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided.\n", + "maxLength": 25 + } + } + } + } + }, + "networkTokenServices": { + "title": "NetworkTokenServicesEnablement", + "type": "object", + "properties": { + "visaTokenService": { + "type": "object", + "properties": { + "enrollment": { + "type": "boolean", + "description": "Indicates if an enrollment to create a TRID for the Visa card association should be attempted" + } + } + }, + "mastercardDigitalEnablementService": { + "type": "object", + "properties": { + "enrollment": { + "type": "boolean", + "description": "Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted" + } + } + } + } + } + } } } } @@ -120330,7 +120682,7 @@ "properties": { "clientVersion": { "type": "string", - "example": 0.22, + "example": "0.24", "maxLength": 60, "description": "Specify the version of Unified Checkout that you want to use." }, @@ -120405,6 +120757,14 @@ "showAcceptedNetworkIcons": { "type": "boolean", "description": "Configure Unified Checkout to display the list of accepted card networks beneath the payment button\n\nPossible values:\n- True\n- False\n" + }, + "requestSaveCard": { + "type": "boolean", + "description": "Configure Unified Checkout to display the \"Save card for future use\" checkbox.
\n\nConfigurable check box that will show in a Manual card entry flow to allow a Cardholder to give consent to store their manually entered credential with the Merchant that they are paying.
\nApplicable when manually entering the details and not enrolling in Click to Pay.\n\nPossible values:\n - True \n - False

\n\n**Use Cases:**\n\n**Offer consumers option to save their card in Unified Checkout:** \n- Include the captureMandate.requestSaveCard field in the capture context request and set it to true.\n- When set to true, this will show a checkbox with the message 'Save card for future use' in Unified Checkout.\n- When selected this provides a response in both the Transient Token and Get Credentials API response.

\n\n**Do not offer consumers the option to save their card in Unified Checkout:** \n- Include the captureMandate.requestSaveCard field in the capture context request and set it to false OR omit the field from the capture context request.\n- When set to false, the save card option is not shown to consumers when manually entering card details.\n" + }, + "comboCard": { + "type": "boolean", + "description": "Configure Unified Checkout to display combo card at checkout.
\n\nA combo debit/credit card is a single card that functions both as a Debit/Credit card. \nUnified Checkout / Click to Pay Drop-in UI allows the Cardholder to choose whether they would like the transaction to be paid for using either debit or credit card.\n**Important:** This is applicable to Visa cards only.\n\nPossible values:\n- True \n- False

\n\n**Use Cases:**\n\n**Offer Combo Card at Checkout:** \n- Include the captureMandate.comboCard field in the capture context request and set it to true.\n- When set to true, Combo Card selection is shown at checkout

\n\n**Do not offer Combo Card at Checkout:** \n- Include the captureMandate.comboCard field in the capture context request and set it to false OR omit the field from the capture context request.\n- The Combo Card selection is not shown at checkout.\n" } } }, @@ -120684,6 +121044,15 @@ } } } + }, + "transientTokenResponseOptions": { + "type": "object", + "properties": { + "includeCardPrefix": { + "type": "boolean", + "description": "Use the transientTokenResponseOptions.includeCardPrefix field to choose your preferred card number prefix length: 6-digit, 8-digit, or no card number prefix.\n\nPossible values:\n- True\n- False

\n\nTo select the type of card number prefix:\n- No field included: A 6-digit prefix is returned (default)\n- True: An 8-digit prefix is returned\n- False: No prefix is returned

\n\nThe following conditions apply:\n- 8-digit card number prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa brands with 16-digit card numbers or more.\n- Any card with less than 16-digit numbers will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true.\n- Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa will return a 6-digit prefix even when the transientTokenResponseOptions.includeCardPrefix field is set to true.\n- If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay, or Visa, an 8-digit prefix will be returned if the transientTokenResponseOptions.includeCardPrefix field is set to true.

\n\n**Important:** \nIf your application does NOT require a card number prefix for routing or identification purposes, set the transientTokenResponseOptions.includeCardPrefix field to False. This will minimize your personal data exposure.\n" + } + } } } } @@ -120693,7 +121062,7 @@ "example0": { "summary": "Generate Unified Checkout Capture Context", "value": { - "clientVersion": "0.23", + "clientVersion": "0.24", "targetOrigins": [ "https://yourCheckoutPage.com" ], @@ -120743,10 +121112,66 @@ } } }, - "example3": { + "example1": { + "summary": "Generate Unified Checkout Capture Context (Opt-out of receiving card number prefix)", + "value": { + "clientVersion": "0.24", + "targetOrigins": [ + "https://yourCheckoutPage.com" + ], + "allowedCardNetworks": [ + "VISA", + "MASTERCARD", + "AMEX", + "CARNET", + "CARTESBANCAIRES", + "CUP", + "DINERSCLUB", + "DISCOVER", + "EFTPOS", + "ELO", + "JCB", + "JCREW", + "MADA", + "MAESTRO", + "MEEZA" + ], + "allowedPaymentTypes": [ + "APPLEPAY", + "CHECK", + "CLICKTOPAY", + "GOOGLEPAY", + "PANENTRY", + "PAZE" + ], + "country": "US", + "locale": "en_US", + "captureMandate": { + "billingType": "FULL", + "requestEmail": true, + "requestPhone": true, + "requestShipping": true, + "shipToCountries": [ + "US", + "GB" + ], + "showAcceptedNetworkIcons": true + }, + "orderInformation": { + "amountDetails": { + "totalAmount": "21.00", + "currency": "USD" + } + }, + "transientTokenResponseOptions": { + "includeCardPrefix": false + } + } + }, + "example2": { "summary": "Generate Unified Checkout Capture Context passing Billing & Shipping", "value": { - "clientVersion": "0.23", + "clientVersion": "0.24", "targetOrigins": [ "https://yourCheckoutPage.com" ], @@ -120843,10 +121268,10 @@ } } }, - "example4": { + "example3": { "summary": "Generate Capture Context For Click To Pay Drop-In UI", "value": { - "clientVersion": "0.23", + "clientVersion": "0.24", "targetOrigins": [ "https://yourCheckoutPage.com" ], diff --git a/requirements.txt b/requirements.txt index a2eb9b77..4260571f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,14 @@ -certifi -pycryptodome -PyJWT -DateTime -setuptools -six -urllib3 -jwcrypto -cryptography +certifi==2025.1.31 +cffi==1.17.1 +cryptography==44.0.2 +DateTime==5.5 +jwcrypto==1.5.6 +pycparser==2.22 +pycryptodome==3.21.0 +PyJWT==2.10.1 +pytz==2025.1 +setuptools==75.8.2 +six==1.17.0 +typing_extensions==4.12.2 +urllib3==2.3.0 +zope.interface==7.2 diff --git a/setup.py b/setup.py index cd375a6c..ecdbb0b9 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages NAME = "cybersource-rest-client-python" -VERSION = "0.0.62" +VERSION = "0.0.63" # To install the library, run the following # # python setup.py install diff --git a/test/test_microformv2sessions_transient_token_response_options.py b/test/test_microformv2sessions_transient_token_response_options.py new file mode 100644 index 00000000..06dc4d78 --- /dev/null +++ b/test/test_microformv2sessions_transient_token_response_options.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.microformv2sessions_transient_token_response_options import Microformv2sessionsTransientTokenResponseOptions + + +class TestMicroformv2sessionsTransientTokenResponseOptions(unittest.TestCase): + """ Microformv2sessionsTransientTokenResponseOptions unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMicroformv2sessionsTransientTokenResponseOptions(self): + """ + Test Microformv2sessionsTransientTokenResponseOptions + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.microformv2sessions_transient_token_response_options.Microformv2sessionsTransientTokenResponseOptions() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_network_token_enrollment.py b/test/test_network_token_enrollment.py new file mode 100644 index 00000000..b8cf3aec --- /dev/null +++ b/test/test_network_token_enrollment.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.network_token_enrollment import NetworkTokenEnrollment + + +class TestNetworkTokenEnrollment(unittest.TestCase): + """ NetworkTokenEnrollment unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNetworkTokenEnrollment(self): + """ + Test NetworkTokenEnrollment + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.network_token_enrollment.NetworkTokenEnrollment() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_network_token_services_enablement.py b/test/test_network_token_services_enablement.py new file mode 100644 index 00000000..ec150961 --- /dev/null +++ b/test/test_network_token_services_enablement.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.network_token_services_enablement import NetworkTokenServicesEnablement + + +class TestNetworkTokenServicesEnablement(unittest.TestCase): + """ NetworkTokenServicesEnablement unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNetworkTokenServicesEnablement(self): + """ + Test NetworkTokenServicesEnablement + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.network_token_services_enablement.NetworkTokenServicesEnablement() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_network_token_services_enablement_mastercard_digital_enablement_service.py b/test/test_network_token_services_enablement_mastercard_digital_enablement_service.py new file mode 100644 index 00000000..a201e7a4 --- /dev/null +++ b/test/test_network_token_services_enablement_mastercard_digital_enablement_service.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.network_token_services_enablement_mastercard_digital_enablement_service import NetworkTokenServicesEnablementMastercardDigitalEnablementService + + +class TestNetworkTokenServicesEnablementMastercardDigitalEnablementService(unittest.TestCase): + """ NetworkTokenServicesEnablementMastercardDigitalEnablementService unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNetworkTokenServicesEnablementMastercardDigitalEnablementService(self): + """ + Test NetworkTokenServicesEnablementMastercardDigitalEnablementService + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.network_token_services_enablement_mastercard_digital_enablement_service.NetworkTokenServicesEnablementMastercardDigitalEnablementService() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_network_token_services_enablement_visa_token_service.py b/test/test_network_token_services_enablement_visa_token_service.py new file mode 100644 index 00000000..4647c58e --- /dev/null +++ b/test/test_network_token_services_enablement_visa_token_service.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.network_token_services_enablement_visa_token_service import NetworkTokenServicesEnablementVisaTokenService + + +class TestNetworkTokenServicesEnablementVisaTokenService(unittest.TestCase): + """ NetworkTokenServicesEnablementVisaTokenService unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNetworkTokenServicesEnablementVisaTokenService(self): + """ + Test NetworkTokenServicesEnablementVisaTokenService + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.network_token_services_enablement_visa_token_service.NetworkTokenServicesEnablementVisaTokenService() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tms_business_information.py b/test/test_tms_business_information.py new file mode 100644 index 00000000..0cc2f630 --- /dev/null +++ b/test/test_tms_business_information.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.tms_business_information import TmsBusinessInformation + + +class TestTmsBusinessInformation(unittest.TestCase): + """ TmsBusinessInformation unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTmsBusinessInformation(self): + """ + Test TmsBusinessInformation + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.tms_business_information.TmsBusinessInformation() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tms_business_information_acquirer.py b/test/test_tms_business_information_acquirer.py new file mode 100644 index 00000000..766704b9 --- /dev/null +++ b/test/test_tms_business_information_acquirer.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.tms_business_information_acquirer import TmsBusinessInformationAcquirer + + +class TestTmsBusinessInformationAcquirer(unittest.TestCase): + """ TmsBusinessInformationAcquirer unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTmsBusinessInformationAcquirer(self): + """ + Test TmsBusinessInformationAcquirer + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.tms_business_information_acquirer.TmsBusinessInformationAcquirer() + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tms_business_information_address.py b/test/test_tms_business_information_address.py new file mode 100644 index 00000000..0f2cdad3 --- /dev/null +++ b/test/test_tms_business_information_address.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + CyberSource Merged Spec + + All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html + + OpenAPI spec version: 0.0.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import os +import sys +import unittest + +import CyberSource +from CyberSource.rest import ApiException +from CyberSource.models.tms_business_information_address import TmsBusinessInformationAddress + + +class TestTmsBusinessInformationAddress(unittest.TestCase): + """ TmsBusinessInformationAddress unit test stubs """ + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTmsBusinessInformationAddress(self): + """ + Test TmsBusinessInformationAddress + """ + # FIXME: construct object with mandatory attributes with example values + #model = CyberSource.models.tms_business_information_address.TmsBusinessInformationAddress() + pass + + +if __name__ == '__main__': + unittest.main()