From f916928b4dbedfe8e1f867c7db0cd0c2bf144a1f Mon Sep 17 00:00:00 2001 From: monkumar Date: Wed, 5 Feb 2025 15:21:48 +0530 Subject: [PATCH 01/22] add MLE implementation --- lib/AuthenticationSDK/core/MerchantConfig.rb | 50 ++++++++- lib/AuthenticationSDK/util/Constants.rb | 6 +- lib/AuthenticationSDK/util/MLEUtility.rb | 111 +++++++++++++++++++ 3 files changed, 164 insertions(+), 3 deletions(-) create mode 100644 lib/AuthenticationSDK/util/MLEUtility.rb diff --git a/lib/AuthenticationSDK/core/MerchantConfig.rb b/lib/AuthenticationSDK/core/MerchantConfig.rb index f3e6ce4f..d528ce25 100644 --- a/lib/AuthenticationSDK/core/MerchantConfig.rb +++ b/lib/AuthenticationSDK/core/MerchantConfig.rb @@ -46,9 +46,14 @@ def initialize(cybsPropertyObj) @defaultCustomHeaders = cybsPropertyObj['defaultCustomHeaders'] # Path to client JWE pem file directory @pemFileDirectory = cybsPropertyObj['pemFileDirectory'] - validateMerchantDetails() + @mleKeyAlias = cybsPropertyObj['mleKeyAlias'] + @useMLEGlobally = cybsPropertyObj['useMLEGlobally'] + @mapToControlMLEonAPI = cybsPropertyObj['mapToControlMLEonAPI'] + validateMerchantDetails logAllProperties(cybsPropertyObj) + validateMLEConfiguration end + #fall back logic def validateMerchantDetails() logmessage='' @@ -225,6 +230,44 @@ def validateMerchantDetails() end end + def validateMLEConfiguration + unless [true, false].include?(@useMLEGlobally) + err = StandardError.new(Constants::ERROR_PREFIX + "useMLEGlobally must be a boolean") + @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) + raise err + end + if !@mapToControlMLEonAPI.nil? && !@mapToControlMLEonAPI.is_a?(Hash) + err = StandardError.new(Constants::ERROR_PREFIX + "mapToControlMLEonAPI must be a map") + @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) + raise err + end + + !@mleKeyAlias.nil? && unless @mleKeyAlias.instance_of? String + (err = StandardError.new(Constants::ERROR_PREFIX + "mleKeyAlias must be a string")) + @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) + raise err + end + if @mleKeyAlias.to_s.empty? + @mleKeyAlias = Constants::DEFAULT_ALIAS_FOR_MLE_CERT + end + + mle_configured = @useMLEGlobally + if !@mapToControlMLEonAPI.nil? && !@mapToControlMLEonAPI.empty? + @mapToControlMLEonAPI.each do |_, value| + unless [true, false].include?(value) && value + mle_configured = true + break + end + end + end + + if mle_configured && !Constants::AUTH_TYPE_JWT.eql?(@authenticationType) + err = StandardError.new(Constants::ERROR_PREFIX + "MLE can only be used with JWT authentication") + @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) + raise + end + end + def logAllProperties(propertyObj) merchantConfig = '' hiddenProperties = (Constants::HIDDEN_MERCHANT_PROPERTIES).split(',') @@ -278,4 +321,7 @@ def logAllProperties(propertyObj) attr_accessor :solutionId attr_accessor :defaultCustomHeaders attr_accessor :pemFileDirectory - end \ No newline at end of file + attr_accessor :useMLEGlobally + attr_accessor :mapToControlMLEonAPI + attr_accessor :mleKeyAlias + end diff --git a/lib/AuthenticationSDK/util/Constants.rb b/lib/AuthenticationSDK/util/Constants.rb index ad0faa63..928c7f99 100644 --- a/lib/AuthenticationSDK/util/Constants.rb +++ b/lib/AuthenticationSDK/util/Constants.rb @@ -165,4 +165,8 @@ class Constants REFRESH_TOKEN_EMPTY = 'RefreshToken is Empty/Null' unless const_defined?(:REFRESH_TOKEN_REQ) DEPRECATED_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.' - end \ No newline at end of file + + DEFAULT_ALIAS_FOR_MLE_CERT = 'CyberSource_SJC_US' unless const_defined?(:DEFAULT_ALIAS_FOR_MLE_CERT) + + CERTIFICATE_EXPIRY_DATE_WARNING_DAYS = 90 unless const_defined?(:CERTIFICATE_EXPIRY_DATE_WARNING_DAYS) + end diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb new file mode 100644 index 00000000..4a342296 --- /dev/null +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -0,0 +1,111 @@ +require_relative '../logging/log_factory.rb' +require 'jose' +public + class MLEUtility + @log_obj + def check_is_mle_for_API(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids) + is_mle_for_api = false + if is_mle_supported_by_cybs_for_api && merchant_config.useMLEGlobally + is_mle_for_api = true + end + if merchant_config.mapToControlMLEonAPI.nil? && merchant_config.mapToControlMLEonAPI.nil? + operation_ids.each do |operation_id| + if merchant_config.mapToControlMLEonAPI.key?(operation_id) + is_mle_for_api = merchant_config.mapToControlMLEonAPI[operation_id] + break + end + end + end + is_mle_for_api + end + + def encrypt_request_payload(merchant_config, request_payload) + if request_payload.nil? + return nil + end + @log_obj = Log.new(merchant_config.log_config, 'MLEUtility') + @log_obj.logger.info('Encrypting request payload') + @log_obj.logger.debug('LOG_REQUEST_BEFORE_MLE: ' + request_payload) + + + begin + certificate = get_certificate(merchant_config, @log_obj) + validate_certificate(certificate, merchant_config, @log_obj) + serial_number = extract_serial_number_from_certificate(certificate) + if serial_number.nil? + @log_obj.logger.error('Serial number not found in certificate for MLE') + raise StandardError.new('Serial number not found in MLE certificate') + end + + jwk = JOSE::JWK.from_key(certificate.public_key) + if jwk.nil? + @log_obj.logger.error('Failed to create JWK object from public key') + raise StandardError.new('Failed to create JWK object from public key') + end + headers = { + 'alg' => 'RSA-OAEP-256', + 'enc' => 'A256GCM', + 'typ' => 'JWT', + 'kid' => serial_number, + 'iat' => Time.now.to_i + } + jwe = JOSE::JWE.block_encrypt(jwk, request_payload, headers) + + compact_jwe = jwe.compact + @log_obj.logger.debug('LOG_REQUEST_AFTER_MLE: ' + compact_jwe) + return "{ \"encryptedRequest\": \"#{compact_jwe}\" }" + rescue StandardError => e + @log_obj.logger.error("An error occurred during encryption: #{e.message}") + raise e + end + end + + + def get_certificate(merchant_config, log_obj) + begin + p12_file_path = File.join(merchant_config.keysDirectory, merchant_config.keyFilename + '.p12') + file = File.binread(p12_file_path) + p12_file = OpenSSL::PKCS12.new(file, merchant_config.keyPass) + x5_cert_pem = OpenSSL::X509::Certificate.new(p12_file.certificate) + x5_cert_pem.subject.to_a.each do |attribute| + return x5_cert_pem if attribute[1].include?(merchant_config.mleKeyAlias) + end + p12_file.ca_certs.each do |cert| + cert.subject.to_a.each do |attribute| + return cert if attribute[1].include?(merchant_config.mleKeyAlias) + end + end + rescue OpenSSL::PKCS12::PKCS12Error => e + log_obj.logger.error("Failed to load PKCS12 file: #{e.message}") + raise e + rescue OpenSSL::X509::CertificateError => e + log_obj.logger.error("Failed to create X509 certificate: #{e.message}") + raise e + rescue StandardError => e + log_obj.logger.error("An error occurred while getting the certificate: #{e.message}") + raise e + end + end + + def validate_certificate(certificate, merchant_config, log_obj) + if certificate.not_after.nil? + log_obj.logger.warn("Certificate for MLE don't have expiry date.") + end + if certificate.not_after < Time.now + log_obj.logger.error('Certificate with MLE alias ' + merchant_config.mleKeyAlias + ' is expired as of ' + certificate.not_after.to_s + ". Please update p12 file.") + else + time_to_expire = certificate.not_after - Time.now + if time_to_expire < Constants::CERTIFICATE_EXPIRY_DATE_WARNING_DAYS * 24 * 60 * 60 + log_obj.logger.warn('Certificate with MLE alias ' + merchant_config.mleKeyAlias + ' is going to expired on ' + certificate.not_after.to_s + ". Please update p12 file before that.") + end + end + end + + def extract_serial_number_from_certificate(certificate) + return nil if certificate.subject.to_s.empty? && certificate.issuer.to_s.empty? + certificate.subject.to_a.each do |attribute| + return attribute[1] if attribute[0].include?('serialNumber') + end + nil + end + end From 516933debe3cd546ae07c8bfefa5e195d6f57adf Mon Sep 17 00:00:00 2001 From: monkumar Date: Wed, 5 Feb 2025 15:36:05 +0530 Subject: [PATCH 02/22] created a method for request body --- lib/AuthenticationSDK/util/MLEUtility.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index 4a342296..b3ab33eb 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -53,7 +53,7 @@ def encrypt_request_payload(merchant_config, request_payload) compact_jwe = jwe.compact @log_obj.logger.debug('LOG_REQUEST_AFTER_MLE: ' + compact_jwe) - return "{ \"encryptedRequest\": \"#{compact_jwe}\" }" + return create_request_payload compact_jwe rescue StandardError => e @log_obj.logger.error("An error occurred during encryption: #{e.message}") raise e @@ -108,4 +108,8 @@ def extract_serial_number_from_certificate(certificate) end nil end + + def create_request_payload(compact_jwe) + "{ \"encryptedRequest\": \"#{compact_jwe}\" }" + end end From 64bef5b1067ce6407de44cf69e942aede15c4ef9 Mon Sep 17 00:00:00 2001 From: monkumar Date: Thu, 6 Feb 2025 14:53:10 +0530 Subject: [PATCH 03/22] mustache file changes --- generator/cybersource-ruby-template/api.mustache | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generator/cybersource-ruby-template/api.mustache b/generator/cybersource-ruby-template/api.mustache index 27cb6dc3..8a4717bc 100644 --- a/generator/cybersource-ruby-template/api.mustache +++ b/generator/cybersource-ruby-template/api.mustache @@ -3,7 +3,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module {{moduleName}} {{#operations}} class {{classname}} @@ -164,6 +164,10 @@ module {{moduleName}} post_body = @api_client.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, '{{dataType}}', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + 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(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, "{{operationId}},{{operationId}}_with_http_info") + post_body = MLEUtility.new.encrypt_request_payload(@api_client.merchantconfig, post_body) + end {{/bodyParam}} auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] data, status_code, headers = @api_client.call_api(:{{httpMethod}}, local_var_path, From 245322e21727165eccae87e26cb4ef9f42e9c552 Mon Sep 17 00:00:00 2001 From: monkumar Date: Thu, 6 Feb 2025 16:11:28 +0530 Subject: [PATCH 04/22] corrected mustache changes --- generator/cybersource-ruby-template/api.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/cybersource-ruby-template/api.mustache b/generator/cybersource-ruby-template/api.mustache index 8a4717bc..f7ae1071 100644 --- a/generator/cybersource-ruby-template/api.mustache +++ b/generator/cybersource-ruby-template/api.mustache @@ -164,11 +164,11 @@ module {{moduleName}} post_body = @api_client.object_to_http_body({{#required}}{{{paramName}}}{{/required}}{{^required}}opts[:'{{{paramName}}}']{{/required}}) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, '{{dataType}}', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + {{/bodyParam}} 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(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, "{{operationId}},{{operationId}}_with_http_info") - post_body = MLEUtility.new.encrypt_request_payload(@api_client.merchantconfig, post_body) + post_body = MLEUtility.new.encrypt_request_payload(@api_client.merchantconfig, post_body) end - {{/bodyParam}} auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] data, status_code, headers = @api_client.call_api(:{{httpMethod}}, local_var_path, :header_params => header_params, From f5306bdd1d416febb54d315c1f394670180c6dd6 Mon Sep 17 00:00:00 2001 From: monkumar Date: Fri, 7 Feb 2025 12:10:47 +0530 Subject: [PATCH 05/22] minor fix --- lib/AuthenticationSDK/util/MLEUtility.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index b3ab33eb..952822a9 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -3,7 +3,7 @@ public class MLEUtility @log_obj - def check_is_mle_for_API(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids) + def self.check_is_mle_for_API(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids) is_mle_for_api = false if is_mle_supported_by_cybs_for_api && merchant_config.useMLEGlobally is_mle_for_api = true From 6c00f3919b1d65e966497d46f596b73dbc30e3ac Mon Sep 17 00:00:00 2001 From: monkumar Date: Mon, 10 Feb 2025 10:53:18 +0530 Subject: [PATCH 06/22] resolved PR comments --- .../cybersource-ruby-template/api.mustache | 2 +- lib/AuthenticationSDK/core/MerchantConfig.rb | 10 ++++---- lib/AuthenticationSDK/util/MLEUtility.rb | 24 +++++++++---------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/generator/cybersource-ruby-template/api.mustache b/generator/cybersource-ruby-template/api.mustache index f7ae1071..be3827eb 100644 --- a/generator/cybersource-ruby-template/api.mustache +++ b/generator/cybersource-ruby-template/api.mustache @@ -167,7 +167,7 @@ module {{moduleName}} {{/bodyParam}} 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(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, "{{operationId}},{{operationId}}_with_http_info") - post_body = MLEUtility.new.encrypt_request_payload(@api_client.merchantconfig, post_body) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) end auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] data, status_code, headers = @api_client.call_api(:{{httpMethod}}, local_var_path, diff --git a/lib/AuthenticationSDK/core/MerchantConfig.rb b/lib/AuthenticationSDK/core/MerchantConfig.rb index d528ce25..3885eab2 100644 --- a/lib/AuthenticationSDK/core/MerchantConfig.rb +++ b/lib/AuthenticationSDK/core/MerchantConfig.rb @@ -236,10 +236,12 @@ def validateMLEConfiguration @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err end - if !@mapToControlMLEonAPI.nil? && !@mapToControlMLEonAPI.is_a?(Hash) - err = StandardError.new(Constants::ERROR_PREFIX + "mapToControlMLEonAPI must be a map") - @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) - raise err + unless @mapToControlMLEonAPI.nil? + unless @mapToControlMLEonAPI.is_a?(Hash) && @mapToControlMLEonAPI.values.all? { |v| [true, false].include?(v) } + err = StandardError.new(Constants::ERROR_PREFIX + "mapToControlMLEonAPI must be a map with boolean values") + @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) + raise err + end end !@mleKeyAlias.nil? && unless @mleKeyAlias.instance_of? String diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index 952822a9..12c26825 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -2,13 +2,13 @@ require 'jose' public class MLEUtility - @log_obj + @log_obj = nil def self.check_is_mle_for_API(merchant_config, is_mle_supported_by_cybs_for_api, operation_ids) is_mle_for_api = false if is_mle_supported_by_cybs_for_api && merchant_config.useMLEGlobally is_mle_for_api = true end - if merchant_config.mapToControlMLEonAPI.nil? && merchant_config.mapToControlMLEonAPI.nil? + if merchant_config.mapToControlMLEonAPI.nil? && !operation_ids.nil? operation_ids.each do |operation_id| if merchant_config.mapToControlMLEonAPI.key?(operation_id) is_mle_for_api = merchant_config.mapToControlMLEonAPI[operation_id] @@ -19,18 +19,18 @@ def self.check_is_mle_for_API(merchant_config, is_mle_supported_by_cybs_for_api, is_mle_for_api end - def encrypt_request_payload(merchant_config, request_payload) + def self.encrypt_request_payload(merchant_config, request_payload) if request_payload.nil? return nil end - @log_obj = Log.new(merchant_config.log_config, 'MLEUtility') + @log_obj ||= Log.new(merchant_config.log_config, 'MLEUtility') @log_obj.logger.info('Encrypting request payload') @log_obj.logger.debug('LOG_REQUEST_BEFORE_MLE: ' + request_payload) begin certificate = get_certificate(merchant_config, @log_obj) - validate_certificate(certificate, merchant_config, @log_obj) + validate_certificate(certificate, merchant_config.mleKeyAlias, @log_obj) serial_number = extract_serial_number_from_certificate(certificate) if serial_number.nil? @log_obj.logger.error('Serial number not found in certificate for MLE') @@ -61,7 +61,7 @@ def encrypt_request_payload(merchant_config, request_payload) end - def get_certificate(merchant_config, log_obj) + def self.get_certificate(merchant_config, log_obj) begin p12_file_path = File.join(merchant_config.keysDirectory, merchant_config.keyFilename + '.p12') file = File.binread(p12_file_path) @@ -87,29 +87,29 @@ def get_certificate(merchant_config, log_obj) end end - def validate_certificate(certificate, merchant_config, log_obj) + def self.validate_certificate(certificate, mle_key_alias, log_obj) if certificate.not_after.nil? log_obj.logger.warn("Certificate for MLE don't have expiry date.") end if certificate.not_after < Time.now - log_obj.logger.error('Certificate with MLE alias ' + merchant_config.mleKeyAlias + ' is expired as of ' + certificate.not_after.to_s + ". Please update p12 file.") + log_obj.logger.error('Certificate with MLE alias ' + mle_key_alias + ' is expired as of ' + certificate.not_after.to_s + ". Please update p12 file.") else time_to_expire = certificate.not_after - Time.now if time_to_expire < Constants::CERTIFICATE_EXPIRY_DATE_WARNING_DAYS * 24 * 60 * 60 - log_obj.logger.warn('Certificate with MLE alias ' + merchant_config.mleKeyAlias + ' is going to expired on ' + certificate.not_after.to_s + ". Please update p12 file before that.") + log_obj.logger.warn('Certificate with MLE alias ' + mle_key_alias + ' is going to expired on ' + certificate.not_after.to_s + ". Please update p12 file before that.") end end end - def extract_serial_number_from_certificate(certificate) + def self.extract_serial_number_from_certificate(certificate) return nil if certificate.subject.to_s.empty? && certificate.issuer.to_s.empty? certificate.subject.to_a.each do |attribute| return attribute[1] if attribute[0].include?('serialNumber') end - nil + certificate.serial.nil? ? nil : certificate.serial.to_s end - def create_request_payload(compact_jwe) + def self.create_request_payload(compact_jwe) "{ \"encryptedRequest\": \"#{compact_jwe}\" }" end end From df69aa55b7ea77a4b285c35795976cab6bdc649f Mon Sep 17 00:00:00 2001 From: monkumar Date: Mon, 10 Feb 2025 13:40:44 +0530 Subject: [PATCH 07/22] checking keys type in mapToControlMLE hash --- lib/AuthenticationSDK/core/MerchantConfig.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AuthenticationSDK/core/MerchantConfig.rb b/lib/AuthenticationSDK/core/MerchantConfig.rb index 3885eab2..c5f47007 100644 --- a/lib/AuthenticationSDK/core/MerchantConfig.rb +++ b/lib/AuthenticationSDK/core/MerchantConfig.rb @@ -237,7 +237,7 @@ def validateMLEConfiguration raise err end unless @mapToControlMLEonAPI.nil? - unless @mapToControlMLEonAPI.is_a?(Hash) && @mapToControlMLEonAPI.values.all? { |v| [true, false].include?(v) } + unless @mapToControlMLEonAPI.is_a?(Hash) && @mapToControlMLEonAPI.keys.all? {|k| k.is_a?(String)} && @mapToControlMLEonAPI.values.all? { |v| [true, false].include?(v) } err = StandardError.new(Constants::ERROR_PREFIX + "mapToControlMLEonAPI must be a map with boolean values") @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) raise err From c606460dc7c3d1ecb6282fd77b9d78778fa448c3 Mon Sep 17 00:00:00 2001 From: monkumar Date: Mon, 10 Feb 2025 20:29:27 +0530 Subject: [PATCH 08/22] added cache --- .../authentication/jwt/JwtToken.rb | 2 +- lib/AuthenticationSDK/util/Cache.rb | 34 ++++++++----------- lib/AuthenticationSDK/util/MLEUtility.rb | 14 ++++++-- lib/AuthenticationSDK/util/Utility.rb | 19 +++++++++++ 4 files changed, 47 insertions(+), 22 deletions(-) diff --git a/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb b/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb index aae83c18..cb34b85b 100644 --- a/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb +++ b/lib/AuthenticationSDK/authentication/jwt/JwtToken.rb @@ -34,7 +34,7 @@ def getToken(merchantconfig_obj,gmtDatetime) # Generating certificate. cacheObj = ActiveSupport::Cache::MemoryStore.new - x5Cert = Cache.new.fetchCachedCertificate(filePath, p12File, merchantconfig_obj.keyPass, cacheObj) + x5Cert = Cache.new.fetchCachedCertificate(filePath, p12File, merchantconfig_obj.keyPass, merchantconfig_obj.keyAlias, cacheObj) # Generating Public key. publicKey = OpenSSL::PKey::RSA.new(p12FilePath.key.public_key) diff --git a/lib/AuthenticationSDK/util/Cache.rb b/lib/AuthenticationSDK/util/Cache.rb index 07fdf522..c23505e6 100644 --- a/lib/AuthenticationSDK/util/Cache.rb +++ b/lib/AuthenticationSDK/util/Cache.rb @@ -3,35 +3,31 @@ public # P12 file certificate Cache class Cache - def fetchCachedCertificate(filePath, p12File, keyPass, cacheObj) - certCache = cacheObj.read('certiFromP12File') - cachedLastModifiedTimeStamp = cacheObj.read('certificateLastModifiedTimeStamp') + def fetchCachedCertificate(filePath, p12File, keyPass, keyAlias, cacheObj) + certCache = cacheObj.read(keyAlias.to_s.upcase) + cachedLastModifiedTimeStamp = cacheObj.read(keyAlias.to_s.upcase + '_LastModifiedTime') if File.exist?(filePath) currentFileLastModifiedTime = File.mtime(filePath) if certCache.to_s.empty? || cachedLastModifiedTimeStamp.to_s.empty? - certificateFromP12File = getCertificate(p12File, keyPass, cacheObj, currentFileLastModifiedTime) - return certificateFromP12File + certificateFromP12File = getCertificate(p12File, keyPass, keyAlias, cacheObj, currentFileLastModifiedTime) + return certificateFromP12File elsif currentFileLastModifiedTime > cachedLastModifiedTimeStamp # Function call to read the file and put values to new cache - certificateFromP12File = getCertificate(p12File, keyPass, cacheObj, currentFileLastModifiedTime) - return certificateFromP12File - else - return certCache - end + certificateFromP12File = getCertificate(p12File, keyPass, keyAlias, cacheObj, currentFileLastModifiedTime) + return certificateFromP12File + else + return certCache + end else raise Constants::ERROR_PREFIX + Constants::FILE_NOT_FOUND + filePath end end - def getCertificate(p12File, keyPass, cacheObj, currentFileLastModifiedTime) - p12FilePath = OpenSSL::PKCS12.new(p12File, keyPass) - # Generating certificate from p12File. - x5CertPem = OpenSSL::X509::Certificate.new(p12FilePath.certificate) - # Converting Certificate format from PEM TO DER to remove header and footer of the certificate. - x5CertDer = Base64.strict_encode64(x5CertPem.to_der) - cacheObj.write('certiFromP12File', x5CertDer) - cacheObj.write('certificateLastModifiedTimeStamp', currentFileLastModifiedTime) - return x5CertDer + def getCertificate(p12File, keyPass, keyAlias, cacheObj, currentFileLastModifiedTime) + x5CertDer = Utility.new.fetchCert(keyPass, p12File, keyAlias) + cacheObj.write(keyAlias.to_s.upcase, x5CertDer) + cacheObj.write(keyAlias.to_s.upcase + '_LastModifiedTime', currentFileLastModifiedTime) + x5CertDer end def fetchPEMFileForNetworkTokenization(filePath, cacheObj) diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index 12c26825..da86a73d 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -1,5 +1,8 @@ require_relative '../logging/log_factory.rb' require 'jose' +require_relative './Cache' +require 'active_support' + public class MLEUtility @log_obj = nil @@ -27,9 +30,16 @@ def self.encrypt_request_payload(merchant_config, request_payload) @log_obj.logger.info('Encrypting request payload') @log_obj.logger.debug('LOG_REQUEST_BEFORE_MLE: ' + request_payload) - begin - certificate = get_certificate(merchant_config, @log_obj) + file_path = merchant_config.keysDirectory + '/' + merchant_config.keyFilename + '.p12' + p12_file = File.binread(file_path) + cache_obj = ActiveSupport::Cache::MemoryStore.new + cert_der = Cache.new.fetchCachedCertificate(merchant_config.keysDirectory, p12_file, merchant_config.keyPass, merchant_config.mleKeyAlias, cache_obj) + if cert_der.nil? + @log_obj.logger.error('Failed to get certificate for MLE') + raise StandardError.new('Failed to get certificate for MLE') + end + certificate = OpenSSL::X509::Certificate.new(Base64.decode64(cert_der)) validate_certificate(certificate, merchant_config.mleKeyAlias, @log_obj) serial_number = extract_serial_number_from_certificate(certificate) if serial_number.nil? diff --git a/lib/AuthenticationSDK/util/Utility.rb b/lib/AuthenticationSDK/util/Utility.rb index 2923518b..4fee37a0 100644 --- a/lib/AuthenticationSDK/util/Utility.rb +++ b/lib/AuthenticationSDK/util/Utility.rb @@ -1,3 +1,6 @@ +require 'openssl' +require 'base64' + public class Utility @@ -29,4 +32,20 @@ def getResponseCodeMessage(responseCode) end return tempResponseCodeMessage end + + def fetchCert(key_pass, file, key_alias) + p12_file = OpenSSL::PKCS12.new(file, key_pass) + x5_cert_pem = p12_file.certificate + x5_cert_pem.subject.to_a.each do |attribute| + return Base64.strict_encode64(x5_cert_pem.to_der) if attribute[1].include?(key_alias) + end + unless p12_file.ca_certs.nil? + p12_file.ca_certs.each do |cert| + cert.subject.to_a.each do |attribute| + return Base64.strict_encode64(cert.to_der) if attribute[1].include?(key_alias) + end + end + end + nil + end end \ No newline at end of file From a5685d694bdb6d152ef99f27658aa9cf98da1879 Mon Sep 17 00:00:00 2001 From: monkumar Date: Tue, 11 Feb 2025 11:01:07 +0530 Subject: [PATCH 09/22] corrected log level and message --- lib/AuthenticationSDK/util/MLEUtility.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index da86a73d..bfea49f5 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -62,7 +62,8 @@ def self.encrypt_request_payload(merchant_config, request_payload) jwe = JOSE::JWE.block_encrypt(jwk, request_payload, headers) compact_jwe = jwe.compact - @log_obj.logger.debug('LOG_REQUEST_AFTER_MLE: ' + compact_jwe) + mle_request_body = create_request_payload(compact_jwe) + @log_obj.logger.debug('LOG_REQUEST_AFTER_MLE: ' + mle_request_body) return create_request_payload compact_jwe rescue StandardError => e @log_obj.logger.error("An error occurred during encryption: #{e.message}") @@ -102,7 +103,7 @@ def self.validate_certificate(certificate, mle_key_alias, log_obj) log_obj.logger.warn("Certificate for MLE don't have expiry date.") end if certificate.not_after < Time.now - log_obj.logger.error('Certificate with MLE alias ' + mle_key_alias + ' is expired as of ' + certificate.not_after.to_s + ". Please update p12 file.") + log_obj.logger.warn('Certificate with MLE alias ' + mle_key_alias + ' is expired as of ' + certificate.not_after.to_s + ". Please update p12 file.") else time_to_expire = certificate.not_after - Time.now if time_to_expire < Constants::CERTIFICATE_EXPIRY_DATE_WARNING_DAYS * 24 * 60 * 60 From 727836f0f6cf36bd6a5e16f51b675b35574838ee Mon Sep 17 00:00:00 2001 From: monkumar Date: Tue, 11 Feb 2025 11:02:21 +0530 Subject: [PATCH 10/22] minor fix --- lib/AuthenticationSDK/util/MLEUtility.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index bfea49f5..b890eb3f 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -64,7 +64,7 @@ def self.encrypt_request_payload(merchant_config, request_payload) compact_jwe = jwe.compact mle_request_body = create_request_payload(compact_jwe) @log_obj.logger.debug('LOG_REQUEST_AFTER_MLE: ' + mle_request_body) - return create_request_payload compact_jwe + return mle_request_body rescue StandardError => e @log_obj.logger.error("An error occurred during encryption: #{e.message}") raise e From 4914d2196eae5fcd413338163b86d41c1b00c3b9 Mon Sep 17 00:00:00 2001 From: monkumar Date: Tue, 11 Feb 2025 11:06:28 +0530 Subject: [PATCH 11/22] fix for appending bactrace in exception message --- lib/AuthenticationSDK/util/ExceptionHandler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/AuthenticationSDK/util/ExceptionHandler.rb b/lib/AuthenticationSDK/util/ExceptionHandler.rb index 47b28ff4..5780b9b9 100644 --- a/lib/AuthenticationSDK/util/ExceptionHandler.rb +++ b/lib/AuthenticationSDK/util/ExceptionHandler.rb @@ -5,8 +5,8 @@ class ExceptionHandler def new_api_exception(err) @exception_message = err.message - if !err.backtrace.to_s.empty? - @exception_message += "\n" + err.backtrace + unless err.backtrace.to_s.empty? + @exception_message += "\n" + err.backtrace.join("\n") end @exception_message += '\nEND> =======================================' From 6925d4287ee8c62ae0fa3bb430378a7036a0ab75 Mon Sep 17 00:00:00 2001 From: monkumar Date: Tue, 11 Feb 2025 22:02:31 +0530 Subject: [PATCH 12/22] corrected map check and mustache file --- generator/cybersource-ruby-template/api.mustache | 2 +- lib/AuthenticationSDK/util/MLEUtility.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/cybersource-ruby-template/api.mustache b/generator/cybersource-ruby-template/api.mustache index be3827eb..1608e3b7 100644 --- a/generator/cybersource-ruby-template/api.mustache +++ b/generator/cybersource-ruby-template/api.mustache @@ -166,7 +166,7 @@ module {{moduleName}} post_body = sdk_tracker.insert_developer_id_tracker(post_body, '{{dataType}}', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) {{/bodyParam}} 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(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, "{{operationId}},{{operationId}}_with_http_info") + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["{{operationId}}","{{operationId}}_with_http_info"]) post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) end auth_names = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index b890eb3f..0d8f5a7a 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -11,7 +11,7 @@ def self.check_is_mle_for_API(merchant_config, is_mle_supported_by_cybs_for_api, if is_mle_supported_by_cybs_for_api && merchant_config.useMLEGlobally is_mle_for_api = true end - if merchant_config.mapToControlMLEonAPI.nil? && !operation_ids.nil? + if merchant_config.mapToControlMLEonAPI && operation_ids operation_ids.each do |operation_id| if merchant_config.mapToControlMLEonAPI.key?(operation_id) is_mle_for_api = merchant_config.mapToControlMLEonAPI[operation_id] From 3330e4ed5f6d3f170f2a8bda3ba84a5c110676ad Mon Sep 17 00:00:00 2001 From: monkumar Date: Tue, 11 Feb 2025 22:52:08 +0530 Subject: [PATCH 13/22] added empty json check --- lib/AuthenticationSDK/util/MLEUtility.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index 0d8f5a7a..8f288174 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -23,9 +23,8 @@ def self.check_is_mle_for_API(merchant_config, is_mle_supported_by_cybs_for_api, end def self.encrypt_request_payload(merchant_config, request_payload) - if request_payload.nil? - return nil - end + return nil if request_payload.nil? + return request_payload if request_payload == '{}' @log_obj ||= Log.new(merchant_config.log_config, 'MLEUtility') @log_obj.logger.info('Encrypting request payload') @log_obj.logger.debug('LOG_REQUEST_BEFORE_MLE: ' + request_payload) From 608f19d01098f63bd05e247adc3a8fd36e6b38e0 Mon Sep 17 00:00:00 2001 From: monkumar Date: Thu, 13 Feb 2025 09:53:06 +0530 Subject: [PATCH 14/22] resolving pr comment and removed unused function --- lib/AuthenticationSDK/util/MLEUtility.rb | 31 ++---------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/lib/AuthenticationSDK/util/MLEUtility.rb b/lib/AuthenticationSDK/util/MLEUtility.rb index 8f288174..26052375 100644 --- a/lib/AuthenticationSDK/util/MLEUtility.rb +++ b/lib/AuthenticationSDK/util/MLEUtility.rb @@ -70,39 +70,12 @@ def self.encrypt_request_payload(merchant_config, request_payload) end end - - def self.get_certificate(merchant_config, log_obj) - begin - p12_file_path = File.join(merchant_config.keysDirectory, merchant_config.keyFilename + '.p12') - file = File.binread(p12_file_path) - p12_file = OpenSSL::PKCS12.new(file, merchant_config.keyPass) - x5_cert_pem = OpenSSL::X509::Certificate.new(p12_file.certificate) - x5_cert_pem.subject.to_a.each do |attribute| - return x5_cert_pem if attribute[1].include?(merchant_config.mleKeyAlias) - end - p12_file.ca_certs.each do |cert| - cert.subject.to_a.each do |attribute| - return cert if attribute[1].include?(merchant_config.mleKeyAlias) - end - end - rescue OpenSSL::PKCS12::PKCS12Error => e - log_obj.logger.error("Failed to load PKCS12 file: #{e.message}") - raise e - rescue OpenSSL::X509::CertificateError => e - log_obj.logger.error("Failed to create X509 certificate: #{e.message}") - raise e - rescue StandardError => e - log_obj.logger.error("An error occurred while getting the certificate: #{e.message}") - raise e - end - end - def self.validate_certificate(certificate, mle_key_alias, log_obj) if certificate.not_after.nil? log_obj.logger.warn("Certificate for MLE don't have expiry date.") - end - if certificate.not_after < Time.now + elsif certificate.not_after < Time.now log_obj.logger.warn('Certificate with MLE alias ' + mle_key_alias + ' is expired as of ' + certificate.not_after.to_s + ". Please update p12 file.") + # raise StandardError.new('Certificate required for MLE has been expired on : ' + certificate.not_after.to_s) else time_to_expire = certificate.not_after - Time.now if time_to_expire < Constants::CERTIFICATE_EXPIRY_DATE_WARNING_DAYS * 24 * 60 * 60 From 16f932263db2720d9627d6a81b02025d2f15968a Mon Sep 17 00:00:00 2001 From: monkumar Date: Thu, 13 Feb 2025 15:47:46 +0530 Subject: [PATCH 15/22] corrected error throw in case of incorrect auth type for MLE --- lib/AuthenticationSDK/core/MerchantConfig.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AuthenticationSDK/core/MerchantConfig.rb b/lib/AuthenticationSDK/core/MerchantConfig.rb index c5f47007..80b4821c 100644 --- a/lib/AuthenticationSDK/core/MerchantConfig.rb +++ b/lib/AuthenticationSDK/core/MerchantConfig.rb @@ -266,7 +266,7 @@ def validateMLEConfiguration if mle_configured && !Constants::AUTH_TYPE_JWT.eql?(@authenticationType) err = StandardError.new(Constants::ERROR_PREFIX + "MLE can only be used with JWT authentication") @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) - raise + raise err end end From 1e3a469c44d7da8d2f4171573f72855beada7813 Mon Sep 17 00:00:00 2001 From: monkumar Date: Tue, 18 Feb 2025 15:09:39 +0530 Subject: [PATCH 16/22] add MLE.md --- MLE.md | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 MLE.md diff --git a/MLE.md b/MLE.md new file mode 100644 index 00000000..4475cf72 --- /dev/null +++ b/MLE.md @@ -0,0 +1,109 @@ +[![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**: `Hash of string to boolean` +- **Description**: Overrides the global MLE setting for specific APIs. The key is the function name of the API in the SDK, and the value is a boolean indicating whether MLE should be enabled (`true`) or disabled (`false`) for that specific API call. + +### MLE Key Alias + +Another optional parameter for MLE is `mleKeyAlias`, which specifies the key alias used to retrieve the MLE certificate from the JWT P12 file. + +- **Variable**: `mleKeyAlias` +- **Type**: `String` +- **Default**: `CyberSource_SJC_US` +- **Description**: By default, CyberSource uses the `CyberSource_SJC_US` public certificate to encrypt the payload. However, users can override this default value by setting their own key alias. + +## Notes + +- If `useMLEGlobally` is set to true, it will enable MLE for all API calls that support MLE by CyberSource, unless overridden by `mapToControlMLEonAPI`. +- If `mapToControlMLEonAPI` is not provided or does not contain a specific API function name, the global `useMLEGlobally` setting will be applied. +- The `mleKeyAlias` parameter is optional and defaults to `CyberSource_SJC_US` if not specified by the user. Users can override this default value by setting their own key alias. +- Example configurations contain only properties related to MLE. + +## Example Configuration + +### Option 1: Enable MLE globally for all MLE supported APIs + +```ruby +configuration_dictionary = { +"useMLEGlobally": true # Globally MLE will be enabled for all MLE supported APIs +} +``` + +### Option 2: Enable/Disable MLE for specific APIs + +```ruby +configuration_dictionary = {} +configuration_dictionary['useMLEGlobally'] = true # globally MLE will be enabled for all the MLE supported APIs by Cybs in SDK +mapToControlMLE = { + 'create_payment' => false, # only create_payment function will have MLE=false i.e. (/pts/v2/payments POST API) out of all MLE supported APIs + 'capture_payment' => true # capture_payment function will have MLE=true i.e. (/pts/v2/payments/{id}/captures POST API), if it not in list of MLE supportedAPIs else it will already have MLE=true by global MLE parameter. +} +configuration_dictionary['mapToControlMLEonAPI'] = mapToControlMLE +# Set other properties +api_client = CyberSource::ApiClient.new +# Create API instance using the configuration dictionary +api_instance = CyberSource::PaymentsApi.new(api_client, configuration_dictionary) + +``` + +### Option 3: Disable MLE globally and enable for specific APIs + +```ruby +configuration_dictionary = { + "useMLEGlobally": false, # Globally MLE will be disabled for all APIs + "mleKeyAlias": "Custom_Key_Alias" # optional if any custom value provided by Cybs +} +mapToControlMLE = { + 'apiFunctionName1' => false, # MLE will be disabled for this API + 'apiFunctionName2' => true # MLE will be enabled for this API +} +configuration_dictionary['mapToControlMLEonAPI'] = mapToControlMLE +``` + +In the above examples: +- MLE is enabled/disabled globally (`useMLEGlobally` is true/false). +- `apiFunctionName1` will have MLE disabled/enabled based on value provided. +- `apiFunctionName2` will have MLE enabled. +- `mleKeyAlias` is set to `Custom_Key_Alias`, overriding the default value. + +Please refer to the given link for sample codes with MLE: + + +## 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 1db105f4ea43e5c0d6537a70e7f3001cce384316 Mon Sep 17 00:00:00 2001 From: monkumar Date: Thu, 27 Feb 2025 11:06:13 +0530 Subject: [PATCH 17/22] added MLE section in readme and add sample codes link --- MLE.md | 2 +- README.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/MLE.md b/MLE.md index 4475cf72..43a9064c 100644 --- a/MLE.md +++ b/MLE.md @@ -86,7 +86,7 @@ In the above examples: - `apiFunctionName2` will have MLE enabled. - `mleKeyAlias` is set to `Custom_Key_Alias`, overriding the default value. -Please refer to the given link for sample codes with MLE: +Please refer to the given link for sample codes with MLE: [MLE Samples](https://github.com/CyberSource/cybersource-rest-samples-ruby/tree/master/Samples/MLEFeature) ## Additional Information diff --git a/README.md b/README.md index b6bb7792..c8276ec7 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,13 @@ API credentials are different for each environment, so be sure to switch to the ## 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 200b8fb471427fdf29d8902fa64c1ba7123c1ba7 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Fri, 28 Feb 2025 21:57:48 +0530 Subject: [PATCH 18/22] Deprecated method for JWE decryption Added new method using PrivateKey parameter --- lib/AuthenticationSDK/core/MerchantConfig.rb | 6 +++++- lib/AuthenticationSDK/util/Cache.rb | 2 ++ lib/AuthenticationSDK/util/JWEUtility.rb | 7 ++++++- lib/cybersource_rest_client/utilities/jwe_utility.rb | 6 ++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/AuthenticationSDK/core/MerchantConfig.rb b/lib/AuthenticationSDK/core/MerchantConfig.rb index 80b4821c..649a4ff7 100644 --- a/lib/AuthenticationSDK/core/MerchantConfig.rb +++ b/lib/AuthenticationSDK/core/MerchantConfig.rb @@ -56,7 +56,7 @@ def initialize(cybsPropertyObj) #fall back logic def validateMerchantDetails() - logmessage='' + logmessage = '' @log_config.validate(logmessage) @log_obj = Log.new @log_config, "MerchantConfig" @log_obj.logger.info('START> =======================================') @@ -231,6 +231,10 @@ def validateMerchantDetails() end def validateMLEConfiguration + if @useMLEGlobally.nil? + @useMLEGlobally = false + end + unless [true, false].include?(@useMLEGlobally) err = StandardError.new(Constants::ERROR_PREFIX + "useMLEGlobally must be a boolean") @log_obj.logger.error(ExceptionHandler.new.new_api_exception err) diff --git a/lib/AuthenticationSDK/util/Cache.rb b/lib/AuthenticationSDK/util/Cache.rb index c23505e6..495a21e0 100644 --- a/lib/AuthenticationSDK/util/Cache.rb +++ b/lib/AuthenticationSDK/util/Cache.rb @@ -30,7 +30,9 @@ def getCertificate(p12File, keyPass, keyAlias, cacheObj, currentFileLastModified x5CertDer end + # DEPRECATED: This method has been marked as Deprecated and will be removed in coming releases. def fetchPEMFileForNetworkTokenization(filePath, cacheObj) + warn("[DEPRECATED] 'fetchPEMFileForNetworkTokenization' method is deprecated and will be removed in coming releases.") pem_file_cache = cacheObj.read('privateKeyFromPEMFile') cached_pem_file_last_updated_time = cacheObj.read('cachedLastModifiedTimeOfPEMFile') if File.exist?(filePath) diff --git a/lib/AuthenticationSDK/util/JWEUtility.rb b/lib/AuthenticationSDK/util/JWEUtility.rb index e3e7f235..3d689fd7 100644 --- a/lib/AuthenticationSDK/util/JWEUtility.rb +++ b/lib/AuthenticationSDK/util/JWEUtility.rb @@ -5,10 +5,15 @@ public class AuthJWEUtility - + # DEPRECATED: This method has been marked as Deprecated and will be removed in coming releases. Use decrypt_jwe_using_private_key() instead. def self.decrypt_jwe_using_pem(merchant_config, encoded_response) + warn("[DEPRECATED] `decrypt_jwe_using_pem()` method is deprecated and will be removed in coming releases. Use `decrypt_jwe_using_private_key()` instead.") cache_obj = ActiveSupport::Cache::MemoryStore.new key = Cache.new.fetchPEMFileForNetworkTokenization(merchant_config.pemFileDirectory, cache_obj) return JOSE::JWE.block_decrypt(key, encoded_response).first end + + def self.decrypt_jwe_using_private_key(private_key, encoded_response) + return JOSE::JWE.block_decrypt(private_key, encoded_response).first + end end diff --git a/lib/cybersource_rest_client/utilities/jwe_utility.rb b/lib/cybersource_rest_client/utilities/jwe_utility.rb index a39e490e..d7d7d68a 100644 --- a/lib/cybersource_rest_client/utilities/jwe_utility.rb +++ b/lib/cybersource_rest_client/utilities/jwe_utility.rb @@ -5,8 +5,14 @@ module CyberSource public class JWEUtility + # DEPRECATED: This method has been marked as Deprecated and will be removed in coming releases. Use decryptJWUsingPrivateKey() instead. def self.decryptJWEResponse(encoded_response, merchant_config) + warn("[DEPRECATED] `decryptJWEResponse()` method is deprecated and will be removed in coming releases. Use `decryptJWUsingPrivateKey()` instead.") return AuthJWEUtility.decrypt_jwe_using_pem(merchant_config, encoded_response) end + + def self.decryptJWUsingPrivateKey(private_key, encoded_response) + return AuthJWEUtility.decrypt_jwe_using_private_key(private_key, encoded_response) + end end end From 18c16d03635579711aea4bcc3ac1403d81b9084b Mon Sep 17 00:00:00 2001 From: gnongsie Date: Sat, 1 Mar 2025 00:34:59 +0530 Subject: [PATCH 19/22] Changes from API updates - Feb 2025 --- ...tConfigurationInformationConfigurations.md | 1 + docs/GenerateCaptureContextRequest.md | 3 +- ...ateUnifiedCheckoutCaptureContextRequest.md | 1 + ...v2sessionsTransientTokenResponseOptions.md | 8 + docs/NetworkTokenEnrollment.md | 9 + docs/NetworkTokenServicesEnablement.md | 9 + ...ementMastercardDigitalEnablementService.md | 8 + ...TokenServicesEnablementVisaTokenService.md | 8 + docs/TmsBusinessInformation.md | 14 + docs/TmsBusinessInformationAcquirer.md | 9 + docs/TmsBusinessInformationAddress.md | 9 + docs/Upv1capturecontextsCaptureMandate.md | 2 + generator/cybersource-rest-spec-ruby.json | 443 +++++++++++++++++- generator/cybersource-rest-spec.json | 443 +++++++++++++++++- lib/cybersource_rest_client.rb | 8 + .../api/batches_api.rb | 18 +- .../api/billing_agreements_api.rb | 14 +- .../api/bin_lookup_api.rb | 6 +- .../api/capture_api.rb | 6 +- .../api/chargeback_details_api.rb | 6 +- .../api/chargeback_summaries_api.rb | 6 +- .../api/conversion_details_api.rb | 6 +- .../api/create_new_webhooks_api.rb | 14 +- lib/cybersource_rest_client/api/credit_api.rb | 6 +- .../api/customer_api.rb | 18 +- .../api/customer_payment_instrument_api.rb | 22 +- .../api/customer_shipping_address_api.rb | 22 +- .../api/decision_manager_api.rb | 22 +- .../api/download_dtd_api.rb | 6 +- .../api/download_xsd_api.rb | 6 +- .../api/emv_tag_details_api.rb | 10 +- .../api/flex_api_api.rb | 6 +- .../api/instrument_identifier_api.rb | 26 +- .../interchange_clearing_level_details_api.rb | 6 +- .../api/invoice_settings_api.rb | 10 +- .../api/invoices_api.rb | 26 +- .../api/manage_webhooks_api.rb | 22 +- .../api/merchant_boarding_api.rb | 10 +- .../api/microform_integration_api.rb | 6 +- .../api/net_fundings_api.rb | 6 +- .../api/notification_of_changes_api.rb | 6 +- lib/cybersource_rest_client/api/orders_api.rb | 10 +- .../api/payer_authentication_api.rb | 14 +- .../api/payment_batch_summaries_api.rb | 6 +- .../api/payment_instrument_api.rb | 18 +- .../api/payments_api.rb | 26 +- .../api/payouts_api.rb | 6 +- lib/cybersource_rest_client/api/plans_api.rb | 34 +- .../api/purchase_and_refund_details_api.rb | 6 +- .../api/push_funds_api.rb | 6 +- lib/cybersource_rest_client/api/refund_api.rb | 10 +- .../api/replay_webhooks_api.rb | 6 +- .../api/report_definitions_api.rb | 10 +- .../api/report_downloads_api.rb | 6 +- .../api/report_subscriptions_api.rb | 22 +- .../api/reports_api.rb | 14 +- .../api/retrieval_details_api.rb | 6 +- .../api/retrieval_summaries_api.rb | 6 +- .../api/reversal_api.rb | 10 +- .../api/search_transactions_api.rb | 10 +- .../api/secure_file_share_api.rb | 10 +- .../api/subscriptions_api.rb | 34 +- lib/cybersource_rest_client/api/taxes_api.rb | 10 +- lib/cybersource_rest_client/api/token_api.rb | 6 +- .../api/transaction_batches_api.rb | 14 +- .../api/transaction_details_api.rb | 6 +- .../api/transient_token_data_api.rb | 10 +- .../unified_checkout_capture_context_api.rb | 6 +- .../api/user_management_api.rb | 6 +- .../api/user_management_search_api.rb | 6 +- .../api/verification_api.rb | 10 +- lib/cybersource_rest_client/api/void_api.rb | 22 +- ...onfiguration_information_configurations.rb | 20 +- .../generate_capture_context_request.rb | 22 +- ...nified_checkout_capture_context_request.rb | 20 +- ...ssions_transient_token_response_options.rb | 190 ++++++++ .../models/network_token_enrollment.rb | 199 ++++++++ .../network_token_services_enablement.rb | 199 ++++++++ ...t_mastercard_digital_enablement_service.rb | 190 ++++++++ ..._services_enablement_visa_token_service.rb | 190 ++++++++ .../models/tms_business_information.rb | 311 ++++++++++++ .../tms_business_information_acquirer.rb | 213 +++++++++ .../tms_business_information_address.rb | 231 +++++++++ .../upv1capturecontexts_capture_mandate.rb | 32 +- ...uration_information_configurations_spec.rb | 6 + .../generate_capture_context_request_spec.rb | 6 + ...d_checkout_capture_context_request_spec.rb | 6 + ...s_transient_token_response_options_spec.rb | 40 ++ spec/models/network_token_enrollment_spec.rb | 46 ++ ...tercard_digital_enablement_service_spec.rb | 40 ++ .../network_token_services_enablement_spec.rb | 46 ++ ...ices_enablement_visa_token_service_spec.rb | 40 ++ .../tms_business_information_acquirer_spec.rb | 46 ++ .../tms_business_information_address_spec.rb | 46 ++ spec/models/tms_business_information_spec.rb | 76 +++ ...pv1capturecontexts_capture_mandate_spec.rb | 12 + 96 files changed, 3783 insertions(+), 97 deletions(-) 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 lib/cybersource_rest_client/models/microformv2sessions_transient_token_response_options.rb create mode 100644 lib/cybersource_rest_client/models/network_token_enrollment.rb create mode 100644 lib/cybersource_rest_client/models/network_token_services_enablement.rb create mode 100644 lib/cybersource_rest_client/models/network_token_services_enablement_mastercard_digital_enablement_service.rb create mode 100644 lib/cybersource_rest_client/models/network_token_services_enablement_visa_token_service.rb create mode 100644 lib/cybersource_rest_client/models/tms_business_information.rb create mode 100644 lib/cybersource_rest_client/models/tms_business_information_acquirer.rb create mode 100644 lib/cybersource_rest_client/models/tms_business_information_address.rb create mode 100644 spec/models/microformv2sessions_transient_token_response_options_spec.rb create mode 100644 spec/models/network_token_enrollment_spec.rb create mode 100644 spec/models/network_token_services_enablement_mastercard_digital_enablement_service_spec.rb create mode 100644 spec/models/network_token_services_enablement_spec.rb create mode 100644 spec/models/network_token_services_enablement_visa_token_service_spec.rb create mode 100644 spec/models/tms_business_information_acquirer_spec.rb create mode 100644 spec/models/tms_business_information_address_spec.rb create mode 100644 spec/models/tms_business_information_spec.rb diff --git a/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md b/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md index 7fde0f1e..d962cdbe 100644 --- a/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md +++ b/docs/CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurations.md @@ -5,5 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **parent_profile_id** | **String** | 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] diff --git a/docs/GenerateCaptureContextRequest.md b/docs/GenerateCaptureContextRequest.md index 5b4841b6..edc48643 100644 --- a/docs/GenerateCaptureContextRequest.md +++ b/docs/GenerateCaptureContextRequest.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client_version** | **String** | Specify the version of Microform that you want to use. | [optional] **target_origins** | **Array<String>** | 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** | **Array<String>** | 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** | **Array<String>** | 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** | **Array<String>** | 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] diff --git a/docs/GenerateUnifiedCheckoutCaptureContextRequest.md b/docs/GenerateUnifiedCheckoutCaptureContextRequest.md index 8fa8fbed..31b43e12 100644 --- a/docs/GenerateUnifiedCheckoutCaptureContextRequest.md +++ b/docs/GenerateUnifiedCheckoutCaptureContextRequest.md @@ -11,5 +11,6 @@ Name | Type | Description | Notes **locale** | **String** | 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] diff --git a/docs/Microformv2sessionsTransientTokenResponseOptions.md b/docs/Microformv2sessionsTransientTokenResponseOptions.md new file mode 100644 index 00000000..b065f69a --- /dev/null +++ b/docs/Microformv2sessionsTransientTokenResponseOptions.md @@ -0,0 +1,8 @@ +# CyberSource::Microformv2sessionsTransientTokenResponseOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**include_card_prefix** | **BOOLEAN** | 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] + + diff --git a/docs/NetworkTokenEnrollment.md b/docs/NetworkTokenEnrollment.md new file mode 100644 index 00000000..b66d3a19 --- /dev/null +++ b/docs/NetworkTokenEnrollment.md @@ -0,0 +1,9 @@ +# CyberSource::NetworkTokenEnrollment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**business_information** | [**TmsBusinessInformation**](TmsBusinessInformation.md) | | [optional] +**network_token_services** | [**NetworkTokenServicesEnablement**](NetworkTokenServicesEnablement.md) | | [optional] + + diff --git a/docs/NetworkTokenServicesEnablement.md b/docs/NetworkTokenServicesEnablement.md new file mode 100644 index 00000000..dcd26ce5 --- /dev/null +++ b/docs/NetworkTokenServicesEnablement.md @@ -0,0 +1,9 @@ +# CyberSource::NetworkTokenServicesEnablement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**visa_token_service** | [**NetworkTokenServicesEnablementVisaTokenService**](NetworkTokenServicesEnablementVisaTokenService.md) | | [optional] +**mastercard_digital_enablement_service** | [**NetworkTokenServicesEnablementMastercardDigitalEnablementService**](NetworkTokenServicesEnablementMastercardDigitalEnablementService.md) | | [optional] + + diff --git a/docs/NetworkTokenServicesEnablementMastercardDigitalEnablementService.md b/docs/NetworkTokenServicesEnablementMastercardDigitalEnablementService.md new file mode 100644 index 00000000..427d3f48 --- /dev/null +++ b/docs/NetworkTokenServicesEnablementMastercardDigitalEnablementService.md @@ -0,0 +1,8 @@ +# CyberSource::NetworkTokenServicesEnablementMastercardDigitalEnablementService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enrollment** | **BOOLEAN** | Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted | [optional] + + diff --git a/docs/NetworkTokenServicesEnablementVisaTokenService.md b/docs/NetworkTokenServicesEnablementVisaTokenService.md new file mode 100644 index 00000000..a949c40c --- /dev/null +++ b/docs/NetworkTokenServicesEnablementVisaTokenService.md @@ -0,0 +1,8 @@ +# CyberSource::NetworkTokenServicesEnablementVisaTokenService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enrollment** | **BOOLEAN** | Indicates if an enrollment to create a TRID for the Visa card association should be attempted | [optional] + + diff --git a/docs/TmsBusinessInformation.md b/docs/TmsBusinessInformation.md new file mode 100644 index 00000000..188dddec --- /dev/null +++ b/docs/TmsBusinessInformation.md @@ -0,0 +1,14 @@ +# CyberSource::TmsBusinessInformation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the network token merchant. | [optional] +**doing_business_as** | **String** | Name the network token merchant does business as | [optional] +**address** | [**TmsBusinessInformationAddress**](TmsBusinessInformationAddress.md) | | [optional] +**website_url** | **String** | Website of network token merchant. | [optional] +**business_identification_type** | **String** | The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided. | [optional] +**business_identification_value** | **String** | The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided. | [optional] +**acquirer** | [**TmsBusinessInformationAcquirer**](TmsBusinessInformationAcquirer.md) | | [optional] + + diff --git a/docs/TmsBusinessInformationAcquirer.md b/docs/TmsBusinessInformationAcquirer.md new file mode 100644 index 00000000..61c2d512 --- /dev/null +++ b/docs/TmsBusinessInformationAcquirer.md @@ -0,0 +1,9 @@ +# CyberSource::TmsBusinessInformationAcquirer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acquirer_id** | **String** | Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided. | [optional] +**acquirer_merchant_id** | **String** | Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided. | [optional] + + diff --git a/docs/TmsBusinessInformationAddress.md b/docs/TmsBusinessInformationAddress.md new file mode 100644 index 00000000..99e0de81 --- /dev/null +++ b/docs/TmsBusinessInformationAddress.md @@ -0,0 +1,9 @@ +# CyberSource::TmsBusinessInformationAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **String** | Country of network token merchant. | [optional] +**locality** | **String** | City of network token merchant. | [optional] + + diff --git a/docs/Upv1capturecontextsCaptureMandate.md b/docs/Upv1capturecontextsCaptureMandate.md index 8d12ad6d..446a5fd8 100644 --- a/docs/Upv1capturecontextsCaptureMandate.md +++ b/docs/Upv1capturecontextsCaptureMandate.md @@ -9,5 +9,7 @@ Name | Type | Description | Notes **request_shipping** | **BOOLEAN** | Configure Unified Checkout to capture customer shipping details. Possible values: - True - False | [optional] **ship_to_countries** | **Array<String>** | List of countries available to ship to. Use the two-character ISO Standard Country Codes. | [optional] **show_accepted_network_icons** | **BOOLEAN** | Configure Unified Checkout to display the list of accepted card networks beneath the payment button Possible values: - True - False | [optional] +**request_save_card** | **BOOLEAN** | 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** | **BOOLEAN** | 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] diff --git a/generator/cybersource-rest-spec-ruby.json b/generator/cybersource-rest-spec-ruby.json index 1d92c989..cc93c8e0 100644 --- a/generator/cybersource-rest-spec-ruby.json +++ b/generator/cybersource-rest-spec-ruby.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/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/lib/cybersource_rest_client.rb b/lib/cybersource_rest_client.rb index 5fd4f753..8d8f7972 100644 --- a/lib/cybersource_rest_client.rb +++ b/lib/cybersource_rest_client.rb @@ -330,9 +330,14 @@ require 'cybersource_rest_client/models/kmsegressv2keyssym_client_reference_information' require 'cybersource_rest_client/models/kmsegressv2keyssym_key_information' require 'cybersource_rest_client/models/merchant_initiated_transaction_object' +require 'cybersource_rest_client/models/microformv2sessions_transient_token_response_options' require 'cybersource_rest_client/models/mit_reversal_request' require 'cybersource_rest_client/models/mit_void_request' require 'cybersource_rest_client/models/modify_billing_agreement' +require 'cybersource_rest_client/models/network_token_enrollment' +require 'cybersource_rest_client/models/network_token_services_enablement' +require 'cybersource_rest_client/models/network_token_services_enablement_mastercard_digital_enablement_service' +require 'cybersource_rest_client/models/network_token_services_enablement_visa_token_service' require 'cybersource_rest_client/models/notificationsubscriptionsv1productsorganization_id_event_types' require 'cybersource_rest_client/models/notificationsubscriptionsv1webhooks_notification_scope' require 'cybersource_rest_client/models/notificationsubscriptionsv1webhooks_products' @@ -1168,6 +1173,9 @@ require 'cybersource_rest_client/models/tms_bin_lookup_payment_account_information_card_brands' require 'cybersource_rest_client/models/tms_bin_lookup_payment_account_information_features' require 'cybersource_rest_client/models/tms_bin_lookup_payment_account_information_network' +require 'cybersource_rest_client/models/tms_business_information' +require 'cybersource_rest_client/models/tms_business_information_acquirer' +require 'cybersource_rest_client/models/tms_business_information_address' require 'cybersource_rest_client/models/tms_card_art' require 'cybersource_rest_client/models/tms_card_art_brand_logo_asset' require 'cybersource_rest_client/models/tms_card_art_brand_logo_asset__links' diff --git a/lib/cybersource_rest_client/api/batches_api.rb b/lib/cybersource_rest_client/api/batches_api.rb index c3da0e10..6c4c87ba 100644 --- a/lib/cybersource_rest_client/api/batches_api.rb +++ b/lib/cybersource_rest_client/api/batches_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class BatchesApi attr_accessor :api_client @@ -76,6 +76,10 @@ def get_batch_report_with_http_info(batch_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_batch_report","get_batch_report_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -151,6 +155,10 @@ def get_batch_status_with_http_info(batch_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_batch_status","get_batch_status_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -228,6 +236,10 @@ def get_batches_list_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_batches_list","get_batches_list_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -297,6 +309,10 @@ def post_batch_with_http_info(body, opts = {}) post_body = @api_client.object_to_http_body(body) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Body', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_batch","post_batch_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/billing_agreements_api.rb b/lib/cybersource_rest_client/api/billing_agreements_api.rb index cf3e2340..68da53e2 100644 --- a/lib/cybersource_rest_client/api/billing_agreements_api.rb +++ b/lib/cybersource_rest_client/api/billing_agreements_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class BillingAgreementsApi attr_accessor :api_client @@ -76,6 +76,10 @@ def billing_agreements_de_registration_with_http_info(modify_billing_agreement, post_body = @api_client.object_to_http_body(modify_billing_agreement) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'ModifyBillingAgreement', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["billing_agreements_de_registration","billing_agreements_de_registration_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, @@ -151,6 +155,10 @@ def billing_agreements_intimation_with_http_info(intimate_billing_agreement, id, post_body = @api_client.object_to_http_body(intimate_billing_agreement) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'IntimateBillingAgreement', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["billing_agreements_intimation","billing_agreements_intimation_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -220,6 +228,10 @@ def billing_agreements_registration_with_http_info(create_billing_agreement, opt post_body = @api_client.object_to_http_body(create_billing_agreement) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateBillingAgreement', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["billing_agreements_registration","billing_agreements_registration_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/bin_lookup_api.rb b/lib/cybersource_rest_client/api/bin_lookup_api.rb index 0ee0ac48..2334bbec 100644 --- a/lib/cybersource_rest_client/api/bin_lookup_api.rb +++ b/lib/cybersource_rest_client/api/bin_lookup_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class BinLookupApi attr_accessor :api_client @@ -71,6 +71,10 @@ def get_account_info_with_http_info(create_bin_lookup_request, opts = {}) post_body = @api_client.object_to_http_body(create_bin_lookup_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateBinLookupRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_account_info","get_account_info_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/capture_api.rb b/lib/cybersource_rest_client/api/capture_api.rb index d4025ca8..0eaef79e 100644 --- a/lib/cybersource_rest_client/api/capture_api.rb +++ b/lib/cybersource_rest_client/api/capture_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class CaptureApi attr_accessor :api_client @@ -76,6 +76,10 @@ def capture_payment_with_http_info(capture_payment_request, id, opts = {}) post_body = @api_client.object_to_http_body(capture_payment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CapturePaymentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["capture_payment","capture_payment_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/chargeback_details_api.rb b/lib/cybersource_rest_client/api/chargeback_details_api.rb index 3ccf2532..86ec3a80 100644 --- a/lib/cybersource_rest_client/api/chargeback_details_api.rb +++ b/lib/cybersource_rest_client/api/chargeback_details_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ChargebackDetailsApi attr_accessor :api_client @@ -87,6 +87,10 @@ def get_chargeback_details_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_chargeback_details","get_chargeback_details_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/chargeback_summaries_api.rb b/lib/cybersource_rest_client/api/chargeback_summaries_api.rb index 87ac49a4..8857ff77 100644 --- a/lib/cybersource_rest_client/api/chargeback_summaries_api.rb +++ b/lib/cybersource_rest_client/api/chargeback_summaries_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ChargebackSummariesApi attr_accessor :api_client @@ -87,6 +87,10 @@ def get_chargeback_summaries_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_chargeback_summaries","get_chargeback_summaries_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/conversion_details_api.rb b/lib/cybersource_rest_client/api/conversion_details_api.rb index 00543074..50d8929f 100644 --- a/lib/cybersource_rest_client/api/conversion_details_api.rb +++ b/lib/cybersource_rest_client/api/conversion_details_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ConversionDetailsApi attr_accessor :api_client @@ -87,6 +87,10 @@ def get_conversion_detail_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_conversion_detail","get_conversion_detail_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/create_new_webhooks_api.rb b/lib/cybersource_rest_client/api/create_new_webhooks_api.rb index d80013d3..a59ab20f 100644 --- a/lib/cybersource_rest_client/api/create_new_webhooks_api.rb +++ b/lib/cybersource_rest_client/api/create_new_webhooks_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class CreateNewWebhooksApi attr_accessor :api_client @@ -67,6 +67,10 @@ def create_webhook_subscription_with_http_info(opts = {}) post_body = @api_client.object_to_http_body(opts[:'create_webhook_request']) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateWebhookRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_webhook_subscription","create_webhook_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -139,6 +143,10 @@ def find_products_to_subscribe_with_http_info(organization_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["find_products_to_subscribe","find_products_to_subscribe_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -230,6 +238,10 @@ def save_sym_egress_key_with_http_info(v_c_sender_organization_id, v_c_permissio post_body = @api_client.object_to_http_body(opts[:'save_sym_egress_key']) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'SaveSymEgressKey', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["save_sym_egress_key","save_sym_egress_key_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/credit_api.rb b/lib/cybersource_rest_client/api/credit_api.rb index e5d870c6..1e5e26c2 100644 --- a/lib/cybersource_rest_client/api/credit_api.rb +++ b/lib/cybersource_rest_client/api/credit_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class CreditApi attr_accessor :api_client @@ -70,6 +70,10 @@ def create_credit_with_http_info(create_credit_request, opts = {}) post_body = @api_client.object_to_http_body(create_credit_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateCreditRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_credit","create_credit_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/customer_api.rb b/lib/cybersource_rest_client/api/customer_api.rb index a70052f1..774bf773 100644 --- a/lib/cybersource_rest_client/api/customer_api.rb +++ b/lib/cybersource_rest_client/api/customer_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class CustomerApi attr_accessor :api_client @@ -75,6 +75,10 @@ def delete_customer_with_http_info(customer_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_customer","delete_customer_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -148,6 +152,10 @@ def get_customer_with_http_info(customer_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_customer","get_customer_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -229,6 +237,10 @@ def patch_customer_with_http_info(customer_id, patch_customer_request, opts = {} post_body = @api_client.object_to_http_body(patch_customer_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PatchCustomerRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["patch_customer","patch_customer_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, @@ -301,6 +313,10 @@ def post_customer_with_http_info(post_customer_request, opts = {}) post_body = @api_client.object_to_http_body(post_customer_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostCustomerRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_customer","post_customer_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb b/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb index e33e462c..1002e550 100644 --- a/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +++ b/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class CustomerPaymentInstrumentApi attr_accessor :api_client @@ -81,6 +81,10 @@ def delete_customer_payment_instrument_with_http_info(customer_id, payment_instr else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_customer_payment_instrument","delete_customer_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -160,6 +164,10 @@ def get_customer_payment_instrument_with_http_info(customer_id, payment_instrume else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_customer_payment_instrument","get_customer_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -240,6 +248,10 @@ def get_customer_payment_instruments_list_with_http_info(customer_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_customer_payment_instruments_list","get_customer_payment_instruments_list_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -327,6 +339,10 @@ def patch_customers_payment_instrument_with_http_info(customer_id, payment_instr post_body = @api_client.object_to_http_body(patch_customer_payment_instrument_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PatchCustomerPaymentInstrumentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["patch_customers_payment_instrument","patch_customers_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, @@ -405,6 +421,10 @@ def post_customer_payment_instrument_with_http_info(customer_id, post_customer_p post_body = @api_client.object_to_http_body(post_customer_payment_instrument_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostCustomerPaymentInstrumentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_customer_payment_instrument","post_customer_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/customer_shipping_address_api.rb b/lib/cybersource_rest_client/api/customer_shipping_address_api.rb index 3eab8da6..1e929369 100644 --- a/lib/cybersource_rest_client/api/customer_shipping_address_api.rb +++ b/lib/cybersource_rest_client/api/customer_shipping_address_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class CustomerShippingAddressApi attr_accessor :api_client @@ -81,6 +81,10 @@ def delete_customer_shipping_address_with_http_info(customer_id, shipping_addres else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_customer_shipping_address","delete_customer_shipping_address_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -160,6 +164,10 @@ def get_customer_shipping_address_with_http_info(customer_id, shipping_address_i else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_customer_shipping_address","get_customer_shipping_address_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -240,6 +248,10 @@ def get_customer_shipping_addresses_list_with_http_info(customer_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_customer_shipping_addresses_list","get_customer_shipping_addresses_list_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -327,6 +339,10 @@ def patch_customers_shipping_address_with_http_info(customer_id, shipping_addres post_body = @api_client.object_to_http_body(patch_customer_shipping_address_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PatchCustomerShippingAddressRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["patch_customers_shipping_address","patch_customers_shipping_address_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, @@ -405,6 +421,10 @@ def post_customer_shipping_address_with_http_info(customer_id, post_customer_shi post_body = @api_client.object_to_http_body(post_customer_shipping_address_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostCustomerShippingAddressRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_customer_shipping_address","post_customer_shipping_address_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/decision_manager_api.rb b/lib/cybersource_rest_client/api/decision_manager_api.rb index c5869bb1..81aac949 100644 --- a/lib/cybersource_rest_client/api/decision_manager_api.rb +++ b/lib/cybersource_rest_client/api/decision_manager_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class DecisionManagerApi attr_accessor :api_client @@ -76,6 +76,10 @@ def action_decision_manager_case_with_http_info(id, case_management_actions_requ post_body = @api_client.object_to_http_body(case_management_actions_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CaseManagementActionsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["action_decision_manager_case","action_decision_manager_case_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -151,6 +155,10 @@ def add_negative_with_http_info(type, add_negative_list_request, opts = {}) post_body = @api_client.object_to_http_body(add_negative_list_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AddNegativeListRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["add_negative","add_negative_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -226,6 +234,10 @@ def comment_decision_manager_case_with_http_info(id, case_management_comments_re post_body = @api_client.object_to_http_body(case_management_comments_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CaseManagementCommentsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["comment_decision_manager_case","comment_decision_manager_case_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -295,6 +307,10 @@ def create_bundled_decision_manager_case_with_http_info(create_bundled_decision_ post_body = @api_client.object_to_http_body(create_bundled_decision_manager_case_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateBundledDecisionManagerCaseRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_bundled_decision_manager_case","create_bundled_decision_manager_case_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -370,6 +386,10 @@ def fraud_update_with_http_info(id, fraud_marking_action_request, opts = {}) post_body = @api_client.object_to_http_body(fraud_marking_action_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'FraudMarkingActionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["fraud_update","fraud_update_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/download_dtd_api.rb b/lib/cybersource_rest_client/api/download_dtd_api.rb index 1d87b18f..57a45dc4 100644 --- a/lib/cybersource_rest_client/api/download_dtd_api.rb +++ b/lib/cybersource_rest_client/api/download_dtd_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class DownloadDTDApi attr_accessor :api_client @@ -72,6 +72,10 @@ def get_dtdv2_with_http_info(report_definition_name_version, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_dtdv2","get_dtdv2_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/download_xsd_api.rb b/lib/cybersource_rest_client/api/download_xsd_api.rb index 0bf99285..77a0bcb6 100644 --- a/lib/cybersource_rest_client/api/download_xsd_api.rb +++ b/lib/cybersource_rest_client/api/download_xsd_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class DownloadXSDApi attr_accessor :api_client @@ -72,6 +72,10 @@ def get_xsdv2_with_http_info(report_definition_name_version, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_xsdv2","get_xsdv2_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/emv_tag_details_api.rb b/lib/cybersource_rest_client/api/emv_tag_details_api.rb index 4fbc7c97..366ec3b7 100644 --- a/lib/cybersource_rest_client/api/emv_tag_details_api.rb +++ b/lib/cybersource_rest_client/api/emv_tag_details_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class EMVTagDetailsApi attr_accessor :api_client @@ -66,6 +66,10 @@ def get_emv_tags_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_emv_tags","get_emv_tags_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -135,6 +139,10 @@ def parse_emv_tags_with_http_info(body, opts = {}) post_body = @api_client.object_to_http_body(body) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Body', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["parse_emv_tags","parse_emv_tags_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/flex_api_api.rb b/lib/cybersource_rest_client/api/flex_api_api.rb index 4860ad4a..c961ce39 100644 --- a/lib/cybersource_rest_client/api/flex_api_api.rb +++ b/lib/cybersource_rest_client/api/flex_api_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class FlexAPIApi attr_accessor :api_client @@ -70,6 +70,10 @@ def generate_flex_api_capture_context_with_http_info(generate_flex_api_capture_c post_body = @api_client.object_to_http_body(generate_flex_api_capture_context_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'GenerateFlexAPICaptureContextRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["generate_flex_api_capture_context","generate_flex_api_capture_context_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/instrument_identifier_api.rb b/lib/cybersource_rest_client/api/instrument_identifier_api.rb index 59c7b807..e245bf61 100644 --- a/lib/cybersource_rest_client/api/instrument_identifier_api.rb +++ b/lib/cybersource_rest_client/api/instrument_identifier_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class InstrumentIdentifierApi attr_accessor :api_client @@ -75,6 +75,10 @@ def delete_instrument_identifier_with_http_info(instrument_identifier_id, opts = else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_instrument_identifier","delete_instrument_identifier_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -151,6 +155,10 @@ def get_instrument_identifier_with_http_info(instrument_identifier_id, opts = {} else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_instrument_identifier","get_instrument_identifier_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -234,6 +242,10 @@ def get_instrument_identifier_payment_instruments_list_with_http_info(instrument else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_instrument_identifier_payment_instruments_list","get_instrument_identifier_payment_instruments_list_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -318,6 +330,10 @@ def patch_instrument_identifier_with_http_info(instrument_identifier_id, patch_i post_body = @api_client.object_to_http_body(patch_instrument_identifier_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PatchInstrumentIdentifierRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["patch_instrument_identifier","patch_instrument_identifier_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, @@ -393,6 +409,10 @@ def post_instrument_identifier_with_http_info(post_instrument_identifier_request post_body = @api_client.object_to_http_body(post_instrument_identifier_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostInstrumentIdentifierRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_instrument_identifier","post_instrument_identifier_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -471,6 +491,10 @@ def post_instrument_identifier_enrollment_with_http_info(instrument_identifier_i post_body = @api_client.object_to_http_body(post_instrument_identifier_enrollment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostInstrumentIdentifierEnrollmentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_instrument_identifier_enrollment","post_instrument_identifier_enrollment_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb b/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb index defeb603..8478f036 100644 --- a/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb +++ b/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class InterchangeClearingLevelDetailsApi attr_accessor :api_client @@ -87,6 +87,10 @@ def get_interchange_clearing_level_details_with_http_info(start_time, end_time, else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_interchange_clearing_level_details","get_interchange_clearing_level_details_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/invoice_settings_api.rb b/lib/cybersource_rest_client/api/invoice_settings_api.rb index 85d189d1..3f46ee7c 100644 --- a/lib/cybersource_rest_client/api/invoice_settings_api.rb +++ b/lib/cybersource_rest_client/api/invoice_settings_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class InvoiceSettingsApi attr_accessor :api_client @@ -66,6 +66,10 @@ def get_invoice_settings_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_invoice_settings","get_invoice_settings_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -135,6 +139,10 @@ def update_invoice_settings_with_http_info(invoice_settings_request, opts = {}) post_body = @api_client.object_to_http_body(invoice_settings_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'InvoiceSettingsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["update_invoice_settings","update_invoice_settings_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/invoices_api.rb b/lib/cybersource_rest_client/api/invoices_api.rb index a3bd0f03..f2245720 100644 --- a/lib/cybersource_rest_client/api/invoices_api.rb +++ b/lib/cybersource_rest_client/api/invoices_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class InvoicesApi attr_accessor :api_client @@ -70,6 +70,10 @@ def create_invoice_with_http_info(create_invoice_request, opts = {}) post_body = @api_client.object_to_http_body(create_invoice_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateInvoiceRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_invoice","create_invoice_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -152,6 +156,10 @@ def get_all_invoices_with_http_info(offset, limit, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_all_invoices","get_all_invoices_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -223,6 +231,10 @@ def get_invoice_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_invoice","get_invoice_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -294,6 +306,10 @@ def perform_cancel_action_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["perform_cancel_action","perform_cancel_action_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -365,6 +381,10 @@ def perform_send_action_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["perform_send_action","perform_send_action_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -440,6 +460,10 @@ def update_invoice_with_http_info(id, update_invoice_request, opts = {}) post_body = @api_client.object_to_http_body(update_invoice_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UpdateInvoiceRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["update_invoice","update_invoice_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/manage_webhooks_api.rb b/lib/cybersource_rest_client/api/manage_webhooks_api.rb index 76892847..f325370d 100644 --- a/lib/cybersource_rest_client/api/manage_webhooks_api.rb +++ b/lib/cybersource_rest_client/api/manage_webhooks_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ManageWebhooksApi attr_accessor :api_client @@ -73,6 +73,10 @@ def delete_webhook_subscription_with_http_info(webhook_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_webhook_subscription","delete_webhook_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -144,6 +148,10 @@ def get_webhook_subscription_by_id_with_http_info(webhook_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_webhook_subscription_by_id","get_webhook_subscription_by_id_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -231,6 +239,10 @@ def get_webhook_subscriptions_by_org_with_http_info(organization_id, product_id, else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_webhook_subscriptions_by_org","get_webhook_subscriptions_by_org_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -326,6 +338,10 @@ def save_asym_egress_key_with_http_info(v_c_sender_organization_id, v_c_permissi post_body = @api_client.object_to_http_body(save_asym_egress_key) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'SaveAsymEgressKey', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["save_asym_egress_key","save_asym_egress_key_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -398,6 +414,10 @@ def update_webhook_subscription_with_http_info(webhook_id, opts = {}) post_body = @api_client.object_to_http_body(opts[:'update_webhook_request']) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UpdateWebhookRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["update_webhook_subscription","update_webhook_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/merchant_boarding_api.rb b/lib/cybersource_rest_client/api/merchant_boarding_api.rb index e1bbf7f0..8c82c569 100644 --- a/lib/cybersource_rest_client/api/merchant_boarding_api.rb +++ b/lib/cybersource_rest_client/api/merchant_boarding_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class MerchantBoardingApi attr_accessor :api_client @@ -72,6 +72,10 @@ def get_registration_with_http_info(registration_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_registration","get_registration_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -144,6 +148,10 @@ def post_registration_with_http_info(post_registration_body, opts = {}) post_body = @api_client.object_to_http_body(post_registration_body) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostRegistrationBody', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_registration","post_registration_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/microform_integration_api.rb b/lib/cybersource_rest_client/api/microform_integration_api.rb index 50266c0f..7d893275 100644 --- a/lib/cybersource_rest_client/api/microform_integration_api.rb +++ b/lib/cybersource_rest_client/api/microform_integration_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class MicroformIntegrationApi attr_accessor :api_client @@ -70,6 +70,10 @@ def generate_capture_context_with_http_info(generate_capture_context_request, op post_body = @api_client.object_to_http_body(generate_capture_context_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'GenerateCaptureContextRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["generate_capture_context","generate_capture_context_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/net_fundings_api.rb b/lib/cybersource_rest_client/api/net_fundings_api.rb index ef20b9d6..b592eb6b 100644 --- a/lib/cybersource_rest_client/api/net_fundings_api.rb +++ b/lib/cybersource_rest_client/api/net_fundings_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class NetFundingsApi attr_accessor :api_client @@ -90,6 +90,10 @@ def get_net_funding_details_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_net_funding_details","get_net_funding_details_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/notification_of_changes_api.rb b/lib/cybersource_rest_client/api/notification_of_changes_api.rb index 765aa129..c63ec6b3 100644 --- a/lib/cybersource_rest_client/api/notification_of_changes_api.rb +++ b/lib/cybersource_rest_client/api/notification_of_changes_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class NotificationOfChangesApi attr_accessor :api_client @@ -80,6 +80,10 @@ def get_notification_of_change_report_with_http_info(start_time, end_time, opts else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_notification_of_change_report","get_notification_of_change_report_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/orders_api.rb b/lib/cybersource_rest_client/api/orders_api.rb index 4780acb9..2f7ac7c5 100644 --- a/lib/cybersource_rest_client/api/orders_api.rb +++ b/lib/cybersource_rest_client/api/orders_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class OrdersApi attr_accessor :api_client @@ -70,6 +70,10 @@ def create_order_with_http_info(create_order_request, opts = {}) post_body = @api_client.object_to_http_body(create_order_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateOrderRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_order","create_order_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -145,6 +149,10 @@ def update_order_with_http_info(id, update_order_request, opts = {}) post_body = @api_client.object_to_http_body(update_order_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UpdateOrderRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["update_order","update_order_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/payer_authentication_api.rb b/lib/cybersource_rest_client/api/payer_authentication_api.rb index 43dfda0e..e87ad287 100644 --- a/lib/cybersource_rest_client/api/payer_authentication_api.rb +++ b/lib/cybersource_rest_client/api/payer_authentication_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PayerAuthenticationApi attr_accessor :api_client @@ -70,6 +70,10 @@ def check_payer_auth_enrollment_with_http_info(check_payer_auth_enrollment_reque post_body = @api_client.object_to_http_body(check_payer_auth_enrollment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CheckPayerAuthEnrollmentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["check_payer_auth_enrollment","check_payer_auth_enrollment_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -139,6 +143,10 @@ def payer_auth_setup_with_http_info(payer_auth_setup_request, opts = {}) post_body = @api_client.object_to_http_body(payer_auth_setup_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PayerAuthSetupRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["payer_auth_setup","payer_auth_setup_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -208,6 +216,10 @@ def validate_authentication_results_with_http_info(validate_request, opts = {}) post_body = @api_client.object_to_http_body(validate_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'ValidateRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["validate_authentication_results","validate_authentication_results_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb b/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb index 334ecb5b..bc4b9379 100644 --- a/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb +++ b/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PaymentBatchSummariesApi attr_accessor :api_client @@ -96,6 +96,10 @@ def get_payment_batch_summary_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_payment_batch_summary","get_payment_batch_summary_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/payment_instrument_api.rb b/lib/cybersource_rest_client/api/payment_instrument_api.rb index 47256ac9..60d9573f 100644 --- a/lib/cybersource_rest_client/api/payment_instrument_api.rb +++ b/lib/cybersource_rest_client/api/payment_instrument_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PaymentInstrumentApi attr_accessor :api_client @@ -75,6 +75,10 @@ def delete_payment_instrument_with_http_info(payment_instrument_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_payment_instrument","delete_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -151,6 +155,10 @@ def get_payment_instrument_with_http_info(payment_instrument_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_payment_instrument","get_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -235,6 +243,10 @@ def patch_payment_instrument_with_http_info(payment_instrument_id, patch_payment post_body = @api_client.object_to_http_body(patch_payment_instrument_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PatchPaymentInstrumentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["patch_payment_instrument","patch_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, @@ -310,6 +322,10 @@ def post_payment_instrument_with_http_info(post_payment_instrument_request, opts post_body = @api_client.object_to_http_body(post_payment_instrument_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostPaymentInstrumentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_payment_instrument","post_payment_instrument_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/payments_api.rb b/lib/cybersource_rest_client/api/payments_api.rb index 3f091f98..f547780f 100644 --- a/lib/cybersource_rest_client/api/payments_api.rb +++ b/lib/cybersource_rest_client/api/payments_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PaymentsApi attr_accessor :api_client @@ -76,6 +76,10 @@ def create_order_request_with_http_info(order_payment_request, id, opts = {}) post_body = @api_client.object_to_http_body(order_payment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'OrderPaymentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_order_request","create_order_request_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -145,6 +149,10 @@ def create_payment_with_http_info(create_payment_request, opts = {}) post_body = @api_client.object_to_http_body(create_payment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreatePaymentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_payment","create_payment_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -214,6 +222,10 @@ def create_session_request_with_http_info(create_session_req, opts = {}) post_body = @api_client.object_to_http_body(create_session_req) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateSessionReq', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_session_request","create_session_request_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -289,6 +301,10 @@ def increment_auth_with_http_info(id, increment_auth_request, opts = {}) post_body = @api_client.object_to_http_body(increment_auth_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'IncrementAuthRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["increment_auth","increment_auth_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, @@ -364,6 +380,10 @@ def refresh_payment_status_with_http_info(id, refresh_payment_status_request, op post_body = @api_client.object_to_http_body(refresh_payment_status_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'RefreshPaymentStatusRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["refresh_payment_status","refresh_payment_status_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -439,6 +459,10 @@ def update_session_req_with_http_info(create_session_request, id, opts = {}) post_body = @api_client.object_to_http_body(create_session_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateSessionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["update_session_req","update_session_req_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/payouts_api.rb b/lib/cybersource_rest_client/api/payouts_api.rb index 00362b2f..f0523c11 100644 --- a/lib/cybersource_rest_client/api/payouts_api.rb +++ b/lib/cybersource_rest_client/api/payouts_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PayoutsApi attr_accessor :api_client @@ -70,6 +70,10 @@ def oct_create_payment_with_http_info(oct_create_payment_request, opts = {}) post_body = @api_client.object_to_http_body(oct_create_payment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'OctCreatePaymentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["oct_create_payment","oct_create_payment_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/plans_api.rb b/lib/cybersource_rest_client/api/plans_api.rb index 5781144b..478f6ce3 100644 --- a/lib/cybersource_rest_client/api/plans_api.rb +++ b/lib/cybersource_rest_client/api/plans_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PlansApi attr_accessor :api_client @@ -72,6 +72,10 @@ def activate_plan_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["activate_plan","activate_plan_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -141,6 +145,10 @@ def create_plan_with_http_info(create_plan_request, opts = {}) post_body = @api_client.object_to_http_body(create_plan_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreatePlanRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_plan","create_plan_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -212,6 +220,10 @@ def deactivate_plan_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["deactivate_plan","deactivate_plan_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -283,6 +295,10 @@ def delete_plan_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_plan","delete_plan_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -354,6 +370,10 @@ def get_plan_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_plan","get_plan_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -419,6 +439,10 @@ def get_plan_code_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_plan_code","get_plan_code_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -499,6 +523,10 @@ def get_plans_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_plans","get_plans_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -574,6 +602,10 @@ def update_plan_with_http_info(id, update_plan_request, opts = {}) post_body = @api_client.object_to_http_body(update_plan_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UpdatePlanRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["update_plan","update_plan_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb b/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb index 81b3b42f..6b8f40fd 100644 --- a/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb +++ b/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PurchaseAndRefundDetailsApi attr_accessor :api_client @@ -102,6 +102,10 @@ def get_purchase_and_refund_details_with_http_info(start_time, end_time, opts = else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_purchase_and_refund_details","get_purchase_and_refund_details_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/push_funds_api.rb b/lib/cybersource_rest_client/api/push_funds_api.rb index f38343f0..4bbf9bbe 100644 --- a/lib/cybersource_rest_client/api/push_funds_api.rb +++ b/lib/cybersource_rest_client/api/push_funds_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class PushFundsApi attr_accessor :api_client @@ -112,6 +112,10 @@ def create_push_funds_transfer_with_http_info(push_funds_request, content_type, post_body = @api_client.object_to_http_body(push_funds_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PushFundsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_push_funds_transfer","create_push_funds_transfer_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/refund_api.rb b/lib/cybersource_rest_client/api/refund_api.rb index 81986510..66830263 100644 --- a/lib/cybersource_rest_client/api/refund_api.rb +++ b/lib/cybersource_rest_client/api/refund_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class RefundApi attr_accessor :api_client @@ -76,6 +76,10 @@ def refund_capture_with_http_info(refund_capture_request, id, opts = {}) post_body = @api_client.object_to_http_body(refund_capture_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'RefundCaptureRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["refund_capture","refund_capture_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -151,6 +155,10 @@ def refund_payment_with_http_info(refund_payment_request, id, opts = {}) post_body = @api_client.object_to_http_body(refund_payment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'RefundPaymentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["refund_payment","refund_payment_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/replay_webhooks_api.rb b/lib/cybersource_rest_client/api/replay_webhooks_api.rb index 3745f064..244f6b3e 100644 --- a/lib/cybersource_rest_client/api/replay_webhooks_api.rb +++ b/lib/cybersource_rest_client/api/replay_webhooks_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ReplayWebhooksApi attr_accessor :api_client @@ -73,6 +73,10 @@ def replay_previous_webhooks_with_http_info(webhook_id, opts = {}) post_body = @api_client.object_to_http_body(opts[:'replay_webhooks_request']) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'ReplayWebhooksRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["replay_previous_webhooks","replay_previous_webhooks_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/report_definitions_api.rb b/lib/cybersource_rest_client/api/report_definitions_api.rb index 0c689e09..c51c5fde 100644 --- a/lib/cybersource_rest_client/api/report_definitions_api.rb +++ b/lib/cybersource_rest_client/api/report_definitions_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ReportDefinitionsApi attr_accessor :api_client @@ -85,6 +85,10 @@ def get_resource_info_by_report_definition_with_http_info(report_definition_name else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_resource_info_by_report_definition","get_resource_info_by_report_definition_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -160,6 +164,10 @@ def get_resource_v2_info_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_resource_v2_info","get_resource_v2_info_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/report_downloads_api.rb b/lib/cybersource_rest_client/api/report_downloads_api.rb index 7083a3c9..2c73429a 100644 --- a/lib/cybersource_rest_client/api/report_downloads_api.rb +++ b/lib/cybersource_rest_client/api/report_downloads_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ReportDownloadsApi attr_accessor :api_client @@ -87,6 +87,10 @@ def download_report_with_http_info(report_date, report_name, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["download_report","download_report_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/report_subscriptions_api.rb b/lib/cybersource_rest_client/api/report_subscriptions_api.rb index ca3581ef..a847c52f 100644 --- a/lib/cybersource_rest_client/api/report_subscriptions_api.rb +++ b/lib/cybersource_rest_client/api/report_subscriptions_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ReportSubscriptionsApi attr_accessor :api_client @@ -77,6 +77,10 @@ def create_standard_or_classic_subscription_with_http_info(predefined_subscripti post_body = @api_client.object_to_http_body(predefined_subscription_request_bean) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PredefinedSubscriptionRequestBean', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_standard_or_classic_subscription","create_standard_or_classic_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, @@ -152,6 +156,10 @@ def create_subscription_with_http_info(create_report_subscription_request, opts post_body = @api_client.object_to_http_body(create_report_subscription_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateReportSubscriptionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_subscription","create_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, @@ -233,6 +241,10 @@ def delete_subscription_with_http_info(report_name, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["delete_subscription","delete_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, @@ -304,6 +316,10 @@ def get_all_subscriptions_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_all_subscriptions","get_all_subscriptions_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -386,6 +402,10 @@ def get_subscription_with_http_info(report_name, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_subscription","get_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/reports_api.rb b/lib/cybersource_rest_client/api/reports_api.rb index a713de27..90c795d5 100644 --- a/lib/cybersource_rest_client/api/reports_api.rb +++ b/lib/cybersource_rest_client/api/reports_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ReportsApi attr_accessor :api_client @@ -77,6 +77,10 @@ def create_report_with_http_info(create_adhoc_report_request, opts = {}) post_body = @api_client.object_to_http_body(create_adhoc_report_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateAdhocReportRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_report","create_report_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -154,6 +158,10 @@ def get_report_by_report_id_with_http_info(report_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_report_by_report_id","get_report_by_report_id_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -262,6 +270,10 @@ def search_reports_with_http_info(start_time, end_time, time_query_type, opts = else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["search_reports","search_reports_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/retrieval_details_api.rb b/lib/cybersource_rest_client/api/retrieval_details_api.rb index 8f804291..3e7b6f43 100644 --- a/lib/cybersource_rest_client/api/retrieval_details_api.rb +++ b/lib/cybersource_rest_client/api/retrieval_details_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class RetrievalDetailsApi attr_accessor :api_client @@ -87,6 +87,10 @@ def get_retrieval_details_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_retrieval_details","get_retrieval_details_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/retrieval_summaries_api.rb b/lib/cybersource_rest_client/api/retrieval_summaries_api.rb index 77330514..c88075a4 100644 --- a/lib/cybersource_rest_client/api/retrieval_summaries_api.rb +++ b/lib/cybersource_rest_client/api/retrieval_summaries_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class RetrievalSummariesApi attr_accessor :api_client @@ -87,6 +87,10 @@ def get_retrieval_summary_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_retrieval_summary","get_retrieval_summary_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/reversal_api.rb b/lib/cybersource_rest_client/api/reversal_api.rb index 43dae37d..7c807a63 100644 --- a/lib/cybersource_rest_client/api/reversal_api.rb +++ b/lib/cybersource_rest_client/api/reversal_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class ReversalApi attr_accessor :api_client @@ -76,6 +76,10 @@ def auth_reversal_with_http_info(id, auth_reversal_request, opts = {}) post_body = @api_client.object_to_http_body(auth_reversal_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AuthReversalRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["auth_reversal","auth_reversal_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -145,6 +149,10 @@ def mit_reversal_with_http_info(mit_reversal_request, opts = {}) post_body = @api_client.object_to_http_body(mit_reversal_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MitReversalRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["mit_reversal","mit_reversal_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/search_transactions_api.rb b/lib/cybersource_rest_client/api/search_transactions_api.rb index 1d799034..ee7e8529 100644 --- a/lib/cybersource_rest_client/api/search_transactions_api.rb +++ b/lib/cybersource_rest_client/api/search_transactions_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class SearchTransactionsApi attr_accessor :api_client @@ -70,6 +70,10 @@ def create_search_with_http_info(create_search_request, opts = {}) post_body = @api_client.object_to_http_body(create_search_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateSearchRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_search","create_search_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -141,6 +145,10 @@ def get_search_with_http_info(search_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_search","get_search_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/secure_file_share_api.rb b/lib/cybersource_rest_client/api/secure_file_share_api.rb index a1b27c23..12069f91 100644 --- a/lib/cybersource_rest_client/api/secure_file_share_api.rb +++ b/lib/cybersource_rest_client/api/secure_file_share_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class SecureFileShareApi attr_accessor :api_client @@ -79,6 +79,10 @@ def get_file_with_http_info(file_id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_file","get_file_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -171,6 +175,10 @@ def get_file_detail_with_http_info(start_date, end_date, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_file_detail","get_file_detail_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/subscriptions_api.rb b/lib/cybersource_rest_client/api/subscriptions_api.rb index e2ff9b7a..8906b003 100644 --- a/lib/cybersource_rest_client/api/subscriptions_api.rb +++ b/lib/cybersource_rest_client/api/subscriptions_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class SubscriptionsApi attr_accessor :api_client @@ -72,6 +72,10 @@ def activate_subscription_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["activate_subscription","activate_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -143,6 +147,10 @@ def cancel_subscription_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["cancel_subscription","cancel_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -212,6 +220,10 @@ def create_subscription_with_http_info(create_subscription_request, opts = {}) post_body = @api_client.object_to_http_body(create_subscription_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateSubscriptionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["create_subscription","create_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -289,6 +301,10 @@ def get_all_subscriptions_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_all_subscriptions","get_all_subscriptions_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -360,6 +376,10 @@ def get_subscription_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_subscription","get_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -425,6 +445,10 @@ def get_subscription_code_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_subscription_code","get_subscription_code_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -496,6 +520,10 @@ def suspend_subscription_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["suspend_subscription","suspend_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -571,6 +599,10 @@ def update_subscription_with_http_info(id, update_subscription, opts = {}) post_body = @api_client.object_to_http_body(update_subscription) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UpdateSubscription', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["update_subscription","update_subscription_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/taxes_api.rb b/lib/cybersource_rest_client/api/taxes_api.rb index 0a9a9d09..42f33f96 100644 --- a/lib/cybersource_rest_client/api/taxes_api.rb +++ b/lib/cybersource_rest_client/api/taxes_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class TaxesApi attr_accessor :api_client @@ -70,6 +70,10 @@ def calculate_tax_with_http_info(tax_request, opts = {}) post_body = @api_client.object_to_http_body(tax_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'TaxRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["calculate_tax","calculate_tax_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -145,6 +149,10 @@ def void_tax_with_http_info(void_tax_request, id, opts = {}) post_body = @api_client.object_to_http_body(void_tax_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'VoidTaxRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["void_tax","void_tax_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/token_api.rb b/lib/cybersource_rest_client/api/token_api.rb index 7e2694c6..57fc2787 100644 --- a/lib/cybersource_rest_client/api/token_api.rb +++ b/lib/cybersource_rest_client/api/token_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class TokenApi attr_accessor :api_client @@ -79,6 +79,10 @@ def post_token_payment_credentials_with_http_info(token_id, post_payment_credent post_body = @api_client.object_to_http_body(post_payment_credentials_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostPaymentCredentialsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["post_token_payment_credentials","post_token_payment_credentials_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/transaction_batches_api.rb b/lib/cybersource_rest_client/api/transaction_batches_api.rb index 39c77d5c..6aea4af4 100644 --- a/lib/cybersource_rest_client/api/transaction_batches_api.rb +++ b/lib/cybersource_rest_client/api/transaction_batches_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class TransactionBatchesApi attr_accessor :api_client @@ -78,6 +78,10 @@ def get_transaction_batch_details_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_transaction_batch_details","get_transaction_batch_details_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -148,6 +152,10 @@ def get_transaction_batch_id_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_transaction_batch_id","get_transaction_batch_id_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -227,6 +235,10 @@ def get_transaction_batches_with_http_info(start_time, end_time, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_transaction_batches","get_transaction_batches_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/transaction_details_api.rb b/lib/cybersource_rest_client/api/transaction_details_api.rb index 29c58bd3..b726a6ed 100644 --- a/lib/cybersource_rest_client/api/transaction_details_api.rb +++ b/lib/cybersource_rest_client/api/transaction_details_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class TransactionDetailsApi attr_accessor :api_client @@ -72,6 +72,10 @@ def get_transaction_with_http_info(id, opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_transaction","get_transaction_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/transient_token_data_api.rb b/lib/cybersource_rest_client/api/transient_token_data_api.rb index 0e83b851..60462ed2 100644 --- a/lib/cybersource_rest_client/api/transient_token_data_api.rb +++ b/lib/cybersource_rest_client/api/transient_token_data_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class TransientTokenDataApi attr_accessor :api_client @@ -72,6 +72,10 @@ def get_payment_credentials_for_transient_token_with_http_info(payment_credentia else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_payment_credentials_for_transient_token","get_payment_credentials_for_transient_token_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, @@ -143,6 +147,10 @@ def get_transaction_for_transient_token_with_http_info(transient_token, opts = { else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_transaction_for_transient_token","get_transaction_for_transient_token_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb b/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb index 43a12de3..984a957a 100644 --- a/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb +++ b/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class UnifiedCheckoutCaptureContextApi attr_accessor :api_client @@ -70,6 +70,10 @@ def generate_unified_checkout_capture_context_with_http_info(generate_unified_ch post_body = @api_client.object_to_http_body(generate_unified_checkout_capture_context_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'GenerateUnifiedCheckoutCaptureContextRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["generate_unified_checkout_capture_context","generate_unified_checkout_capture_context_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/user_management_api.rb b/lib/cybersource_rest_client/api/user_management_api.rb index 9164a2aa..daa77e4d 100644 --- a/lib/cybersource_rest_client/api/user_management_api.rb +++ b/lib/cybersource_rest_client/api/user_management_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class UserManagementApi attr_accessor :api_client @@ -78,6 +78,10 @@ def get_users_with_http_info(opts = {}) else post_body = nil end + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["get_users","get_users_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/user_management_search_api.rb b/lib/cybersource_rest_client/api/user_management_search_api.rb index 6508e038..fc7b26b7 100644 --- a/lib/cybersource_rest_client/api/user_management_search_api.rb +++ b/lib/cybersource_rest_client/api/user_management_search_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class UserManagementSearchApi attr_accessor :api_client @@ -70,6 +70,10 @@ def search_users_with_http_info(search_request, opts = {}) post_body = @api_client.object_to_http_body(search_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'SearchRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["search_users","search_users_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/verification_api.rb b/lib/cybersource_rest_client/api/verification_api.rb index 3299ee12..85551f38 100644 --- a/lib/cybersource_rest_client/api/verification_api.rb +++ b/lib/cybersource_rest_client/api/verification_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class VerificationApi attr_accessor :api_client @@ -70,6 +70,10 @@ def validate_export_compliance_with_http_info(validate_export_compliance_request post_body = @api_client.object_to_http_body(validate_export_compliance_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'ValidateExportComplianceRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["validate_export_compliance","validate_export_compliance_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -139,6 +143,10 @@ def verify_customer_address_with_http_info(verify_customer_address_request, opts post_body = @api_client.object_to_http_body(verify_customer_address_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'VerifyCustomerAddressRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = false + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["verify_customer_address","verify_customer_address_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/api/void_api.rb b/lib/cybersource_rest_client/api/void_api.rb index 1b857d40..c45ebec0 100644 --- a/lib/cybersource_rest_client/api/void_api.rb +++ b/lib/cybersource_rest_client/api/void_api.rb @@ -10,7 +10,7 @@ =end require 'uri' - +require 'AuthenticationSDK/util/MLEUtility' module CyberSource class VoidApi attr_accessor :api_client @@ -70,6 +70,10 @@ def mit_void_with_http_info(mit_void_request, opts = {}) post_body = @api_client.object_to_http_body(mit_void_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MitVoidRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["mit_void","mit_void_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -145,6 +149,10 @@ def void_capture_with_http_info(void_capture_request, id, opts = {}) post_body = @api_client.object_to_http_body(void_capture_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'VoidCaptureRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["void_capture","void_capture_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -220,6 +228,10 @@ def void_credit_with_http_info(void_credit_request, id, opts = {}) post_body = @api_client.object_to_http_body(void_credit_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'VoidCreditRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["void_credit","void_credit_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -295,6 +307,10 @@ def void_payment_with_http_info(void_payment_request, id, opts = {}) post_body = @api_client.object_to_http_body(void_payment_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'VoidPaymentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["void_payment","void_payment_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, @@ -370,6 +386,10 @@ def void_refund_with_http_info(void_refund_request, id, opts = {}) post_body = @api_client.object_to_http_body(void_refund_request) sdk_tracker = SdkTracker.new post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'VoidRefundRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId) + is_mle_supported_by_cybs_for_api = true + if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, is_mle_supported_by_cybs_for_api, ["void_refund","void_refund_with_http_info"]) + post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body) + end auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, diff --git a/lib/cybersource_rest_client/models/commerce_solutions_products_token_management_configuration_information_configurations.rb b/lib/cybersource_rest_client/models/commerce_solutions_products_token_management_configuration_information_configurations.rb index c0352251..2833d736 100644 --- a/lib/cybersource_rest_client/models/commerce_solutions_products_token_management_configuration_information_configurations.rb +++ b/lib/cybersource_rest_client/models/commerce_solutions_products_token_management_configuration_information_configurations.rb @@ -18,11 +18,14 @@ class CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurat attr_accessor :vault + attr_accessor :network_token_enrollment + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'parent_profile_id' => :'parentProfileId', - :'vault' => :'vault' + :'vault' => :'vault', + :'network_token_enrollment' => :'networkTokenEnrollment' } end @@ -30,7 +33,8 @@ def self.attribute_map def self.json_map { :'parent_profile_id' => :'parent_profile_id', - :'vault' => :'vault' + :'vault' => :'vault', + :'network_token_enrollment' => :'network_token_enrollment' } end @@ -38,7 +42,8 @@ def self.json_map def self.swagger_types { :'parent_profile_id' => :'String', - :'vault' => :'CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault' + :'vault' => :'CommerceSolutionsProductsTokenManagementConfigurationInformationConfigurationsVault', + :'network_token_enrollment' => :'NetworkTokenEnrollment' } end @@ -57,6 +62,10 @@ def initialize(attributes = {}) if attributes.has_key?(:'vault') self.vault = attributes[:'vault'] end + + if attributes.has_key?(:'networkTokenEnrollment') + self.network_token_enrollment = attributes[:'networkTokenEnrollment'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -78,7 +87,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && parent_profile_id == o.parent_profile_id && - vault == o.vault + vault == o.vault && + network_token_enrollment == o.network_token_enrollment end # @see the `==` method @@ -90,7 +100,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [parent_profile_id, vault].hash + [parent_profile_id, vault, network_token_enrollment].hash end # Builds the object from hash diff --git a/lib/cybersource_rest_client/models/generate_capture_context_request.rb b/lib/cybersource_rest_client/models/generate_capture_context_request.rb index 7cc66ae6..b1855e42 100644 --- a/lib/cybersource_rest_client/models/generate_capture_context_request.rb +++ b/lib/cybersource_rest_client/models/generate_capture_context_request.rb @@ -20,19 +20,22 @@ class GenerateCaptureContextRequest # 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

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\" ] attr_accessor :target_origins - # 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. attr_accessor :allowed_card_networks # The payment types that are allowed for the merchant. Possible values when launching Microform: - CARD - CHECK

