From e72bc746dab416dcc6601f20a3f355d06c270e5d Mon Sep 17 00:00:00 2001 From: gaubansa Date: Mon, 6 Jan 2025 17:21:21 +0530 Subject: [PATCH 01/52] adding mle config in merchantConfig --- .../core/MerchantConfiguration.py | 49 +++++++++++++++++++ .../util/GlobalLabelParameters.py | 2 + 2 files changed, 51 insertions(+) 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/util/GlobalLabelParameters.py b/authenticationsdk/util/GlobalLabelParameters.py index 636e9136..e4afd9dc 100644 --- a/authenticationsdk/util/GlobalLabelParameters.py +++ b/authenticationsdk/util/GlobalLabelParameters.py @@ -75,6 +75,7 @@ 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 @@ -86,6 +87,7 @@ 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" From 4589aae2b4ece4a7d3bf853bf6ec7749cfe2972d Mon Sep 17 00:00:00 2001 From: gaubansa Date: Mon, 6 Jan 2025 17:21:49 +0530 Subject: [PATCH 02/52] adding mleUtility --- authenticationsdk/util/MLEUtility.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 authenticationsdk/util/MLEUtility.py diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py new file mode 100644 index 00000000..854f0977 --- /dev/null +++ b/authenticationsdk/util/MLEUtility.py @@ -0,0 +1,18 @@ + + +class MLEUtility: + @staticmethod + def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationId): + # isMLE for an api is false by default + isMLEForAPI = False + + # return true or false based on logic + return isMLEForAPI + + @staticmethod + def encrypt_request_payload(merchant_config, requestBody): + # complete the logic to encrypt request payload for mle + + # return encrypted requestBody + return requestBody + From 0d792b1e5cb341242a115b3400be3086b771fbf9 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Fri, 10 Jan 2025 15:31:04 +0530 Subject: [PATCH 03/52] Python SDK MLE 1 --- authenticationsdk/util/MLEUtility.py | 14 +++++++++++++- generator/cybersource-python-template/api.mustache | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 854f0977..c7434995 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -3,10 +3,22 @@ class MLEUtility: @staticmethod def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationId): + # isMLE for an api is false by default isMLEForAPI = False - # return true or false based on logic + if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): + isMLEForAPI = True + + operation_array = [op_id.strip() for op_id in operationId.split(",")] + + # Control the MLE only from map + if merchant_config.get_mapToControlMLEonAPI() and merchant_config.get_mapToControlMLEonAPI(): + for op_id in operation_array: + if op_id in merchant_config.get_mapToControlMLEonAPI(): + isMLEForAPI = merchant_config.get_mapToControlMLEonAPI()[op_id] + break + return isMLEForAPI @staticmethod diff --git a/generator/cybersource-python-template/api.mustache b/generator/cybersource-python-template/api.mustache index 11edc4f5..e75863b0 100644 --- a/generator/cybersource-python-template/api.mustache +++ b/generator/cybersource-python-template/api.mustache @@ -190,6 +190,11 @@ class {{classname}}(object): body_params = '{}' {{/bodyParam}} {{#hasProduces}} + + 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}}]) From 68289faf72e8367f5ee692366fe3134f2e9ac2e4 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Fri, 10 Jan 2025 16:04:42 +0530 Subject: [PATCH 04/52] mustache updated with import --- generator/cybersource-python-template/api.mustache | 1 + 1 file changed, 1 insertion(+) diff --git a/generator/cybersource-python-template/api.mustache b/generator/cybersource-python-template/api.mustache index e75863b0..0d4b6792 100644 --- a/generator/cybersource-python-template/api.mustache +++ b/generator/cybersource-python-template/api.mustache @@ -14,6 +14,7 @@ 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 ..utilities.tracking.sdk_tracker import SdkTracker {{#operations}} From 5324505a1b6a6b74dfb33eca73bd684f2691218d Mon Sep 17 00:00:00 2001 From: mahmishr Date: Fri, 10 Jan 2025 16:53:42 +0530 Subject: [PATCH 05/52] spacing adjustment --- authenticationsdk/util/MLEUtility.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index c7434995..b1907cb1 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -3,22 +3,15 @@ class MLEUtility: @staticmethod def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationId): - - # isMLE for an api is false by default isMLEForAPI = False - if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): isMLEForAPI = True - operation_array = [op_id.strip() for op_id in operationId.split(",")] - - # Control the MLE only from map if merchant_config.get_mapToControlMLEonAPI() and merchant_config.get_mapToControlMLEonAPI(): for op_id in operation_array: if op_id in merchant_config.get_mapToControlMLEonAPI(): isMLEForAPI = merchant_config.get_mapToControlMLEonAPI()[op_id] break - return isMLEForAPI @staticmethod From be37dc82a3c9d52490cb79092d7527d4146cfa53 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 15 Jan 2025 10:26:33 +0530 Subject: [PATCH 06/52] comments resolved --- authenticationsdk/util/MLEUtility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index b1907cb1..643e4ecb 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -7,7 +7,7 @@ def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationI if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): isMLEForAPI = True operation_array = [op_id.strip() for op_id in operationId.split(",")] - if merchant_config.get_mapToControlMLEonAPI() and merchant_config.get_mapToControlMLEonAPI(): + if merchant_config.get_mapToControlMLEonAPI(): for op_id in operation_array: if op_id in merchant_config.get_mapToControlMLEonAPI(): isMLEForAPI = merchant_config.get_mapToControlMLEonAPI()[op_id] From 698b4329b7fcf82b3eedf5f25bca975ffc5667dc Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 15 Jan 2025 11:05:06 +0530 Subject: [PATCH 07/52] commiting all api chngs --- CyberSource/api/batches_api.py | 21 ++++++++++ CyberSource/api/billing_agreements_api.py | 16 ++++++++ CyberSource/api/bin_lookup_api.py | 6 +++ CyberSource/api/capture_api.py | 6 +++ CyberSource/api/chargeback_details_api.py | 6 +++ CyberSource/api/chargeback_summaries_api.py | 6 +++ CyberSource/api/conversion_details_api.py | 6 +++ CyberSource/api/create_new_webhooks_api.py | 16 ++++++++ CyberSource/api/credit_api.py | 6 +++ CyberSource/api/customer_api.py | 21 ++++++++++ .../api/customer_payment_instrument_api.py | 26 ++++++++++++ .../api/customer_shipping_address_api.py | 26 ++++++++++++ CyberSource/api/decision_manager_api.py | 26 ++++++++++++ CyberSource/api/download_dtd_api.py | 6 +++ CyberSource/api/download_xsd_api.py | 6 +++ CyberSource/api/emv_tag_details_api.py | 11 +++++ CyberSource/api/flex_api_api.py | 6 +++ CyberSource/api/instrument_identifier_api.py | 31 ++++++++++++++ .../interchange_clearing_level_details_api.py | 6 +++ CyberSource/api/invoice_settings_api.py | 11 +++++ CyberSource/api/invoices_api.py | 31 ++++++++++++++ CyberSource/api/manage_webhooks_api.py | 26 ++++++++++++ CyberSource/api/merchant_boarding_api.py | 11 +++++ CyberSource/api/microform_integration_api.py | 6 +++ CyberSource/api/net_fundings_api.py | 6 +++ .../api/notification_of_changes_api.py | 6 +++ CyberSource/api/orders_api.py | 11 +++++ CyberSource/api/payer_authentication_api.py | 16 ++++++++ .../api/payment_batch_summaries_api.py | 6 +++ CyberSource/api/payment_instrument_api.py | 21 ++++++++++ CyberSource/api/payments_api.py | 38 +++++++++++++++++ CyberSource/api/payouts_api.py | 6 +++ CyberSource/api/plans_api.py | 41 +++++++++++++++++++ .../api/purchase_and_refund_details_api.py | 6 +++ CyberSource/api/push_funds_api.py | 6 +++ CyberSource/api/refund_api.py | 11 +++++ CyberSource/api/replay_webhooks_api.py | 6 +++ CyberSource/api/report_definitions_api.py | 11 +++++ CyberSource/api/report_downloads_api.py | 6 +++ CyberSource/api/report_subscriptions_api.py | 26 ++++++++++++ CyberSource/api/reports_api.py | 16 ++++++++ CyberSource/api/retrieval_details_api.py | 6 +++ CyberSource/api/retrieval_summaries_api.py | 6 +++ CyberSource/api/reversal_api.py | 11 +++++ CyberSource/api/search_transactions_api.py | 11 +++++ CyberSource/api/secure_file_share_api.py | 11 +++++ CyberSource/api/subscriptions_api.py | 41 +++++++++++++++++++ CyberSource/api/taxes_api.py | 11 +++++ CyberSource/api/token_api.py | 6 +++ CyberSource/api/transaction_batches_api.py | 16 ++++++++ CyberSource/api/transaction_details_api.py | 6 +++ CyberSource/api/transient_token_data_api.py | 11 +++++ .../unified_checkout_capture_context_api.py | 6 +++ CyberSource/api/user_management_api.py | 6 +++ CyberSource/api/user_management_search_api.py | 6 +++ CyberSource/api/verification_api.py | 11 +++++ CyberSource/api/void_api.py | 26 ++++++++++++ 57 files changed, 769 insertions(+) diff --git a/CyberSource/api/batches_api.py b/CyberSource/api/batches_api.py index f1c88c95..8417ed4b 100644 --- a/CyberSource/api/batches_api.py +++ b/CyberSource/api/batches_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class BatchesApi(object): @@ -133,6 +134,11 @@ def get_batch_report_with_http_info(self, batch_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +252,11 @@ def get_batch_status_with_http_info(self, batch_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +376,11 @@ def get_batches_list_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +494,11 @@ 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) + + 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..f5018d68 100644 --- a/CyberSource/api/billing_agreements_api.py +++ b/CyberSource/api/billing_agreements_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class BillingAgreementsApi(object): @@ -143,6 +144,11 @@ 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) + + 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 +272,11 @@ 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) + + 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 +390,11 @@ 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) + + 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..124eaa8d 100644 --- a/CyberSource/api/bin_lookup_api.py +++ b/CyberSource/api/bin_lookup_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class BinLookupApi(object): @@ -136,6 +137,11 @@ 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) + + 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..4954326b 100644 --- a/CyberSource/api/capture_api.py +++ b/CyberSource/api/capture_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class CaptureApi(object): @@ -143,6 +144,11 @@ 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) + + 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..61d6a80a 100644 --- a/CyberSource/api/chargeback_details_api.py +++ b/CyberSource/api/chargeback_details_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ChargebackDetailsApi(object): @@ -145,6 +146,11 @@ def get_chargeback_details_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): 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..ac478c95 100644 --- a/CyberSource/api/chargeback_summaries_api.py +++ b/CyberSource/api/chargeback_summaries_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ChargebackSummariesApi(object): @@ -145,6 +146,11 @@ def get_chargeback_summaries_with_http_info(self, start_time, end_time, **kwargs body_params = None if 'GET' in ('POST'): 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..afd36800 100644 --- a/CyberSource/api/conversion_details_api.py +++ b/CyberSource/api/conversion_details_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ConversionDetailsApi(object): @@ -145,6 +146,11 @@ def get_conversion_detail_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): 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..90a747a5 100644 --- a/CyberSource/api/create_new_webhooks_api.py +++ b/CyberSource/api/create_new_webhooks_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class CreateNewWebhooksApi(object): @@ -131,6 +132,11 @@ 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) + + 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 +253,11 @@ def find_products_to_subscribe_with_http_info(self, organization_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +391,11 @@ 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) + + 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..2bb60e3c 100644 --- a/CyberSource/api/credit_api.py +++ b/CyberSource/api/credit_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class CreditApi(object): @@ -133,6 +134,11 @@ 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) + + 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..5a2396e8 100644 --- a/CyberSource/api/customer_api.py +++ b/CyberSource/api/customer_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class CustomerApi(object): @@ -137,6 +138,11 @@ def delete_customer_with_http_info(self, customer_id, **kwargs): body_params = None if 'DELETE' in ('POST'): 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 +260,11 @@ def get_customer_with_http_info(self, customer_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +396,11 @@ 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) + + 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 +518,11 @@ 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) + + 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..48e96f14 100644 --- a/CyberSource/api/customer_payment_instrument_api.py +++ b/CyberSource/api/customer_payment_instrument_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class CustomerPaymentInstrumentApi(object): @@ -147,6 +148,11 @@ def delete_customer_payment_instrument_with_http_info(self, customer_id, payment body_params = None if 'DELETE' in ('POST'): 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 +280,11 @@ def get_customer_payment_instrument_with_http_info(self, customer_id, payment_in body_params = None if 'GET' in ('POST'): 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 +410,11 @@ def get_customer_payment_instruments_list_with_http_info(self, customer_id, **kw body_params = None if 'GET' in ('POST'): 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 +556,11 @@ 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) + + 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 +688,11 @@ 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) + + 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..7f5fc50e 100644 --- a/CyberSource/api/customer_shipping_address_api.py +++ b/CyberSource/api/customer_shipping_address_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class CustomerShippingAddressApi(object): @@ -147,6 +148,11 @@ def delete_customer_shipping_address_with_http_info(self, customer_id, shipping_ body_params = None if 'DELETE' in ('POST'): 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 +280,11 @@ def get_customer_shipping_address_with_http_info(self, customer_id, shipping_add body_params = None if 'GET' in ('POST'): 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 +410,11 @@ def get_customer_shipping_addresses_list_with_http_info(self, customer_id, **kwa body_params = None if 'GET' in ('POST'): 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 +556,11 @@ 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) + + 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 +688,11 @@ 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) + + 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..700808a9 100644 --- a/CyberSource/api/decision_manager_api.py +++ b/CyberSource/api/decision_manager_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class DecisionManagerApi(object): @@ -143,6 +144,11 @@ 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) + + 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 +272,11 @@ 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) + + 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 +400,11 @@ 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) + + 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 +518,11 @@ 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) + + 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 +646,11 @@ 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) + + 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..6bb5692e 100644 --- a/CyberSource/api/download_dtd_api.py +++ b/CyberSource/api/download_dtd_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class DownloadDTDApi(object): @@ -133,6 +134,11 @@ def get_dtdv2_with_http_info(self, report_definition_name_version, **kwargs): body_params = None if 'GET' in ('POST'): 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..d095dd7c 100644 --- a/CyberSource/api/download_xsd_api.py +++ b/CyberSource/api/download_xsd_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class DownloadXSDApi(object): @@ -133,6 +134,11 @@ def get_xsdv2_with_http_info(self, report_definition_name_version, **kwargs): body_params = None if 'GET' in ('POST'): 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..89cbe06d 100644 --- a/CyberSource/api/emv_tag_details_api.py +++ b/CyberSource/api/emv_tag_details_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class EMVTagDetailsApi(object): @@ -122,6 +123,11 @@ def get_emv_tags_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +241,11 @@ 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) + + 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..33ca9a1d 100644 --- a/CyberSource/api/flex_api_api.py +++ b/CyberSource/api/flex_api_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class FlexAPIApi(object): @@ -133,6 +134,11 @@ 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) + + 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 69dd635c..d89bc069 100644 --- a/CyberSource/api/instrument_identifier_api.py +++ b/CyberSource/api/instrument_identifier_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class InstrumentIdentifierApi(object): @@ -137,6 +138,11 @@ def delete_instrument_identifier_with_http_info(self, instrument_identifier_id, body_params = None if 'DELETE' in ('POST'): 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']) @@ -254,6 +260,11 @@ def get_instrument_identifier_with_http_info(self, instrument_identifier_id, **k body_params = None if 'GET' in ('POST'): 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']) @@ -379,6 +390,11 @@ def get_instrument_identifier_payment_instruments_list_with_http_info(self, inst body_params = None if 'GET' in ('POST'): 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']) @@ -510,6 +526,11 @@ 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) + + 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']) @@ -627,6 +648,11 @@ 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) + + 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']) @@ -754,6 +780,11 @@ 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) + + 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..e2338f46 100644 --- a/CyberSource/api/interchange_clearing_level_details_api.py +++ b/CyberSource/api/interchange_clearing_level_details_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class InterchangeClearingLevelDetailsApi(object): @@ -145,6 +146,11 @@ def get_interchange_clearing_level_details_with_http_info(self, start_time, end_ body_params = None if 'GET' in ('POST'): 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..682ffc37 100644 --- a/CyberSource/api/invoice_settings_api.py +++ b/CyberSource/api/invoice_settings_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class InvoiceSettingsApi(object): @@ -122,6 +123,11 @@ def get_invoice_settings_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +241,11 @@ 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) + + 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..ed73ab90 100644 --- a/CyberSource/api/invoices_api.py +++ b/CyberSource/api/invoices_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class InvoicesApi(object): @@ -133,6 +134,11 @@ 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) + + 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 +264,11 @@ def get_all_invoices_with_http_info(self, offset, limit, **kwargs): body_params = None if 'GET' in ('POST'): 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 +382,11 @@ def get_invoice_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +500,11 @@ def perform_cancel_action_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): 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 +618,11 @@ def perform_send_action_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): 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 +746,11 @@ 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) + + 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..346e6cda 100644 --- a/CyberSource/api/manage_webhooks_api.py +++ b/CyberSource/api/manage_webhooks_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ManageWebhooksApi(object): @@ -136,6 +137,11 @@ def delete_webhook_subscription_with_http_info(self, webhook_id, **kwargs): body_params = None if 'DELETE' in ('POST'): 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 +258,11 @@ def get_webhook_subscription_by_id_with_http_info(self, webhook_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +396,11 @@ def get_webhook_subscriptions_by_org_with_http_info(self, organization_id, produ body_params = None if 'GET' in ('POST'): 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 +539,11 @@ 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) + + 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 +665,11 @@ 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) + + 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..170fb9d3 100644 --- a/CyberSource/api/merchant_boarding_api.py +++ b/CyberSource/api/merchant_boarding_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class MerchantBoardingApi(object): @@ -133,6 +134,11 @@ def get_registration_with_http_info(self, registration_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +256,11 @@ 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) + + 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..c19818fa 100644 --- a/CyberSource/api/microform_integration_api.py +++ b/CyberSource/api/microform_integration_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class MicroformIntegrationApi(object): @@ -133,6 +134,11 @@ 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) + + 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..031d749a 100644 --- a/CyberSource/api/net_fundings_api.py +++ b/CyberSource/api/net_fundings_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class NetFundingsApi(object): @@ -149,6 +150,11 @@ def get_net_funding_details_with_http_info(self, start_time, end_time, **kwargs) body_params = None if 'GET' in ('POST'): 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..39299f6f 100644 --- a/CyberSource/api/notification_of_changes_api.py +++ b/CyberSource/api/notification_of_changes_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class NotificationOfChangesApi(object): @@ -141,6 +142,11 @@ def get_notification_of_change_report_with_http_info(self, start_time, end_time, body_params = None if 'GET' in ('POST'): 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..47de080b 100644 --- a/CyberSource/api/orders_api.py +++ b/CyberSource/api/orders_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class OrdersApi(object): @@ -133,6 +134,11 @@ 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) + + 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 +262,11 @@ 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) + + 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..37a9cdd5 100644 --- a/CyberSource/api/payer_authentication_api.py +++ b/CyberSource/api/payer_authentication_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PayerAuthenticationApi(object): @@ -133,6 +134,11 @@ 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) + + 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 +252,11 @@ 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) + + 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 +370,11 @@ 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) + + 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..4813912f 100644 --- a/CyberSource/api/payment_batch_summaries_api.py +++ b/CyberSource/api/payment_batch_summaries_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PaymentBatchSummariesApi(object): @@ -157,6 +158,11 @@ def get_payment_batch_summary_with_http_info(self, start_time, end_time, **kwarg body_params = None if 'GET' in ('POST'): 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 4433bfb4..3effb93d 100644 --- a/CyberSource/api/payment_instrument_api.py +++ b/CyberSource/api/payment_instrument_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PaymentInstrumentApi(object): @@ -137,6 +138,11 @@ def delete_payment_instrument_with_http_info(self, payment_instrument_id, **kwar body_params = None if 'DELETE' in ('POST'): 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']) @@ -254,6 +260,11 @@ def get_payment_instrument_with_http_info(self, payment_instrument_id, **kwargs) body_params = None if 'GET' in ('POST'): 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']) @@ -385,6 +396,11 @@ 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) + + 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']) @@ -502,6 +518,11 @@ 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) + + 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..9cf1d546 100644 --- a/CyberSource/api/payments_api.py +++ b/CyberSource/api/payments_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PaymentsApi(object): @@ -143,6 +144,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) + + 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"): + print("I am TRUE") + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + + print("I am FALSE") + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -256,6 +265,15 @@ 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) + + 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"): + print("I am TRUE") + body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) + else: + print("I am FALSE") + + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -369,6 +387,11 @@ 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) + + 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 +515,11 @@ 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) + + 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 +643,11 @@ 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) + + 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 +771,11 @@ 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) + + 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..63c224f8 100644 --- a/CyberSource/api/payouts_api.py +++ b/CyberSource/api/payouts_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PayoutsApi(object): @@ -133,6 +134,11 @@ 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) + + 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..5123c8cd 100644 --- a/CyberSource/api/plans_api.py +++ b/CyberSource/api/plans_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PlansApi(object): @@ -133,6 +134,11 @@ def activate_plan_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): 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 +252,11 @@ 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) + + 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 +370,11 @@ def deactivate_plan_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): 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 +488,11 @@ def delete_plan_with_http_info(self, id, **kwargs): body_params = None if 'DELETE' in ('POST'): 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 +606,11 @@ def get_plan_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +713,11 @@ def get_plan_code_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +841,11 @@ def get_plans_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +969,11 @@ 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) + + 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..5046b898 100644 --- a/CyberSource/api/purchase_and_refund_details_api.py +++ b/CyberSource/api/purchase_and_refund_details_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PurchaseAndRefundDetailsApi(object): @@ -165,6 +166,11 @@ def get_purchase_and_refund_details_with_http_info(self, start_time, end_time, * body_params = None if 'GET' in ('POST'): 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..0f7b5f45 100644 --- a/CyberSource/api/push_funds_api.py +++ b/CyberSource/api/push_funds_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class PushFundsApi(object): @@ -187,6 +188,11 @@ 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) + + 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..3883a405 100644 --- a/CyberSource/api/refund_api.py +++ b/CyberSource/api/refund_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class RefundApi(object): @@ -143,6 +144,11 @@ 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) + + 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 +272,11 @@ 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) + + 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..a51bf7b0 100644 --- a/CyberSource/api/replay_webhooks_api.py +++ b/CyberSource/api/replay_webhooks_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ReplayWebhooksApi(object): @@ -141,6 +142,11 @@ 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) + + 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..119ae31a 100644 --- a/CyberSource/api/report_definitions_api.py +++ b/CyberSource/api/report_definitions_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ReportDefinitionsApi(object): @@ -145,6 +146,11 @@ def get_resource_info_by_report_definition_with_http_info(self, report_definitio body_params = None if 'GET' in ('POST'): 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 +262,11 @@ def get_resource_v2_info_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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..d5cebe4c 100644 --- a/CyberSource/api/report_downloads_api.py +++ b/CyberSource/api/report_downloads_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ReportDownloadsApi(object): @@ -145,6 +146,11 @@ def download_report_with_http_info(self, report_date, report_name, **kwargs): body_params = None if 'GET' in ('POST'): 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..2d808ed5 100644 --- a/CyberSource/api/report_subscriptions_api.py +++ b/CyberSource/api/report_subscriptions_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ReportSubscriptionsApi(object): @@ -137,6 +138,11 @@ 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) + + 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 +260,11 @@ 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) + + 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 +382,11 @@ def delete_subscription_with_http_info(self, report_name, **kwargs): body_params = None if 'DELETE' in ('POST'): 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 +494,11 @@ def get_all_subscriptions_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +616,11 @@ def get_subscription_with_http_info(self, report_name, **kwargs): body_params = None if 'GET' in ('POST'): 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..bc96fa58 100644 --- a/CyberSource/api/reports_api.py +++ b/CyberSource/api/reports_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ReportsApi(object): @@ -137,6 +138,11 @@ 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) + + 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 +260,11 @@ def get_report_by_report_id_with_http_info(self, report_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +419,11 @@ def search_reports_with_http_info(self, start_time, end_time, time_query_type, * body_params = None if 'GET' in ('POST'): 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..f0d9430b 100644 --- a/CyberSource/api/retrieval_details_api.py +++ b/CyberSource/api/retrieval_details_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class RetrievalDetailsApi(object): @@ -145,6 +146,11 @@ def get_retrieval_details_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): 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..55cf1a7d 100644 --- a/CyberSource/api/retrieval_summaries_api.py +++ b/CyberSource/api/retrieval_summaries_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class RetrievalSummariesApi(object): @@ -145,6 +146,11 @@ def get_retrieval_summary_with_http_info(self, start_time, end_time, **kwargs): body_params = None if 'GET' in ('POST'): 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..7d88bdc5 100644 --- a/CyberSource/api/reversal_api.py +++ b/CyberSource/api/reversal_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class ReversalApi(object): @@ -143,6 +144,11 @@ 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) + + 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 +262,11 @@ 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) + + 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..df7bfa8d 100644 --- a/CyberSource/api/search_transactions_api.py +++ b/CyberSource/api/search_transactions_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class SearchTransactionsApi(object): @@ -133,6 +134,11 @@ 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) + + 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 +252,11 @@ def get_search_with_http_info(self, search_id, **kwargs): body_params = None if 'GET' in ('POST'): 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..941f4164 100644 --- a/CyberSource/api/secure_file_share_api.py +++ b/CyberSource/api/secure_file_share_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class SecureFileShareApi(object): @@ -137,6 +138,11 @@ def get_file_with_http_info(self, file_id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +272,11 @@ def get_file_detail_with_http_info(self, start_date, end_date, **kwargs): body_params = None if 'GET' in ('POST'): 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..8bd17781 100644 --- a/CyberSource/api/subscriptions_api.py +++ b/CyberSource/api/subscriptions_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class SubscriptionsApi(object): @@ -133,6 +134,11 @@ def activate_subscription_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): 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 +252,11 @@ def cancel_subscription_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): 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 +370,11 @@ 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) + + 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 +494,11 @@ def get_all_subscriptions_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +612,11 @@ def get_subscription_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +719,11 @@ def get_subscription_code_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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 +837,11 @@ def suspend_subscription_with_http_info(self, id, **kwargs): body_params = None if 'POST' in ('POST'): 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 +965,11 @@ 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) + + 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..59bb6e49 100644 --- a/CyberSource/api/taxes_api.py +++ b/CyberSource/api/taxes_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class TaxesApi(object): @@ -133,6 +134,11 @@ 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) + + 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 +262,11 @@ 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) + + 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..04470aff 100644 --- a/CyberSource/api/token_api.py +++ b/CyberSource/api/token_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class TokenApi(object): @@ -147,6 +148,11 @@ 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) + + 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..65bcad4e 100644 --- a/CyberSource/api/transaction_batches_api.py +++ b/CyberSource/api/transaction_batches_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class TransactionBatchesApi(object): @@ -141,6 +142,11 @@ def get_transaction_batch_details_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +260,11 @@ def get_transaction_batch_id_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): 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 +386,11 @@ def get_transaction_batches_with_http_info(self, start_time, end_time, **kwargs) body_params = None if 'GET' in ('POST'): 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..ca616b43 100644 --- a/CyberSource/api/transaction_details_api.py +++ b/CyberSource/api/transaction_details_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class TransactionDetailsApi(object): @@ -133,6 +134,11 @@ def get_transaction_with_http_info(self, id, **kwargs): body_params = None if 'GET' in ('POST'): 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..bf99680f 100644 --- a/CyberSource/api/transient_token_data_api.py +++ b/CyberSource/api/transient_token_data_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class TransientTokenDataApi(object): @@ -133,6 +134,11 @@ def get_payment_credentials_for_transient_token_with_http_info(self, payment_cre body_params = None if 'GET' in ('POST'): 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 +252,11 @@ def get_transaction_for_transient_token_with_http_info(self, transient_token, ** body_params = None if 'GET' in ('POST'): 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..780ee5ed 100644 --- a/CyberSource/api/unified_checkout_capture_context_api.py +++ b/CyberSource/api/unified_checkout_capture_context_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class UnifiedCheckoutCaptureContextApi(object): @@ -133,6 +134,11 @@ 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) + + 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..acd53557 100644 --- a/CyberSource/api/user_management_api.py +++ b/CyberSource/api/user_management_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class UserManagementApi(object): @@ -139,6 +140,11 @@ def get_users_with_http_info(self, **kwargs): body_params = None if 'GET' in ('POST'): 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..d358fdc5 100644 --- a/CyberSource/api/user_management_search_api.py +++ b/CyberSource/api/user_management_search_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class UserManagementSearchApi(object): @@ -133,6 +134,11 @@ 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) + + 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..877f7c4d 100644 --- a/CyberSource/api/verification_api.py +++ b/CyberSource/api/verification_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class VerificationApi(object): @@ -133,6 +134,11 @@ 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) + + 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 +252,11 @@ 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) + + 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..c428f889 100644 --- a/CyberSource/api/void_api.py +++ b/CyberSource/api/void_api.py @@ -22,6 +22,7 @@ from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory +from authenticationsdk.util.MLEUtility import MLEUtility from ..utilities.tracking.sdk_tracker import SdkTracker class VoidApi(object): @@ -133,6 +134,11 @@ 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) + + 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 +262,11 @@ 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) + + 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 +390,11 @@ 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) + + 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 +518,11 @@ 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) + + 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 +646,11 @@ 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) + + 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']) From 81019d1a73e7ea43c0e6d125f9582ddde55f2f8b Mon Sep 17 00:00:00 2001 From: mahmishr Date: Tue, 21 Jan 2025 10:11:02 +0530 Subject: [PATCH 08/52] params change --- authenticationsdk/util/MLEUtility.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 643e4ecb..03177ecb 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -1,12 +1,11 @@ - class MLEUtility: @staticmethod - def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationId): + def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationIds): isMLEForAPI = False if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): isMLEForAPI = True - operation_array = [op_id.strip() for op_id in operationId.split(",")] + operation_array = [op_id.strip() for op_id in operationIds.split(",")] if merchant_config.get_mapToControlMLEonAPI(): for op_id in operation_array: if op_id in merchant_config.get_mapToControlMLEonAPI(): @@ -20,4 +19,3 @@ def encrypt_request_payload(merchant_config, requestBody): # return encrypted requestBody return requestBody - From 890dca012397e63dda577ea770c07359f3eaae90 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Tue, 21 Jan 2025 10:23:01 +0530 Subject: [PATCH 09/52] null n empty case for map --- authenticationsdk/util/MLEUtility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 03177ecb..e96ade40 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -6,7 +6,7 @@ def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationI if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): isMLEForAPI = True operation_array = [op_id.strip() for op_id in operationIds.split(",")] - if merchant_config.get_mapToControlMLEonAPI(): + if merchant_config.get_mapToControlMLEonAPI() is not None and merchant_config.get_mapToControlMLEonAPI(): for op_id in operation_array: if op_id in merchant_config.get_mapToControlMLEonAPI(): isMLEForAPI = merchant_config.get_mapToControlMLEonAPI()[op_id] From e40cf97c3173deed2e0d1852988f4b5e669217fc Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 27 Jan 2025 10:48:18 +0530 Subject: [PATCH 10/52] Encrypt changes --- authenticationsdk/util/Cache.py | 102 ++++++++++++++++++++++--- authenticationsdk/util/MLEUtility.py | 110 +++++++++++++++++++++++++-- 2 files changed, 196 insertions(+), 16 deletions(-) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 8da26069..fb106b6e 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -2,6 +2,7 @@ import ssl from jwcrypto import jwk +from cryptography import x509 from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend @@ -21,15 +22,96 @@ def get_private_key_from_pem(self, pem_file_path): private_key = jwk.JWK.from_pem(cert.encode('utf-8')) return private_key - def grab_file(self, mconfig, filepath, filename): + def grab_file_mle(self, mconfig, filepath, filename): + file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime - file_mod_time = os.stat(os.path.join(filepath, filename)+GlobalLabelParameters.P12_PREFIX).st_mtime + if "MLE_CERT" not in self.filecache: + print("Cache miss: MLE_CERT not found in cache. Loading from file.") - 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() + ) + + mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = certificate + break + + # Check the additional certificates if not found in the main certificate + if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = cert + print("m here") + break + if mle_cert: + break + + if mle_cert: + self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] + else: + raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") + + if file_mod_time != self.filecache["MLE_CERT"][1]: + print("Cache invalid: File modification time has changed. Reloading from file.") + + 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() + ) + + mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = certificate + break + + # Check the additional certificates if not found in the main certificate + if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = cert + print("m there") + + break + if mle_cert: + break + + if mle_cert: + self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] + else: + raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") + + print(self.filecache["MLE_CERT"]) + + return self.filecache["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(), + open(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX, 'rb').read(), + password=(mconfig.key_password).encode(), backend=default_backend() ) @@ -43,18 +125,22 @@ def grab_file(self, mconfig, filepath, filename): 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(), + 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') + print("cert_pem_str (updated):", cert_pem_str) + der_cert_string = base64.b64encode(ssl.PEM_cert_to_DER_cert(cert_pem_str)) + print("der_cert_string (updated):", der_cert_string) 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) + print("self.filecache (after update):", self.filecache) return self.filecache[filename] @@ -65,5 +151,3 @@ def get_cached_private_key_from_pem(self, file_path, cache_key): self.filecache.setdefault(str(cache_key), []).append(private_key) self.filecache.setdefault(str(cache_key), []).append(file_mod_time) return self.filecache[str(cache_key)][0] - - diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index e96ade40..d1af8c37 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -1,21 +1,117 @@ +import json +import time +# from jose import jwe +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives import serialization +import datetime + +import json +import time +import base64 +import logging +from datetime import datetime +from wsgiref.handlers import format_date_time +from time import mktime +from jwcrypto import jwe, jwk +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import serialization, hashes +from cryptography.hazmat.primitives.asymmetric import padding +import jwt +from authenticationsdk.util.Cache import FileCache +from authenticationsdk.util.GlobalLabelParameters import * +# from jose import jwe +# from jose.constants import ALGORITHMS +from cryptography.hazmat.primitives import serialization +import json +from jwcrypto import jwk, jwe +from cryptography import x509 +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.backends import default_backend + + + 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, isMLESupportedByCybsForApi, operationIds): isMLEForAPI = False if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): isMLEForAPI = True operation_array = [op_id.strip() for op_id in operationIds.split(",")] - if merchant_config.get_mapToControlMLEonAPI() is not None and merchant_config.get_mapToControlMLEonAPI(): + 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 merchant_config.get_mapToControlMLEonAPI(): - isMLEForAPI = merchant_config.get_mapToControlMLEonAPI()[op_id] + if op_id in map_to_control_mle: + isMLEForAPI = map_to_control_mle[op_id] break return isMLEForAPI - + + + @staticmethod def encrypt_request_payload(merchant_config, requestBody): - # complete the logic to encrypt request payload for mle - - # return encrypted requestBody + # Load the x509 certificate + cert = MLEUtility.get_certificate(merchant_config) + + # Extract the public key from the certificate + public_key = cert.public_key() + + # Extract the serial number from the certificate + serial_number = MLEUtility.extract_serial_number(cert) + return requestBody + + # return encrypted_json + + + + @staticmethod + def get_certificate(merchant_config): + cache_obj = FileCache() + try: + cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, merchant_config.key_file_name) + certificate = cert_data[0] + if certificate is not None: + return certificate + else: + 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: + raise MLEUtility.MLEException(f"No certificate found matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") + except Exception as e: + raise MLEUtility.MLEException(f"Unable to load PEM file: {str(e)}") + + @staticmethod + def extract_serial_number(x509_certificate): + serial_number = None + serial_number_prefix = "SERIALNUMBER=" + principal = x509_certificate.subject.rfc4514_string().upper() + beg = principal.find(serial_number_prefix) + if beg >= 0: + #check if using this is required. + end = principal.find(",", beg) + if end == -1: + end = len(principal) + print("m here fr s no") + serial_number = principal[beg + len(serial_number_prefix):end] + else: + for attribute in x509_certificate.subject: + if attribute.oid == x509.NameOID.SERIAL_NUMBER: + serial_number = attribute.value + print("m there fr s no") + break + else: + logging.warning("Serial number not found in MLE certificate for alias.") + serial_number = str(x509_certificate.serial_number) + print("serial number", serial_number) + return serial_number + + # @staticmethod + # def create_json_object(jwe_token): + # return json.dumps({"encryptedRequest": jwe_token}) \ No newline at end of file From 4a82ad7db90402e6c73c1d4a8127b80701dc3bef Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 27 Jan 2025 11:17:44 +0530 Subject: [PATCH 11/52] Revert "Encrypt changes" This reverts commit e40cf97c3173deed2e0d1852988f4b5e669217fc. --- authenticationsdk/util/Cache.py | 102 +++---------------------- authenticationsdk/util/MLEUtility.py | 110 ++------------------------- 2 files changed, 16 insertions(+), 196 deletions(-) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index fb106b6e..8da26069 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -2,7 +2,6 @@ import ssl from jwcrypto import jwk -from cryptography import x509 from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend @@ -22,96 +21,15 @@ def get_private_key_from_pem(self, pem_file_path): private_key = jwk.JWK.from_pem(cert.encode('utf-8')) return private_key - def grab_file_mle(self, mconfig, filepath, filename): - file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime - - if "MLE_CERT" not in self.filecache: - print("Cache miss: MLE_CERT not found in cache. Loading from file.") - - 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() - ) - - mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = certificate - break - - # Check the additional certificates if not found in the main certificate - if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = cert - print("m here") - break - if mle_cert: - break - - if mle_cert: - self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] - else: - raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") - - if file_mod_time != self.filecache["MLE_CERT"][1]: - print("Cache invalid: File modification time has changed. Reloading from file.") - - 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() - ) - - mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = certificate - break - - # Check the additional certificates if not found in the main certificate - if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = cert - print("m there") - - break - if mle_cert: - break - - if mle_cert: - self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] - else: - raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") - - print(self.filecache["MLE_CERT"]) - - return self.filecache["MLE_CERT"] - - def grab_file(self, mconfig, filepath, filename): - file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime + + 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(), + open(os.path.join(filepath, filename)+GlobalLabelParameters.P12_PREFIX,'rb').read() , + password=(mconfig.key_password).encode(), backend=default_backend() ) @@ -125,22 +43,18 @@ def grab_file(self, mconfig, filepath, filename): 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(), + 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') - print("cert_pem_str (updated):", cert_pem_str) - der_cert_string = base64.b64encode(ssl.PEM_cert_to_DER_cert(cert_pem_str)) - print("der_cert_string (updated):", der_cert_string) 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) - print("self.filecache (after update):", self.filecache) return self.filecache[filename] @@ -151,3 +65,5 @@ def get_cached_private_key_from_pem(self, file_path, cache_key): self.filecache.setdefault(str(cache_key), []).append(private_key) self.filecache.setdefault(str(cache_key), []).append(file_mod_time) return self.filecache[str(cache_key)][0] + + diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index d1af8c37..e96ade40 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -1,117 +1,21 @@ -import json -import time -# from jose import jwe -from cryptography.hazmat.primitives.asymmetric import rsa -from cryptography.hazmat.primitives import serialization -import datetime - -import json -import time -import base64 -import logging -from datetime import datetime -from wsgiref.handlers import format_date_time -from time import mktime -from jwcrypto import jwe, jwk -from cryptography import x509 -from cryptography.hazmat.backends import default_backend -from cryptography.hazmat.primitives import serialization, hashes -from cryptography.hazmat.primitives.asymmetric import padding -import jwt -from authenticationsdk.util.Cache import FileCache -from authenticationsdk.util.GlobalLabelParameters import * -# from jose import jwe -# from jose.constants import ALGORITHMS -from cryptography.hazmat.primitives import serialization -import json -from jwcrypto import jwk, jwe -from cryptography import x509 -from cryptography.hazmat.primitives import serialization -from cryptography.hazmat.backends import default_backend - - - 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, isMLESupportedByCybsForApi, operationIds): isMLEForAPI = False if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): isMLEForAPI = True operation_array = [op_id.strip() for op_id in operationIds.split(",")] - map_to_control_mle = merchant_config.get_mapToControlMLEonAPI() - if map_to_control_mle is not None and map_to_control_mle: + if merchant_config.get_mapToControlMLEonAPI() is not None and merchant_config.get_mapToControlMLEonAPI(): for op_id in operation_array: - if op_id in map_to_control_mle: - isMLEForAPI = map_to_control_mle[op_id] + if op_id in merchant_config.get_mapToControlMLEonAPI(): + isMLEForAPI = merchant_config.get_mapToControlMLEonAPI()[op_id] break return isMLEForAPI - - - + @staticmethod def encrypt_request_payload(merchant_config, requestBody): - # Load the x509 certificate - cert = MLEUtility.get_certificate(merchant_config) - - # Extract the public key from the certificate - public_key = cert.public_key() - - # Extract the serial number from the certificate - serial_number = MLEUtility.extract_serial_number(cert) - - return requestBody - - # return encrypted_json - - - - @staticmethod - def get_certificate(merchant_config): - cache_obj = FileCache() - try: - cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, merchant_config.key_file_name) - certificate = cert_data[0] - if certificate is not None: - return certificate - else: - 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: - raise MLEUtility.MLEException(f"No certificate found matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") - except Exception as e: - raise MLEUtility.MLEException(f"Unable to load PEM file: {str(e)}") + # complete the logic to encrypt request payload for mle - @staticmethod - def extract_serial_number(x509_certificate): - serial_number = None - serial_number_prefix = "SERIALNUMBER=" - principal = x509_certificate.subject.rfc4514_string().upper() - beg = principal.find(serial_number_prefix) - if beg >= 0: - #check if using this is required. - end = principal.find(",", beg) - if end == -1: - end = len(principal) - print("m here fr s no") - serial_number = principal[beg + len(serial_number_prefix):end] - else: - for attribute in x509_certificate.subject: - if attribute.oid == x509.NameOID.SERIAL_NUMBER: - serial_number = attribute.value - print("m there fr s no") - break - else: - logging.warning("Serial number not found in MLE certificate for alias.") - serial_number = str(x509_certificate.serial_number) - print("serial number", serial_number) - return serial_number - - # @staticmethod - # def create_json_object(jwe_token): - # return json.dumps({"encryptedRequest": jwe_token}) \ No newline at end of file + # return encrypted requestBody + return requestBody From 8ac40c6b14445364a1bb286869d59374fe658cdb Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 27 Jan 2025 13:45:00 +0530 Subject: [PATCH 12/52] encrypt chngs --- authenticationsdk/util/Cache.py | 104 ++++++++++++++++++++++--- authenticationsdk/util/MLEUtility.py | 112 +++++++++++++++++++++++++-- 2 files changed, 199 insertions(+), 17 deletions(-) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 8da26069..cab98dbb 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -2,6 +2,7 @@ import ssl from jwcrypto import jwk +from cryptography import x509 from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend @@ -21,15 +22,96 @@ def get_private_key_from_pem(self, pem_file_path): private_key = jwk.JWK.from_pem(cert.encode('utf-8')) return private_key - def grab_file(self, mconfig, filepath, filename): + def grab_file_mle(self, mconfig, filepath, filename): + file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime - file_mod_time = os.stat(os.path.join(filepath, filename)+GlobalLabelParameters.P12_PREFIX).st_mtime + if "MLE_CERT" not in self.filecache: + print("Cache miss: MLE_CERT not found in cache. Loading from file.") - 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() + ) + + mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = certificate + break + + # Check the additional certificates if not found in the main certificate + if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = cert + print("m here") + break + if mle_cert: + break + + if mle_cert: + self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] + else: + raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") + + if file_mod_time != self.filecache["MLE_CERT"][1]: + print("Cache invalid: File modification time has changed. Reloading from file.") + + 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() + ) + + mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = certificate + break + + # Check the additional certificates if not found in the main certificate + if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: + mle_cert = cert + print("m there") + + break + if mle_cert: + break + + if mle_cert: + self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] + else: + raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") + + print(self.filecache["MLE_CERT"]) + + return self.filecache["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(), + open(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX, 'rb').read(), + password=(mconfig.key_password).encode(), backend=default_backend() ) @@ -43,18 +125,22 @@ def grab_file(self, mconfig, filepath, filename): 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(), + 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') + print("cert_pem_str (updated):", cert_pem_str) + der_cert_string = base64.b64encode(ssl.PEM_cert_to_DER_cert(cert_pem_str)) + print("der_cert_string (updated):", der_cert_string) 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) + print("self.filecache (after update):", self.filecache) return self.filecache[filename] @@ -64,6 +150,4 @@ def get_cached_private_key_from_pem(self, file_path, cache_key): 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) - return self.filecache[str(cache_key)][0] - - + return self.filecache[str(cache_key)][0] \ No newline at end of file diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index e96ade40..ee5aa4e5 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -1,21 +1,119 @@ +import json +import time +# from jose import jwe +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives import serialization +import datetime + +import json +import time +import base64 +import logging +from datetime import datetime +from wsgiref.handlers import format_date_time +from time import mktime +from jwcrypto import jwe, jwk +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import serialization, hashes +from cryptography.hazmat.primitives.asymmetric import padding +import jwt +from authenticationsdk.util.Cache import FileCache +from authenticationsdk.util.GlobalLabelParameters import * +# from jose import jwe +# from jose.constants import ALGORITHMS +from cryptography.hazmat.primitives import serialization +import json +from jwcrypto import jwk, jwe +from cryptography import x509 +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.backends import default_backend + + + 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, isMLESupportedByCybsForApi, operationIds): isMLEForAPI = False if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): isMLEForAPI = True operation_array = [op_id.strip() for op_id in operationIds.split(",")] - if merchant_config.get_mapToControlMLEonAPI() is not None and merchant_config.get_mapToControlMLEonAPI(): + 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 merchant_config.get_mapToControlMLEonAPI(): - isMLEForAPI = merchant_config.get_mapToControlMLEonAPI()[op_id] + if op_id in map_to_control_mle: + isMLEForAPI = map_to_control_mle[op_id] break return isMLEForAPI - + + + @staticmethod def encrypt_request_payload(merchant_config, requestBody): - # complete the logic to encrypt request payload for mle - - # return encrypted requestBody + # Load the x509 certificate + cert = MLEUtility.get_certificate(merchant_config) + + # Extract the public key from the certificate + public_key = cert.public_key() + + # Extract the serial number from the certificate + serial_number = MLEUtility.extract_serial_number(cert) + + #encrypt using jose or jwcrypto + return requestBody + + # return encrypted_json + + + + @staticmethod + def get_certificate(merchant_config): + cache_obj = FileCache() + try: + cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, merchant_config.key_file_name) + certificate = cert_data[0] + if certificate is not None: + return certificate + else: + 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: + raise MLEUtility.MLEException(f"No certificate found matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") + except Exception as e: + raise MLEUtility.MLEException(f"Unable to load PEM file: {str(e)}") + + @staticmethod + def extract_serial_number(x509_certificate): + serial_number = None + serial_number_prefix = "SERIALNUMBER=" + principal = x509_certificate.subject.rfc4514_string().upper() + beg = principal.find(serial_number_prefix) + if beg >= 0: + #check if using this is required. + end = principal.find(",", beg) + if end == -1: + end = len(principal) + print("m here fr s no") + serial_number = principal[beg + len(serial_number_prefix):end] + else: + for attribute in x509_certificate.subject: + if attribute.oid == x509.NameOID.SERIAL_NUMBER: + serial_number = attribute.value + print("m there fr s no") + break + else: + logging.warning("Serial number not found in MLE certificate for alias.") + serial_number = str(x509_certificate.serial_number) + print("serial number", serial_number) + return serial_number + + # @staticmethod + # def create_json_object(jwe_token): + # return json.dumps({"encryptedRequest": jwe_token}) \ No newline at end of file From 0decd088e286e5a1aa5f1a800ca918c537335eae Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 27 Jan 2025 14:08:11 +0530 Subject: [PATCH 13/52] jwcrypto --- authenticationsdk/util/MLEUtility.py | 104 +++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 14 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index ee5aa4e5..e67d46bf 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -1,4 +1,3 @@ - import json import time # from jose import jwe @@ -29,8 +28,7 @@ from cryptography import x509 from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend - - +from jwcrypto.common import json_encode class MLEUtility: class MLEException(Exception): @@ -55,23 +53,101 @@ def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationI - @staticmethod - def encrypt_request_payload(merchant_config, requestBody): - # Load the x509 certificate - cert = MLEUtility.get_certificate(merchant_config) + # @staticmethod + # def encrypt_request_payload_jwcrypto_without_headers(merchant_config, requestBody): + # # Load the X.509 certificate + # cert = MLEUtility.get_certificate(merchant_config) + + # # Extract the public key from the certificate + # public_key = cert.public_key() + + # # Convert the public key to a JWK (JSON Web Key) + # jwk_key = jwk.JWK.from_pyca(public_key) - # Extract the public key from the certificate - public_key = cert.public_key() + # payload = json_encode(requestBody).encode('utf-8') - # Extract the serial number from the certificate - serial_number = MLEUtility.extract_serial_number(cert) + # print("payload", payload) + + + # # Create a JWE object + # jwetoken = jwe.JWE(plaintext=payload, + # protected={"alg": "RSA-OAEP", "enc": "A256GCM"}) + + + # # Encrypt the payload using the public key + # jwetoken.add_recipient(jwk_key) + + # # Serialize the JWE token to compact format + # encrypted_request_body = jwetoken.serialize(compact=True) - #encrypt using jose or jwcrypto + # print("encrypted_request_body", encrypted_request_body) + + + # # Return the encrypted request body in JSON format + # return json.dumps({"encryptedRequest": encrypted_request_body}) + + + + # @staticmethod + # def encrypt_request_payload_jwcrypto_with_headers(merchant_config, requestBody): + # if requestBody is not None: + # token = MLEUtility.generate_jwe_token(requestBody, merchant_config) + # print("token", token) + + # return token + # else: + # return requestBody + + # @staticmethod + # def generate_jwe_token(requestBody, merchant_config): + # print("requestBody", requestBody) + + - return requestBody + # # Get the MLE cert and verify the expiry of cert + # cert = MLEUtility.get_certificate(merchant_config) + # print("A") + # # is_cert_expired = MLEUtility.verify_is_certificate_expired(cert, merchant_config.get_mleKeyAlias(), logger) + # # if is_cert_expired: + # # raise Exception(f"Certificate for MLE with alias {merchant_config.get_mleKeyAlias()} is expired in {merchant_config.key_file_name}.p12") + + # custom_headers = { + # "iat": int(time.time()) # epoch time in seconds + # } + # print("B") + # serial_number = MLEUtility.extract_serial_number(cert) + # print("C") + # headers = { + # "alg": "RSA-OAEP-256", + # "enc": "A256GCM", + # "cty": "JWT", + # "kid": serial_number, + # **custom_headers + # } + # print("D") + + + # # if isinstance(requestBody, dict): + # # requestBody = json.dumps(requestBody) + + # print("requestBody11", requestBody) + + # payload = requestBody.encode() + # print("E") + # public_key = cert.public_key() + # print("F") + # jwk_key = jwk.JWK.from_pyca(public_key) + # print("G") + + # jwetoken = jwe.JWE(plaintext=payload, protected=headers) + # print("H") + # jwetoken.add_recipient(jwk_key) + # print("I") - # return encrypted_json + # encrypted_request_body = jwetoken.serialize(compact=True) + + # return json.dumps({"encryptedRequest": encrypted_request_body}) @staticmethod From a4950c7a24445eac1d9e141e2150803f01ec78cd Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 27 Jan 2025 15:17:57 +0530 Subject: [PATCH 14/52] validate --- authenticationsdk/util/MLEUtility.py | 122 +++++++++++++++------------ 1 file changed, 70 insertions(+), 52 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index e67d46bf..095acf7c 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -29,6 +29,8 @@ from cryptography.hazmat.primitives import serialization from cryptography.hazmat.backends import default_backend from jwcrypto.common import json_encode +from datetime import datetime, timezone + class MLEUtility: class MLEException(Exception): @@ -88,66 +90,66 @@ def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationI - # @staticmethod - # def encrypt_request_payload_jwcrypto_with_headers(merchant_config, requestBody): - # if requestBody is not None: - # token = MLEUtility.generate_jwe_token(requestBody, merchant_config) - # print("token", token) + @staticmethod + def encrypt_request_payload(merchant_config, requestBody): + if requestBody is not None: + token = MLEUtility.generate_jwe_token(requestBody, merchant_config) + print("token", token) - # return token - # else: - # return requestBody + return token + else: + return requestBody - # @staticmethod - # def generate_jwe_token(requestBody, merchant_config): - # print("requestBody", requestBody) + @staticmethod + def generate_jwe_token(requestBody, merchant_config): + print("requestBody", requestBody) - # # Get the MLE cert and verify the expiry of cert - # cert = MLEUtility.get_certificate(merchant_config) - # print("A") - # # is_cert_expired = MLEUtility.verify_is_certificate_expired(cert, merchant_config.get_mleKeyAlias(), logger) - # # if is_cert_expired: - # # raise Exception(f"Certificate for MLE with alias {merchant_config.get_mleKeyAlias()} is expired in {merchant_config.key_file_name}.p12") - - # custom_headers = { - # "iat": int(time.time()) # epoch time in seconds - # } - # print("B") - # serial_number = MLEUtility.extract_serial_number(cert) - # print("C") - # headers = { - # "alg": "RSA-OAEP-256", - # "enc": "A256GCM", - # "cty": "JWT", - # "kid": serial_number, - # **custom_headers - # } - # print("D") - - - # # if isinstance(requestBody, dict): - # # requestBody = json.dumps(requestBody) + # Get the MLE cert and verify the expiry of cert + cert = MLEUtility.get_certificate(merchant_config) + print("A") + # is_cert_expired = MLEUtility.verify_is_certificate_expired(cert, merchant_config.get_mleKeyAlias(), logger) + # if is_cert_expired: + # raise Exception(f"Certificate for MLE with alias {merchant_config.get_mleKeyAlias()} is expired in {merchant_config.key_file_name}.p12") + + custom_headers = { + "iat": int(time.time()) # epoch time in seconds + } + print("B") + serial_number = MLEUtility.extract_serial_number(cert) + print("C") + headers = { + "alg": "RSA-OAEP-256", + "enc": "A256GCM", + "cty": "JWT", + "kid": serial_number, + **custom_headers + } + print("D") + + + # if isinstance(requestBody, dict): + # requestBody = json.dumps(requestBody) - # print("requestBody11", requestBody) - - # payload = requestBody.encode() - # print("E") - # public_key = cert.public_key() - # print("F") - # jwk_key = jwk.JWK.from_pyca(public_key) - # print("G") - - # jwetoken = jwe.JWE(plaintext=payload, protected=headers) - # print("H") - # jwetoken.add_recipient(jwk_key) - # print("I") + print("requestBody11", requestBody) + + payload = requestBody.encode() + print("E") + public_key = cert.public_key() + print("F") + jwk_key = jwk.JWK.from_pyca(public_key) + print("G") + + jwetoken = jwe.JWE(plaintext=payload, protected=headers) + print("H") + jwetoken.add_recipient(jwk_key) + print("I") - # encrypted_request_body = jwetoken.serialize(compact=True) + encrypted_request_body = jwetoken.serialize(compact=True) - # return json.dumps({"encryptedRequest": encrypted_request_body}) + return json.dumps({"encryptedRequest": encrypted_request_body}) @staticmethod @@ -156,6 +158,7 @@ def get_certificate(merchant_config): try: cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, merchant_config.key_file_name) certificate = cert_data[0] + MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) if certificate is not None: return certificate else: @@ -189,7 +192,22 @@ def extract_serial_number(x509_certificate): serial_number = str(x509_certificate.serial_number) print("serial number", serial_number) return serial_number - + + @staticmethod + def validate_certificate_expiry(certificate, key_alias): + try: + print("inside validate method") + if certificate.not_valid_after_utc is None: + print("Certificate for MLE doesn't have an expiry date.") + elif certificate.not_valid_after_utc < datetime.now(timezone.utc): + print(f"Certificate with MLE alias {key_alias} is expired as of {certificate.not_valid_after_utc}. Please update p12 file.") + 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: + print(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: + logging.error(f"Error validating certificate expiry: {e}") + raise # @staticmethod # def create_json_object(jwe_token): # return json.dumps({"encryptedRequest": jwe_token}) \ No newline at end of file From 55decbc349f4311cb36541494c05e8b9e5076494 Mon Sep 17 00:00:00 2001 From: monkumar Date: Mon, 27 Jan 2025 17:55:05 +0530 Subject: [PATCH 15/52] added logs and corrected encrypt method --- CyberSource/api_client.py | 18 +- .../util/GlobalLabelParameters.py | 1 + authenticationsdk/util/MLEUtility.py | 221 ++++++------------ 3 files changed, 85 insertions(+), 155 deletions(-) diff --git a/CyberSource/api_client.py b/CyberSource/api_client.py index 54a6544d..ba52e615 100644 --- a/CyberSource/api_client.py +++ b/CyberSource/api_client.py @@ -464,14 +464,8 @@ 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") + body = self.process_body(body=body) query_param_path = self.set_query_params(resource_path, query_params) if query_param_path: self.mconfig.request_target = query_param_path @@ -480,7 +474,6 @@ def call_api(self, resource_path, method, if self.mconfig.authentication_type.upper() != GlobalLabelParameters.MUTUAL_AUTH.upper(): self.call_authentication_header(method, header_params, body) - """ Makes the HTTP request (synchronous) and return the deserialized data. To make an async request, define a function for callback. @@ -830,3 +823,12 @@ def __deserialize_model(self, data, klass): instance = klass(**kwargs) return instance + + def process_body(self, body): + 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") + return body diff --git a/authenticationsdk/util/GlobalLabelParameters.py b/authenticationsdk/util/GlobalLabelParameters.py index e4afd9dc..2abe0fbb 100644 --- a/authenticationsdk/util/GlobalLabelParameters.py +++ b/authenticationsdk/util/GlobalLabelParameters.py @@ -94,3 +94,4 @@ class GlobalLabelParameters: 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 diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 095acf7c..aa4b5941 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -1,171 +1,101 @@ import json import time -# from jose import jwe -from cryptography.hazmat.primitives.asymmetric import rsa -from cryptography.hazmat.primitives import serialization -import datetime +from datetime import datetime, timezone -import json -import time -import base64 -import logging -from datetime import datetime -from wsgiref.handlers import format_date_time -from time import mktime -from jwcrypto import jwe, jwk from cryptography import x509 -from cryptography.hazmat.backends import default_backend -from cryptography.hazmat.primitives import serialization, hashes -from cryptography.hazmat.primitives.asymmetric import padding -import jwt -from authenticationsdk.util.Cache import FileCache -from authenticationsdk.util.GlobalLabelParameters import * -# from jose import jwe -# from jose.constants import ALGORITHMS -from cryptography.hazmat.primitives import serialization -import json from jwcrypto import jwk, jwe -from cryptography import x509 -from cryptography.hazmat.primitives import serialization -from cryptography.hazmat.backends import default_backend -from jwcrypto.common import json_encode -from datetime import datetime, timezone +from authenticationsdk.util.Cache import FileCache +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +import CyberSource.logging.log_factory as LogFactory class MLEUtility: + logger = None + + @staticmethod + def setup_logger(merchant_config): + MLEUtility.logger = LogFactory.setup_logger(__name__, merchant_config.log_config) + class MLEException(Exception): def __init__(self, message, errors=None): super().__init__(message) self.errors = errors - @staticmethod - def check_is_mle_for_api(merchant_config, isMLESupportedByCybsForApi, operationIds): - isMLEForAPI = False - if isMLESupportedByCybsForApi and merchant_config.get_useMLEGlobally(): - isMLEForAPI = True - operation_array = [op_id.strip() for op_id in operationIds.split(",")] + def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids): + if MLEUtility.logger is None: + MLEUtility.setup_logger(merchant_config) + 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: - isMLEForAPI = map_to_control_mle[op_id] + is_mle_for_api = map_to_control_mle[op_id] break - return isMLEForAPI - - - - # @staticmethod - # def encrypt_request_payload_jwcrypto_without_headers(merchant_config, requestBody): - # # Load the X.509 certificate - # cert = MLEUtility.get_certificate(merchant_config) - - # # Extract the public key from the certificate - # public_key = cert.public_key() - - # # Convert the public key to a JWK (JSON Web Key) - # jwk_key = jwk.JWK.from_pyca(public_key) - - # payload = json_encode(requestBody).encode('utf-8') - - # print("payload", payload) - - - # # Create a JWE object - # jwetoken = jwe.JWE(plaintext=payload, - # protected={"alg": "RSA-OAEP", "enc": "A256GCM"}) - - - # # Encrypt the payload using the public key - # jwetoken.add_recipient(jwk_key) - - # # Serialize the JWE token to compact format - # encrypted_request_body = jwetoken.serialize(compact=True) - - # print("encrypted_request_body", encrypted_request_body) - - - # # Return the encrypted request body in JSON format - # return json.dumps({"encryptedRequest": encrypted_request_body}) - - + return is_mle_for_api @staticmethod - def encrypt_request_payload(merchant_config, requestBody): - if requestBody is not None: - token = MLEUtility.generate_jwe_token(requestBody, merchant_config) - print("token", token) + def encrypt_request_payload(merchant_config, request_body): + try: + cert = MLEUtility.get_certificate(merchant_config) + except Exception as e: + raise MLEUtility.MLEException(f"Unable to load certificate: {str(e)}") - return token - else: - return requestBody + try: + public_key = cert.public_key() + serial_number = MLEUtility.extract_serial_number(cert) + + jwk_key = jwk.JWK.from_pyca(public_key) + + payload = request_body.encode('utf-8') - @staticmethod - def generate_jwe_token(requestBody, merchant_config): - print("requestBody", requestBody) - - - - # Get the MLE cert and verify the expiry of cert - cert = MLEUtility.get_certificate(merchant_config) - print("A") - # is_cert_expired = MLEUtility.verify_is_certificate_expired(cert, merchant_config.get_mleKeyAlias(), logger) - # if is_cert_expired: - # raise Exception(f"Certificate for MLE with alias {merchant_config.get_mleKeyAlias()} is expired in {merchant_config.key_file_name}.p12") - - custom_headers = { - "iat": int(time.time()) # epoch time in seconds - } - print("B") - serial_number = MLEUtility.extract_serial_number(cert) - print("C") - headers = { - "alg": "RSA-OAEP-256", - "enc": "A256GCM", - "cty": "JWT", - "kid": serial_number, - **custom_headers - } - print("D") - - - # if isinstance(requestBody, dict): - # requestBody = json.dumps(requestBody) - - print("requestBody11", requestBody) - - payload = requestBody.encode() - print("E") - public_key = cert.public_key() - print("F") - jwk_key = jwk.JWK.from_pyca(public_key) - print("G") - - jwetoken = jwe.JWE(plaintext=payload, protected=headers) - print("H") - jwetoken.add_recipient(jwk_key) - print("I") - - encrypted_request_body = jwetoken.serialize(compact=True) - - - return json.dumps({"encryptedRequest": encrypted_request_body}) + 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) + + encrypted_request_body = jwe_token.serialize(compact=True) + MLEUtility.logger.info(f"Request payload encrypted successfully. {encrypted_request_body}") + return MLEUtility.create_json_object(encrypted_request_body) + except Exception as e: + MLEUtility.logger.error(f"Error encrypting request payload: {str(e)}") + raise MLEUtility.MLEException(f"Error encrypting request payload: {str(e)}") @staticmethod def get_certificate(merchant_config): cache_obj = FileCache() try: - cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, merchant_config.key_file_name) + cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, + merchant_config.key_file_name) certificate = cert_data[0] - MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) if certificate is not None: + MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) + MLEUtility.logger.info(f"Certificate found for MLE with alias {merchant_config.get_mleKeyAlias()}") return certificate else: - 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") + MLEUtility.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: - raise MLEUtility.MLEException(f"No certificate found matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") + MLEUtility.logger.error( + f"No certificate found matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") + raise MLEUtility.MLEException( + f"No certificate found matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") except Exception as e: + MLEUtility.logger.error(f"Unable to load certificate: {str(e)}") raise MLEUtility.MLEException(f"Unable to load PEM file: {str(e)}") @staticmethod @@ -175,39 +105,36 @@ def extract_serial_number(x509_certificate): principal = x509_certificate.subject.rfc4514_string().upper() beg = principal.find(serial_number_prefix) if beg >= 0: - #check if using this is required. end = principal.find(",", beg) if end == -1: end = len(principal) - print("m here fr s no") serial_number = principal[beg + len(serial_number_prefix):end] else: for attribute in x509_certificate.subject: if attribute.oid == x509.NameOID.SERIAL_NUMBER: serial_number = attribute.value - print("m there fr s no") break else: - logging.warning("Serial number not found in MLE certificate for alias.") + MLEUtility.logger.warning("Serial number not found in MLE certificate for alias.") serial_number = str(x509_certificate.serial_number) - print("serial number", 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): try: - print("inside validate method") if certificate.not_valid_after_utc is None: - print("Certificate for MLE doesn't have an expiry date.") + MLEUtility.logger.info("Certificate for MLE doesn't have an expiry date.") elif certificate.not_valid_after_utc < datetime.now(timezone.utc): - print(f"Certificate with MLE alias {key_alias} is expired as of {certificate.not_valid_after_utc}. Please update p12 file.") + MLEUtility.logger.warning( + f"Certificate with MLE alias {key_alias} is expired as of {certificate.not_valid_after_utc}. Please update p12 file.") 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: - print(f"Certificate for MLE with alias {key_alias} is going to expire on {certificate.not_valid_after_utc}. Please update p12 file before that.") + MLEUtility.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: - logging.error(f"Error validating certificate expiry: {e}") - raise - # @staticmethod - # def create_json_object(jwe_token): - # return json.dumps({"encryptedRequest": jwe_token}) \ No newline at end of file + MLEUtility.logger.error(f"Error while checking certificate expiry: {str(e)}") From b5954262e11ba27381bb3b121bd71927dfdc7a11 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 27 Jan 2025 18:44:57 +0530 Subject: [PATCH 16/52] cache code refactored --- authenticationsdk/util/Cache.py | 113 +++++------------- .../util/GlobalLabelParameters.py | 1 + 2 files changed, 29 insertions(+), 85 deletions(-) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index cab98dbb..753b03ac 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -21,19 +21,16 @@ def get_private_key_from_pem(self, pem_file_path): cert = pem_file.read() private_key = jwk.JWK.from_pem(cert.encode('utf-8')) return private_key - - def grab_file_mle(self, mconfig, filepath, filename): - file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime - - if "MLE_CERT" not in self.filecache: - print("Cache miss: MLE_CERT not found in cache. Loading from file.") - - 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() - ) - + + 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 update_cache(self, cache_key, certificate, private_key, file_mod_time, is_mle, filename, additional_certificates): + if is_mle: mle_cert = None # Check the main certificate @@ -52,69 +49,15 @@ def grab_file_mle(self, mconfig, filepath, filename): cn_value = attribute.value if cn_value == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: mle_cert = cert - print("m here") break if mle_cert: break if mle_cert: - self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] + self.filecache[cache_key] = [mle_cert, file_mod_time] else: raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") - - if file_mod_time != self.filecache["MLE_CERT"][1]: - print("Cache invalid: File modification time has changed. Reloading from file.") - - 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() - ) - - mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = certificate - break - - # Check the additional certificates if not found in the main certificate - if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = cert - print("m there") - - break - if mle_cert: - break - - if mle_cert: - self.filecache["MLE_CERT"] = [mle_cert, file_mod_time] - else: - raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") - - print(self.filecache["MLE_CERT"]) - - return self.filecache["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() - ) - + else: 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)) @@ -122,27 +65,27 @@ def grab_file(self, mconfig, filepath, filename): 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() - ) + def grab_file(self, mconfig, filepath, filename, is_mle=False): + file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime - cert_pem = certificate.public_bytes(serialization.Encoding.PEM) - cert_pem_str = cert_pem.decode('utf-8') - print("cert_pem_str (updated):", cert_pem_str) + if is_mle: + cache_key = GlobalLabelParameters.MLE_CERT + else: + cache_key = filename + + if cache_key not in self.filecache: - der_cert_string = base64.b64encode(ssl.PEM_cert_to_DER_cert(cert_pem_str)) - print("der_cert_string (updated):", der_cert_string) + private_key, certificate, additional_certificates = self.load_certificates(filepath, filename, mconfig.key_password) + self.update_cache(cache_key, certificate, private_key, file_mod_time, is_mle, filename, additional_certificates) - 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) - print("self.filecache (after update):", self.filecache) + if file_mod_time != self.filecache[cache_key][1 if is_mle else 2]: + + private_key, certificate, additional_certificates = self.load_certificates(filepath, filename, mconfig.key_password) + self.update_cache(cache_key, certificate, private_key, file_mod_time, is_mle, filename, additional_certificates) - return self.filecache[filename] + return self.filecache[cache_key] def get_cached_private_key_from_pem(self, file_path, cache_key): file_mod_time = os.stat(file_path).st_mtime diff --git a/authenticationsdk/util/GlobalLabelParameters.py b/authenticationsdk/util/GlobalLabelParameters.py index e4afd9dc..bf7761b7 100644 --- a/authenticationsdk/util/GlobalLabelParameters.py +++ b/authenticationsdk/util/GlobalLabelParameters.py @@ -88,6 +88,7 @@ class GlobalLabelParameters: DEFAULT_PROXY_PORT = 443 DEFAULT_KEY_FILE_PATH = os.path.join(os.getcwd(),"resources") DEFAULT_MLE_ALIAS_FOR_CERT = "CyberSource_SJC_US" + MLE_CERT="MLE_CERT" 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" From f0d97bfb40398be95be1beba110f412458339e15 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 27 Jan 2025 18:54:48 +0530 Subject: [PATCH 17/52] loggers --- authenticationsdk/util/MLEUtility.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index aa4b5941..cdfb15ba 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -67,7 +67,7 @@ def encrypt_request_payload(merchant_config, request_body): jwe_token.add_recipient(jwk_key) encrypted_request_body = jwe_token.serialize(compact=True) - MLEUtility.logger.info(f"Request payload encrypted successfully. {encrypted_request_body}") + MLEUtility.logger.debug(f"Request payload encrypted successfully. {encrypted_request_body}") return MLEUtility.create_json_object(encrypted_request_body) except Exception as e: MLEUtility.logger.error(f"Error encrypting request payload: {str(e)}") @@ -78,11 +78,11 @@ def get_certificate(merchant_config): cache_obj = FileCache() try: cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, - merchant_config.key_file_name) + merchant_config.key_file_name, True) certificate = cert_data[0] if certificate is not None: MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) - MLEUtility.logger.info(f"Certificate found for MLE with alias {merchant_config.get_mleKeyAlias()}") + MLEUtility.logger.debug(f"Certificate found for MLE with alias {merchant_config.get_mleKeyAlias()}") return certificate else: MLEUtility.logger.error( @@ -127,7 +127,7 @@ def create_json_object(jwe_token): def validate_certificate_expiry(certificate, key_alias): try: if certificate.not_valid_after_utc is None: - MLEUtility.logger.info("Certificate for MLE doesn't have an expiry date.") + MLEUtility.logger.debug("Certificate for MLE doesn't have an expiry date.") elif certificate.not_valid_after_utc < datetime.now(timezone.utc): MLEUtility.logger.warning( f"Certificate with MLE alias {key_alias} is expired as of {certificate.not_valid_after_utc}. Please update p12 file.") From ce3db67825d0c36e8f7382979493ad36aa890892 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Tue, 28 Jan 2025 19:12:50 +0530 Subject: [PATCH 18/52] "comment resolved" --- CyberSource/api_client.py | 2 - authenticationsdk/util/Cache.py | 153 +++++++++++------- .../util/GlobalLabelParameters.py | 1 - authenticationsdk/util/MLEUtility.py | 39 +++-- 4 files changed, 117 insertions(+), 78 deletions(-) diff --git a/CyberSource/api_client.py b/CyberSource/api_client.py index ba52e615..5678053f 100644 --- a/CyberSource/api_client.py +++ b/CyberSource/api_client.py @@ -464,8 +464,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: - body = self.process_body(body=body) 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/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 753b03ac..98888e48 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -29,68 +29,111 @@ def load_certificates(self, filepath, filename, password): backend=default_backend() ) - def update_cache(self, cache_key, certificate, private_key, file_mod_time, is_mle, filename, additional_certificates): - if is_mle: - mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = certificate - break - - # Check the additional certificates if not found in the main certificate - if not mle_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 == GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT: - mle_cert = cert - break - if mle_cert: - break - - if mle_cert: - self.filecache[cache_key] = [mle_cert, file_mod_time] - else: - raise ValueError(f"No certificate found matching the MLE key alias: {GlobalLabelParameters.DEFAULT_MLE_ALIAS_FOR_CERT}") - else: - 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) + # def grab_file(self, mconfig, filepath, filename, key_alias): + # file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime + + # if key_alias not in self.filecache or file_mod_time != self.filecache[key_alias][2]: + # if filename not in self.filecache: + # print(f"Cache miss: {key_alias} not found in cache. Loading from file.") + # else: + # print("Cached file is outdated. Reloading from file.") + + # private_key, certificate, additional_certificates = self.load_certificates(filepath, filename, mconfig.key_password) + + # 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 - def grab_file(self, mconfig, filepath, filename, is_mle=False): + # if target_cert: + # if key_alias == mconfig.get_mleKeyAlias: + # self.filecache[str(key_alias)] = [target_cert, None ,file_mod_time] + # elif key_alias == mconfig.key_alias: + # cert_pem = target_cert.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[str(key_alias)] = [der_cert_string, private_key, file_mod_time] + # else: + # self.filecache[str(key_alias)] = [None, None, None, None] + + # print("target_cert", target_cert) + # print("self.filecache[filename]", self.filecache[key_alias]) + + # return self.filecache[key_alias] + + 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 + print("target_cert", target_cert) + + 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()) + print("mle_cert",mle_cert) + + self.filecache.setdefault(str(filename), []).append(jwt_der_cert_string) + self.filecache.setdefault(str(filename), []).append(private_key) + self.filecache.setdefault(str(filename), []).append(file_mod_time) + self.filecache.setdefault(str(filename), []).append(mle_cert) - if is_mle: - cache_key = GlobalLabelParameters.MLE_CERT - else: - cache_key = filename - - if cache_key not in self.filecache: - - private_key, certificate, additional_certificates = self.load_certificates(filepath, filename, mconfig.key_password) - self.update_cache(cache_key, certificate, private_key, file_mod_time, is_mle, filename, additional_certificates) - - if file_mod_time != self.filecache[cache_key][1 if is_mle else 2]: - - private_key, certificate, additional_certificates = self.load_certificates(filepath, filename, mconfig.key_password) - self.update_cache(cache_key, certificate, private_key, file_mod_time, is_mle, filename, additional_certificates) - - return self.filecache[cache_key] - + 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 or file_mod_time != self.filecache[filename][2]: + self.update_cache(mconfig, filepath, filename) + return self.filecache[filename] + 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) - return self.filecache[str(cache_key)][0] \ No newline at end of file + return self.filecache[str(cache_key)][0] diff --git a/authenticationsdk/util/GlobalLabelParameters.py b/authenticationsdk/util/GlobalLabelParameters.py index 47f23502..2abe0fbb 100644 --- a/authenticationsdk/util/GlobalLabelParameters.py +++ b/authenticationsdk/util/GlobalLabelParameters.py @@ -88,7 +88,6 @@ class GlobalLabelParameters: DEFAULT_PROXY_PORT = 443 DEFAULT_KEY_FILE_PATH = os.path.join(os.getcwd(),"resources") DEFAULT_MLE_ALIAS_FOR_CERT = "CyberSource_SJC_US" - MLE_CERT="MLE_CERT" 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" diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index cdfb15ba..85271c50 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -39,6 +39,10 @@ def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, oper @staticmethod def encrypt_request_payload(merchant_config, request_body): + + if request_body is None or request_body == "": + return request_body + try: cert = MLEUtility.get_certificate(merchant_config) except Exception as e: @@ -47,12 +51,15 @@ def encrypt_request_payload(merchant_config, request_body): try: public_key = cert.public_key() serial_number = MLEUtility.extract_serial_number(cert) + if serial_number is None: + raise ValueError("Serial number could not be fetched") jwk_key = jwk.JWK.from_pyca(public_key) + + MLEUtility.logger.debug("LOG_REQUEST_BEFORE_MLE: ", payload) payload = request_body.encode('utf-8') - header = { "alg": "RSA-OAEP-256", "enc": "A256GCM", @@ -77,9 +84,9 @@ def encrypt_request_payload(merchant_config, request_body): def get_certificate(merchant_config): cache_obj = FileCache() try: - cert_data = cache_obj.grab_file_mle(merchant_config, merchant_config.key_file_path, - merchant_config.key_file_name, True) - certificate = cert_data[0] + cert_data = cache_obj.grab_file(merchant_config, merchant_config.key_file_path, + merchant_config.key_file_name) + certificate = cert_data[3] if certificate is not None: MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) MLEUtility.logger.debug(f"Certificate found for MLE with alias {merchant_config.get_mleKeyAlias()}") @@ -101,22 +108,14 @@ def get_certificate(merchant_config): @staticmethod def extract_serial_number(x509_certificate): serial_number = None - serial_number_prefix = "SERIALNUMBER=" - principal = x509_certificate.subject.rfc4514_string().upper() - beg = principal.find(serial_number_prefix) - if beg >= 0: - end = principal.find(",", beg) - if end == -1: - end = len(principal) - serial_number = principal[beg + len(serial_number_prefix):end] - else: - for attribute in x509_certificate.subject: - if attribute.oid == x509.NameOID.SERIAL_NUMBER: - serial_number = attribute.value - break - else: - MLEUtility.logger.warning("Serial number not found in MLE certificate for alias.") - serial_number = str(x509_certificate.serial_number) + + for attribute in x509_certificate.subject: + if attribute.oid == x509.NameOID.SERIAL_NUMBER: + serial_number = attribute.value + break + if serial_number is None: + MLEUtility.logger.warning("Serial number not found in MLE certificate for alias.") + serial_number = str(x509_certificate.serial_number) return serial_number @staticmethod From bc90790dfbd62ba8820fac8e89ff32abc051d06b Mon Sep 17 00:00:00 2001 From: mahmishr Date: Tue, 28 Jan 2025 19:34:05 +0530 Subject: [PATCH 19/52] "resolved" --- authenticationsdk/util/Cache.py | 53 --------------------------------- 1 file changed, 53 deletions(-) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 98888e48..588a6ba4 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -28,57 +28,6 @@ def load_certificates(self, filepath, filename, password): password=password.encode(), backend=default_backend() ) - - # def grab_file(self, mconfig, filepath, filename, key_alias): - # file_mod_time = os.stat(os.path.join(filepath, filename) + GlobalLabelParameters.P12_PREFIX).st_mtime - - # if key_alias not in self.filecache or file_mod_time != self.filecache[key_alias][2]: - # if filename not in self.filecache: - # print(f"Cache miss: {key_alias} not found in cache. Loading from file.") - # else: - # print("Cached file is outdated. Reloading from file.") - - # private_key, certificate, additional_certificates = self.load_certificates(filepath, filename, mconfig.key_password) - - # 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 - - - # if target_cert: - # if key_alias == mconfig.get_mleKeyAlias: - # self.filecache[str(key_alias)] = [target_cert, None ,file_mod_time] - # elif key_alias == mconfig.key_alias: - # cert_pem = target_cert.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[str(key_alias)] = [der_cert_string, private_key, file_mod_time] - # else: - # self.filecache[str(key_alias)] = [None, None, None, None] - - # print("target_cert", target_cert) - # print("self.filecache[filename]", self.filecache[key_alias]) - - # return self.filecache[key_alias] def get_cert_based_on_key_alias(self, certificate, additional_certificates, key_alias): target_cert = None @@ -102,7 +51,6 @@ def get_cert_based_on_key_alias(self, certificate, additional_certificates, key_ break if target_cert: break - print("target_cert", target_cert) return target_cert @@ -117,7 +65,6 @@ def update_cache(self, mconfig, filepath, filename): 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()) - print("mle_cert",mle_cert) self.filecache.setdefault(str(filename), []).append(jwt_der_cert_string) self.filecache.setdefault(str(filename), []).append(private_key) From 7fc4ed909914733531539e640afbaea432ad3c14 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Tue, 28 Jan 2025 19:34:42 +0530 Subject: [PATCH 20/52] "resolved" --- authenticationsdk/util/MLEUtility.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 85271c50..d055fbfc 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -25,6 +25,7 @@ def __init__(self, message, errors=None): def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids): if MLEUtility.logger is None: MLEUtility.setup_logger(merchant_config) + # MLEUtility.initialize_logger(merchant_config) is_mle_for_api = False if is_mle_supported_by_cybs_for_api and merchant_config.get_useMLEGlobally(): is_mle_for_api = True @@ -56,7 +57,7 @@ def encrypt_request_payload(merchant_config, request_body): jwk_key = jwk.JWK.from_pyca(public_key) - MLEUtility.logger.debug("LOG_REQUEST_BEFORE_MLE: ", payload) + MLEUtility.logger.debug("LOG_REQUEST_BEFORE_MLE: ", request_body) payload = request_body.encode('utf-8') From 77814fb666664cfedada726981f51d89343bc4ad Mon Sep 17 00:00:00 2001 From: mahmishr Date: Tue, 28 Jan 2025 19:39:06 +0530 Subject: [PATCH 21/52] "log" --- authenticationsdk/util/MLEUtility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index d055fbfc..33d8ffce 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -57,7 +57,7 @@ def encrypt_request_payload(merchant_config, request_body): jwk_key = jwk.JWK.from_pyca(public_key) - MLEUtility.logger.debug("LOG_REQUEST_BEFORE_MLE: ", request_body) + MLEUtility.logger.debug(f"Request payload encrypted successfully. {request_body}") payload = request_body.encode('utf-8') From 4d653081848b5acc532666d1767bdb89bb391867 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 00:54:42 +0530 Subject: [PATCH 22/52] "Utility" --- authenticationsdk/util/Utility.py | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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 From da0cac46eea10046ba01131d99234abaacc48b96 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 11:18:43 +0530 Subject: [PATCH 23/52] "MLE utility comments" --- authenticationsdk/util/MLEUtility.py | 37 ++++++++++------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 33d8ffce..d6c0a8c4 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -23,9 +23,7 @@ def __init__(self, message, errors=None): @staticmethod def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids): - if MLEUtility.logger is None: - MLEUtility.setup_logger(merchant_config) - # MLEUtility.initialize_logger(merchant_config) + is_mle_for_api = False if is_mle_supported_by_cybs_for_api and merchant_config.get_useMLEGlobally(): is_mle_for_api = True @@ -41,24 +39,20 @@ def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, oper @staticmethod def encrypt_request_payload(merchant_config, request_body): + if MLEUtility.logger is None: + MLEUtility.setup_logger(merchant_config) + if request_body is None or request_body == "": return request_body - try: - cert = MLEUtility.get_certificate(merchant_config) - except Exception as e: - raise MLEUtility.MLEException(f"Unable to load certificate: {str(e)}") - + cert = MLEUtility.get_mle_certificate(merchant_config) + try: public_key = cert.public_key() serial_number = MLEUtility.extract_serial_number(cert) - if serial_number is None: - raise ValueError("Serial number could not be fetched") jwk_key = jwk.JWK.from_pyca(public_key) - MLEUtility.logger.debug(f"Request payload encrypted successfully. {request_body}") - payload = request_body.encode('utf-8') header = { @@ -74,23 +68,20 @@ def encrypt_request_payload(merchant_config, request_body): jwe_token.add_recipient(jwk_key) - encrypted_request_body = jwe_token.serialize(compact=True) - MLEUtility.logger.debug(f"Request payload encrypted successfully. {encrypted_request_body}") - return MLEUtility.create_json_object(encrypted_request_body) + serialized_jwe_token = jwe_token.serialize(compact=True) + return MLEUtility.create_json_object(serialized_jwe_token) except Exception as e: MLEUtility.logger.error(f"Error encrypting request payload: {str(e)}") raise MLEUtility.MLEException(f"Error encrypting request payload: {str(e)}") @staticmethod - def get_certificate(merchant_config): + def get_mle_certificate(merchant_config): cache_obj = FileCache() try: - cert_data = cache_obj.grab_file(merchant_config, merchant_config.key_file_path, - merchant_config.key_file_name) + cert_data = cache_obj.grab_file(merchant_config, merchant_config.key_file_path, merchant_config.key_file_name) certificate = cert_data[3] if certificate is not None: MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) - MLEUtility.logger.debug(f"Certificate found for MLE with alias {merchant_config.get_mleKeyAlias()}") return certificate else: MLEUtility.logger.error( @@ -99,9 +90,9 @@ def get_certificate(merchant_config): f"No certificate found for MLE for given mleKeyAlias {merchant_config.get_mleKeyAlias()} in p12 file {merchant_config.key_file_name}.p12") except KeyError: MLEUtility.logger.error( - f"No certificate found matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") + 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 matching the MLE key alias: {merchant_config.get_mleKeyAlias()}") + 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: MLEUtility.logger.error(f"Unable to load certificate: {str(e)}") raise MLEUtility.MLEException(f"Unable to load PEM file: {str(e)}") @@ -126,9 +117,7 @@ def create_json_object(jwe_token): @staticmethod def validate_certificate_expiry(certificate, key_alias): try: - if certificate.not_valid_after_utc is None: - MLEUtility.logger.debug("Certificate for MLE doesn't have an expiry date.") - elif certificate.not_valid_after_utc < datetime.now(timezone.utc): + if certificate.not_valid_after_utc < datetime.now(timezone.utc): MLEUtility.logger.warning( f"Certificate with MLE alias {key_alias} is expired as of {certificate.not_valid_after_utc}. Please update p12 file.") else: From e29ab60cdd0027b628420cc6798766aff429f6f4 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 11:42:39 +0530 Subject: [PATCH 24/52] "generate token" --- authenticationsdk/util/MLEUtility.py | 43 +++++++++++++++------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index d6c0a8c4..79c96535 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -48,31 +48,34 @@ def encrypt_request_payload(merchant_config, request_body): cert = MLEUtility.get_mle_certificate(merchant_config) try: - public_key = cert.public_key() - serial_number = MLEUtility.extract_serial_number(cert) + serialized_jwe_token = MLEUtility.generate_token(cert, request_body) + return MLEUtility.create_json_object(serialized_jwe_token) + + except Exception as e: + MLEUtility.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): + public_key = cert.public_key() + serial_number = MLEUtility.extract_serial_number(cert) - jwk_key = jwk.JWK.from_pyca(public_key) - - payload = request_body.encode('utf-8') + 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()) - } + 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 = jwe.JWE(plaintext=payload, protected=json.dumps(header)) + jwe_token.add_recipient(jwk_key) - jwe_token.add_recipient(jwk_key) + return jwe_token.serialize(compact=True) - serialized_jwe_token = jwe_token.serialize(compact=True) - return MLEUtility.create_json_object(serialized_jwe_token) - except Exception as e: - MLEUtility.logger.error(f"Error encrypting request payload: {str(e)}") - raise MLEUtility.MLEException(f"Error encrypting request payload: {str(e)}") @staticmethod def get_mle_certificate(merchant_config): From c3c0ec9f13cbace69af31e65610b777051966494 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 12:15:31 +0530 Subject: [PATCH 25/52] "beautify" --- authenticationsdk/util/Cache.py | 2 ++ authenticationsdk/util/MLEUtility.py | 1 + 2 files changed, 3 insertions(+) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 588a6ba4..040df0bc 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -70,6 +70,8 @@ def update_cache(self, mconfig, filepath, filename): self.filecache.setdefault(str(filename), []).append(private_key) self.filecache.setdefault(str(filename), []).append(file_mod_time) self.filecache.setdefault(str(filename), []).append(mle_cert) + + # 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 diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 79c96535..65d81a30 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -123,6 +123,7 @@ def validate_certificate_expiry(certificate, key_alias): if certificate.not_valid_after_utc < datetime.now(timezone.utc): MLEUtility.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: From 594643bd207d89968f76432e2bf3797d1b1515c8 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 13:09:33 +0530 Subject: [PATCH 26/52] "mustache" --- generator/cybersource-python-template/api.mustache | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generator/cybersource-python-template/api.mustache b/generator/cybersource-python-template/api.mustache index 0d4b6792..8a95894e 100644 --- a/generator/cybersource-python-template/api.mustache +++ b/generator/cybersource-python-template/api.mustache @@ -15,6 +15,8 @@ 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}} @@ -192,6 +194,9 @@ class {{classname}}(object): {{/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) From bef06a7a4db60d24b6aaf0d2fc8e92dcb1265eb0 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 13:13:05 +0530 Subject: [PATCH 27/52] "test api" --- CyberSource/api/payments_api.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CyberSource/api/payments_api.py b/CyberSource/api/payments_api.py index 9cf1d546..3fb37807 100644 --- a/CyberSource/api/payments_api.py +++ b/CyberSource/api/payments_api.py @@ -19,6 +19,9 @@ # python 2 and python 3 compatibility library from six import iteritems +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters +from authenticationsdk.util.Utility import process_body + from ..configuration import Configuration from ..api_client import ApiClient import CyberSource.logging.log_factory as LogFactory @@ -138,7 +141,6 @@ def create_order_request_with_http_info(self, order_payment_request, id, **kwarg form_params = [] local_var_files = {} - body_params = None if 'order_payment_request' in params: body_params = params['order_payment_request'] @@ -147,7 +149,6 @@ def create_order_request_with_http_info(self, order_payment_request, id, **kwarg 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"): - print("I am TRUE") body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) print("I am FALSE") @@ -265,15 +266,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"): - print("I am TRUE") body_params = MLEUtility.encrypt_request_payload(self.api_client.mconfig, body_params) - else: - print("I am FALSE") - - + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) From f9f0a053c9b557b9114e15a8a612200cb0c97e0b Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 13:26:27 +0530 Subject: [PATCH 28/52] "client mustache" --- generator/cybersource-python-template/api_client.mustache | 7 ------- 1 file changed, 7 deletions(-) diff --git a/generator/cybersource-python-template/api_client.mustache b/generator/cybersource-python-template/api_client.mustache index b3cc896e..28b67cbb 100644 --- a/generator/cybersource-python-template/api_client.mustache +++ b/generator/cybersource-python-template/api_client.mustache @@ -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 From ed1797abd446ef655b5cda0ceaa76b61c409d965 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 13:54:36 +0530 Subject: [PATCH 29/52] "api chngs" --- CyberSource/api/batches_api.py | 14 +++++++++ CyberSource/api/billing_agreements_api.py | 11 +++++++ CyberSource/api/bin_lookup_api.py | 5 ++++ CyberSource/api/capture_api.py | 5 ++++ CyberSource/api/chargeback_details_api.py | 5 ++++ CyberSource/api/chargeback_summaries_api.py | 5 ++++ CyberSource/api/conversion_details_api.py | 5 ++++ CyberSource/api/create_new_webhooks_api.py | 11 +++++++ CyberSource/api/credit_api.py | 5 ++++ CyberSource/api/customer_api.py | 14 +++++++++ .../api/customer_payment_instrument_api.py | 17 +++++++++++ .../api/customer_shipping_address_api.py | 17 +++++++++++ CyberSource/api/decision_manager_api.py | 17 +++++++++++ CyberSource/api/download_dtd_api.py | 5 ++++ CyberSource/api/download_xsd_api.py | 5 ++++ CyberSource/api/emv_tag_details_api.py | 8 +++++ CyberSource/api/flex_api_api.py | 5 ++++ CyberSource/api/instrument_identifier_api.py | 20 +++++++++++++ .../interchange_clearing_level_details_api.py | 5 ++++ CyberSource/api/invoice_settings_api.py | 8 +++++ CyberSource/api/invoices_api.py | 20 +++++++++++++ CyberSource/api/manage_webhooks_api.py | 17 +++++++++++ CyberSource/api/merchant_boarding_api.py | 8 +++++ CyberSource/api/microform_integration_api.py | 5 ++++ CyberSource/api/net_fundings_api.py | 5 ++++ .../api/notification_of_changes_api.py | 5 ++++ CyberSource/api/orders_api.py | 8 +++++ CyberSource/api/payer_authentication_api.py | 11 +++++++ .../api/payment_batch_summaries_api.py | 5 ++++ CyberSource/api/payment_instrument_api.py | 14 +++++++++ CyberSource/api/payments_api.py | 30 +++++++++++++------ CyberSource/api/payouts_api.py | 5 ++++ CyberSource/api/plans_api.py | 26 ++++++++++++++++ .../api/purchase_and_refund_details_api.py | 5 ++++ CyberSource/api/push_funds_api.py | 5 ++++ CyberSource/api/refund_api.py | 8 +++++ CyberSource/api/replay_webhooks_api.py | 5 ++++ CyberSource/api/report_definitions_api.py | 8 +++++ CyberSource/api/report_downloads_api.py | 5 ++++ CyberSource/api/report_subscriptions_api.py | 17 +++++++++++ CyberSource/api/reports_api.py | 11 +++++++ CyberSource/api/retrieval_details_api.py | 5 ++++ CyberSource/api/retrieval_summaries_api.py | 5 ++++ CyberSource/api/reversal_api.py | 8 +++++ CyberSource/api/search_transactions_api.py | 8 +++++ CyberSource/api/secure_file_share_api.py | 8 +++++ CyberSource/api/subscriptions_api.py | 26 ++++++++++++++++ CyberSource/api/taxes_api.py | 8 +++++ CyberSource/api/token_api.py | 5 ++++ CyberSource/api/transaction_batches_api.py | 11 +++++++ CyberSource/api/transaction_details_api.py | 5 ++++ CyberSource/api/transient_token_data_api.py | 8 +++++ .../unified_checkout_capture_context_api.py | 5 ++++ CyberSource/api/user_management_api.py | 5 ++++ CyberSource/api/user_management_search_api.py | 5 ++++ CyberSource/api/verification_api.py | 8 +++++ CyberSource/api/void_api.py | 17 +++++++++++ CyberSource/api_client.py | 11 ++----- authenticationsdk/util/MLEUtility.py | 10 +++++-- 59 files changed, 547 insertions(+), 21 deletions(-) diff --git a/CyberSource/api/batches_api.py b/CyberSource/api/batches_api.py index 8417ed4b..cbeb1e65 100644 --- a/CyberSource/api/batches_api.py +++ b/CyberSource/api/batches_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def get_batch_report_with_http_info(self, batch_id, **kwargs): 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) @@ -253,6 +258,9 @@ def get_batch_status_with_http_info(self, batch_id, **kwargs): 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) @@ -377,6 +385,9 @@ def get_batches_list_with_http_info(self, **kwargs): 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) @@ -495,6 +506,9 @@ 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) diff --git a/CyberSource/api/billing_agreements_api.py b/CyberSource/api/billing_agreements_api.py index f5018d68..d05fdab7 100644 --- a/CyberSource/api/billing_agreements_api.py +++ b/CyberSource/api/billing_agreements_api.py @@ -23,6 +23,8 @@ 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): @@ -145,6 +147,9 @@ 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) @@ -273,6 +278,9 @@ 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) @@ -391,6 +399,9 @@ 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) diff --git a/CyberSource/api/bin_lookup_api.py b/CyberSource/api/bin_lookup_api.py index 124eaa8d..020bc768 100644 --- a/CyberSource/api/bin_lookup_api.py +++ b/CyberSource/api/bin_lookup_api.py @@ -23,6 +23,8 @@ 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): @@ -138,6 +140,9 @@ 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) diff --git a/CyberSource/api/capture_api.py b/CyberSource/api/capture_api.py index 4954326b..85b0d317 100644 --- a/CyberSource/api/capture_api.py +++ b/CyberSource/api/capture_api.py @@ -23,6 +23,8 @@ 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): @@ -145,6 +147,9 @@ 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) diff --git a/CyberSource/api/chargeback_details_api.py b/CyberSource/api/chargeback_details_api.py index 61d6a80a..d800277b 100644 --- a/CyberSource/api/chargeback_details_api.py +++ b/CyberSource/api/chargeback_details_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def get_chargeback_details_with_http_info(self, start_time, end_time, **kwargs): 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) diff --git a/CyberSource/api/chargeback_summaries_api.py b/CyberSource/api/chargeback_summaries_api.py index ac478c95..0c4c1b8e 100644 --- a/CyberSource/api/chargeback_summaries_api.py +++ b/CyberSource/api/chargeback_summaries_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def get_chargeback_summaries_with_http_info(self, start_time, end_time, **kwargs 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) diff --git a/CyberSource/api/conversion_details_api.py b/CyberSource/api/conversion_details_api.py index afd36800..8ccfb69d 100644 --- a/CyberSource/api/conversion_details_api.py +++ b/CyberSource/api/conversion_details_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def get_conversion_detail_with_http_info(self, start_time, end_time, **kwargs): 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) diff --git a/CyberSource/api/create_new_webhooks_api.py b/CyberSource/api/create_new_webhooks_api.py index 90a747a5..1bfe8506 100644 --- a/CyberSource/api/create_new_webhooks_api.py +++ b/CyberSource/api/create_new_webhooks_api.py @@ -23,6 +23,8 @@ 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): @@ -133,6 +135,9 @@ 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) @@ -254,6 +259,9 @@ def find_products_to_subscribe_with_http_info(self, organization_id, **kwargs): 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) @@ -392,6 +400,9 @@ 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) diff --git a/CyberSource/api/credit_api.py b/CyberSource/api/credit_api.py index 2bb60e3c..0760c3ce 100644 --- a/CyberSource/api/credit_api.py +++ b/CyberSource/api/credit_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) diff --git a/CyberSource/api/customer_api.py b/CyberSource/api/customer_api.py index 5a2396e8..981daa2f 100644 --- a/CyberSource/api/customer_api.py +++ b/CyberSource/api/customer_api.py @@ -23,6 +23,8 @@ 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): @@ -139,6 +141,9 @@ def delete_customer_with_http_info(self, customer_id, **kwargs): 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) @@ -261,6 +266,9 @@ def get_customer_with_http_info(self, customer_id, **kwargs): 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) @@ -397,6 +405,9 @@ 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) @@ -519,6 +530,9 @@ 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) diff --git a/CyberSource/api/customer_payment_instrument_api.py b/CyberSource/api/customer_payment_instrument_api.py index 48e96f14..59941161 100644 --- a/CyberSource/api/customer_payment_instrument_api.py +++ b/CyberSource/api/customer_payment_instrument_api.py @@ -23,6 +23,8 @@ 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): @@ -149,6 +151,9 @@ def delete_customer_payment_instrument_with_http_info(self, customer_id, payment 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) @@ -281,6 +286,9 @@ def get_customer_payment_instrument_with_http_info(self, customer_id, payment_in 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) @@ -411,6 +419,9 @@ def get_customer_payment_instruments_list_with_http_info(self, customer_id, **kw 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) @@ -557,6 +568,9 @@ 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) @@ -689,6 +703,9 @@ 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) diff --git a/CyberSource/api/customer_shipping_address_api.py b/CyberSource/api/customer_shipping_address_api.py index 7f5fc50e..443d9d1b 100644 --- a/CyberSource/api/customer_shipping_address_api.py +++ b/CyberSource/api/customer_shipping_address_api.py @@ -23,6 +23,8 @@ 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): @@ -149,6 +151,9 @@ def delete_customer_shipping_address_with_http_info(self, customer_id, shipping_ 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) @@ -281,6 +286,9 @@ def get_customer_shipping_address_with_http_info(self, customer_id, shipping_add 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) @@ -411,6 +419,9 @@ def get_customer_shipping_addresses_list_with_http_info(self, customer_id, **kwa 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) @@ -557,6 +568,9 @@ 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) @@ -689,6 +703,9 @@ 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) diff --git a/CyberSource/api/decision_manager_api.py b/CyberSource/api/decision_manager_api.py index 700808a9..b3c86214 100644 --- a/CyberSource/api/decision_manager_api.py +++ b/CyberSource/api/decision_manager_api.py @@ -23,6 +23,8 @@ 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): @@ -145,6 +147,9 @@ 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) @@ -273,6 +278,9 @@ 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) @@ -401,6 +409,9 @@ 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) @@ -519,6 +530,9 @@ 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) @@ -647,6 +661,9 @@ 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) diff --git a/CyberSource/api/download_dtd_api.py b/CyberSource/api/download_dtd_api.py index 6bb5692e..094f0e8f 100644 --- a/CyberSource/api/download_dtd_api.py +++ b/CyberSource/api/download_dtd_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def get_dtdv2_with_http_info(self, report_definition_name_version, **kwargs): 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) diff --git a/CyberSource/api/download_xsd_api.py b/CyberSource/api/download_xsd_api.py index d095dd7c..7f05d3d6 100644 --- a/CyberSource/api/download_xsd_api.py +++ b/CyberSource/api/download_xsd_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def get_xsdv2_with_http_info(self, report_definition_name_version, **kwargs): 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) diff --git a/CyberSource/api/emv_tag_details_api.py b/CyberSource/api/emv_tag_details_api.py index 89cbe06d..c4eff6d9 100644 --- a/CyberSource/api/emv_tag_details_api.py +++ b/CyberSource/api/emv_tag_details_api.py @@ -23,6 +23,8 @@ 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): @@ -124,6 +126,9 @@ def get_emv_tags_with_http_info(self, **kwargs): 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) @@ -242,6 +247,9 @@ 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) diff --git a/CyberSource/api/flex_api_api.py b/CyberSource/api/flex_api_api.py index 33ca9a1d..2e1b8bdb 100644 --- a/CyberSource/api/flex_api_api.py +++ b/CyberSource/api/flex_api_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) diff --git a/CyberSource/api/instrument_identifier_api.py b/CyberSource/api/instrument_identifier_api.py index d89bc069..a912477a 100644 --- a/CyberSource/api/instrument_identifier_api.py +++ b/CyberSource/api/instrument_identifier_api.py @@ -23,6 +23,8 @@ 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): @@ -139,6 +141,9 @@ def delete_instrument_identifier_with_http_info(self, instrument_identifier_id, 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) @@ -261,6 +266,9 @@ def get_instrument_identifier_with_http_info(self, instrument_identifier_id, **k 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) @@ -391,6 +399,9 @@ def get_instrument_identifier_payment_instruments_list_with_http_info(self, inst 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) @@ -527,6 +538,9 @@ 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) @@ -649,6 +663,9 @@ 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) @@ -781,6 +798,9 @@ 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) diff --git a/CyberSource/api/interchange_clearing_level_details_api.py b/CyberSource/api/interchange_clearing_level_details_api.py index e2338f46..239e93ad 100644 --- a/CyberSource/api/interchange_clearing_level_details_api.py +++ b/CyberSource/api/interchange_clearing_level_details_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def get_interchange_clearing_level_details_with_http_info(self, start_time, end_ 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) diff --git a/CyberSource/api/invoice_settings_api.py b/CyberSource/api/invoice_settings_api.py index 682ffc37..8d689075 100644 --- a/CyberSource/api/invoice_settings_api.py +++ b/CyberSource/api/invoice_settings_api.py @@ -23,6 +23,8 @@ 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): @@ -124,6 +126,9 @@ def get_invoice_settings_with_http_info(self, **kwargs): 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) @@ -242,6 +247,9 @@ 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) diff --git a/CyberSource/api/invoices_api.py b/CyberSource/api/invoices_api.py index ed73ab90..96576be4 100644 --- a/CyberSource/api/invoices_api.py +++ b/CyberSource/api/invoices_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) @@ -265,6 +270,9 @@ def get_all_invoices_with_http_info(self, offset, limit, **kwargs): 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) @@ -383,6 +391,9 @@ def get_invoice_with_http_info(self, id, **kwargs): 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) @@ -501,6 +512,9 @@ def perform_cancel_action_with_http_info(self, id, **kwargs): 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) @@ -619,6 +633,9 @@ def perform_send_action_with_http_info(self, id, **kwargs): 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) @@ -747,6 +764,9 @@ 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) diff --git a/CyberSource/api/manage_webhooks_api.py b/CyberSource/api/manage_webhooks_api.py index 346e6cda..5c93c0f7 100644 --- a/CyberSource/api/manage_webhooks_api.py +++ b/CyberSource/api/manage_webhooks_api.py @@ -23,6 +23,8 @@ 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): @@ -138,6 +140,9 @@ def delete_webhook_subscription_with_http_info(self, webhook_id, **kwargs): 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) @@ -259,6 +264,9 @@ def get_webhook_subscription_by_id_with_http_info(self, webhook_id, **kwargs): 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) @@ -397,6 +405,9 @@ def get_webhook_subscriptions_by_org_with_http_info(self, organization_id, produ 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) @@ -540,6 +551,9 @@ 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) @@ -666,6 +680,9 @@ 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) diff --git a/CyberSource/api/merchant_boarding_api.py b/CyberSource/api/merchant_boarding_api.py index 170fb9d3..5c514ee5 100644 --- a/CyberSource/api/merchant_boarding_api.py +++ b/CyberSource/api/merchant_boarding_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def get_registration_with_http_info(self, registration_id, **kwargs): 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) @@ -257,6 +262,9 @@ 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) diff --git a/CyberSource/api/microform_integration_api.py b/CyberSource/api/microform_integration_api.py index c19818fa..421777d3 100644 --- a/CyberSource/api/microform_integration_api.py +++ b/CyberSource/api/microform_integration_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) diff --git a/CyberSource/api/net_fundings_api.py b/CyberSource/api/net_fundings_api.py index 031d749a..db7881bb 100644 --- a/CyberSource/api/net_fundings_api.py +++ b/CyberSource/api/net_fundings_api.py @@ -23,6 +23,8 @@ 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): @@ -151,6 +153,9 @@ def get_net_funding_details_with_http_info(self, start_time, end_time, **kwargs) 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) diff --git a/CyberSource/api/notification_of_changes_api.py b/CyberSource/api/notification_of_changes_api.py index 39299f6f..81fd84a8 100644 --- a/CyberSource/api/notification_of_changes_api.py +++ b/CyberSource/api/notification_of_changes_api.py @@ -23,6 +23,8 @@ 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): @@ -143,6 +145,9 @@ def get_notification_of_change_report_with_http_info(self, start_time, end_time, 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) diff --git a/CyberSource/api/orders_api.py b/CyberSource/api/orders_api.py index 47de080b..112bc63d 100644 --- a/CyberSource/api/orders_api.py +++ b/CyberSource/api/orders_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) @@ -263,6 +268,9 @@ 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) diff --git a/CyberSource/api/payer_authentication_api.py b/CyberSource/api/payer_authentication_api.py index 37a9cdd5..fce491fe 100644 --- a/CyberSource/api/payer_authentication_api.py +++ b/CyberSource/api/payer_authentication_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) @@ -253,6 +258,9 @@ 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) @@ -371,6 +379,9 @@ 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) diff --git a/CyberSource/api/payment_batch_summaries_api.py b/CyberSource/api/payment_batch_summaries_api.py index 4813912f..9ccec274 100644 --- a/CyberSource/api/payment_batch_summaries_api.py +++ b/CyberSource/api/payment_batch_summaries_api.py @@ -23,6 +23,8 @@ 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): @@ -159,6 +161,9 @@ def get_payment_batch_summary_with_http_info(self, start_time, end_time, **kwarg 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) diff --git a/CyberSource/api/payment_instrument_api.py b/CyberSource/api/payment_instrument_api.py index 3effb93d..6f3688af 100644 --- a/CyberSource/api/payment_instrument_api.py +++ b/CyberSource/api/payment_instrument_api.py @@ -23,6 +23,8 @@ 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): @@ -139,6 +141,9 @@ def delete_payment_instrument_with_http_info(self, payment_instrument_id, **kwar 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) @@ -261,6 +266,9 @@ def get_payment_instrument_with_http_info(self, payment_instrument_id, **kwargs) 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) @@ -397,6 +405,9 @@ 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) @@ -519,6 +530,9 @@ 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) diff --git a/CyberSource/api/payments_api.py b/CyberSource/api/payments_api.py index 3fb37807..7ca0d5dd 100644 --- a/CyberSource/api/payments_api.py +++ b/CyberSource/api/payments_api.py @@ -19,13 +19,12 @@ # python 2 and python 3 compatibility library from six import iteritems -from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters -from authenticationsdk.util.Utility import process_body - 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): @@ -147,12 +146,13 @@ 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) - - print("I am FALSE") - + # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept(['application/hal+json;charset=utf-8']) @@ -266,14 +266,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']) @@ -388,6 +388,9 @@ 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) @@ -516,6 +519,9 @@ 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) @@ -644,6 +650,9 @@ 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) @@ -772,6 +781,9 @@ 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) diff --git a/CyberSource/api/payouts_api.py b/CyberSource/api/payouts_api.py index 63c224f8..b5afc074 100644 --- a/CyberSource/api/payouts_api.py +++ b/CyberSource/api/payouts_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) diff --git a/CyberSource/api/plans_api.py b/CyberSource/api/plans_api.py index 5123c8cd..890c8430 100644 --- a/CyberSource/api/plans_api.py +++ b/CyberSource/api/plans_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def activate_plan_with_http_info(self, id, **kwargs): 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) @@ -253,6 +258,9 @@ 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) @@ -371,6 +379,9 @@ def deactivate_plan_with_http_info(self, id, **kwargs): 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) @@ -489,6 +500,9 @@ def delete_plan_with_http_info(self, id, **kwargs): 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) @@ -607,6 +621,9 @@ def get_plan_with_http_info(self, id, **kwargs): 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) @@ -714,6 +731,9 @@ def get_plan_code_with_http_info(self, **kwargs): 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) @@ -842,6 +862,9 @@ def get_plans_with_http_info(self, **kwargs): 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) @@ -970,6 +993,9 @@ 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) diff --git a/CyberSource/api/purchase_and_refund_details_api.py b/CyberSource/api/purchase_and_refund_details_api.py index 5046b898..458a7aa3 100644 --- a/CyberSource/api/purchase_and_refund_details_api.py +++ b/CyberSource/api/purchase_and_refund_details_api.py @@ -23,6 +23,8 @@ 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): @@ -167,6 +169,9 @@ def get_purchase_and_refund_details_with_http_info(self, start_time, end_time, * 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) diff --git a/CyberSource/api/push_funds_api.py b/CyberSource/api/push_funds_api.py index 0f7b5f45..a4283a1e 100644 --- a/CyberSource/api/push_funds_api.py +++ b/CyberSource/api/push_funds_api.py @@ -23,6 +23,8 @@ 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): @@ -189,6 +191,9 @@ 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) diff --git a/CyberSource/api/refund_api.py b/CyberSource/api/refund_api.py index 3883a405..30a28be4 100644 --- a/CyberSource/api/refund_api.py +++ b/CyberSource/api/refund_api.py @@ -23,6 +23,8 @@ 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): @@ -145,6 +147,9 @@ 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) @@ -273,6 +278,9 @@ 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) diff --git a/CyberSource/api/replay_webhooks_api.py b/CyberSource/api/replay_webhooks_api.py index a51bf7b0..57cd8630 100644 --- a/CyberSource/api/replay_webhooks_api.py +++ b/CyberSource/api/replay_webhooks_api.py @@ -23,6 +23,8 @@ 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): @@ -143,6 +145,9 @@ 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) diff --git a/CyberSource/api/report_definitions_api.py b/CyberSource/api/report_definitions_api.py index 119ae31a..fff617e2 100644 --- a/CyberSource/api/report_definitions_api.py +++ b/CyberSource/api/report_definitions_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def get_resource_info_by_report_definition_with_http_info(self, report_definitio 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) @@ -263,6 +268,9 @@ def get_resource_v2_info_with_http_info(self, **kwargs): 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) diff --git a/CyberSource/api/report_downloads_api.py b/CyberSource/api/report_downloads_api.py index d5cebe4c..2852d2c0 100644 --- a/CyberSource/api/report_downloads_api.py +++ b/CyberSource/api/report_downloads_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def download_report_with_http_info(self, report_date, report_name, **kwargs): 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) diff --git a/CyberSource/api/report_subscriptions_api.py b/CyberSource/api/report_subscriptions_api.py index 2d808ed5..5ba94d37 100644 --- a/CyberSource/api/report_subscriptions_api.py +++ b/CyberSource/api/report_subscriptions_api.py @@ -23,6 +23,8 @@ 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): @@ -139,6 +141,9 @@ 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) @@ -261,6 +266,9 @@ 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) @@ -383,6 +391,9 @@ def delete_subscription_with_http_info(self, report_name, **kwargs): 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) @@ -495,6 +506,9 @@ def get_all_subscriptions_with_http_info(self, **kwargs): 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) @@ -617,6 +631,9 @@ def get_subscription_with_http_info(self, report_name, **kwargs): 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) diff --git a/CyberSource/api/reports_api.py b/CyberSource/api/reports_api.py index bc96fa58..36e10ba8 100644 --- a/CyberSource/api/reports_api.py +++ b/CyberSource/api/reports_api.py @@ -23,6 +23,8 @@ 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): @@ -139,6 +141,9 @@ 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) @@ -261,6 +266,9 @@ def get_report_by_report_id_with_http_info(self, report_id, **kwargs): 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) @@ -420,6 +428,9 @@ def search_reports_with_http_info(self, start_time, end_time, time_query_type, * 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) diff --git a/CyberSource/api/retrieval_details_api.py b/CyberSource/api/retrieval_details_api.py index f0d9430b..6b09f910 100644 --- a/CyberSource/api/retrieval_details_api.py +++ b/CyberSource/api/retrieval_details_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def get_retrieval_details_with_http_info(self, start_time, end_time, **kwargs): 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) diff --git a/CyberSource/api/retrieval_summaries_api.py b/CyberSource/api/retrieval_summaries_api.py index 55cf1a7d..945b3035 100644 --- a/CyberSource/api/retrieval_summaries_api.py +++ b/CyberSource/api/retrieval_summaries_api.py @@ -23,6 +23,8 @@ 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): @@ -147,6 +149,9 @@ def get_retrieval_summary_with_http_info(self, start_time, end_time, **kwargs): 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) diff --git a/CyberSource/api/reversal_api.py b/CyberSource/api/reversal_api.py index 7d88bdc5..d9bac785 100644 --- a/CyberSource/api/reversal_api.py +++ b/CyberSource/api/reversal_api.py @@ -23,6 +23,8 @@ 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): @@ -145,6 +147,9 @@ 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) @@ -263,6 +268,9 @@ 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) diff --git a/CyberSource/api/search_transactions_api.py b/CyberSource/api/search_transactions_api.py index df7bfa8d..18cc3d0d 100644 --- a/CyberSource/api/search_transactions_api.py +++ b/CyberSource/api/search_transactions_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) @@ -253,6 +258,9 @@ def get_search_with_http_info(self, search_id, **kwargs): 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) diff --git a/CyberSource/api/secure_file_share_api.py b/CyberSource/api/secure_file_share_api.py index 941f4164..4e1cd656 100644 --- a/CyberSource/api/secure_file_share_api.py +++ b/CyberSource/api/secure_file_share_api.py @@ -23,6 +23,8 @@ 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): @@ -139,6 +141,9 @@ def get_file_with_http_info(self, file_id, **kwargs): 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) @@ -273,6 +278,9 @@ def get_file_detail_with_http_info(self, start_date, end_date, **kwargs): 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) diff --git a/CyberSource/api/subscriptions_api.py b/CyberSource/api/subscriptions_api.py index 8bd17781..225717d1 100644 --- a/CyberSource/api/subscriptions_api.py +++ b/CyberSource/api/subscriptions_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def activate_subscription_with_http_info(self, id, **kwargs): 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) @@ -253,6 +258,9 @@ def cancel_subscription_with_http_info(self, id, **kwargs): 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) @@ -371,6 +379,9 @@ 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) @@ -495,6 +506,9 @@ def get_all_subscriptions_with_http_info(self, **kwargs): 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) @@ -613,6 +627,9 @@ def get_subscription_with_http_info(self, id, **kwargs): 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) @@ -720,6 +737,9 @@ def get_subscription_code_with_http_info(self, **kwargs): 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) @@ -838,6 +858,9 @@ def suspend_subscription_with_http_info(self, id, **kwargs): 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) @@ -966,6 +989,9 @@ 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) diff --git a/CyberSource/api/taxes_api.py b/CyberSource/api/taxes_api.py index 59bb6e49..8d1a3c6f 100644 --- a/CyberSource/api/taxes_api.py +++ b/CyberSource/api/taxes_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) @@ -263,6 +268,9 @@ 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) diff --git a/CyberSource/api/token_api.py b/CyberSource/api/token_api.py index 04470aff..0389a80f 100644 --- a/CyberSource/api/token_api.py +++ b/CyberSource/api/token_api.py @@ -23,6 +23,8 @@ 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): @@ -149,6 +151,9 @@ 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) diff --git a/CyberSource/api/transaction_batches_api.py b/CyberSource/api/transaction_batches_api.py index 65bcad4e..afdec6a9 100644 --- a/CyberSource/api/transaction_batches_api.py +++ b/CyberSource/api/transaction_batches_api.py @@ -23,6 +23,8 @@ 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): @@ -143,6 +145,9 @@ def get_transaction_batch_details_with_http_info(self, id, **kwargs): 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) @@ -261,6 +266,9 @@ def get_transaction_batch_id_with_http_info(self, id, **kwargs): 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) @@ -387,6 +395,9 @@ def get_transaction_batches_with_http_info(self, start_time, end_time, **kwargs) 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) diff --git a/CyberSource/api/transaction_details_api.py b/CyberSource/api/transaction_details_api.py index ca616b43..1af7fc22 100644 --- a/CyberSource/api/transaction_details_api.py +++ b/CyberSource/api/transaction_details_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def get_transaction_with_http_info(self, id, **kwargs): 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) diff --git a/CyberSource/api/transient_token_data_api.py b/CyberSource/api/transient_token_data_api.py index bf99680f..d695dadf 100644 --- a/CyberSource/api/transient_token_data_api.py +++ b/CyberSource/api/transient_token_data_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ def get_payment_credentials_for_transient_token_with_http_info(self, payment_cre 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) @@ -253,6 +258,9 @@ def get_transaction_for_transient_token_with_http_info(self, transient_token, ** 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) diff --git a/CyberSource/api/unified_checkout_capture_context_api.py b/CyberSource/api/unified_checkout_capture_context_api.py index 780ee5ed..46e6b3a4 100644 --- a/CyberSource/api/unified_checkout_capture_context_api.py +++ b/CyberSource/api/unified_checkout_capture_context_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) diff --git a/CyberSource/api/user_management_api.py b/CyberSource/api/user_management_api.py index acd53557..51eea808 100644 --- a/CyberSource/api/user_management_api.py +++ b/CyberSource/api/user_management_api.py @@ -23,6 +23,8 @@ 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): @@ -141,6 +143,9 @@ def get_users_with_http_info(self, **kwargs): 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) diff --git a/CyberSource/api/user_management_search_api.py b/CyberSource/api/user_management_search_api.py index d358fdc5..672d211e 100644 --- a/CyberSource/api/user_management_search_api.py +++ b/CyberSource/api/user_management_search_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) diff --git a/CyberSource/api/verification_api.py b/CyberSource/api/verification_api.py index 877f7c4d..a98c48ee 100644 --- a/CyberSource/api/verification_api.py +++ b/CyberSource/api/verification_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) @@ -253,6 +258,9 @@ 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) diff --git a/CyberSource/api/void_api.py b/CyberSource/api/void_api.py index c428f889..a96b6dd8 100644 --- a/CyberSource/api/void_api.py +++ b/CyberSource/api/void_api.py @@ -23,6 +23,8 @@ 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): @@ -135,6 +137,9 @@ 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) @@ -263,6 +268,9 @@ 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) @@ -391,6 +399,9 @@ 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) @@ -519,6 +530,9 @@ 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) @@ -647,6 +661,9 @@ 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) diff --git a/CyberSource/api_client.py b/CyberSource/api_client.py index 5678053f..a2d5a00f 100644 --- a/CyberSource/api_client.py +++ b/CyberSource/api_client.py @@ -464,6 +464,7 @@ def call_api(self, resource_path, method, if header_params['Content-Type'] == 'application/x-www-form-urlencoded': post_params = body + query_param_path = self.set_query_params(resource_path, query_params) if query_param_path: self.mconfig.request_target = query_param_path @@ -472,6 +473,7 @@ def call_api(self, resource_path, method, if self.mconfig.authentication_type.upper() != GlobalLabelParameters.MUTUAL_AUTH.upper(): self.call_authentication_header(method, header_params, body) + """ Makes the HTTP request (synchronous) and return the deserialized data. To make an async request, define a function for callback. @@ -821,12 +823,3 @@ def __deserialize_model(self, data, klass): instance = klass(**kwargs) return instance - - def process_body(self, body): - 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") - return body diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 65d81a30..7e24d6ae 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -39,17 +39,21 @@ def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, oper @staticmethod def encrypt_request_payload(merchant_config, request_body): + if request_body is None or request_body == "": + return request_body + if MLEUtility.logger is None: MLEUtility.setup_logger(merchant_config) - if request_body is None or request_body == "": - return request_body + MLEUtility.logger.debug(f"Request before MLE: {request_body}") cert = MLEUtility.get_mle_certificate(merchant_config) try: serialized_jwe_token = MLEUtility.generate_token(cert, request_body) - return MLEUtility.create_json_object(serialized_jwe_token) + mleRequest = MLEUtility.create_json_object(serialized_jwe_token) + MLEUtility.logger.debug(f"Request after MLE: {mleRequest}") + return mleRequest except Exception as e: MLEUtility.logger.error(f"Error encrypting request payload: {str(e)}") From 7a3f7f0caa25bc144cdc03c67aa13823f7fa0885 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 14:45:02 +0530 Subject: [PATCH 30/52] "fixed logging" --- authenticationsdk/util/MLEUtility.py | 38 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 7e24d6ae..c617029f 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -15,6 +15,7 @@ class MLEUtility: @staticmethod def setup_logger(merchant_config): MLEUtility.logger = LogFactory.setup_logger(__name__, merchant_config.log_config) + MLEUtility.mconfig = merchant_config class MLEException(Exception): def __init__(self, message, errors=None): @@ -37,26 +38,28 @@ def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, oper return is_mle_for_api @staticmethod - def encrypt_request_payload(merchant_config, request_body): - + def encrypt_request_payload(merchant_config, request_body): if request_body is None or request_body == "": return request_body if MLEUtility.logger is None: MLEUtility.setup_logger(merchant_config) - - MLEUtility.logger.debug(f"Request before MLE: {request_body}") + + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.logger.debug(f"Request before MLE: {request_body}") cert = MLEUtility.get_mle_certificate(merchant_config) try: serialized_jwe_token = MLEUtility.generate_token(cert, request_body) mleRequest = MLEUtility.create_json_object(serialized_jwe_token) - MLEUtility.logger.debug(f"Request after MLE: {mleRequest}") + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.logger.debug(f"Request after MLE: {mleRequest}") return mleRequest except Exception as e: - MLEUtility.logger.error(f"Error encrypting request payload: {str(e)}") + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.logger.error(f"Error encrypting request payload: {str(e)}") raise MLEUtility.MLEException(f"Error encrypting request payload: {str(e)}") @staticmethod @@ -91,17 +94,20 @@ def get_mle_certificate(merchant_config): MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) return certificate else: - MLEUtility.logger.error( + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.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: - MLEUtility.logger.error( + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.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: - MLEUtility.logger.error(f"Unable to load certificate: {str(e)}") + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.logger.error(f"Unable to load certificate: {str(e)}") raise MLEUtility.MLEException(f"Unable to load PEM file: {str(e)}") @staticmethod @@ -113,8 +119,9 @@ def extract_serial_number(x509_certificate): serial_number = attribute.value break if serial_number is None: - MLEUtility.logger.warning("Serial number not found in MLE certificate for alias.") - serial_number = str(x509_certificate.serial_number) + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.logger.warning("Serial number not found in MLE certificate for alias.") + serial_number = str(x509_certificate.serial_number) return serial_number @staticmethod @@ -125,13 +132,16 @@ def create_json_object(jwe_token): def validate_certificate_expiry(certificate, key_alias): try: if certificate.not_valid_after_utc < datetime.now(timezone.utc): - MLEUtility.logger.warning( + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.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: - MLEUtility.logger.warning( + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.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: - MLEUtility.logger.error(f"Error while checking certificate expiry: {str(e)}") + if MLEUtility.mconfig.log_config.enable_log: + MLEUtility.logger.error(f"Error while checking certificate expiry: {str(e)}") From 11fa290e6def9254da5fc8dc4506eac8de8d9cd0 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 29 Jan 2025 20:48:56 +0530 Subject: [PATCH 31/52] "logging" --- authenticationsdk/util/MLEUtility.py | 74 +++++++++++++--------------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/authenticationsdk/util/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index c617029f..cef3710f 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -10,13 +10,6 @@ import CyberSource.logging.log_factory as LogFactory class MLEUtility: - logger = None - - @staticmethod - def setup_logger(merchant_config): - MLEUtility.logger = LogFactory.setup_logger(__name__, merchant_config.log_config) - MLEUtility.mconfig = merchant_config - class MLEException(Exception): def __init__(self, message, errors=None): super().__init__(message) @@ -42,30 +35,29 @@ def encrypt_request_payload(merchant_config, request_body): if request_body is None or request_body == "": return request_body - if MLEUtility.logger is None: - MLEUtility.setup_logger(merchant_config) - - if MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.debug(f"Request before MLE: {request_body}") + logger = LogFactory.setup_logger(__name__, merchant_config.log_config) + + if merchant_config.log_config.enable_log: + logger.debug(f"Request before MLE: {request_body}") - cert = MLEUtility.get_mle_certificate(merchant_config) + cert = MLEUtility.get_mle_certificate(merchant_config, logger) try: - serialized_jwe_token = MLEUtility.generate_token(cert, request_body) + serialized_jwe_token = MLEUtility.generate_token(cert, request_body, merchant_config.log_config, logger) mleRequest = MLEUtility.create_json_object(serialized_jwe_token) - if MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.debug(f"Request after MLE: {mleRequest}") + if merchant_config.log_config.enable_log: + logger.debug(f"Request after MLE: {mleRequest}") return mleRequest except Exception as e: - if MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.error(f"Error encrypting request payload: {str(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): + def generate_token(cert, request_body, log_config, logger): public_key = cert.public_key() - serial_number = MLEUtility.extract_serial_number(cert) + serial_number = MLEUtility.extract_serial_number(cert, log_config, logger) jwk_key = jwk.JWK.from_pyca(public_key) payload = request_body.encode('utf-8') @@ -85,33 +77,33 @@ def generate_token(cert, request_body): @staticmethod - def get_mle_certificate(merchant_config): + 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) - certificate = cert_data[3] - if certificate is not None: - MLEUtility.validate_certificate_expiry(certificate, merchant_config.get_mleKeyAlias()) - return certificate + 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 MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.error( + 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 MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.error( + 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 MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.error(f"Unable to load certificate: {str(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): + def extract_serial_number(x509_certificate, log_config, logger): serial_number = None for attribute in x509_certificate.subject: @@ -119,8 +111,8 @@ def extract_serial_number(x509_certificate): serial_number = attribute.value break if serial_number is None: - if MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.warning("Serial number not found in MLE certificate for alias.") + 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 @@ -129,19 +121,19 @@ def create_json_object(jwe_token): return json.dumps({"encryptedRequest": jwe_token}) @staticmethod - def validate_certificate_expiry(certificate, key_alias): + def validate_certificate_expiry(certificate, key_alias, log_config, logger): try: if certificate.not_valid_after_utc < datetime.now(timezone.utc): - if MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.warning( + 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 MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.warning( + 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 MLEUtility.mconfig.log_config.enable_log: - MLEUtility.logger.error(f"Error while checking certificate expiry: {str(e)}") + if log_config.enable_log: + logger.error(f"Error while checking certificate expiry: {str(e)}") \ No newline at end of file From ccee97eccfce1400136d38954e823c4e69dc3215 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Thu, 30 Jan 2025 10:00:21 +0530 Subject: [PATCH 32/52] "files" --- MLE.md | 0 README.md | 9 +++++++++ 2 files changed, 9 insertions(+) create mode 100644 MLE.md diff --git a/MLE.md b/MLE.md new file mode 100644 index 00000000..e69de29b diff --git a/README.md b/README.md index c8aaf1e8..e869a9ec 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,15 @@ 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. From 9824b759b5153f3f523696116c330001befcd182 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Thu, 30 Jan 2025 11:19:03 +0530 Subject: [PATCH 33/52] Update MLE.md --- MLE.md | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/MLE.md b/MLE.md index e69de29b..6a20c2ff 100644 --- a/MLE.md +++ b/MLE.md @@ -0,0 +1,121 @@ +[![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**: `Map` +- **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. + + + +## 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 From 82e9cc23cb4e222b37e0eb3e27d99ac89ad856f3 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Fri, 31 Jan 2025 15:53:24 +0530 Subject: [PATCH 34/52] "log masking" --- CyberSource/api/payments_api.py | 4 +- CyberSource/logging/sensitive_formatter.py | 52 +++++++++++----------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CyberSource/api/payments_api.py b/CyberSource/api/payments_api.py index 7ca0d5dd..419a8044 100644 --- a/CyberSource/api/payments_api.py +++ b/CyberSource/api/payments_api.py @@ -139,7 +139,7 @@ def create_order_request_with_http_info(self, order_payment_request, id, **kwarg form_params = [] local_var_files = {} - + body_params = None if 'order_payment_request' in params: body_params = params['order_payment_request'] @@ -266,7 +266,7 @@ 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) diff --git a/CyberSource/logging/sensitive_formatter.py b/CyberSource/logging/sensitive_formatter.py index 5a998444..14c9f631 100644 --- a/CyberSource/logging/sensitive_formatter.py +++ b/CyberSource/logging/sensitive_formatter.py @@ -6,86 +6,86 @@ class SensitiveFormatter(logging.Formatter): """Formatter that removes sensitive information in urls.""" @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'"securityCode"\s*:\s*"[0-9]{3,4}"', r'"securityCode":"xxxxx"', s) + s = re.sub(r'"expirationMonth"\s*:\s*"[0-1][0-9]"', r'"expirationMonth":"xxxx"', s) + s = re.sub(r'"expirationYear"\s*:\s*"2[0-9][0-9][0-9]"', r'"expirationYear":"xxxx"', s) + s = re.sub(r'"routingNumber"\s*:\s*"[0-9]+"', r'"routingNumber":"xxxxx"', s) + s = re.sub(r'"email"\s*:\s*"[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"\s*:\s*"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"firstName":"xxxxxx"', s) + s = re.sub(r'"lastName"\s*:\s*"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"lastName":"xxxxxx"', s) + s = re.sub(r'"phoneNumber"\s*:\s*"(\\+[0-9]{1,2})?\\([0-9]{3}\\)?[.-]?[0-9]{3}[ .-]?[0-9]{4}"', r'"phoneNumber":"xxxxxx"', s) + s = re.sub(r'"type"\s*:\s*"[-A-Za-z0-9 ]+"', r'"type":"xxxxx"', s) + s = re.sub(r'"token"\s*:\s*"[-.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) # masking cardNumber - matches = re.search(r'"cardNumber":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) + matches = re.search(r'"cardNumber"\s*:\s*"(((\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) + pats = re.findall(r'"cardNumber"\s*:\s*"[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) + replaceString = re.sub(r'"cardNumber"\s*:\s*"[0-9]+"', pat, matchString) s=s.replace(matchedString,replaceString) # masking number - matches = re.search(r'"number":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) + matches = re.search(r'"number"\s*:\s*"(((\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) + pats = re.findall(r'"number"\s*:\s*"[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) + replaceString = re.sub(r'"number"\s*:\s*"[0-9]+"', pat, matchString) s=s.replace(matchedString,replaceString) # masking account - matches = re.search(r'"account":"(((\s*[s/-]*\s*)+[0-9](\s*[s/-]*\s*)+)+)"', s) + matches = re.search(r'"account"\s*:\s*"(((\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) + pats = re.findall(r'"account"\s*:\s*"[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) + replaceString = re.sub(r'"account"\s*:\s*"[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) + matches = re.search(r'"prefix"\s*:\s*"(((\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) + pats = re.findall(r'"prefix"\s*:\s*"[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) + replaceString = re.sub(r'"prefix"\s*:\s*"[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) + matches = re.search(r'"bin"\s*:\s*"(((\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) + pats = re.findall(r'"bin"\s*:\s*"[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) + replaceString = re.sub(r'"bin"\s*:\s*"[0-9]+"', pat, matchString) s=s.replace(matchedString,replaceString) return s - +# // def format(self, record): original = logging.Formatter.format(self, record) return self._filter(original) \ No newline at end of file From 0faed400e1facbde6bb7cb72fff424bdb8ae0729 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 3 Feb 2025 09:48:33 +0530 Subject: [PATCH 35/52] Update sensitive_formatter.py --- CyberSource/logging/sensitive_formatter.py | 1 - 1 file changed, 1 deletion(-) diff --git a/CyberSource/logging/sensitive_formatter.py b/CyberSource/logging/sensitive_formatter.py index 14c9f631..816b5224 100644 --- a/CyberSource/logging/sensitive_formatter.py +++ b/CyberSource/logging/sensitive_formatter.py @@ -85,7 +85,6 @@ def _filter(s): s=s.replace(matchedString,replaceString) return s -# // def format(self, record): original = logging.Formatter.format(self, record) return self._filter(original) \ No newline at end of file From afc6ed7f18d774350ad91d9f0399bfd100cb6150 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 3 Feb 2025 09:52:50 +0530 Subject: [PATCH 36/52] Update sensitive_formatter.py --- CyberSource/logging/sensitive_formatter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/CyberSource/logging/sensitive_formatter.py b/CyberSource/logging/sensitive_formatter.py index 816b5224..7e5eb41b 100644 --- a/CyberSource/logging/sensitive_formatter.py +++ b/CyberSource/logging/sensitive_formatter.py @@ -85,6 +85,7 @@ def _filter(s): s=s.replace(matchedString,replaceString) return s + def format(self, record): original = logging.Formatter.format(self, record) return self._filter(original) \ No newline at end of file From 3bb4c08481834b5ce0911d081ff6d7cd3a7200ab Mon Sep 17 00:00:00 2001 From: Bansal Date: Thu, 6 Feb 2025 14:25:22 +0530 Subject: [PATCH 37/52] correcting space changes for auto generation --- CyberSource/api/payments_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CyberSource/api/payments_api.py b/CyberSource/api/payments_api.py index 419a8044..b421022b 100644 --- a/CyberSource/api/payments_api.py +++ b/CyberSource/api/payments_api.py @@ -139,6 +139,7 @@ def create_order_request_with_http_info(self, order_payment_request, id, **kwarg form_params = [] local_var_files = {} + body_params = None if 'order_payment_request' in params: body_params = params['order_payment_request'] @@ -266,7 +267,7 @@ 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) From c787a5392f30319110ddb0ac0b9ebe8997dc50a6 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 10 Feb 2025 10:43:10 +0530 Subject: [PATCH 38/52] Update MLE.md --- MLE.md | 179 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 122 insertions(+), 57 deletions(-) diff --git a/MLE.md b/MLE.md index 6a20c2ff..68befe15 100644 --- a/MLE.md +++ b/MLE.md @@ -32,70 +32,122 @@ Another optional parameter for MLE is `mleKeyAlias`, which specifies the key ali - **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 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 - +Please refer to the given link for sample codes with MLE: + + +## 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. ## 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 From 2043d798c3d404cf8869046a74a95f7d7aecc395 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 10 Feb 2025 10:45:32 +0530 Subject: [PATCH 39/52] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e869a9ec..b7e2d521 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,6 @@ This feature provides an implementation of Message Level Encryption (MLE) for AP 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. From ba3d68e3bbc7b406fa67bcb8c57c5e2218a9c8de Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 10 Feb 2025 10:47:33 +0530 Subject: [PATCH 40/52] Update MLE.md --- MLE.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MLE.md b/MLE.md index 68befe15..fc294dc9 100644 --- a/MLE.md +++ b/MLE.md @@ -32,6 +32,13 @@ Another optional parameter for MLE is `mleKeyAlias`, which specifies the key ali - **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 @@ -159,13 +166,6 @@ In the above examples: Please refer to the given link for sample codes with MLE: -## 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. - ## Additional Information ### API Support From 0c1e9dc10d98ecd5c2ecb5ce6dcf1fa1522909e9 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Mon, 10 Feb 2025 11:55:32 +0530 Subject: [PATCH 41/52] Update MLE.md --- MLE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MLE.md b/MLE.md index fc294dc9..2f258b5a 100644 --- a/MLE.md +++ b/MLE.md @@ -20,7 +20,7 @@ In the `merchantConfig` object, set the `useMLEGlobally` variable to enable or d Optionally, you can control the MLE feature at the API level using the `mapToControlMLEonAPI` variable in the `merchantConfig` object. - **Variable**: `mapToControlMLEonAPI` -- **Type**: `Map` +- **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 @@ -164,7 +164,7 @@ In the above examples: - `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 From 276c3ceb8de816d4cbe90180b97becc7ac9dac65 Mon Sep 17 00:00:00 2001 From: Bansal Date: Mon, 10 Feb 2025 13:45:01 +0530 Subject: [PATCH 42/52] correcting comments --- MLE.md | 80 ++++++++++------------------------------------------------ 1 file changed, 13 insertions(+), 67 deletions(-) diff --git a/MLE.md b/MLE.md index 2f258b5a..9eb0fd6e 100644 --- a/MLE.md +++ b/MLE.md @@ -61,8 +61,8 @@ class Configuration: configuration_dictionary = { "useMLEGlobally": True, # Globally MLE will be enabled for all MLE supported APIs "mapToControlMLEonAPI": { - "apiFunctionName1": False, # Disable MLE for this API - "apiFunctionName2": True # Enable MLE for this API + "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 } @@ -73,11 +73,11 @@ class Configuration: def __init__(self): self.useMLEGlobally = True self.mapToControlMLEonAPI = { - "apiFunctionName1": False, # Disable MLE for this API - "apiFunctionName2": True # Enable MLE for this API + "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" -``` + self.mleKeyAlias = "Custom_Key_Alias" # Optional custom value provided by Cybs +``` ### Option 3: Disable MLE globally and enable for specific APIs @@ -85,10 +85,10 @@ class Configuration: configuration_dictionary = { "useMLEGlobally": False, # Globally MLE will be disabled for all APIs "mapToControlMLEonAPI": { - "apiFunctionName1": True, # Enable MLE for this API - "apiFunctionName2": True # Enable MLE for this API + "apiFunctionName1": True, # if want to enable MLE for API1 + "apiFunctionName2": True # if want to enable MLE for API2 }, - "mleKeyAlias": "Custom_Key_Alias" + "mleKeyAlias": "Custom_Key_Alias" # optional if any custom value provided by Cybs } # OR @@ -97,64 +97,10 @@ class Configuration: def __init__(self): self.useMLEGlobally = False # Globally MLE will be disabled for all APIs self.mapToControlMLEonAPI = { - "apiFunctionName1": True, # Enable MLE for this API - "apiFunctionName2": True # Enable MLE for this API - } - self.mleKeyAlias = "Custom_Key_Alias" -``` - -### Another example with MLE enabled globally - -```python -mle_map = { - "apiFunctionName1": False, # Disable MLE for this API - "apiFunctionName2": True # Enable MLE for this API -} - -configuration_dictionary = { - "useMLEGlobally": True, # Globally MLE will be enabled for all APIs - "mapToControlMLEonAPI": mle_map, - "mleKeyAlias": "Custom_Key_Alias" -} - -# OR - -class Configuration: - def __init__(self): - self.useMLEGlobally = True # Globally MLE will be enabled for all APIs - mle_map = { - "apiFunctionName1": False, # Disable MLE for this API - "apiFunctionName2": True # Enable MLE for this API - } - self.mapToControlMLEonAPI = mle_map - self.mleKeyAlias = "Custom_Key_Alias" -``` - -### Another example with MLE disabled globally - -```python -mle_map = { - "apiFunctionName1": True, # Enable MLE for this API - "apiFunctionName2": True # Enable MLE for this API -} - -configuration_dictionary = { - "useMLEGlobally": False, # Globally MLE will be disabled for all APIs - "mapToControlMLEonAPI": mle_map, - "mleKeyAlias": "Custom_Key_Alias" -} - -# OR - -class Configuration: - def __init__(self): - self.useMLEGlobally = False # Globally MLE will be disabled for all APIs - mle_map = { - "apiFunctionName1": True, # Enable MLE for this API - "apiFunctionName2": True # Enable MLE for this API - } - self.mapToControlMLEonAPI = mle_map - self.mleKeyAlias = "Custom_Key_Alias" + "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: From 555ed7e6f6259e925b8fff8861e51b5719fe39f6 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Tue, 11 Feb 2025 14:46:14 +0530 Subject: [PATCH 43/52] Update sensitive_formatter.py --- CyberSource/logging/sensitive_formatter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/CyberSource/logging/sensitive_formatter.py b/CyberSource/logging/sensitive_formatter.py index 7e5eb41b..750b2742 100644 --- a/CyberSource/logging/sensitive_formatter.py +++ b/CyberSource/logging/sensitive_formatter.py @@ -14,6 +14,7 @@ def _filter(s): s = re.sub(r'"firstName"\s*:\s*"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"firstName":"xxxxxx"', s) s = re.sub(r'"lastName"\s*:\s*"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"lastName":"xxxxxx"', s) s = re.sub(r'"phoneNumber"\s*:\s*"(\\+[0-9]{1,2})?\\([0-9]{3}\\)?[.-]?[0-9]{3}[ .-]?[0-9]{4}"', r'"phoneNumber":"xxxxxx"', s) + s = re.sub(r'"phoneNumber"\s*:\s*"\+?[0-9]{0,2}[.-]?[0-9]{3}[.-]?[0-9]{3}[.-]?[0-9]{4}"', r'"phoneNumber":"xxxxxx"', s) s = re.sub(r'"type"\s*:\s*"[-A-Za-z0-9 ]+"', r'"type":"xxxxx"', s) s = re.sub(r'"token"\s*:\s*"[-.A-Za-z0-9+/= ]+"', r'"token":"xxxxx"', s) s = re.sub(r'signature="[-.A-Za-z0-9+/= ]+"', r'signature="xxxxxxxx"', s) From 85db9d6e85ff0431455f5deeafa7c0ce4edd33ab Mon Sep 17 00:00:00 2001 From: gaubansa Date: Thu, 27 Feb 2025 12:18:42 +0530 Subject: [PATCH 44/52] fixing Cache for singleton class --- authenticationsdk/util/Cache.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 040df0bc..a2582707 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -13,7 +13,17 @@ 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 = {} def get_private_key_from_pem(self, pem_file_path): From 9d01f84b5ffee842b9bf71289b854bdab23e95c3 Mon Sep 17 00:00:00 2001 From: gaubansa Date: Thu, 27 Feb 2025 12:19:35 +0530 Subject: [PATCH 45/52] fixing cache for overriding values --- authenticationsdk/util/Cache.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index a2582707..743dd25f 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -76,12 +76,7 @@ def update_cache(self, mconfig, filepath, filename): mle_cert = self.get_cert_based_on_key_alias(certificate, additional_certificates, mconfig.get_mleKeyAlias()) - self.filecache.setdefault(str(filename), []).append(jwt_der_cert_string) - self.filecache.setdefault(str(filename), []).append(private_key) - self.filecache.setdefault(str(filename), []).append(file_mod_time) - self.filecache.setdefault(str(filename), []).append(mle_cert) - - # self.filecache[str(filename)] = [jwt_der_cert_string, private_key, file_mod_time, mle_cert] + 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 @@ -93,6 +88,5 @@ 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] From ba7226d96f99a931122f49aceb925e583e850573 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Fri, 28 Feb 2025 17:41:24 +0530 Subject: [PATCH 46/52] Deprecated method for JWE decryption Added new method using PrivateKey parameter --- CyberSource/utilities/JWEResponse/JWEUtility.py | 10 +++++++++- authenticationsdk/util/Cache.py | 6 +++++- authenticationsdk/util/JWEUtility.py | 11 +++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) 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/authenticationsdk/util/Cache.py b/authenticationsdk/util/Cache.py index 743dd25f..37e4620a 100644 --- a/authenticationsdk/util/Cache.py +++ b/authenticationsdk/util/Cache.py @@ -8,6 +8,8 @@ from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import pkcs12 +from typing_extensions import deprecated + from authenticationsdk.util.GlobalLabelParameters import * @@ -26,6 +28,7 @@ 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() @@ -83,7 +86,8 @@ def grab_file(self, mconfig, filepath, filename): 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]: 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') + From e482a2f9531952a7adc4281a5b76c73c4ee6111d Mon Sep 17 00:00:00 2001 From: gnongsie Date: Fri, 28 Feb 2025 18:38:00 +0530 Subject: [PATCH 47/52] Changes from API updates - Feb 2025 --- CyberSource/__init__.py | 8 + CyberSource/models/__init__.py | 8 + ...onfiguration_information_configurations.py | 32 +- .../generate_capture_context_request.py | 36 +- ...nified_checkout_capture_context_request.py | 32 +- ...ssions_transient_token_response_options.py | 124 +++++ .../models/network_token_enrollment.py | 148 ++++++ .../network_token_services_enablement.py | 148 ++++++ ...t_mastercard_digital_enablement_service.py | 124 +++++ ..._services_enablement_visa_token_service.py | 124 +++++ .../models/tms_business_information.py | 288 ++++++++++++ .../tms_business_information_acquirer.py | 152 ++++++ .../tms_business_information_address.py | 152 ++++++ .../upv1capturecontexts_capture_mandate.py | 62 ++- ...tConfigurationInformationConfigurations.md | 1 + docs/GenerateCaptureContextRequest.md | 3 +- ...ateUnifiedCheckoutCaptureContextRequest.md | 1 + ...v2sessionsTransientTokenResponseOptions.md | 10 + docs/NetworkTokenEnrollment.md | 11 + docs/NetworkTokenServicesEnablement.md | 11 + ...ementMastercardDigitalEnablementService.md | 10 + ...TokenServicesEnablementVisaTokenService.md | 10 + docs/TmsBusinessInformation.md | 16 + docs/TmsBusinessInformationAcquirer.md | 11 + docs/TmsBusinessInformationAddress.md | 11 + docs/Upv1capturecontextsCaptureMandate.md | 2 + generator/cybersource-rest-spec.json | 443 +++++++++++++++++- ...ssions_transient_token_response_options.py | 43 ++ test/test_network_token_enrollment.py | 43 ++ .../test_network_token_services_enablement.py | 43 ++ ...t_mastercard_digital_enablement_service.py | 43 ++ ..._services_enablement_visa_token_service.py | 43 ++ test/test_tms_business_information.py | 43 ++ .../test_tms_business_information_acquirer.py | 43 ++ test/test_tms_business_information_address.py | 43 ++ 35 files changed, 2298 insertions(+), 24 deletions(-) create mode 100644 CyberSource/models/microformv2sessions_transient_token_response_options.py create mode 100644 CyberSource/models/network_token_enrollment.py create mode 100644 CyberSource/models/network_token_services_enablement.py create mode 100644 CyberSource/models/network_token_services_enablement_mastercard_digital_enablement_service.py create mode 100644 CyberSource/models/network_token_services_enablement_visa_token_service.py create mode 100644 CyberSource/models/tms_business_information.py create mode 100644 CyberSource/models/tms_business_information_acquirer.py create mode 100644 CyberSource/models/tms_business_information_address.py create mode 100644 docs/Microformv2sessionsTransientTokenResponseOptions.md create mode 100644 docs/NetworkTokenEnrollment.md create mode 100644 docs/NetworkTokenServicesEnablement.md create mode 100644 docs/NetworkTokenServicesEnablementMastercardDigitalEnablementService.md create mode 100644 docs/NetworkTokenServicesEnablementVisaTokenService.md create mode 100644 docs/TmsBusinessInformation.md create mode 100644 docs/TmsBusinessInformationAcquirer.md create mode 100644 docs/TmsBusinessInformationAddress.md create mode 100644 test/test_microformv2sessions_transient_token_response_options.py create mode 100644 test/test_network_token_enrollment.py create mode 100644 test/test_network_token_services_enablement.py create mode 100644 test/test_network_token_services_enablement_mastercard_digital_enablement_service.py create mode 100644 test/test_network_token_services_enablement_visa_token_service.py create mode 100644 test/test_tms_business_information.py create mode 100644 test/test_tms_business_information_acquirer.py create mode 100644 test/test_tms_business_information_address.py 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/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/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-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/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() From a64dc9874cbed525ea6cc034896b7216f10dab05 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Tue, 4 Mar 2025 12:20:44 +0530 Subject: [PATCH 48/52] Updated dependencies --- requirements.txt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index a2eb9b77..b3186f02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,15 @@ -certifi -pycryptodome -PyJWT -DateTime -setuptools -six -urllib3 -jwcrypto -cryptography +certifi==2025.1.31 +cffi==1.17.1 +cryptography==44.0.2 +cybersource-rest-client-python @ file:///C:/New_Software/GitHub/cybersource-rest-client-python +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 From 34b7cae749a6948b8855e131a1d5f10c852fd0c8 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Thu, 13 Mar 2025 19:33:51 +0530 Subject: [PATCH 49/52] Fixes for security findings --- CyberSource/api_client.py | 4 +- CyberSource/rest.py | 6 +-- authenticationsdk/core/Authorization.py | 9 ++--- authenticationsdk/http/HTTPSignatureToken.py | 3 -- authenticationsdk/util/MLEUtility.py | 37 ++++++++----------- .../api_client.mustache | 4 +- .../cybersource-python-template/rest.mustache | 6 +-- requirements.txt | 1 - 8 files changed, 28 insertions(+), 42 deletions(-) diff --git a/CyberSource/api_client.py b/CyberSource/api_client.py index a2d5a00f..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)} 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/authenticationsdk/core/Authorization.py b/authenticationsdk/core/Authorization.py index d0198638..5f433ea2 100644 --- a/authenticationsdk/core/Authorization.py +++ b/authenticationsdk/core/Authorization.py @@ -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/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/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index cef3710f..358d2075 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -31,29 +31,29 @@ def check_is_mle_for_api(merchant_config, is_mle_supported_by_cybs_for_api, oper return is_mle_for_api @staticmethod - def encrypt_request_payload(merchant_config, request_body): + 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"Request before MLE: {request_body}") + # if merchant_config.log_config.enable_log: + # logger.debug(f"Request before MLE: {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"Request after MLE: {mleRequest}") + # if merchant_config.log_config.enable_log: + # logger.debug(f"Request after MLE: {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() @@ -75,7 +75,6 @@ def generate_token(cert, request_body, log_config, logger): return jwe_token.serialize(compact=True) - @staticmethod def get_mle_certificate(merchant_config, logger): cache_obj = FileCache() @@ -87,16 +86,12 @@ def get_mle_certificate(merchant_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") + 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") + 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)}") @@ -125,15 +120,13 @@ 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.") + 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.") + 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/generator/cybersource-python-template/api_client.mustache b/generator/cybersource-python-template/api_client.mustache index 28b67cbb..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)} 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/requirements.txt b/requirements.txt index b3186f02..4260571f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ certifi==2025.1.31 cffi==1.17.1 cryptography==44.0.2 -cybersource-rest-client-python @ file:///C:/New_Software/GitHub/cybersource-rest-client-python DateTime==5.5 jwcrypto==1.5.6 pycparser==2.22 From 4d8390a0ac3a9b0cf5373b64a2c7b1cb6862211f Mon Sep 17 00:00:00 2001 From: gnongsie Date: Mon, 17 Mar 2025 12:28:33 +0530 Subject: [PATCH 50/52] Fixes for security findings --- CyberSource/logging/sensitive_formatter.py | 142 +++++++++------------ authenticationsdk/core/Authorization.py | 2 +- 2 files changed, 64 insertions(+), 80 deletions(-) diff --git a/CyberSource/logging/sensitive_formatter.py b/CyberSource/logging/sensitive_formatter.py index 750b2742..72887fda 100644 --- a/CyberSource/logging/sensitive_formatter.py +++ b/CyberSource/logging/sensitive_formatter.py @@ -1,92 +1,76 @@ import logging +import json import re class SensitiveFormatter(logging.Formatter): + sensitive_fields = [ + "securityCode", + "cardNumber", + "number", + "expirationMonth", + "expirationYear", + "routingNumber", + "email", + "firstName", + "lastName", + "phoneNumber", + "type", + "token", + "signature", + "keyid" + ] + """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"\s*:\s*"[0-9]{3,4}"', r'"securityCode":"xxxxx"', s) - s = re.sub(r'"expirationMonth"\s*:\s*"[0-1][0-9]"', r'"expirationMonth":"xxxx"', s) - s = re.sub(r'"expirationYear"\s*:\s*"2[0-9][0-9][0-9]"', r'"expirationYear":"xxxx"', s) - s = re.sub(r'"routingNumber"\s*:\s*"[0-9]+"', r'"routingNumber":"xxxxx"', s) - s = re.sub(r'"email"\s*:\s*"[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"\s*:\s*"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"firstName":"xxxxxx"', s) - s = re.sub(r'"lastName"\s*:\s*"([a-zA-Z]+( )?[a-zA-Z]*?-?[a-zA-Z]*( )?([a-zA-Z]*)?)"', r'"lastName":"xxxxxx"', s) - s = re.sub(r'"phoneNumber"\s*:\s*"(\\+[0-9]{1,2})?\\([0-9]{3}\\)?[.-]?[0-9]{3}[ .-]?[0-9]{4}"', r'"phoneNumber":"xxxxxx"', s) - s = re.sub(r'"phoneNumber"\s*:\s*"\+?[0-9]{0,2}[.-]?[0-9]{3}[.-]?[0-9]{3}[.-]?[0-9]{4}"', r'"phoneNumber":"xxxxxx"', s) - s = re.sub(r'"type"\s*:\s*"[-A-Za-z0-9 ]+"', r'"type":"xxxxx"', s) - s = re.sub(r'"token"\s*:\s*"[-.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 SensitiveFormatter.is_json_string(s): + json_msg = json.loads(s) - # masking cardNumber - matches = re.search(r'"cardNumber"\s*:\s*"(((\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"\s*:\s*"[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"\s*:\s*"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) + 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) + + 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*[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"\s*:\s*"[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"\s*:\s*"[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*[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"\s*:\s*"[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"\s*:\s*"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) - - # masking prefix - matches = re.search(r'"prefix"\s*:\s*"(((\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"\s*:\s*"[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"\s*:\s*"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) - - # masking bin - matches = re.search(r'"bin"\s*:\s*"(((\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"\s*:\s*"[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"\s*:\s*"[0-9]+"', pat, matchString) - s=s.replace(matchedString,replaceString) - - return s + elif "Authorization Bearer:" in s: + splits = s.split(" ") + new_log_message = splits[0] + " XXXXX" + return new_log_message + 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/authenticationsdk/core/Authorization.py b/authenticationsdk/core/Authorization.py index 5f433ea2..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 From 9b1298e20be30f591e430308d3c7a9de1c5e0a34 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Mon, 17 Mar 2025 13:19:30 +0530 Subject: [PATCH 51/52] Enforced sensitive masking of logs --- CyberSource/logging/log_configuration.py | 4 ++-- CyberSource/logging/sensitive_formatter.py | 10 +++++++++- authenticationsdk/util/GlobalLabelParameters.py | 4 +++- authenticationsdk/util/MLEUtility.py | 8 ++++---- 4 files changed, 18 insertions(+), 8 deletions(-) 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 72887fda..be4291a5 100644 --- a/CyberSource/logging/sensitive_formatter.py +++ b/CyberSource/logging/sensitive_formatter.py @@ -1,6 +1,7 @@ import logging import json import re +from authenticationsdk.util.GlobalLabelParameters import GlobalLabelParameters class SensitiveFormatter(logging.Formatter): @@ -18,7 +19,8 @@ class SensitiveFormatter(logging.Formatter): "type", "token", "signature", - "keyid" + "keyid", + "encryptedRequest" ] """Formatter that removes sensitive information in urls.""" @@ -32,6 +34,11 @@ def is_json_string(message): @staticmethod def _filter(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) @@ -67,6 +74,7 @@ def _filter(s): splits = s.split(" ") new_log_message = splits[0] + " XXXXX" return new_log_message + else: return s diff --git a/authenticationsdk/util/GlobalLabelParameters.py b/authenticationsdk/util/GlobalLabelParameters.py index 2abe0fbb..568958b0 100644 --- a/authenticationsdk/util/GlobalLabelParameters.py +++ b/authenticationsdk/util/GlobalLabelParameters.py @@ -78,7 +78,7 @@ class GlobalLabelParameters: 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" @@ -95,3 +95,5 @@ class GlobalLabelParameters: 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/MLEUtility.py b/authenticationsdk/util/MLEUtility.py index 358d2075..ec97617c 100644 --- a/authenticationsdk/util/MLEUtility.py +++ b/authenticationsdk/util/MLEUtility.py @@ -37,16 +37,16 @@ def encrypt_request_payload(merchant_config, request_body): logger = LogFactory.setup_logger(__name__, merchant_config.log_config) - # if merchant_config.log_config.enable_log: - # logger.debug(f"Request before MLE: {request_body}") + 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"Request after MLE: {mleRequest}") + if merchant_config.log_config.enable_log: + logger.debug(f"{GlobalLabelParameters.MESSAGE_AFTER_MLE_REQUEST}{mleRequest}") return mleRequest except Exception as e: From 48bfe86bd76500a4ba248f76d05969400f618b1f Mon Sep 17 00:00:00 2001 From: gnongsie Date: Mon, 24 Mar 2025 15:13:03 +0530 Subject: [PATCH 52/52] Update to new version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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