attr_accessor :allowed_payment_types + attr_accessor :transient_token_response_options + # Attribute mapping from ruby-style variable name to JSON key. def self.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' } end @@ -42,7 +45,8 @@ def self.json_map :'client_version' => :'client_version', :'target_origins' => :'target_origins', :'allowed_card_networks' => :'allowed_card_networks', - :'allowed_payment_types' => :'allowed_payment_types' + :'allowed_payment_types' => :'allowed_payment_types', + :'transient_token_response_options' => :'transient_token_response_options' } end @@ -52,7 +56,8 @@ def self.swagger_types :'client_version' => :'String', :'target_origins' => :'Array', :'allowed_card_networks' => :'Array', - :'allowed_payment_types' => :'Array' + :'allowed_payment_types' => :'Array', + :'transient_token_response_options' => :'Microformv2sessionsTransientTokenResponseOptions' } end @@ -85,6 +90,10 @@ def initialize(attributes = {}) self.allowed_payment_types = value end end + + if attributes.has_key?(:'transientTokenResponseOptions') + self.transient_token_response_options = attributes[:'transientTokenResponseOptions'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -108,7 +117,8 @@ def ==(o) client_version == o.client_version && target_origins == o.target_origins && allowed_card_networks == o.allowed_card_networks && - allowed_payment_types == o.allowed_payment_types + allowed_payment_types == o.allowed_payment_types && + transient_token_response_options == o.transient_token_response_options end # @see the `==` method @@ -120,7 +130,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [client_version, target_origins, allowed_card_networks, allowed_payment_types].hash + [client_version, target_origins, allowed_card_networks, allowed_payment_types, transient_token_response_options].hash end # Builds the object from hash diff --git a/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb b/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb index 732e4bfc..2271ae6f 100644 --- a/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +++ b/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb @@ -35,6 +35,8 @@ class GenerateUnifiedCheckoutCaptureContextRequest attr_accessor :order_information + attr_accessor :transient_token_response_options + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -45,7 +47,8 @@ def self.attribute_map :'country' => :'country', :'locale' => :'locale', :'capture_mandate' => :'captureMandate', - :'order_information' => :'orderInformation' + :'order_information' => :'orderInformation', + :'transient_token_response_options' => :'transientTokenResponseOptions' } end @@ -59,7 +62,8 @@ def self.json_map :'country' => :'country', :'locale' => :'locale', :'capture_mandate' => :'capture_mandate', - :'order_information' => :'order_information' + :'order_information' => :'order_information', + :'transient_token_response_options' => :'transient_token_response_options' } end @@ -73,7 +77,8 @@ def self.swagger_types :'country' => :'String', :'locale' => :'String', :'capture_mandate' => :'Upv1capturecontextsCaptureMandate', - :'order_information' => :'Upv1capturecontextsOrderInformation' + :'order_information' => :'Upv1capturecontextsOrderInformation', + :'transient_token_response_options' => :'Microformv2sessionsTransientTokenResponseOptions' } end @@ -122,6 +127,10 @@ def initialize(attributes = {}) if attributes.has_key?(:'orderInformation') self.order_information = attributes[:'orderInformation'] end + + if attributes.has_key?(:'transientTokenResponseOptions') + self.transient_token_response_options = attributes[:'transientTokenResponseOptions'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -161,7 +170,8 @@ def ==(o) country == o.country && locale == o.locale && capture_mandate == o.capture_mandate && - order_information == o.order_information + order_information == o.order_information && + transient_token_response_options == o.transient_token_response_options end # @see the `==` method @@ -173,7 +183,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [client_version, target_origins, allowed_card_networks, allowed_payment_types, country, locale, capture_mandate, order_information].hash + [client_version, target_origins, allowed_card_networks, allowed_payment_types, country, locale, capture_mandate, order_information, transient_token_response_options].hash end # Builds the object from hash diff --git a/lib/cybersource_rest_client/models/microformv2sessions_transient_token_response_options.rb b/lib/cybersource_rest_client/models/microformv2sessions_transient_token_response_options.rb new file mode 100644 index 00000000..3a170ba1 --- /dev/null +++ b/lib/cybersource_rest_client/models/microformv2sessions_transient_token_response_options.rb @@ -0,0 +1,190 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class 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. + attr_accessor :include_card_prefix + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'include_card_prefix' => :'includeCardPrefix' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'include_card_prefix' => :'include_card_prefix' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'include_card_prefix' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'includeCardPrefix') + self.include_card_prefix = attributes[:'includeCardPrefix'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + include_card_prefix == o.include_card_prefix + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [include_card_prefix].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/network_token_enrollment.rb b/lib/cybersource_rest_client/models/network_token_enrollment.rb new file mode 100644 index 00000000..716e4fc8 --- /dev/null +++ b/lib/cybersource_rest_client/models/network_token_enrollment.rb @@ -0,0 +1,199 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class NetworkTokenEnrollment + attr_accessor :business_information + + attr_accessor :network_token_services + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'business_information' => :'businessInformation', + :'network_token_services' => :'networkTokenServices' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'business_information' => :'business_information', + :'network_token_services' => :'network_token_services' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'business_information' => :'TmsBusinessInformation', + :'network_token_services' => :'NetworkTokenServicesEnablement' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'businessInformation') + self.business_information = attributes[:'businessInformation'] + end + + if attributes.has_key?(:'networkTokenServices') + self.network_token_services = attributes[:'networkTokenServices'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + business_information == o.business_information && + network_token_services == o.network_token_services + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [business_information, network_token_services].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/network_token_services_enablement.rb b/lib/cybersource_rest_client/models/network_token_services_enablement.rb new file mode 100644 index 00000000..39901dc8 --- /dev/null +++ b/lib/cybersource_rest_client/models/network_token_services_enablement.rb @@ -0,0 +1,199 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class NetworkTokenServicesEnablement + attr_accessor :visa_token_service + + attr_accessor :mastercard_digital_enablement_service + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'visa_token_service' => :'visaTokenService', + :'mastercard_digital_enablement_service' => :'mastercardDigitalEnablementService' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'visa_token_service' => :'visa_token_service', + :'mastercard_digital_enablement_service' => :'mastercard_digital_enablement_service' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'visa_token_service' => :'NetworkTokenServicesEnablementVisaTokenService', + :'mastercard_digital_enablement_service' => :'NetworkTokenServicesEnablementMastercardDigitalEnablementService' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'visaTokenService') + self.visa_token_service = attributes[:'visaTokenService'] + end + + if attributes.has_key?(:'mastercardDigitalEnablementService') + self.mastercard_digital_enablement_service = attributes[:'mastercardDigitalEnablementService'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + visa_token_service == o.visa_token_service && + mastercard_digital_enablement_service == o.mastercard_digital_enablement_service + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [visa_token_service, mastercard_digital_enablement_service].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/network_token_services_enablement_mastercard_digital_enablement_service.rb b/lib/cybersource_rest_client/models/network_token_services_enablement_mastercard_digital_enablement_service.rb new file mode 100644 index 00000000..aa45a1e1 --- /dev/null +++ b/lib/cybersource_rest_client/models/network_token_services_enablement_mastercard_digital_enablement_service.rb @@ -0,0 +1,190 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class NetworkTokenServicesEnablementMastercardDigitalEnablementService + # Indicates if an enrollment to create a TRID for the MasterCard card association should be attempted + attr_accessor :enrollment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enrollment' => :'enrollment' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'enrollment' => :'enrollment' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'enrollment' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'enrollment') + self.enrollment = attributes[:'enrollment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enrollment == o.enrollment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [enrollment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/network_token_services_enablement_visa_token_service.rb b/lib/cybersource_rest_client/models/network_token_services_enablement_visa_token_service.rb new file mode 100644 index 00000000..6d5b0134 --- /dev/null +++ b/lib/cybersource_rest_client/models/network_token_services_enablement_visa_token_service.rb @@ -0,0 +1,190 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class NetworkTokenServicesEnablementVisaTokenService + # Indicates if an enrollment to create a TRID for the Visa card association should be attempted + attr_accessor :enrollment + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enrollment' => :'enrollment' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'enrollment' => :'enrollment' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'enrollment' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'enrollment') + self.enrollment = attributes[:'enrollment'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enrollment == o.enrollment + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [enrollment].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/tms_business_information.rb b/lib/cybersource_rest_client/models/tms_business_information.rb new file mode 100644 index 00000000..b0914c02 --- /dev/null +++ b/lib/cybersource_rest_client/models/tms_business_information.rb @@ -0,0 +1,311 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class TmsBusinessInformation + # Name of the network token merchant. + attr_accessor :name + + # Name the network token merchant does business as + attr_accessor :doing_business_as + + attr_accessor :address + + # Website of network token merchant. + attr_accessor :website_url + + # The Identifier associated with the business type; required unless both acquirerId and acquirerMerchantId are provided. + attr_accessor :business_identification_type + + # The value associated with the business identifier type; required unless both acquirerId and acquirerMerchantId are provided. + attr_accessor :business_identification_value + + attr_accessor :acquirer + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'doing_business_as' => :'doingBusinessAs', + :'address' => :'address', + :'website_url' => :'websiteUrl', + :'business_identification_type' => :'businessIdentificationType', + :'business_identification_value' => :'businessIdentificationValue', + :'acquirer' => :'acquirer' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'name' => :'name', + :'doing_business_as' => :'doing_business_as', + :'address' => :'address', + :'website_url' => :'website_url', + :'business_identification_type' => :'business_identification_type', + :'business_identification_value' => :'business_identification_value', + :'acquirer' => :'acquirer' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String', + :'doing_business_as' => :'String', + :'address' => :'TmsBusinessInformationAddress', + :'website_url' => :'String', + :'business_identification_type' => :'String', + :'business_identification_value' => :'String', + :'acquirer' => :'TmsBusinessInformationAcquirer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'doingBusinessAs') + self.doing_business_as = attributes[:'doingBusinessAs'] + end + + if attributes.has_key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.has_key?(:'websiteUrl') + self.website_url = attributes[:'websiteUrl'] + end + + if attributes.has_key?(:'businessIdentificationType') + self.business_identification_type = attributes[:'businessIdentificationType'] + end + + if attributes.has_key?(:'businessIdentificationValue') + self.business_identification_value = attributes[:'businessIdentificationValue'] + end + + if attributes.has_key?(:'acquirer') + self.acquirer = attributes[:'acquirer'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + #if !@name.nil? && @name !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/) + #invalid_properties.push('invalid value for "name", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.') + #end + + #if !@doing_business_as.nil? && @doing_business_as !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/) + #invalid_properties.push('invalid value for "doing_business_as", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.') + #end + + #if !@website_url.nil? && @website_url !~ Regexp.new(/\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“â€.‘’]))/) + #invalid_properties.push('invalid value for "website_url", must conform to the pattern /\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“â€.‘’]))/.') + #end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + #return false if !@name.nil? && @name !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/) + #return false if !@doing_business_as.nil? && @doing_business_as !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/) + #return false if !@website_url.nil? && @website_url !~ Regexp.new(/\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“â€.‘’]))/) + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + #if !name.nil? && name !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/) + #fail ArgumentError, 'invalid value for "name", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.' + #end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] doing_business_as Value to be assigned + def doing_business_as=(doing_business_as) + #if !doing_business_as.nil? && doing_business_as !~ Regexp.new(/^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/) + #fail ArgumentError, 'invalid value for "doing_business_as", must conform to the pattern /^[0-9a-zA-Z _\\-\\+\\.\\*\\\"\/'&\\,\\(\\)!$;:?@\\#¡-￿]+$/.' + #end + + @doing_business_as = doing_business_as + end + + # Custom attribute writer method with validation + # @param [Object] website_url Value to be assigned + def website_url=(website_url) + #if !website_url.nil? && website_url !~ Regexp.new(/\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“â€.‘’]))/) + #fail ArgumentError, 'invalid value for "website_url", must conform to the pattern /\\b((?:https?:\/\/|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“â€.‘’]))/.' + #end + + @website_url = website_url + end + + # Custom attribute writer method with validation + # @param [Object] business_identification_type Value to be assigned + def business_identification_type=(business_identification_type) + @business_identification_type = business_identification_type + end + + # Custom attribute writer method with validation + # @param [Object] business_identification_value Value to be assigned + def business_identification_value=(business_identification_value) + @business_identification_value = business_identification_value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + doing_business_as == o.doing_business_as && + address == o.address && + website_url == o.website_url && + business_identification_type == o.business_identification_type && + business_identification_value == o.business_identification_value && + acquirer == o.acquirer + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, doing_business_as, address, website_url, business_identification_type, business_identification_value, acquirer].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/tms_business_information_acquirer.rb b/lib/cybersource_rest_client/models/tms_business_information_acquirer.rb new file mode 100644 index 00000000..080acef7 --- /dev/null +++ b/lib/cybersource_rest_client/models/tms_business_information_acquirer.rb @@ -0,0 +1,213 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class TmsBusinessInformationAcquirer + # Acquirer ID; required unless both businessIdentificationType and businessIdentificationValue are provided. + attr_accessor :acquirer_id + + # Acquirer merchant ID; required unless both businessIdentificationType and businessIdentificationValue are provided. + attr_accessor :acquirer_merchant_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'acquirer_id' => :'acquirerId', + :'acquirer_merchant_id' => :'acquirerMerchantId' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'acquirer_id' => :'acquirer_id', + :'acquirer_merchant_id' => :'acquirer_merchant_id' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'acquirer_id' => :'String', + :'acquirer_merchant_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'acquirerId') + self.acquirer_id = attributes[:'acquirerId'] + end + + if attributes.has_key?(:'acquirerMerchantId') + self.acquirer_merchant_id = attributes[:'acquirerMerchantId'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Custom attribute writer method with validation + # @param [Object] acquirer_id Value to be assigned + def acquirer_id=(acquirer_id) + @acquirer_id = acquirer_id + end + + # Custom attribute writer method with validation + # @param [Object] acquirer_merchant_id Value to be assigned + def acquirer_merchant_id=(acquirer_merchant_id) + @acquirer_merchant_id = acquirer_merchant_id + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + acquirer_id == o.acquirer_id && + acquirer_merchant_id == o.acquirer_merchant_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [acquirer_id, acquirer_merchant_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/tms_business_information_address.rb b/lib/cybersource_rest_client/models/tms_business_information_address.rb new file mode 100644 index 00000000..2b0f7131 --- /dev/null +++ b/lib/cybersource_rest_client/models/tms_business_information_address.rb @@ -0,0 +1,231 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'date' + +module CyberSource + class TmsBusinessInformationAddress + # Country of network token merchant. + attr_accessor :country + + # City of network token merchant. + attr_accessor :locality + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'country' => :'country', + :'locality' => :'locality' + } + end + + # Attribute mapping from JSON key to ruby-style variable name. + def self.json_map + { + :'country' => :'country', + :'locality' => :'locality' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'country' => :'String', + :'locality' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'country') + self.country = attributes[:'country'] + end + + if attributes.has_key?(:'locality') + self.locality = attributes[:'locality'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + #if !@country.nil? && @country !~ Regexp.new(/^[À-ÖØ-öø-ǿa-zA-Z0-9().\\-_#,;\/@$:!% ]{1,}$/) + #invalid_properties.push('invalid value for "country", must conform to the pattern /^[À-ÖØ-öø-ǿa-zA-Z0-9().\\-_#,;\/@$:!% ]{1,}$/.') + #end + + #if !@locality.nil? && @locality !~ Regexp.new(/^[0-9a-zA-Z _\\-¡-￿]+$/) + #invalid_properties.push('invalid value for "locality", must conform to the pattern /^[0-9a-zA-Z _\\-¡-￿]+$/.') + #end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + #return false if !@country.nil? && @country !~ Regexp.new(/^[À-ÖØ-öø-ǿa-zA-Z0-9().\\-_#,;\/@$:!% ]{1,}$/) + #return false if !@locality.nil? && @locality !~ Regexp.new(/^[0-9a-zA-Z _\\-¡-￿]+$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] country Value to be assigned + def country=(country) + #if !country.nil? && country !~ Regexp.new(/^[À-ÖØ-öø-ǿa-zA-Z0-9().\\-_#,;\/@$:!% ]{1,}$/) + #fail ArgumentError, 'invalid value for "country", must conform to the pattern /^[À-ÖØ-öø-ǿa-zA-Z0-9().\\-_#,;\/@$:!% ]{1,}$/.' + #end + + @country = country + end + + # Custom attribute writer method with validation + # @param [Object] locality Value to be assigned + def locality=(locality) + #if !locality.nil? && locality !~ Regexp.new(/^[0-9a-zA-Z _\\-¡-￿]+$/) + #fail ArgumentError, 'invalid value for "locality", must conform to the pattern /^[0-9a-zA-Z _\\-¡-￿]+$/.' + #end + + @locality = locality + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + country == o.country && + locality == o.locality + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [country, locality].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CyberSource.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb b/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb index 76359ec6..3a1950f2 100644 --- a/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb +++ b/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb @@ -31,6 +31,12 @@ class Upv1capturecontextsCaptureMandate # Configure Unified Checkout to display the list of accepted card networks beneath the payment button Possible values: - True - False attr_accessor :show_accepted_network_icons + # 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. + attr_accessor :request_save_card + + # 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. + attr_accessor :combo_card + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -39,7 +45,9 @@ def self.attribute_map :'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' } end @@ -51,7 +59,9 @@ def self.json_map :'request_phone' => :'request_phone', :'request_shipping' => :'request_shipping', :'ship_to_countries' => :'ship_to_countries', - :'show_accepted_network_icons' => :'show_accepted_network_icons' + :'show_accepted_network_icons' => :'show_accepted_network_icons', + :'request_save_card' => :'request_save_card', + :'combo_card' => :'combo_card' } end @@ -63,7 +73,9 @@ def self.swagger_types :'request_phone' => :'BOOLEAN', :'request_shipping' => :'BOOLEAN', :'ship_to_countries' => :'Array', - :'show_accepted_network_icons' => :'BOOLEAN' + :'show_accepted_network_icons' => :'BOOLEAN', + :'request_save_card' => :'BOOLEAN', + :'combo_card' => :'BOOLEAN' } end @@ -100,6 +112,14 @@ def initialize(attributes = {}) if attributes.has_key?(:'showAcceptedNetworkIcons') self.show_accepted_network_icons = attributes[:'showAcceptedNetworkIcons'] end + + if attributes.has_key?(:'requestSaveCard') + self.request_save_card = attributes[:'requestSaveCard'] + end + + if attributes.has_key?(:'comboCard') + self.combo_card = attributes[:'comboCard'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -131,7 +151,9 @@ def ==(o) request_phone == o.request_phone && request_shipping == o.request_shipping && ship_to_countries == o.ship_to_countries && - show_accepted_network_icons == o.show_accepted_network_icons + show_accepted_network_icons == o.show_accepted_network_icons && + request_save_card == o.request_save_card && + combo_card == o.combo_card end # @see the `==` method @@ -143,7 +165,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [billing_type, request_email, request_phone, request_shipping, ship_to_countries, show_accepted_network_icons].hash + [billing_type, request_email, request_phone, request_shipping, ship_to_countries, show_accepted_network_icons, request_save_card, combo_card].hash end # Builds the object from hash diff --git a/spec/models/commerce_solutions_products_token_management_configuration_information_configurations_spec.rb b/spec/models/commerce_solutions_products_token_management_configuration_information_configurations_spec.rb index c5e1ed26..4e7430ee 100644 --- a/spec/models/commerce_solutions_products_token_management_configuration_information_configurations_spec.rb +++ b/spec/models/commerce_solutions_products_token_management_configuration_information_configurations_spec.rb @@ -43,4 +43,10 @@ end end + describe 'test attribute "network_token_enrollment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/generate_capture_context_request_spec.rb b/spec/models/generate_capture_context_request_spec.rb index 1c1f3361..46e487f2 100644 --- a/spec/models/generate_capture_context_request_spec.rb +++ b/spec/models/generate_capture_context_request_spec.rb @@ -55,4 +55,10 @@ end end + describe 'test attribute "transient_token_response_options"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/generate_unified_checkout_capture_context_request_spec.rb b/spec/models/generate_unified_checkout_capture_context_request_spec.rb index 4d554088..2047e3b4 100644 --- a/spec/models/generate_unified_checkout_capture_context_request_spec.rb +++ b/spec/models/generate_unified_checkout_capture_context_request_spec.rb @@ -79,4 +79,10 @@ end end + describe 'test attribute "transient_token_response_options"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/microformv2sessions_transient_token_response_options_spec.rb b/spec/models/microformv2sessions_transient_token_response_options_spec.rb new file mode 100644 index 00000000..5e4d45c4 --- /dev/null +++ b/spec/models/microformv2sessions_transient_token_response_options_spec.rb @@ -0,0 +1,40 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::Microformv2sessionsTransientTokenResponseOptions +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'Microformv2sessionsTransientTokenResponseOptions' do + before do + # run before each test + @instance = CyberSource::Microformv2sessionsTransientTokenResponseOptions.new + end + + after do + # run after each test + end + + describe 'test an instance of Microformv2sessionsTransientTokenResponseOptions' do + it 'should create an instance of Microformv2sessionsTransientTokenResponseOptions' do + expect(@instance).to be_instance_of(CyberSource::Microformv2sessionsTransientTokenResponseOptions) + end + end + describe 'test attribute "include_card_prefix"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/network_token_enrollment_spec.rb b/spec/models/network_token_enrollment_spec.rb new file mode 100644 index 00000000..5ed15a0e --- /dev/null +++ b/spec/models/network_token_enrollment_spec.rb @@ -0,0 +1,46 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::NetworkTokenEnrollment +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'NetworkTokenEnrollment' do + before do + # run before each test + @instance = CyberSource::NetworkTokenEnrollment.new + end + + after do + # run after each test + end + + describe 'test an instance of NetworkTokenEnrollment' do + it 'should create an instance of NetworkTokenEnrollment' do + expect(@instance).to be_instance_of(CyberSource::NetworkTokenEnrollment) + end + end + describe 'test attribute "business_information"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "network_token_services"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/network_token_services_enablement_mastercard_digital_enablement_service_spec.rb b/spec/models/network_token_services_enablement_mastercard_digital_enablement_service_spec.rb new file mode 100644 index 00000000..5562447e --- /dev/null +++ b/spec/models/network_token_services_enablement_mastercard_digital_enablement_service_spec.rb @@ -0,0 +1,40 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::NetworkTokenServicesEnablementMastercardDigitalEnablementService +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'NetworkTokenServicesEnablementMastercardDigitalEnablementService' do + before do + # run before each test + @instance = CyberSource::NetworkTokenServicesEnablementMastercardDigitalEnablementService.new + end + + after do + # run after each test + end + + describe 'test an instance of NetworkTokenServicesEnablementMastercardDigitalEnablementService' do + it 'should create an instance of NetworkTokenServicesEnablementMastercardDigitalEnablementService' do + expect(@instance).to be_instance_of(CyberSource::NetworkTokenServicesEnablementMastercardDigitalEnablementService) + end + end + describe 'test attribute "enrollment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/network_token_services_enablement_spec.rb b/spec/models/network_token_services_enablement_spec.rb new file mode 100644 index 00000000..e7c65a43 --- /dev/null +++ b/spec/models/network_token_services_enablement_spec.rb @@ -0,0 +1,46 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::NetworkTokenServicesEnablement +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'NetworkTokenServicesEnablement' do + before do + # run before each test + @instance = CyberSource::NetworkTokenServicesEnablement.new + end + + after do + # run after each test + end + + describe 'test an instance of NetworkTokenServicesEnablement' do + it 'should create an instance of NetworkTokenServicesEnablement' do + expect(@instance).to be_instance_of(CyberSource::NetworkTokenServicesEnablement) + end + end + describe 'test attribute "visa_token_service"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mastercard_digital_enablement_service"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/network_token_services_enablement_visa_token_service_spec.rb b/spec/models/network_token_services_enablement_visa_token_service_spec.rb new file mode 100644 index 00000000..f00c4ab4 --- /dev/null +++ b/spec/models/network_token_services_enablement_visa_token_service_spec.rb @@ -0,0 +1,40 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::NetworkTokenServicesEnablementVisaTokenService +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'NetworkTokenServicesEnablementVisaTokenService' do + before do + # run before each test + @instance = CyberSource::NetworkTokenServicesEnablementVisaTokenService.new + end + + after do + # run after each test + end + + describe 'test an instance of NetworkTokenServicesEnablementVisaTokenService' do + it 'should create an instance of NetworkTokenServicesEnablementVisaTokenService' do + expect(@instance).to be_instance_of(CyberSource::NetworkTokenServicesEnablementVisaTokenService) + end + end + describe 'test attribute "enrollment"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/tms_business_information_acquirer_spec.rb b/spec/models/tms_business_information_acquirer_spec.rb new file mode 100644 index 00000000..1487553d --- /dev/null +++ b/spec/models/tms_business_information_acquirer_spec.rb @@ -0,0 +1,46 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::TmsBusinessInformationAcquirer +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'TmsBusinessInformationAcquirer' do + before do + # run before each test + @instance = CyberSource::TmsBusinessInformationAcquirer.new + end + + after do + # run after each test + end + + describe 'test an instance of TmsBusinessInformationAcquirer' do + it 'should create an instance of TmsBusinessInformationAcquirer' do + expect(@instance).to be_instance_of(CyberSource::TmsBusinessInformationAcquirer) + end + end + describe 'test attribute "acquirer_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "acquirer_merchant_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/tms_business_information_address_spec.rb b/spec/models/tms_business_information_address_spec.rb new file mode 100644 index 00000000..37f4812f --- /dev/null +++ b/spec/models/tms_business_information_address_spec.rb @@ -0,0 +1,46 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::TmsBusinessInformationAddress +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'TmsBusinessInformationAddress' do + before do + # run before each test + @instance = CyberSource::TmsBusinessInformationAddress.new + end + + after do + # run after each test + end + + describe 'test an instance of TmsBusinessInformationAddress' do + it 'should create an instance of TmsBusinessInformationAddress' do + expect(@instance).to be_instance_of(CyberSource::TmsBusinessInformationAddress) + end + end + describe 'test attribute "country"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "locality"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/tms_business_information_spec.rb b/spec/models/tms_business_information_spec.rb new file mode 100644 index 00000000..83ae98c7 --- /dev/null +++ b/spec/models/tms_business_information_spec.rb @@ -0,0 +1,76 @@ +=begin +#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 +Swagger Codegen version: 2.4.38 +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CyberSource::TmsBusinessInformation +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'TmsBusinessInformation' do + before do + # run before each test + @instance = CyberSource::TmsBusinessInformation.new + end + + after do + # run after each test + end + + describe 'test an instance of TmsBusinessInformation' do + it 'should create an instance of TmsBusinessInformation' do + expect(@instance).to be_instance_of(CyberSource::TmsBusinessInformation) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "doing_business_as"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "address"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "website_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "business_identification_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "business_identification_value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "acquirer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/upv1capturecontexts_capture_mandate_spec.rb b/spec/models/upv1capturecontexts_capture_mandate_spec.rb index 487d9cb7..4e4ae254 100644 --- a/spec/models/upv1capturecontexts_capture_mandate_spec.rb +++ b/spec/models/upv1capturecontexts_capture_mandate_spec.rb @@ -67,4 +67,16 @@ end end + describe 'test attribute "request_save_card"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "combo_card"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end From c52ab5676ed7117d39101fb64434cb9cfcda31bc Mon Sep 17 00:00:00 2001 From: gnongsie Date: Fri, 21 Mar 2025 15:52:12 +0530 Subject: [PATCH 20/22] Enforced sensitive masking of logs --- lib/AuthenticationSDK/logging/log_configuration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AuthenticationSDK/logging/log_configuration.rb b/lib/AuthenticationSDK/logging/log_configuration.rb index b57393ff..6ad91c85 100644 --- a/lib/AuthenticationSDK/logging/log_configuration.rb +++ b/lib/AuthenticationSDK/logging/log_configuration.rb @@ -62,7 +62,7 @@ def validate(log_message) elsif @enableMasking == true @enableMasking = true else - @enableMasking = false + @enableMasking = true end end return log_message From 159eadcbe67dcda513866201ec10e611ddefcb5e Mon Sep 17 00:00:00 2001 From: gnongsie Date: Fri, 21 Mar 2025 18:15:02 +0530 Subject: [PATCH 21/22] Enforced sensitive masking of logs --- .../logging/sensitive_logging.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/AuthenticationSDK/logging/sensitive_logging.rb b/lib/AuthenticationSDK/logging/sensitive_logging.rb index c9d49ddd..fa8f3464 100644 --- a/lib/AuthenticationSDK/logging/sensitive_logging.rb +++ b/lib/AuthenticationSDK/logging/sensitive_logging.rb @@ -1,4 +1,5 @@ require 'logger' +require 'json' class SensitiveTag attr_accessor :tagName, :pattern, :replacement, :disableMask @@ -72,10 +73,23 @@ def initialize end end + def maskSensitiveDataInJson(input) + parts = input.split(":", 2) + json_data = JSON.parse(parts[1].strip) + encrypted_request = json_data["encryptedRequest"] + json_data["encryptedRequest"] = 'X' * encrypted_request.length + return parts[0] + ":" + JSON.generate(json_data) + end + def call(severity, time, progname, msg) maskedMessage = maskSensitiveString(msg) ccMasked = maskCreditCards(maskedMessage) - return formatLogEntry(severity, time, progname, ccMasked) + if ccMasked.include?("encryptedRequest") + mleMasked = maskSensitiveDataInJson(ccMasked) + return formatLogEntry(severity, time, progname, mleMasked) + else + return formatLogEntry(severity, time, progname, ccMasked) + end end def maskCreditCards(input) From 833e5f6fef88c3a9cd7fecdafcaab8ac82b9cefc Mon Sep 17 00:00:00 2001 From: gnongsie Date: Mon, 24 Mar 2025 16:21:30 +0530 Subject: [PATCH 22/22] Update to new version --- cybersource_rest_client.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cybersource_rest_client.gemspec b/cybersource_rest_client.gemspec index 02455021..077cea11 100644 --- a/cybersource_rest_client.gemspec +++ b/cybersource_rest_client.gemspec @@ -17,7 +17,7 @@ require "cybersource_rest_client/version" Gem::Specification.new do |s| s.name = "cybersource_rest_client" - s.version = "0.0.69" + s.version = "0.0.70" s.platform = Gem::Platform::RUBY s.authors = ["CyberSource"] s.email = ["cybersourcedev@gmail.com"]