diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/authentication/jwt/JwtTokenGenerator.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/authentication/jwt/JwtTokenGenerator.cs index 77bb54d6..048a1e54 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/authentication/jwt/JwtTokenGenerator.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/authentication/jwt/JwtTokenGenerator.cs @@ -4,6 +4,7 @@ using System.Security.Cryptography.X509Certificates; using System.Text; using AuthenticationSdk.core; +using Newtonsoft.Json.Linq; namespace AuthenticationSdk.authentication.jwt { @@ -11,9 +12,11 @@ public class JwtTokenGenerator : ITokenGenerator { private readonly MerchantConfig _merchantConfig; private readonly JwtToken _jwtToken; + private readonly bool _isResponseMLEForApi; - public JwtTokenGenerator(MerchantConfig merchantConfig) + public JwtTokenGenerator(MerchantConfig merchantConfig, bool isResponseMLEForApi) { + _isResponseMLEForApi = isResponseMLEForApi; _merchantConfig = merchantConfig; _jwtToken = new JwtToken(_merchantConfig); } @@ -54,7 +57,16 @@ private string SetToken() private string TokenForCategory1() { - var jwtBody = $"{{ \"iat\":\"{DateTime.Now.ToUniversalTime().ToString("r")}\"}}"; + JObject claimSetJson = new JObject(); + claimSetJson["iat"] = DateTime.Now.ToUniversalTime().ToString("r"); + + if (_isResponseMLEForApi) + { + claimSetJson["v-c-response-mle-kid"] = _merchantConfig.ResponseMleKID; + } + + String jwtBody = ""; + jwtBody = claimSetJson.ToString(Newtonsoft.Json.Formatting.None); var x5Cert = _jwtToken.Certificate; @@ -82,7 +94,18 @@ private string TokenForCategory2() { var digest = GenerateDigest(_jwtToken.RequestJsonData); - var jwtBody = $"{{\n \"digest\":\"{digest}\", \"digestAlgorithm\":\"SHA-256\", \"iat\":\"{DateTime.Now.ToUniversalTime().ToString("r")}\"}}"; + JObject claimSetJson = new JObject(); + claimSetJson["digest"] = digest; + claimSetJson["digestAlgorithm"] = "SHA-256"; + claimSetJson["iat"] = DateTime.Now.ToUniversalTime().ToString("r"); + + if (_isResponseMLEForApi) + { + claimSetJson["v-c-response-mle-kid"] = _merchantConfig.ResponseMleKID; + } + + String jwtBody = ""; + jwtBody = claimSetJson.ToString(Newtonsoft.Json.Formatting.None); var x5Cert = _jwtToken.Certificate; @@ -101,7 +124,6 @@ private string TokenForCategory2() }; var token = Jose.JWT.Encode(jwtBody, privateKey, Jose.JwsAlgorithm.RS256, cybsHeaders); - return token; } } diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/Authorize.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/Authorize.cs index 0cb1ed2b..82f07909 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/Authorize.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/Authorize.cs @@ -86,7 +86,7 @@ public HttpToken GetSignature() * @return a JwtToken object (JWT Bearer Token), * based on the Merchant Configuration passed to the Constructor of Authorize Class */ - public JwtToken GetToken() + public JwtToken GetToken(bool isResponseMLEForApi = false) { try { @@ -101,7 +101,7 @@ public JwtToken GetToken() throw new Exception("Missing or Empty Credentials : MerchantID or KeyAlias or KeyPassphrase"); } - var tokenObj = (JwtToken)new JwtTokenGenerator(_merchantConfig).GetToken(); + var tokenObj = (JwtToken)new JwtTokenGenerator(_merchantConfig, isResponseMLEForApi).GetToken(); if (_merchantConfig.IsGetRequest || _merchantConfig.IsDeleteRequest) { diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/MerchantConfig.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/MerchantConfig.cs index da195c7b..4350a12a 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/MerchantConfig.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/MerchantConfig.cs @@ -6,6 +6,8 @@ using System.Configuration; using System.IO; using System.Linq; +using System.Security; +using System.Security.Cryptography; namespace AuthenticationSdk.core { @@ -18,7 +20,7 @@ namespace AuthenticationSdk.core *============================================================================================*/ public class MerchantConfig { - public MerchantConfig(IReadOnlyDictionary merchantConfigDictionary = null, Dictionary mapToControlMLEonAPI = null) + public MerchantConfig(IReadOnlyDictionary merchantConfigDictionary = null, Dictionary mapToControlMLEonAPI = null, AsymmetricAlgorithm responseMlePrivateKey = null) { var _propertiesSetUsing = string.Empty; @@ -42,7 +44,21 @@ public MerchantConfig(IReadOnlyDictionary merchantConfigDictiona else { // MerchantConfig section inside App.Config File - var merchantConfigSection = (NameValueCollection)ConfigurationManager.GetSection("MerchantConfig"); + NameValueCollection merchantConfigSection = null; + try + { + merchantConfigSection = (NameValueCollection)ConfigurationManager.GetSection("MerchantConfig"); + } + catch (ConfigurationErrorsException ex) + { + Logger.Error($"Error accessing MerchantConfig section in App.Config: {ex.Message}"); + throw new Exception($"{Constants.ErrorPrefix} Error accessing MerchantConfig section in App.Config: {ex.Message}", ex); + } + catch (Exception ex) + { + Logger.Error($"Unexpected error accessing MerchantConfig section in App.Config: {ex.Message}"); + throw new Exception($"{Constants.ErrorPrefix} Unexpected error accessing MerchantConfig section in App.Config: {ex.Message}", ex); + } if (merchantConfigSection != null) { @@ -57,6 +73,11 @@ public MerchantConfig(IReadOnlyDictionary merchantConfigDictiona } } + if(responseMlePrivateKey != null) + { + ResponseMlePrivateKey = responseMlePrivateKey; + } + Logger.Debug("APPLICATION LOGGING START:\n"); // Logging the source of properties' values @@ -174,10 +195,65 @@ public bool UseMLEGlobally get => EnableRequestMLEForOptionalApisGlobally; set => EnableRequestMLEForOptionalApisGlobally = value; } + private Dictionary _mapToControlMLEonAPI { get; set; } + public Dictionary MapToControlMLEonAPI + { + get => _mapToControlMLEonAPI; + set + { + // Validate the map values of MLE Config if not null + if (value != null) + { + ValidateMapToControlMLEonAPIValues(value); + // Populate the internal Maps for MLE control + var internalMapToControlRequestMLEonAPI = new Dictionary(); + var internalMapToControlResponseMLEonAPI = new Dictionary(); - public Dictionary MapToControlMLEonAPI { get; set; } + foreach (var entry in value) + { + var apiName = entry.Key; + var configValue = entry.Value; - public string MleKeyAlias { get; set; } + + if (string.IsNullOrEmpty(configValue)) + { + // Throw exception if configValue is empty for the given apiName + throw new Exception($"Invalid MLE control map value for key '{apiName}'. Value cannot be null or empty."); + } + else if (configValue.Contains("::")) + { + // Format: "requestMLE::responseMLE" + var parts = configValue.Split(new[] { "::" }, StringSplitOptions.None); + var requestMLE = parts.Length > 0 ? parts[0] : string.Empty; + var responseMLE = parts.Length > 1 ? parts[1] : string.Empty; + + // Set request MLE value + if (!string.IsNullOrEmpty(requestMLE)) + { + internalMapToControlRequestMLEonAPI[apiName] = bool.Parse(requestMLE); + } + + // Set response MLE value + if (!string.IsNullOrEmpty(responseMLE)) + { + internalMapToControlResponseMLEonAPI[apiName] = bool.Parse(responseMLE); + } + } + else + { + // Format: "true" or "false" - applies to request MLE only + internalMapToControlRequestMLEonAPI[apiName] = bool.Parse(configValue); + } + } + + this.InternalMapToControlRequestMLEonAPI = internalMapToControlRequestMLEonAPI; + this.InternalMapToControlResponseMLEonAPI = internalMapToControlResponseMLEonAPI; + _mapToControlMLEonAPI = value; + } + } + } + public Dictionary InternalMapToControlRequestMLEonAPI { get; set; } + public Dictionary InternalMapToControlResponseMLEonAPI { get; set; } public string MaxConnectionPoolSize { get; set; } @@ -185,6 +261,41 @@ public bool UseMLEGlobally public string MleForRequestPublicCertPath { get; set; } + + /** + * Optional parameter. User can pass a custom requestMleKeyAlias to fetch from the certificate. + * Older flag "mleKeyAlias" is deprecated and will be used as alias/another name for requestMleKeyAlias. + */ + public string RequestMleKeyAlias { get; set; } + + /// + /// Flag to enable MLE (Message Level Encryption) for response body for all APIs in SDK to get MLE Response (encrypted response) if supported by API. + /// + public bool EnableResponseMleGlobally { get; set; } + + /// + /// Parameter to pass the KID value for the MLE response public certificate. This value will be provided in the merchant portal when retrieving the MLE response certificate. + /// + public string ResponseMleKID { get; set; } + + /// + /// Path to the private key file used for Response MLE decryption by the SDK. + /// Supported formats: .p12, .key, .pem, etc. + /// + public string ResponseMlePrivateKeyFilePath { get; set; } + + /// + /// Password for the private key file used in Response MLE decryption by the SDK. + /// Required for .p12 files or encrypted private keys. + /// + public SecureString ResponseMlePrivateKeyFilePassword { get; set; } + + /// + /// AsymmetricAlgorithm instance used for Response MLE decryption by the SDK. + /// Optional — either provide this object directly or specify the private key file path via configuration. + /// + public AsymmetricAlgorithm ResponseMlePrivateKey { get; set; } + #endregion public void LogMerchantConfigurationProperties() @@ -218,7 +329,7 @@ public void LogMerchantConfigurationProperties() Logger.Debug($"Merchant Configuration :\n{merchCfgLogString}"); } - private void SetValuesFromAppConfig(NameValueCollection merchantConfigSection, Dictionary mapToControlMLEonAPI) + private void SetValuesFromAppConfig(NameValueCollection merchantConfigSection, Dictionary mapToControlMLEonAPI) { MerchantId = merchantConfigSection["merchantID"]; PortfolioId = merchantConfigSection["portfolioID"]; @@ -289,14 +400,43 @@ private void SetValuesFromAppConfig(NameValueCollection merchantConfigSection, D MapToControlMLEonAPI = mapToControlMLEonAPI; - if (merchantConfigSection["mleKeyAlias"] != null) + if (!string.IsNullOrWhiteSpace(merchantConfigSection["requestMleKeyAlias"])) + { + RequestMleKeyAlias = merchantConfigSection["requestMleKeyAlias"]?.Trim(); + } + else if (!string.IsNullOrWhiteSpace(merchantConfigSection["mleKeyAlias"])) { - MleKeyAlias = merchantConfigSection["mleKeyAlias"]?.Trim(); + RequestMleKeyAlias = merchantConfigSection["mleKeyAlias"]?.Trim(); } - if (string.IsNullOrWhiteSpace(MleKeyAlias?.Trim())) + if(string.IsNullOrWhiteSpace(RequestMleKeyAlias?.Trim())) { - MleKeyAlias = Constants.DefaultMleAliasForCert; + RequestMleKeyAlias = Constants.DefaultMleAliasForCert; + } + + // Adding Response MLE Related Params + if (merchantConfigSection["enableResponseMleGlobally"] != null) + { + EnableResponseMleGlobally = bool.Parse(merchantConfigSection["enableResponseMleGlobally"]); + } + else + { + EnableResponseMleGlobally = false; + } + + if (merchantConfigSection["responseMleKID"] != null && !string.IsNullOrEmpty(merchantConfigSection["responseMleKID"]?.Trim())) + { + ResponseMleKID = merchantConfigSection["responseMleKID"].Trim(); + } + + if (merchantConfigSection["responseMlePrivateKeyFilePath"] != null && !string.IsNullOrWhiteSpace(merchantConfigSection["responseMlePrivateKeyFilePath"])) + { + ResponseMlePrivateKeyFilePath = merchantConfigSection["responseMlePrivateKeyFilePath"].Trim(); + } + + if (merchantConfigSection["responseMlePrivateKeyFilePassword"] != null && !string.IsNullOrEmpty(merchantConfigSection["responseMlePrivateKeyFilePassword"])) + { + ResponseMlePrivateKeyFilePassword = Utility.ConvertStringToSecureString(merchantConfigSection["responseMlePrivateKeyFilePassword"]); } if (merchantConfigSection["maxConnectionPoolSize"] != null) @@ -318,7 +458,7 @@ private void SetValuesFromAppConfig(NameValueCollection merchantConfigSection, D } } - private void SetValuesUsingDictObj(IReadOnlyDictionary merchantConfigDictionary, Dictionary mapToControlMLEonAPI) + private void SetValuesUsingDictObj(IReadOnlyDictionary merchantConfigDictionary, Dictionary mapToControlMLEonAPI) { var key = string.Empty; @@ -569,15 +709,19 @@ private void SetValuesUsingDictObj(IReadOnlyDictionary merchantC MapToControlMLEonAPI = mapToControlMLEonAPI; } - if (merchantConfigDictionary.ContainsKey("mleKeyAlias")) + if (merchantConfigDictionary.ContainsKey("requestMleKeyAlias")) { - MleKeyAlias = merchantConfigDictionary["mleKeyAlias"]?.Trim(); + RequestMleKeyAlias = merchantConfigDictionary["requestMleKeyAlias"]?.Trim(); + } + else if (merchantConfigDictionary.ContainsKey("mleKeyAlias")) + { + RequestMleKeyAlias = merchantConfigDictionary["mleKeyAlias"]?.Trim(); } - //if MleKeyAlias is null or empty or contains only whitespace then set default value - if (string.IsNullOrWhiteSpace(MleKeyAlias?.Trim())) + //if RequestMleKeyAlias is null or empty or contains only whitespace then set default value + if (string.IsNullOrWhiteSpace(RequestMleKeyAlias?.Trim())) { - MleKeyAlias = Constants.DefaultMleAliasForCert; + RequestMleKeyAlias = Constants.DefaultMleAliasForCert; } if (merchantConfigDictionary.ContainsKey("maxConnectionPoolSize")) @@ -602,6 +746,31 @@ private void SetValuesUsingDictObj(IReadOnlyDictionary merchantC { MleForRequestPublicCertPath = merchantConfigDictionary["mleForRequestPublicCertPath"].Trim(); } + + // Adding Response MLE Related Params + if (merchantConfigDictionary.ContainsKey("enableResponseMleGlobally")) + { + EnableResponseMleGlobally = bool.Parse(merchantConfigDictionary["enableResponseMleGlobally"]); + } + else + { + EnableResponseMleGlobally = false; + } + + if (merchantConfigDictionary.ContainsKey("responseMleKID") && !string.IsNullOrEmpty(merchantConfigDictionary["responseMleKID"]?.Trim())) + { + ResponseMleKID = merchantConfigDictionary["responseMleKID"].Trim(); + } + + if (merchantConfigDictionary.ContainsKey("responseMlePrivateKeyFilePath") && !string.IsNullOrWhiteSpace(merchantConfigDictionary["responseMlePrivateKeyFilePath"])) + { + ResponseMlePrivateKeyFilePath = merchantConfigDictionary["responseMlePrivateKeyFilePath"].Trim(); + } + + if (merchantConfigDictionary.ContainsKey("responseMlePrivateKeyFilePassword") && !string.IsNullOrEmpty(merchantConfigDictionary["responseMlePrivateKeyFilePassword"])) + { + ResponseMlePrivateKeyFilePassword = Utility.ConvertStringToSecureString(merchantConfigDictionary["responseMlePrivateKeyFilePassword"]); + } } } catch (KeyNotFoundException err) @@ -611,6 +780,64 @@ private void SetValuesUsingDictObj(IReadOnlyDictionary merchantC } } + private void ValidateMapToControlMLEonAPIValues(Dictionary mapToControlMLEonAPI) + { + if (mapToControlMLEonAPI == null) + { + return; + } + + foreach (var entry in mapToControlMLEonAPI) + { + var key = entry.Key; + var value = entry.Value; + + if (string.IsNullOrEmpty(value)) + { + Logger.Error($"ConfigException : Invalid MLE control map value for key '{key}'. Value cannot be null or empty."); + throw new Exception($"Invalid MLE control map value for key '{key}'. Value cannot be null or empty."); + } + + // Check if value contains "::" separator + if (value.Contains("::")) + { + var parts = value.Split(new[] { "::" }, StringSplitOptions.None); + + if (parts.Length != 2) + { + Logger.Error($"ConfigException : Invalid MLE control map value format for key '{key}'. Expected format: true/false for 'requestMLE::responseMLE' but got: '{value}'"); + throw new Exception($"Invalid MLE control map value format for key '{key}'. Expected format: true/false for 'requestMLE::responseMLE' but got: '{value}'"); + } + + var requestMLE = parts[0]; + var responseMLE = parts[1]; + + // Validate first part (request MLE) - can be empty, "true", or "false" + if (!string.IsNullOrEmpty(requestMLE) && !Utility.IsValidBooleanString(requestMLE)) + { + Logger.Error($"ConfigException : Invalid request MLE value for key '{key}'. Expected 'true', 'false', or empty but got: '{requestMLE}'"); + throw new Exception($"Invalid request MLE value for key '{key}'. Expected 'true', 'false', or empty but got: '{requestMLE}'"); + } + + // Validate second part (response MLE) - can be empty, "true", or "false" + if (!string.IsNullOrEmpty(responseMLE) && !Utility.IsValidBooleanString(responseMLE)) + { + Logger.Error($"ConfigException : Invalid response MLE value for key '{key}'. Expected 'true', 'false', or empty but got: '{responseMLE}'"); + throw new Exception($"Invalid response MLE value for key '{key}'. Expected 'true', 'false', or empty but got: '{responseMLE}'"); + } + } + else + { + // Value without "::" separator - should be "true" or "false" + if (!Utility.IsValidBooleanString(value)) + { + Logger.Error($"ConfigException : Invalid MLE control map value for key '{key}'. Expected 'true' or 'false' for requestMLE but got: '{value}'"); + throw new Exception($"Invalid MLE control map value for key '{key}'. Expected 'true' or 'false' for requestMLE but got: '{value}'"); + } + } + } + } + private void ValidateProperties() { // Validating and setting up Authentication type @@ -727,9 +954,9 @@ private void ValidateMLEProperties() bool requestMleConfigured = EnableRequestMLEForOptionalApisGlobally; - if (MapToControlMLEonAPI != null && MapToControlMLEonAPI.Count > 0) + if (InternalMapToControlRequestMLEonAPI != null && InternalMapToControlRequestMLEonAPI.Count > 0) { - foreach (bool value in MapToControlMLEonAPI.Values) + foreach (bool value in InternalMapToControlRequestMLEonAPI.Values) { if (value) { @@ -759,6 +986,64 @@ private void ValidateMLEProperties() throw new Exception(err.Message); } } + + // Validation for MLE Response Configuration + + bool responseMleConfigured = EnableResponseMleGlobally; + if (InternalMapToControlResponseMLEonAPI != null && InternalMapToControlResponseMLEonAPI.Count > 0) + { + foreach (bool value in InternalMapToControlResponseMLEonAPI.Values) + { + if (value) + { + responseMleConfigured = true; + break; + } + } + } + if (responseMleConfigured) + { + // Validate for Auth type - Currently responseMLE feature will be enabled for JWT auth type only + if (!Enumerations.AuthenticationType.JWT.ToString().Equals(AuthenticationType, StringComparison.OrdinalIgnoreCase)) + { + Logger.Error("Response MLE is only supported for JWT auth type"); + throw new Exception("Response MLE is only supported for JWT auth type"); + } + + // Check if either private key object or private key file path is provided + if (ResponseMlePrivateKey == null && string.IsNullOrEmpty(ResponseMlePrivateKeyFilePath)) + { + Logger.Error("Response MLE is enabled but no private key provided. Either set ResponseMlePrivateKey object or provide ResponseMlePrivateKeyFilePath."); + throw new Exception("Response MLE is enabled but no private key provided. Either set ResponseMlePrivateKey object or provide ResponseMlePrivateKeyFilePath."); + } + + // Check if both private key object and private key file path are provided + if (ResponseMlePrivateKey != null && !string.IsNullOrEmpty(ResponseMlePrivateKeyFilePath)) + { + Logger.Error("ConfigException : Both responseMlePrivateKey object and responseMlePrivateKeyFilePath are provided. Please provide only one of them for response mle private key."); + throw new Exception("Both responseMlePrivateKey object and responseMlePrivateKeyFilePath are provided. Please provide only one of them for response mle private key."); + } + + // If private key file path is provided, validate the file exists + if (!string.IsNullOrEmpty(ResponseMlePrivateKeyFilePath)) + { + try + { + CertificateUtility.ValidatePathAndFile(ResponseMlePrivateKeyFilePath, "responseMlePrivateKeyFilePath"); + } + catch (IOException err) + { + Logger.Error("Invalid responseMlePrivateKeyFilePath - " + err.Message); + throw new Exception("Invalid responseMlePrivateKeyFilePath - " + err.Message); + } + } + // Validate responseMleKID is provided when response MLE is enabled + if (string.IsNullOrEmpty(ResponseMleKID)) + { + Logger.Error("ConfigException : Response MLE is enabled but responseMleKID is not provided."); + throw new Exception("Response MLE is enabled but responseMleKID is not provided."); + } + } } public bool CheckKeyFile() @@ -829,5 +1114,6 @@ public bool CheckKeyFile() return false; } } + } } \ No newline at end of file diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Cache.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Cache.cs index 43517fd2..5f3ca88f 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Cache.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Cache.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.IO; using System.Runtime.Caching; +using System.Security; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text.RegularExpressions; @@ -35,6 +36,12 @@ private class CertInfo public X509Certificate2 MLECertificate { get; set; } } + private class PrivateKeyInfo + { + public AsymmetricAlgorithm PrivateKey { get; set; } + public DateTime Timestamp { get; set; } + } + public static X509Certificate2Collection FetchCachedCertificate(string p12FilePath, string keyPassword) { try @@ -173,6 +180,57 @@ private static X509Certificate2 GetMLECertBasedOnCacheKey(MerchantConfig merchan private static void SetupCache(MerchantConfig merchantConfig, string cacheKey, string certificateFilePath) { + var policy = new CacheItemPolicy(); + var filePaths = new List(); + var cachedFilePath = Path.GetFullPath(certificateFilePath); + filePaths.Add(cachedFilePath); + policy.ChangeMonitors.Add(new HostFileChangeMonitor(filePaths)); + + ObjectCache cache = MemoryCache.Default; + + if (cacheKey.EndsWith(Constants.MLE_CACHE_KEY_IDENTIFIER_FOR_RESPONSE_PRIVATE_KEY)) + { + try + { + string fileExtension = Path.GetExtension(certificateFilePath)?.TrimStart('.').ToLowerInvariant(); + AsymmetricAlgorithm mlePrivateKey = null; + SecureString password = merchantConfig.ResponseMlePrivateKeyFilePassword; + + // Case 1 - PKCS#12 formats (.p12, .pfx) + if (fileExtension.Equals("p12") || fileExtension.Equals("pfx")) + { + mlePrivateKey = Utility.ReadPrivateKeyFromP12(certificateFilePath, password); + } + // Case 2 - PEM-based formats (.pem, .key, .p8) + else if (fileExtension.Equals("pem") || fileExtension.Equals("key") || fileExtension.Equals("p8")) + { + mlePrivateKey = (AsymmetricAlgorithm) Utility.ExtractPrivateKeyFromFile(certificateFilePath, password); + } + else + { + throw new Exception($"Unsupported Response MLE Private Key file format: {fileExtension}. Supported formats are: .p12, .pfx, .pem, .key, .p8"); + } + + PrivateKeyInfo privateKeyInfo = new PrivateKeyInfo + { + PrivateKey = mlePrivateKey, + Timestamp = File.GetLastWriteTime(certificateFilePath) + }; + + lock (mutex) + { + cache.Set(cacheKey, privateKeyInfo, policy); + } + } + catch (Exception e) + { + logger.Error($"Error loading MLE response private key from: {certificateFilePath}. Error: {e.Message}"); + throw new Exception($"Error loading MLE response private key from: {certificateFilePath}. Error: {e.Message}", e); + } + return; + } + + // ... existing code for other cacheKey cases ... X509Certificate2 mleCertificate = null; if (cacheKey.EndsWith(Constants.MLE_CACHE_IDENTIFIER_FOR_CONFIG_CERT)) @@ -181,7 +239,7 @@ private static void SetupCache(MerchantConfig merchantConfig, string cacheKey, s try { - mleCertificate = GetCertBasedOnKeyAlias(certificates, merchantConfig.MleKeyAlias); + mleCertificate = GetCertBasedOnKeyAlias(certificates, merchantConfig.RequestMleKeyAlias); } catch (Exception) { @@ -189,7 +247,7 @@ private static void SetupCache(MerchantConfig merchantConfig, string cacheKey, s { // If no certificate found for the specified alias, fall back to first certificate string fileName = Path.GetFileName(certificateFilePath); - logger.Warn($"No certificate found for the specified mleKeyAlias '{merchantConfig.MleKeyAlias}'. Using the first certificate from file {fileName} as the MLE request certificate."); + logger.Warn($"No certificate found for the specified requestMleKeyAlias '{merchantConfig.RequestMleKeyAlias}'. Using the first certificate from file {fileName} as the MLE request certificate."); mleCertificate = certificates[0]; } } @@ -199,13 +257,13 @@ private static void SetupCache(MerchantConfig merchantConfig, string cacheKey, s { try { - mleCertificate = GetCertBasedOnKeyAlias(FetchCertificateCollectionFromP12File(merchantConfig.P12Keyfilepath, merchantConfig.KeyPass), merchantConfig.MleKeyAlias); + mleCertificate = GetCertBasedOnKeyAlias(FetchCertificateCollectionFromP12File(merchantConfig.P12Keyfilepath, merchantConfig.KeyPass), merchantConfig.RequestMleKeyAlias); } catch (Exception) { string fileName = Path.GetFileName(merchantConfig.P12Keyfilepath); - logger.Error($"No certificate found for the specified mleKeyAlias '{merchantConfig.MleKeyAlias}' in file {fileName}."); - throw new ArgumentException($"No certificate found for the specified mleKeyAlias '{merchantConfig.MleKeyAlias}' in file {fileName}."); + logger.Error($"No certificate found for the specified requestMleKeyAlias '{merchantConfig.RequestMleKeyAlias}' in file {fileName}."); + throw new ArgumentException($"No certificate found for the specified requestMleKeyAlias '{merchantConfig.RequestMleKeyAlias}' in file {fileName}."); } } @@ -215,13 +273,7 @@ private static void SetupCache(MerchantConfig merchantConfig, string cacheKey, s Timestamp = File.GetLastWriteTime(certificateFilePath) }; - var policy = new CacheItemPolicy(); - var filePaths = new List(); - var cachedFilePath = Path.GetFullPath(certificateFilePath); - filePaths.Add(cachedFilePath); - policy.ChangeMonitors.Add(new HostFileChangeMonitor(filePaths)); - ObjectCache cache = MemoryCache.Default; lock(mutex) { cache.Set(cacheKey, certInfo, policy); @@ -236,5 +288,39 @@ private static X509Certificate2Collection FetchCertificateCollectionFromP12File( //return all certs in p12 return certificates; } + public static AsymmetricAlgorithm GetMleResponsePrivateKeyFromFilePath(MerchantConfig merchantConfig) + { + string merchantId = merchantConfig.MerchantId; + string identifier = Constants.MLE_CACHE_KEY_IDENTIFIER_FOR_RESPONSE_PRIVATE_KEY; + string cacheKey = $"{merchantId}_{identifier}"; + string mleResponsePrivateKeyFilePath = merchantConfig.ResponseMlePrivateKeyFilePath; + + ObjectCache cache = MemoryCache.Default; + + if (!cache.Contains(cacheKey)) + { + SetupCache(merchantConfig, cacheKey, mleResponsePrivateKeyFilePath); + } + else + { + var responseMlePrivateKeyInfo = (PrivateKeyInfo)cache.Get(cacheKey); + if (responseMlePrivateKeyInfo == null || responseMlePrivateKeyInfo.Timestamp != File.GetLastWriteTime(mleResponsePrivateKeyFilePath)) + { + SetupCache(merchantConfig, cacheKey, mleResponsePrivateKeyFilePath); + } + } + + var cachedResponseMlePrivateKeyInfo = (PrivateKeyInfo)cache.Get(cacheKey); + + try + { + return cachedResponseMlePrivateKeyInfo.PrivateKey; + } + catch (Exception ex) + { + logger.Error($"Error retrieving MLE response private key: {ex.Message}"); + throw new Exception($"{Constants.ErrorPrefix} Failed to retrieve MLE response private key from cache.", ex); + } + } } } diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Constants.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Constants.cs index 65861570..3b15811f 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Constants.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Constants.cs @@ -51,5 +51,18 @@ public static class Constants public static readonly string MLE_CACHE_IDENTIFIER_FOR_CONFIG_CERT = "mleCertFromMerchantConfig"; public static readonly string MLE_CACHE_IDENTIFIER_FOR_P12_CERT = "mleCertFromP12"; + + public static readonly string MLE_CACHE_KEY_IDENTIFIER_FOR_RESPONSE_PRIVATE_KEY = "mleResponsePrivateKeyFromFile"; + + public static readonly string PKCS8_PRIVATE_KEY_HEADER = "-----BEGIN PRIVATE KEY-----"; + + public static readonly string PKCS8_ENCRYPTED_PRIVATE_KEY_HEADER = "-----BEGIN ENCRYPTED PRIVATE KEY-----"; + + public static readonly string PKCS1_PRIVATE_KEY_HEADER = "-----BEGIN RSA PRIVATE KEY-----"; + + public static readonly string LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION = "LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION: "; + + public static readonly string LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION = "LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION: "; + } } diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Enumerations.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Enumerations.cs index 338d0562..b4f57e2a 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Enumerations.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Enumerations.cs @@ -35,7 +35,7 @@ public static bool ValidateAuthenticationType(string authType) return true; } - throw new Exception($"{Constants.ErrorPrefix}Invalid Auth type {authType} provided in config file"); + throw new Exception($"{Constants.ErrorPrefix}Invalid Auth type provided in config file"); } public static bool ValidateRequestType(string requestType) diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/LogUtility.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/LogUtility.cs index e3b2b67b..0c80ecd1 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/LogUtility.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/LogUtility.cs @@ -57,6 +57,14 @@ public string MaskSensitiveData(string str) { return Constants.LOG_REQUEST_AFTER_MLE + MaskSensitiveData(str.Substring(Constants.LOG_REQUEST_AFTER_MLE.Length)); } + if (str.StartsWith(Constants.LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION)) + { + return Constants.LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION + MaskSensitiveData(str.Substring(Constants.LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION.Length)); + } + if (str.StartsWith(Constants.LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION)) + { + return Constants.LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION + MaskSensitiveData(str.Substring(Constants.LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION.Length)); + } bool isJsonString; try diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/MLEUtility.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/MLEUtility.cs index b8c33089..21ed038f 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/MLEUtility.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/MLEUtility.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.IO; using System.Security.Cryptography.X509Certificates; +using System.Security.Cryptography; +using Newtonsoft.Json.Linq; namespace AuthenticationSdk.util { @@ -36,13 +38,13 @@ public static bool CheckIsMLEForAPI(MerchantConfig merchantConfig, string inboun } // Control the MLE only from map - if (merchantConfig.MapToControlMLEonAPI != null && merchantConfig.MapToControlMLEonAPI.Count > 0) + if (merchantConfig.InternalMapToControlRequestMLEonAPI != null && merchantConfig.InternalMapToControlRequestMLEonAPI.Count > 0) { foreach (string operationId in operationArray) { - if (merchantConfig.MapToControlMLEonAPI.ContainsKey(operationId)) + if (merchantConfig.InternalMapToControlRequestMLEonAPI.ContainsKey(operationId)) { - isMLEForAPI = merchantConfig.MapToControlMLEonAPI[operationId]; + isMLEForAPI = merchantConfig.InternalMapToControlRequestMLEonAPI[operationId]; break; } } @@ -60,7 +62,7 @@ public static object EncryptRequestPayload(MerchantConfig merchantConfig, object string payload = requestBody.ToString(); logUtility.LogDebugMessage(logger, Constants.LOG_REQUEST_BEFORE_MLE + payload); - X509Certificate2 mleCertificate = GetMLECertificate(merchantConfig); + X509Certificate2 mleCertificate = GetRequestMLECertificate(merchantConfig); // Handling special case : MLE Certificate is not currently available for HTTP Signature if (mleCertificate == null && Constants.AuthMechanismHttp.Equals(merchantConfig.AuthenticationType, StringComparison.OrdinalIgnoreCase)) @@ -90,7 +92,7 @@ public static object EncryptRequestPayload(MerchantConfig merchantConfig, object return mleRequest; } - private static X509Certificate2 GetMLECertificate(MerchantConfig merchantConfig) + private static X509Certificate2 GetRequestMLECertificate(MerchantConfig merchantConfig) { X509Certificate2 mleCertificate = Cache.GetRequestMLECertFromCache(merchantConfig); return mleCertificate; @@ -116,7 +118,7 @@ private static string GetSerialNumberFromCertificate(X509Certificate2 certificat } if (string.IsNullOrEmpty(serialNumber)) { - logger.Warn($"Serial number not found in MLE certificate for alias {merchantConfig.MleKeyAlias} in {merchantConfig.P12Keyfilepath}.p12"); + logger.Warn($"Serial number not found in MLE certificate for alias {merchantConfig.RequestMleKeyAlias} in {merchantConfig.P12Keyfilepath}.p12"); return certificate.SerialNumber; } @@ -128,5 +130,139 @@ private static object CreateJsonObject(string jweToken) var jsonObject = new { encryptedRequest = jweToken }; return JsonConvert.SerializeObject(jsonObject); } + public static bool CheckIsResponseMLEForAPI(MerchantConfig merchantConfig, string operationIds) + { + // isMLE for response for an api is false by default + bool isResponseMLEForAPI = false; + + if (merchantConfig.EnableResponseMleGlobally) + { + isResponseMLEForAPI = true; + } + + // operationIds are array as there are multiple public functions for apiCallFunction such as apiCall, apiCallAsync .. + string[] operationArray = operationIds.Split(','); + for (int i = 0; i < operationArray.Length; i++) + { + operationArray[i] = operationArray[i].Trim(); + } + + // Control the Response MLE only from map + // Special Note: If API expects MLE Response mandatory and map is saying to receive non MLE response then API might throw an error from CyberSource + if (merchantConfig.InternalMapToControlResponseMLEonAPI != null && merchantConfig.InternalMapToControlResponseMLEonAPI.Count > 0) + { + foreach (string operationId in operationArray) + { + if (merchantConfig.InternalMapToControlResponseMLEonAPI.ContainsKey(operationId)) + { + isResponseMLEForAPI = merchantConfig.InternalMapToControlResponseMLEonAPI[operationId]; + break; + } + } + } + return isResponseMLEForAPI; + } + + public static bool CheckIsMleEncryptedResponse(string responseBody) + { + if (string.IsNullOrWhiteSpace(responseBody)) + { + return false; + } + try + { + var jsonObject = JsonConvert.DeserializeObject(responseBody); + if (jsonObject == null || jsonObject.Count != 1) + { + return false; + } + if (jsonObject.ContainsKey("encryptedResponse")) + { + var value = jsonObject["encryptedResponse"]; + return value != null && value.Type == JTokenType.String; + } + return false; + } + catch + { + // If JSON parsing fails, it's not a valid JSON thus not a MLE response + return false; + } + } + private static string GetResponseMleToken(string mleResponseBody) + { + try + { + var jsonObject = JsonConvert.DeserializeObject(mleResponseBody); + return jsonObject?["encryptedResponse"]?.ToString(); + } + catch (Exception e) + { + logger.Error("Failed to extract Response MLE token: " + e.Message); + return null; + } + } + private static AsymmetricAlgorithm GetMleResponsePrivateKey(MerchantConfig merchantConfig) + { + // First priority - if privateKey is given in merchant config return that + if (merchantConfig.ResponseMlePrivateKey != null) + { + return merchantConfig.ResponseMlePrivateKey; + } + // Second priority - get the privateKey from merchantConfig.ResponseMlePrivateKeyFilePath + var responseMlePrivateKey = Cache.GetMleResponsePrivateKeyFromFilePath(merchantConfig); + return responseMlePrivateKey; + } + public static string DecryptMleResponsePayload(MerchantConfig merchantConfig, string mleResponseBody) + { + if (!CheckIsMleEncryptedResponse(mleResponseBody)) + { + throw new Exception("Response body is not MLE encrypted."); + } + + var mlePrivateKey = GetMleResponsePrivateKey(merchantConfig); + string jweResponseToken = GetResponseMleToken(mleResponseBody); + + if (string.IsNullOrEmpty(jweResponseToken)) + { + // When MLE token is empty or null then fall back to non MLE encrypted response + return mleResponseBody; + } + + try + { + logUtility.LogDebugMessage(logger, Constants.LOG_NETWORK_RESPONSE_BEFORE_MLE_DECRYPTION + mleResponseBody); + + // Convert AsymmetricAlgorithm to RSA if needed + RSA rsaKey = mlePrivateKey as RSA; + if (rsaKey == null) + { + throw new Exception("MLE Response private key is not an RSA key. Only RSA keys are supported for MLE decryption."); + } + string decryptedResponse = JWEUtilty.DecryptUsingRSAParameters(rsaKey.ExportParameters(true), jweResponseToken); + logUtility.LogDebugMessage(logger, Constants.LOG_NETWORK_RESPONSE_AFTER_MLE_DECRYPTION + decryptedResponse); + return decryptedResponse; + } + catch (Jose.JoseException e) + { + string errorMessage = $"MLE Response decryption failed (JoseException): {e.Message}. " + + $"Possible reason: The provided RSA private key does not match the public key used to encrypt the message."; + logger.Error(errorMessage, e); + throw new Exception(errorMessage, e); + } + catch (CryptographicException e) + { + string errorMessage = $"MLE Response decryption failed (CryptographicException): {e.Message}. " + + "This may happen if the private key is incorrect or corrupted."; + logger.Error(errorMessage, e); + throw new Exception(errorMessage, e); + } + catch (Exception e) + { + string errorMessage = $"MLE Response decryption failed: {e.Message}"; + logger.Error(errorMessage, e); + throw new Exception(errorMessage, e); + } + } } } \ No newline at end of file diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/PEMUtility.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/PEMUtility.cs new file mode 100644 index 00000000..f4da9ede --- /dev/null +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/PEMUtility.cs @@ -0,0 +1,308 @@ +using System; +using System.IO; +using System.Security; +using System.Security.Cryptography; +using Org.BouncyCastle.Asn1.Pkcs; +using Org.BouncyCastle.Crypto; +using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.OpenSsl; +using Org.BouncyCastle.Pkcs; +using Org.BouncyCastle.Security; + +namespace AuthenticationSdk.util +{ + public class PEMUtility + { + /// + /// Extracts private key from file + /// + /// Path to PEM file + /// Password for encrypted keys (optional, SecureString) + /// RSA private key object + public static RSA ExtractPrivateKeyFromFile(string filePath, SecureString password = null) + { + if (!File.Exists(filePath)) + { + throw new FileNotFoundException($"Private key file not found: {filePath}"); + } + + try + { + string pemContent = File.ReadAllText(filePath); + return ExtractPrivateKey(pemContent, password); + } + catch (Exception ex) + { + throw new InvalidOperationException($"Failed to read or extract private key from file: {ex.Message}", ex); + } + } + + + + /// + /// Extracts private key supporting PKCS#1 and PKCS#8, encrypted and unencrypted + /// + /// PEM content as string + /// Password for encrypted keys (optional, SecureString) + /// RSA private key object + private static RSA ExtractPrivateKey(string pemContent, SecureString password = null) + { + try + { + // First try with PemReader (handles most PEM formats) + var privateKey = ExtractWithPemReader(pemContent, password); + if (privateKey != null) + { + return ConvertToRSA(privateKey); + } + + // If PemReader fails, try manual parsing + return ExtractWithManualParsing(pemContent, password); + } + catch (Exception ex) + { + throw new InvalidOperationException($"Failed to extract private key: {ex.Message}", ex); + } + } + + + /// + /// Extract using PemReader (handles standard PEM formats) + /// + /// PEM content as string + /// Password for encrypted keys (optional, SecureString) + /// BouncyCastle AsymmetricKeyParameter + private static AsymmetricKeyParameter ExtractWithPemReader(string pemContent, SecureString password) + { + try + { + using (var stringReader = new StringReader(pemContent)) + { + var pemReader = new PemReader(stringReader, new PasswordFinder(password)); + + var keyObject = pemReader.ReadObject(); + + if (keyObject is AsymmetricCipherKeyPair keyPair) + { + return keyPair.Private; + } + else if (keyObject is AsymmetricKeyParameter keyParam && keyParam.IsPrivate) + { + return keyParam; + } + + return null; + } + } + catch + { + return null; + } + } + + /// + /// Manual parsing for different key formats + /// + /// PEM content as string + /// Password for encrypted keys (optional, SecureString) + /// RSA private key object + private static RSA ExtractWithManualParsing(string pemContent, SecureString password) + { + // Remove PEM headers and decode base64 + var base64Content = ExtractBase64FromPem(pemContent); + var keyBytes = Convert.FromBase64String(base64Content); + + // Determine the key format and handle accordingly + if (IsKeyPkcs8Format(pemContent)) + { + return HandlePkcs8Key(keyBytes, password); + } + else if (IsKeyPkcs1Format(pemContent)) + { + return HandlePkcs1Key(keyBytes, password); + } + else + { + throw new NotSupportedException("Unsupported key format"); + } + } + + /// + /// Check if PEM content is PKCS#8 format + /// + /// PEM content as string + /// True if PKCS#8 format + private static bool IsKeyPkcs8Format(string pemContent) + { + return pemContent.Contains(Constants.PKCS8_PRIVATE_KEY_HEADER) || + pemContent.Contains(Constants.PKCS8_ENCRYPTED_PRIVATE_KEY_HEADER); + } + + /// + /// Handle PKCS#8 format keys (encrypted and unencrypted) + /// + /// Key bytes + /// Password for encrypted keys (optional, SecureString) + /// RSA private key object + private static RSA HandlePkcs8Key(byte[] keyBytes, SecureString password) + { + try + { + if (password == null || password.Length == 0) + { + // Unencrypted PKCS#8 + var privateKeyInfo = PrivateKeyInfo.GetInstance(keyBytes); + var privateKey = PrivateKeyFactory.CreateKey(privateKeyInfo); + return ConvertToRSA(privateKey); + } + else + { + // Encrypted PKCS#8 + char[] pwdChars = new System.Net.NetworkCredential(string.Empty, password).Password.ToCharArray(); + var encryptedPrivateKeyInfo = EncryptedPrivateKeyInfo.GetInstance(keyBytes); + var privateKeyInfo = PrivateKeyInfoFactory.CreatePrivateKeyInfo( + pwdChars, encryptedPrivateKeyInfo); + Array.Clear(pwdChars, 0, pwdChars.Length); // Clear password from memory + var privateKey = PrivateKeyFactory.CreateKey(privateKeyInfo); + return ConvertToRSA(privateKey); + } + } + catch (Exception ex) + { + throw new InvalidOperationException($"Possible causes: wrong password, corrupted file, or unsupported format.: {ex.Message}", ex); + } + } + + /// + /// Check if PEM content is PKCS#1 format + /// + /// PEM content as string + /// True if PKCS#1 format + private static bool IsKeyPkcs1Format(string pemContent) + { + return pemContent.Contains(Constants.PKCS1_PRIVATE_KEY_HEADER); + } + + /// + /// Handle PKCS#1 format keys + /// + /// Key bytes + /// Password for encrypted keys (optional, SecureString) + /// RSA private key object + private static RSA HandlePkcs1Key(byte[] keyBytes, SecureString password) + { + try + { + // Parse PKCS#1 RSA private key + var rsaPrivateKey = RsaPrivateKeyStructure.GetInstance(keyBytes); + var rsaParams = new RsaPrivateCrtKeyParameters( + rsaPrivateKey.Modulus, + rsaPrivateKey.PublicExponent, + rsaPrivateKey.PrivateExponent, + rsaPrivateKey.Prime1, + rsaPrivateKey.Prime2, + rsaPrivateKey.Exponent1, + rsaPrivateKey.Exponent2, + rsaPrivateKey.Coefficient); + + return ConvertToRSA(rsaParams); + } + catch (Exception ex) + { + throw new InvalidOperationException($"Possible causes: wrong password, corrupted file, or unsupported format.: {ex.Message}", ex); + } + } + + /// + /// Convert Bouncy Castle RSA parameters to .NET RSA object + /// + /// BouncyCastle AsymmetricKeyParameter + /// .NET RSA object + private static RSA ConvertToRSA(AsymmetricKeyParameter privateKey) + { + if (!(privateKey is RsaPrivateCrtKeyParameters rsaParams)) + { + throw new InvalidOperationException("Key is not an RSA private key"); + } + + var rsa = RSA.Create(); + var parameters = new RSAParameters + { + Modulus = rsaParams.Modulus.ToByteArrayUnsigned(), + Exponent = rsaParams.PublicExponent.ToByteArrayUnsigned(), + D = rsaParams.Exponent.ToByteArrayUnsigned(), + P = rsaParams.P.ToByteArrayUnsigned(), + Q = rsaParams.Q.ToByteArrayUnsigned(), + DP = rsaParams.DP.ToByteArrayUnsigned(), + DQ = rsaParams.DQ.ToByteArrayUnsigned(), + InverseQ = rsaParams.QInv.ToByteArrayUnsigned() + }; + + rsa.ImportParameters(parameters); + return rsa; + } + + /// + /// Extract base64 content from PEM format + /// + /// PEM content as string + /// Base64 string + private static string ExtractBase64FromPem(string pemContent) + { + var lines = pemContent.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); + var base64Lines = new System.Collections.Generic.List(); + + bool inKey = false; + foreach (var line in lines) + { + if (line.StartsWith("-----BEGIN")) + { + inKey = true; + continue; + } + if (line.StartsWith("-----END")) + { + break; + } + // Skip encryption headers + if (inKey && !line.StartsWith("Proc-Type:") && !line.StartsWith("DEK-Info:")) + { + base64Lines.Add(line.Trim()); + } + } + + return string.Join("", base64Lines); + } + + /// + /// Password finder for encrypted keys + /// + private class PasswordFinder : IPasswordFinder + { + private readonly SecureString _password; + + /// + /// Initializes a new instance of the PasswordFinder class. + /// + /// Password as SecureString + public PasswordFinder(SecureString password) + { + _password = password; + } + + /// + /// Returns the password as a char array for BouncyCastle + /// + /// Char array of password + public char[] GetPassword() + { + if (_password == null || _password.Length == 0) + { + return null; + } + return new System.Net.NetworkCredential(string.Empty, _password).Password.ToCharArray(); + } + } + + } +} \ No newline at end of file diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/SensitiveDataConfigurationType.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/SensitiveDataConfigurationType.cs index 0b9ca3f6..9b00d868 100644 --- a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/SensitiveDataConfigurationType.cs +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/SensitiveDataConfigurationType.cs @@ -21,7 +21,8 @@ public class SensitiveDataConfigurationType new SensitiveTag("signature", "", "", false), new SensitiveTag("prefix", "", "", false), new SensitiveTag("bin", "", "", false), - new SensitiveTag("encryptedRequest", "", "", false) + new SensitiveTag("encryptedRequest", "", "", false), + new SensitiveTag("encryptedResponse", "", "", false) }; public static AuthenticationSchemeTag[] authenticationTags = new AuthenticationSchemeTag[] diff --git a/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Utility.cs b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Utility.cs new file mode 100644 index 00000000..66f596ed --- /dev/null +++ b/cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/Utility.cs @@ -0,0 +1,107 @@ +using System; +using System.IO; +using System.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace AuthenticationSdk.util +{ + public static class Utility + { + + /// + /// Reads a private key from a PKCS#12 (.p12 or .pfx) file. + /// + /// Path to the PKCS#12 file. + /// Password to unlock the file as SecureString. + /// The RSA or ECDsa private key. + /// If the file doesn't exist. + /// If no private key is found. + /// If the file is invalid or the password is wrong. + public static AsymmetricAlgorithm ReadPrivateKeyFromP12(string p12FilePath, SecureString password = null) + { + if (string.IsNullOrWhiteSpace(p12FilePath)) + { + throw new ArgumentException("File path cannot be null or empty", nameof(p12FilePath)); + } + + try + { + // Load the certificate (including private key) from the P12 file + var cert = new X509Certificate2( + p12FilePath, + password == null ? string.Empty : new System.Net.NetworkCredential(string.Empty, password).Password, + X509KeyStorageFlags.Exportable | X509KeyStorageFlags.MachineKeySet + ); + + // Check if private key exists + if (!cert.HasPrivateKey) + { + throw new InvalidOperationException("No private key found in the P12 file."); + } + + // Try RSA key + var rsaKey = cert.GetRSAPrivateKey(); + if (rsaKey != null) + { + return rsaKey; + } + + throw new InvalidOperationException("Private key found but unsupported algorithm type."); + } + catch (CryptographicException ex) + { + throw new CryptographicException("Failed to read private key. Possible causes: wrong password, corrupted file, or unsupported format.", ex); + } + catch (InvalidOperationException ex) + { + if (ex.Message.Contains("No private key found")) + { + throw new InvalidOperationException("No private key found in the P12 file.", ex); + } + else if (ex.Message.Contains("unsupported algorithm type")) + { + throw new InvalidOperationException("Private key found but unsupported algorithm type.", ex); + } + throw; + } + } + + public static SecureString ConvertStringToSecureString(string password) + { + if (string.IsNullOrEmpty(password)) + return null; + var securePassword = new SecureString(); + foreach (char c in password) + { + securePassword.AppendChar(c); + } + securePassword.MakeReadOnly(); + return securePassword; + } + + /// + /// Checks if the provided string represents a valid boolean value ("true" or "false", case-insensitive). + /// + /// The string to validate. + /// True if the string is "true" or "false" (case-insensitive); otherwise, false. + public static bool IsValidBooleanString(string value) + { + return string.Equals(value, "true", StringComparison.OrdinalIgnoreCase) || + string.Equals(value, "false", StringComparison.OrdinalIgnoreCase); + } + + /// + /// Extracts private key from file + /// + /// Path to PEM file + /// Password for encrypted keys (optional, SecureString) + /// RSA private key object + public static RSA ExtractPrivateKeyFromFile(string filePath, SecureString password = null) + { + return PEMUtility.ExtractPrivateKeyFromFile(filePath, password); + } + + } + +} diff --git a/cybersource-rest-client-netstandard/MLE.md b/cybersource-rest-client-netstandard/MLE.md index 2ecb7423..55a63dc0 100644 --- a/cybersource-rest-client-netstandard/MLE.md +++ b/cybersource-rest-client-netstandard/MLE.md @@ -4,110 +4,522 @@ 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. +MLE supports both **Request Encryption** (encrypting outgoing request payloads) and **Response Decryption** (decrypting incoming response payloads). + +## Authentication Requirements + +- **Request MLE**: Only supported with `JWT (JSON Web Token)` authentication type +- **Response MLE**: Only supported with `JWT (JSON Web Token)` authentication type + +
+ ## Configuration -### Global MLE Configuration +## 1. Request MLE Configuration + +#### 1.1 Global Request MLE Configuration -In the `merchantConfig` object, set the `useMLEGlobally` variable to enable or disable MLE for all supported APIs for the Rest SDK. +Configure global settings for request MLE using these properties in your `merchantConfig`: -- **Variable**: `useMLEGlobally` -- **Type**: `boolean` +##### (i) Primary Configuration + +- **Variable**: `enableRequestMLEForOptionalApisGlobally` +- **Type**: `bool` - **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`. +- **Description**: Enables request MLE globally for all APIs that have optional MLE support when set to `true`. -### API-level MLE Control +--- -Optionally, you can control the MLE feature at the API level using the `mapToControlMLEonAPI` variable in the `merchantConfig` object. +##### (ii) Deprecated Configuration (Backward Compatibility) -- **Variable**: `mapToControlMLEonAPI` -- **Type**: `Dictionary` -- **Description**: Overrides the global MLE setting for specific APIs. The key is the function name of the API in the SDK, and the value is a boolean indicating whether MLE should be enabled (`true`) or disabled (`false`) for that specific API call. +- **Variable**: `useMLEGlobally` ⚠️ **DEPRECATED** +- **Type**: `bool` +- **Default**: `false` +- **Description**: **DEPRECATED** - Use `enableRequestMLEForOptionalApisGlobally` instead. This field is maintained for backward compatibility and will be used as an alias for `enableRequestMLEForOptionalApisGlobally`. + +--- + +##### (iii) Advanced Configuration + +- **Variable**: `disableRequestMLEForMandatoryApisGlobally` +- **Type**: `bool` +- **Default**: `false` +- **Description**: Disables request MLE for APIs that have mandatory MLE requirement when set to `true`. + +--- + +#### 1.2 Request MLE Certificate Configuration [Optional Params] + +##### (i) Certificate File Path (Optional) + +- **Variable**: `mleForRequestPublicCertPath` +- **Type**: `string` +- **Optional**: `true` +- **Description**: Path to the public certificate file used for request encryption. Supported formats: `.pem`, `.crt`. + - **Note**: This parameter is optional when using JWT authentication. If not provided, the request MLE certificate will be automatically fetched from the JWT authentication P12 file using the `requestMleKeyAlias`. + +--- -### MLE Key Alias +##### (ii) Key Alias Configuration (Optional) -Another optional parameter for MLE is `mleKeyAlias`, which specifies the key alias used to retrieve the MLE certificate from the JWT P12 file. +- **Variable**: `requestMleKeyAlias` +- **Type**: `string` +- **Optional**: `true` +- **Default**: `CyberSource_SJC_US` +- **Description**: Key alias used to retrieve the MLE certificate from the certificate file. When `mleForRequestPublicCertPath` is not provided, this alias is used to fetch the certificate from the JWT authentication P12 file. If not specified, the SDK will automatically use the default value `CyberSource_SJC_US`. + +--- -- **Variable**: `mleKeyAlias` +##### (iii) Deprecated Key Alias (Backward Compatibility) (Optional) + +- **Variable**: `mleKeyAlias` ⚠️ **DEPRECATED** - **Type**: `string` +- **Optional**: `true` - **Default**: `CyberSource_SJC_US` -- **Description**: By default, CyberSource uses the `CyberSource_SJC_US` public certificate to encrypt the payload. However, users can override this default value by setting their own key alias. - -## Notes -- If `useMLEGlobally` is set to true, it will enable MLE for all API calls that support MLE by CyberSource, unless overridden by mapToControlMLEonAPI. -- If `mapToControlMLEonAPI` is not provided or does not contain a specific API function name, the global useMLEGlobally setting will be applied. -- The `mleKeyAlias` parameter is optional and defaults to CyberSource_SJC_US if not specified by the user. Users can override this default value by setting their own key alias. - -## Example Configuration - - private readonly Dictionary _configurationDictionary = new Dictionary(); - - public Dictionary GetConfiguration() - { - _configurationDictionary.Add("authenticationType", "JWT"); - _configurationDictionary.Add("useMLEGlobally", "true"); //globally MLE will be enabled for all the MLE supported APIs by Cybs in SDK - _configurationDictionary.Add("mleKeyAlias", "CyberSource_SJC_US"); //this is optional paramter, not required to set the parameter/value if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". - //other properties - } - -Or - - private readonly Dictionary _configurationDictionary = new Dictionary(); - private readonly Dictionary _configurationDictionaryforMLE = new Dictionary(); - - public Dictionary GetMapToControlMLE() - { - _configurationDictionaryforMLE.Add("CreatePayment", true); //CreatePayment function will have MLE=true i.e. (/pts/v2/payments POST API) - _configurationDictionaryforMLE.Add("CapturePayment", false); //capturePayment function will have MLE=false i.e. (/pts/v2/payments/{id}/captures POST API) - - return _configurationDictionaryforMLE; - } - - public Dictionary GetConfiguration() - { - _configurationDictionary.Add("authenticationType", "JWT"); - _configurationDictionary.Add("useMLEGlobally", "true"); //globally MLE will be enabled for all the MLE supported APIs by Cybs in SDK except the APIs marked false in GetMapToControlMLE. - _configurationDictionary.Add("mleKeyAlias", "CyberSource_SJC_US"); //this is optional paramter, not required to set the parameter/value if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". - //other properties - } - -Or - - private readonly Dictionary _configurationDictionary = new Dictionary(); - private readonly Dictionary _configurationDictionaryforMLE = new Dictionary(); - - public Dictionary GetMapToControlMLE() - { - _configurationDictionaryforMLE.Add("CreatePayment", true); //CreatePayment function will have MLE=true i.e. (/pts/v2/payments POST API) - _configurationDictionaryforMLE.Add("CapturePayment", false); //capturePayment function will have MLE=false i.e. (/pts/v2/payments/{id}/captures POST API) - - return _configurationDictionaryforMLE; - } - - public Dictionary GetConfiguration() - { - _configurationDictionary.Add("authenticationType", "JWT"); - _configurationDictionary.Add("useMLEGlobally", "false"); //globally MLE will be disabled for all the MLE supported APIs by Cybs in SDK, the APIs marked true in GetMapToControlMLE will only have MLE enabled. - _configurationDictionary.Add("mleKeyAlias", "CyberSource_SJC_US"); //this is optional paramter, not required to set the parameter/value if custom value is not required for MLE key alias. Default value is "CyberSource_SJC_US". - //other properties - } - -In the above example: -- MLE is enabled/disabled globally (`useMLEGlobally` is true/false). -- `apiFunctionName1` i.e "CapturePayment" will have MLE disabled/enabled based on value provided. -- `apiFunctionName2` i.e. "CreatePayment" will have MLE enabled. -- `mleKeyAlias` is set to `Custom_Key_Alias`, overriding the default value. - -Please refer given link for sample codes with MLE: https://github.com/CyberSource/cybersource-rest-samples-csharp/tree/master/Source/Samples/MLEFeature - -## Additional Information - -### API Support -- MLE is initially designed to support a few APIs. -- It can be extended to support more APIs in the future based on requirements and updates. -### Authentication Type -- MLE is only supported with `JWT (JSON Web Token)` authentication type within the SDK. -### Using the SDK -To use the MLE feature in the SDK, configure the `merchantConfig` object as shown above and pass it to the SDK initialization. - -## Contact +- **Description**: **DEPRECATED** - Use `requestMleKeyAlias` instead. This field is maintained for backward compatibility and will be used as an alias for `requestMleKeyAlias`. + +
+ +## 2. Response MLE Configuration + +#### 2.1 Global Response MLE Configuration + +- **Variable**: `enableResponseMleGlobally` +- **Type**: `bool` +- **Default**: `false` +- **Description**: Enables response MLE globally for all APIs that support MLE responses when set to `true`. + +---- + +#### 2.2 Response MLE Private Key Configuration + +##### (i) Option 1: Provide Private Key Object + +- **Variable**: `responseMlePrivateKey` +- **Type**: `AsymmetricAlgorithm` +- **Description**: Direct private key object for response decryption. + +--- + +##### (ii) Option 2: Provide Private Key File Path + +- **Variable**: `responseMlePrivateKeyFilePath` +- **Type**: `string` +- **Description**: Path to the private key file. Supported formats: `.p12`, `.pfx`, `.pem`, `.key`, `.p8`. Recommendation use encrypted private Key (password protection) for MLE response. + +--- + +##### (iii) Private Key File Password + +- **Variable**: `responseMlePrivateKeyFilePassword` +- **Type**: `String` +- **Description**: Password for the private key file (required for `.p12/.pfx` files or encrypted private keys). + +--- + +#### 2.3 Response MLE Additional Configuration + +- **Variable**: `responseMleKID` +- **Type**: `string` +- **Required**: `true` (when response MLE is enabled) +- **Description**: Key ID value for the MLE response certificate (provided in merchant portal). + +
+ +## 3. API-level MLE Control for Request and Response MLE + +### Dictionary Configuration + +- **Variable**: `mapToControlMLEonAPI` +- **Type**: `Dictionary` +- **Description**: Overrides global MLE settings for specific APIs. The key is the API function name, and the value controls both request and response MLE. +- **Example**: `Dictionary { {"apiFunctionName", "true::true"} }` + +#### Structure of Values in Dictionary: + +(i) **"requestMLE::responseMLE"** - Control both request and response MLE + - `"true::true"` - Enable both request and response MLE + - `"false::false"` - Disable both request and response MLE + - `"true::false"` - Enable request MLE, disable response MLE + - `"false::true"` - Disable request MLE, enable response MLE + - `"::true"` - Use global setting for request, enable response MLE + - `"true::"` - Enable request MLE, use global setting for response + - `"::false"` - Use global setting for request, disable response MLE + - `"false::"` - Disable request MLE, use global setting for response + +(ii) **"requestMLE"** - Control request MLE only (response uses global setting) + - `"true"` - Enable request MLE + - `"false"` - Disable request MLE + +
+ +## 4. Example Configurations + +### (i) Minimal Request MLE Configuration + +```csharp +// Dictionary-based configuration - Uses defaults (most common scenario) +private readonly Dictionary _configurationDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + _configurationDictionary.Add("enableRequestMLEForOptionalApisGlobally", "true"); + // Both mleForRequestPublicCertPath and requestMleKeyAlias are optional + // SDK will use JWT P12 file with default alias "CyberSource_SJC_US" + + return _configurationDictionary; +} +``` + +### (ii) Request MLE with Deprecated Parameters (Backward Compatibility) + +```csharp +// Using deprecated parameters - still supported but not recommended +private readonly Dictionary _configurationDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + _configurationDictionary.Add("useMLEGlobally", "true"); // Deprecated - use enableRequestMLEForOptionalApisGlobally + _configurationDictionary.Add("mleKeyAlias", "Custom_Key_Alias"); // Deprecated - use requestMleKeyAlias + + return _configurationDictionary; +} +``` + +### (iii) Request MLE with Custom Key Alias + +```csharp +// Dictionary-based configuration - With custom key alias only +private readonly Dictionary _configurationDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + _configurationDictionary.Add("enableRequestMLEForOptionalApisGlobally", "true"); + _configurationDictionary.Add("requestMleKeyAlias", "Custom_Key_Alias"); + // Will fetch from JWT P12 file using custom alias + + return _configurationDictionary; +} +``` + +### (iv) Request MLE with Separate Certificate File + +```csharp +// Dictionary-based configuration - With separate MLE certificate file +private readonly Dictionary _configurationDictionary = new Dictionary(); +private readonly Dictionary _mleControlDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + _configurationDictionary.Add("enableRequestMLEForOptionalApisGlobally", "true"); + _configurationDictionary.Add("mleForRequestPublicCertPath", "C:\path\to\public\cert.pem"); + _configurationDictionary.Add("requestMleKeyAlias", "Custom_Key_Alias"); + + return _configurationDictionary; +} + +public Dictionary GetMLEControlMap() +{ + _mleControlDictionary.Add("CreatePayment", "true"); // Enable request MLE for this API + _mleControlDictionary.Add("CapturePayment", "false"); // Disable request MLE for this API + + return _mleControlDictionary; +} +``` + +### (v) Response MLE Configuration with Private Key File + +```csharp +// Dictionary-based configuration +private readonly Dictionary _configurationDictionary = new Dictionary(); +private readonly Dictionary _mleControlDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + _configurationDictionary.Add("enableResponseMleGlobally", "true"); + _configurationDictionary.Add("responseMlePrivateKeyFilePath", "C:\path\to\private\key.p12"); + _configurationDictionary.Add("responseMlePrivateKeyFilePassword", "password"); + _configurationDictionary.Add("responseMleKID", "your-key-id"); + + return _configurationDictionary; +} + +public Dictionary GetMLEControlMap() +{ + _mleControlDictionary.Add("CreatePayment", "::true"); // Enable response MLE only for this API + + return _mleControlDictionary; +} +``` + +### (vi) Response MLE Configuration with Private Key Object + +```csharp +// Load private key programmatically +AsymmetricAlgorithm privateKey = LoadPrivateKeyFromSomewhere(); + +// Dictionary-based configuration +private readonly Dictionary _configurationDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + _configurationDictionary.Add("enableResponseMleGlobally", "true"); + _configurationDictionary.Add("responseMleKID", "your-key-id"); + + return _configurationDictionary; +} + +// Use constructor that accepts private key object +MerchantConfig merchantConfig = new MerchantConfig(GetConfiguration(), null, privateKey); +``` + +### (vii) Both Request and Response MLE Configuration + +```csharp +// Dictionary-based configuration +private readonly Dictionary _configurationDictionary = new Dictionary(); +private readonly Dictionary _mleControlDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + + // Request MLE settings (minimal - uses defaults) + _configurationDictionary.Add("enableRequestMLEForOptionalApisGlobally", "true"); + + // Response MLE settings + _configurationDictionary.Add("enableResponseMleGlobally", "true"); + _configurationDictionary.Add("responseMlePrivateKeyFilePath", @"C:\path\to\private\key.p12"); + _configurationDictionary.Add("responseMlePrivateKeyFilePassword", "password"); + _configurationDictionary.Add("responseMleKID", "your-key-id"); + + return _configurationDictionary; +} + +public Dictionary GetMLEControlMap() +{ + _mleControlDictionary.Add("CreatePayment", "true::true"); // Enable both request and response MLE for this API + _mleControlDictionary.Add("CapturePayment", "false::true"); // Disable request, enable response MLE for this API + _mleControlDictionary.Add("RefundPayment", "true::false"); // Enable request, disable response MLE for this API + _mleControlDictionary.Add("CreateCredit", "::true"); // Use global request setting, enable response MLE for this API + + return _mleControlDictionary; +} +``` + +### (viii) Mixed Configuration (New and Deprecated Parameters) + +```csharp +// Example showing both new and deprecated parameters (deprecated will be used as aliases) +private readonly Dictionary _configurationDictionary = new Dictionary(); + +public Dictionary GetConfiguration() +{ + _configurationDictionary.Add("authenticationType", "JWT"); + + // If both are set with same value, it works fine + _configurationDictionary.Add("enableRequestMLEForOptionalApisGlobally", "true"); + _configurationDictionary.Add("useMLEGlobally", "true"); // Deprecated but same value + + // If both are set with different values, it will cause ConfigException + + // Key alias - new parameter takes precedence if both are provided + _configurationDictionary.Add("requestMleKeyAlias", "New_Alias"); + _configurationDictionary.Add("mleKeyAlias", "Old_Alias"); // This will be ignored + + return _configurationDictionary; +} +``` + +
+ +## 5. App.Config Configuration Examples + +### (i) Minimal Request MLE + +```xml + + +
+ + + + + + +``` + +### (ii) Request MLE with Deprecated Parameters + +```xml + + +
+ + + + + + + +``` + +### (iii) Request MLE with Custom Configuration + +```xml + + +
+ + + + + + + + +``` + +### (iv) Response MLE Only + +```xml + + +
+ + + + + + + + + +``` + +### (v) Both Request and Response MLE + +```xml + + +
+ + + + + + + + + + +``` + +
+ +## 6. Supported Private Key File Formats + +For Response MLE private key files, the following formats are supported: + +- **PKCS#12**: `.p12`, `.pfx` (requires password) +- **PEM**: `.pem`, `.key`, `.p8` (supports both encrypted and unencrypted) + +
+ +## 7. Important Notes + +### (i) Request MLE +- Both `mleForRequestPublicCertPath` and `requestMleKeyAlias` are **optional** parameters +- If `mleForRequestPublicCertPath` is not provided, the SDK will automatically fetch the MLE certificate from the JWT authentication P12 file +- If `requestMleKeyAlias` is not provided, the SDK will use the default value `CyberSource_SJC_US` +- The SDK provides flexible configuration options: you can use defaults, customize the key alias only, or provide a separate certificate file +- If `enableRequestMLEForOptionalApisGlobally` is set to `true`, it enables request MLE for all APIs that have optional MLE support +- APIs with mandatory MLE requirements are enabled by default unless `disableRequestMLEForMandatoryApisGlobally` is set to `true` +- If `mapToControlMLEonAPI` doesn't contain a specific API, the global setting applies +- For HTTP Signature authentication, request MLE will fall back to non-encrypted requests with a warning + +### (ii) Response MLE +- Response MLE requires either `responseMlePrivateKey` object OR `responseMlePrivateKeyFilePath` (not both) +- The `responseMleKID` parameter is mandatory when response MLE is enabled +- If an API expects a mandatory MLE response but the map specifies non-MLE response, the API might return an error +- Both the private key object and file path approaches are mutually exclusive +- `responseMlePrivateKeyFilePassword` uses `SecureString` type for enhanced security + +### (iii) Backward Compatibility +- `useMLEGlobally` is **deprecated** but still supported as an alias for `enableRequestMLEForOptionalApisGlobally` + +- If `useMLEGlobally` and `enableRequestMLEForOptionalApisGlobally` are provided with **different values**, it will cause a `ConfigException` +- `mleKeyAlias` is **deprecated** but still supported as an alias for `requestMleKeyAlias` +- When both `mleKeyAlias` and `requestMleKeyAlias` are provided, the **`requestMleKeyAlias`** takes precedence + +### (iv) API-level Control Validation +- The `mapToControlMLEonAPI` values are validated for proper format +- Invalid formats (empty values, multiple separators, non-boolean values) will cause configuration errors +- Empty string after or before `::` separator will use global defaults + + +### (v) Configuration Validation +- The SDK performs comprehensive validation of MLE configuration parameters +- Conflicting values between new and deprecated parameters will result in `ConfigException` +- File path validation is performed for certificate and private key files +- Invalid boolean values in `mapToControlMLEonAPI` will cause parsing errors + +
+ +## 8. Error Handling + +The SDK provides specific error messages for common MLE issues: +- Invalid private key for response decryption +- Missing certificates for request encryption +- Invalid file formats or paths +- Authentication type mismatches +- Configuration validation errors +- Conflicting parameter values between new and deprecated fields +- Invalid format in `mapToControlMLEonAPI` values + +
+ +## 9. Sample Code Repository + +For comprehensive examples and sample implementations, please refer to: +[Cybersource .NET Sample Code Repository (on GitHub)](https://github.com/CyberSource/cybersource-rest-samples-csharp) + +
+ +## 10. Additional Information + +### (i) API Support +- MLE is designed to support specific APIs that have been enabled for encryption +- Support can be extended to additional APIs based on requirements and updates + +### (ii) 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. The SDK will automatically handle encryption and decryption based on your configuration. + + + +### (iii) Migration from Deprecated Parameters + +If you're currently using deprecated parameters, here's how to migrate: + +```csharp +// OLD (Deprecated) +_configurationDictionary.Add("useMLEGlobally", "true"); +_configurationDictionary.Add("mleKeyAlias", "Custom_Alias"); + +// NEW (Recommended) +_configurationDictionary.Add("enableRequestMLEForOptionalApisGlobally", "true"); +_configurationDictionary.Add("requestMleKeyAlias", "Custom_Alias"); +``` + +The deprecated parameters will continue to work but are not recommended for new implementations. + +
+ +## 11. Contact For any issues or further assistance, please open an issue on the GitHub repository or contact our support team. diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BankAccountValidationApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BankAccountValidationApi.cs index b167a97a..ec09aa97 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BankAccountValidationApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BankAccountValidationApi.cs @@ -283,7 +283,7 @@ public ApiResponse< InlineResponse20013 > BankAccountValidationRequestWithHttpIn } string inboundMLEStatus = "mandatory"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "BankAccountValidationRequest,BankAccountValidationRequestAsync,BankAccountValidationRequestWithHttpInfo,BankAccountValidationRequestAsyncWithHttpInfo")) { try @@ -297,13 +297,15 @@ public ApiResponse< InlineResponse20013 > BankAccountValidationRequestWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "BankAccountValidationRequest,BankAccountValidationRequestAsync,BankAccountValidationRequestWithHttpInfo,BankAccountValidationRequestAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -319,7 +321,7 @@ public ApiResponse< InlineResponse20013 > BankAccountValidationRequestWithHttpIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20013))); // Return statement + (InlineResponse20013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20013),merchantConfig)); // Return statement } /// @@ -392,7 +394,7 @@ public async System.Threading.Tasks.Task> BankA } string inboundMLEStatus = "mandatory"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "BankAccountValidationRequest,BankAccountValidationRequestAsync,BankAccountValidationRequestWithHttpInfo,BankAccountValidationRequestAsyncWithHttpInfo")) { try @@ -406,13 +408,15 @@ public async System.Threading.Tasks.Task> BankA } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "BankAccountValidationRequest,BankAccountValidationRequestAsync,BankAccountValidationRequestWithHttpInfo,BankAccountValidationRequestAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -428,7 +432,7 @@ public async System.Threading.Tasks.Task> BankA return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20013))); // Return statement + (InlineResponse20013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20013), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BatchesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BatchesApi.cs index 9c3729bf..850ff1c9 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BatchesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BatchesApi.cs @@ -429,7 +429,7 @@ public ApiResponse< InlineResponse20012 > GetBatchReportWithHttpInfo (string bat } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetBatchReport,GetBatchReportAsync,GetBatchReportWithHttpInfo,GetBatchReportAsyncWithHttpInfo")) { try @@ -443,12 +443,14 @@ public ApiResponse< InlineResponse20012 > GetBatchReportWithHttpInfo (string bat } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetBatchReport,GetBatchReportAsync,GetBatchReportWithHttpInfo,GetBatchReportAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -464,7 +466,7 @@ public ApiResponse< InlineResponse20012 > GetBatchReportWithHttpInfo (string bat return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20012))); // Return statement + (InlineResponse20012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20012),merchantConfig)); // Return statement } /// @@ -546,7 +548,7 @@ public async System.Threading.Tasks.Task> GetBa } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetBatchReport,GetBatchReportAsync,GetBatchReportWithHttpInfo,GetBatchReportAsyncWithHttpInfo")) { try @@ -560,12 +562,14 @@ public async System.Threading.Tasks.Task> GetBa } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetBatchReport,GetBatchReportAsync,GetBatchReportWithHttpInfo,GetBatchReportAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -581,7 +585,7 @@ public async System.Threading.Tasks.Task> GetBa return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20012))); // Return statement + (InlineResponse20012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20012), merchantConfig)); // Return statement } /// /// Retrieve a Batch Status **Get Batch Status**<br>This resource accepts a batch id and returns: - The batch status. - The total number of accepted, rejected, updated records. - The total number of card association responses. - The billable quantities of: - New Account Numbers (NAN) - New Expiry Dates (NED) - Account Closures (ACL) - Contact Card Holders (CCH) @@ -661,7 +665,7 @@ public ApiResponse< InlineResponse20011 > GetBatchStatusWithHttpInfo (string bat } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetBatchStatus,GetBatchStatusAsync,GetBatchStatusWithHttpInfo,GetBatchStatusAsyncWithHttpInfo")) { try @@ -675,12 +679,14 @@ public ApiResponse< InlineResponse20011 > GetBatchStatusWithHttpInfo (string bat } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetBatchStatus,GetBatchStatusAsync,GetBatchStatusWithHttpInfo,GetBatchStatusAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -696,7 +702,7 @@ public ApiResponse< InlineResponse20011 > GetBatchStatusWithHttpInfo (string bat return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20011))); // Return statement + (InlineResponse20011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20011),merchantConfig)); // Return statement } /// @@ -778,7 +784,7 @@ public async System.Threading.Tasks.Task> GetBa } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetBatchStatus,GetBatchStatusAsync,GetBatchStatusWithHttpInfo,GetBatchStatusAsyncWithHttpInfo")) { try @@ -792,12 +798,14 @@ public async System.Threading.Tasks.Task> GetBa } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetBatchStatus,GetBatchStatusAsync,GetBatchStatusWithHttpInfo,GetBatchStatusAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -813,7 +821,7 @@ public async System.Threading.Tasks.Task> GetBa return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20011))); // Return statement + (InlineResponse20011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20011), merchantConfig)); // Return statement } /// /// List Batches **List Batches**<br>This resource accepts a optional date range, record offset and limit, returning a paginated response of batches containing: - The batch id. - The batch status. - The batch created / modified dates. - The total number of accepted, rejected, updated records. - The total number of card association responses. @@ -908,7 +916,7 @@ public ApiResponse< InlineResponse20010 > GetBatchesListWithHttpInfo (long? offs } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetBatchesList,GetBatchesListAsync,GetBatchesListWithHttpInfo,GetBatchesListAsyncWithHttpInfo")) { try @@ -922,12 +930,14 @@ public ApiResponse< InlineResponse20010 > GetBatchesListWithHttpInfo (long? offs } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetBatchesList,GetBatchesListAsync,GetBatchesListWithHttpInfo,GetBatchesListAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -943,7 +953,7 @@ public ApiResponse< InlineResponse20010 > GetBatchesListWithHttpInfo (long? offs return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20010) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20010))); // Return statement + (InlineResponse20010) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20010),merchantConfig)); // Return statement } /// @@ -1040,7 +1050,7 @@ public async System.Threading.Tasks.Task> GetBa } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetBatchesList,GetBatchesListAsync,GetBatchesListWithHttpInfo,GetBatchesListAsyncWithHttpInfo")) { try @@ -1054,12 +1064,14 @@ public async System.Threading.Tasks.Task> GetBa } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetBatchesList,GetBatchesListAsync,GetBatchesListWithHttpInfo,GetBatchesListAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1075,7 +1087,7 @@ public async System.Threading.Tasks.Task> GetBa return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse20010) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20010))); // Return statement + (InlineResponse20010) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse20010), merchantConfig)); // Return statement } /// /// Create a Batch **Create a Batch**<br>This resource accepts TMS tokens ids of a Customer, Payment Instrument or Instrument Identifier. <br> The card numbers for the supplied tokens ids are then sent to the relevant card associations to check for updates.<br>The following type of batches can be submitted: - **oneOff** batch containing tokens id for Visa or MasterCard card numbers. - **amexRegistration** batch containing tokens id for Amex card numbers. A batch id will be returned on a successful response which can be used to get the batch status and the batch report. The availability of API features for a merchant may depend on the portfolio configuration and may need to be enabled at the portfolio level before they can be added to merchant accounts. @@ -1146,7 +1158,7 @@ public ApiResponse< InlineResponse202 > PostBatchWithHttpInfo (Body body) } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostBatch,PostBatchAsync,PostBatchWithHttpInfo,PostBatchAsyncWithHttpInfo")) { try @@ -1160,13 +1172,15 @@ public ApiResponse< InlineResponse202 > PostBatchWithHttpInfo (Body body) } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostBatch,PostBatchAsync,PostBatchWithHttpInfo,PostBatchAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1182,7 +1196,7 @@ public ApiResponse< InlineResponse202 > PostBatchWithHttpInfo (Body body) return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse202) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse202))); // Return statement + (InlineResponse202) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse202),merchantConfig)); // Return statement } /// @@ -1255,7 +1269,7 @@ public async System.Threading.Tasks.Task> PostBat } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostBatch,PostBatchAsync,PostBatchWithHttpInfo,PostBatchAsyncWithHttpInfo")) { try @@ -1269,13 +1283,15 @@ public async System.Threading.Tasks.Task> PostBat } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostBatch,PostBatchAsync,PostBatchWithHttpInfo,PostBatchAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1291,7 +1307,7 @@ public async System.Threading.Tasks.Task> PostBat return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse202) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse202))); // Return statement + (InlineResponse202) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse202), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BillingAgreementsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BillingAgreementsApi.cs index 9ceb42e6..51d0b7b2 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BillingAgreementsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BillingAgreementsApi.cs @@ -387,7 +387,7 @@ public ApiResponse< PtsV2ModifyBillingAgreementPost201Response > BillingAgreemen } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "BillingAgreementsDeRegistration,BillingAgreementsDeRegistrationAsync,BillingAgreementsDeRegistrationWithHttpInfo,BillingAgreementsDeRegistrationAsyncWithHttpInfo")) { try @@ -401,13 +401,15 @@ public ApiResponse< PtsV2ModifyBillingAgreementPost201Response > BillingAgreemen } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "BillingAgreementsDeRegistration,BillingAgreementsDeRegistrationAsync,BillingAgreementsDeRegistrationWithHttpInfo,BillingAgreementsDeRegistrationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -423,7 +425,7 @@ public ApiResponse< PtsV2ModifyBillingAgreementPost201Response > BillingAgreemen return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2ModifyBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2ModifyBillingAgreementPost201Response))); // Return statement + (PtsV2ModifyBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2ModifyBillingAgreementPost201Response),merchantConfig)); // Return statement } /// @@ -509,7 +511,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2ModifyBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2ModifyBillingAgreementPost201Response))); // Return statement + (PtsV2ModifyBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2ModifyBillingAgreementPost201Response), merchantConfig)); // Return statement } /// /// Standing Instruction intimation Standing Instruction with or without Token. @@ -629,7 +633,7 @@ public ApiResponse< PtsV2CreditsPost201Response1 > BillingAgreementsIntimationWi } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "BillingAgreementsIntimation,BillingAgreementsIntimationAsync,BillingAgreementsIntimationWithHttpInfo,BillingAgreementsIntimationAsyncWithHttpInfo")) { try @@ -643,13 +647,15 @@ public ApiResponse< PtsV2CreditsPost201Response1 > BillingAgreementsIntimationWi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "BillingAgreementsIntimation,BillingAgreementsIntimationAsync,BillingAgreementsIntimationWithHttpInfo,BillingAgreementsIntimationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -665,7 +671,7 @@ public ApiResponse< PtsV2CreditsPost201Response1 > BillingAgreementsIntimationWi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreditsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response1))); // Return statement + (PtsV2CreditsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response1),merchantConfig)); // Return statement } /// @@ -751,7 +757,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreditsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response1))); // Return statement + (PtsV2CreditsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response1), merchantConfig)); // Return statement } /// /// Create a Billing Agreement #### Standing Instruction: Standing Instruction with or without Token. Transaction amount in case First payment is coming along with registration. Only 2 decimal places allowed #### Create Mandate: You can create a mandate through the direct debit mandate flow. Possible create mandate status values: - Pending—the create mandate request was successfully processed. - Failed—the create mandate request was not accepted. #### Import Mandate: In the Bacs scheme, a mandate is created with a status of active. Direct debit collections can be made against it immediately. You can import a mandate to the CyberSource database when: - You have existing customers with signed, active mandates - You manage mandates outside of CyberSource. When you import an existing mandate to the CyberSource database, provide a unique value for the mandate ID or the request results in an error. If an import mandate request is not accepted, the import mandate status value is failed. @@ -858,7 +866,7 @@ public ApiResponse< PtsV2CreateBillingAgreementPost201Response > BillingAgreemen } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "BillingAgreementsRegistration,BillingAgreementsRegistrationAsync,BillingAgreementsRegistrationWithHttpInfo,BillingAgreementsRegistrationAsyncWithHttpInfo")) { try @@ -872,13 +880,15 @@ public ApiResponse< PtsV2CreateBillingAgreementPost201Response > BillingAgreemen } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "BillingAgreementsRegistration,BillingAgreementsRegistrationAsync,BillingAgreementsRegistrationWithHttpInfo,BillingAgreementsRegistrationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -894,7 +904,7 @@ public ApiResponse< PtsV2CreateBillingAgreementPost201Response > BillingAgreemen return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreateBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateBillingAgreementPost201Response))); // Return statement + (PtsV2CreateBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateBillingAgreementPost201Response),merchantConfig)); // Return statement } /// @@ -967,7 +977,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreateBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateBillingAgreementPost201Response))); // Return statement + (PtsV2CreateBillingAgreementPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateBillingAgreementPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BinLookupApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BinLookupApi.cs index 572dd789..69cdf317 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BinLookupApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/BinLookupApi.cs @@ -283,7 +283,7 @@ public ApiResponse< InlineResponse2012 > GetAccountInfoWithHttpInfo (CreateBinLo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo")) { try @@ -297,13 +297,15 @@ public ApiResponse< InlineResponse2012 > GetAccountInfoWithHttpInfo (CreateBinLo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -319,7 +321,7 @@ public ApiResponse< InlineResponse2012 > GetAccountInfoWithHttpInfo (CreateBinLo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2012))); // Return statement + (InlineResponse2012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2012),merchantConfig)); // Return statement } /// @@ -392,7 +394,7 @@ public async System.Threading.Tasks.Task> GetAcc } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo")) { try @@ -406,13 +408,15 @@ public async System.Threading.Tasks.Task> GetAcc } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -428,7 +432,7 @@ public async System.Threading.Tasks.Task> GetAcc return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2012))); // Return statement + (InlineResponse2012) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2012), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CaptureApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CaptureApi.cs index 30a60a33..41e2a65c 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CaptureApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CaptureApi.cs @@ -299,7 +299,7 @@ public ApiResponse< PtsV2PaymentsCapturesPost201Response > CapturePaymentWithHtt } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CapturePayment,CapturePaymentAsync,CapturePaymentWithHttpInfo,CapturePaymentAsyncWithHttpInfo")) { try @@ -313,13 +313,15 @@ public ApiResponse< PtsV2PaymentsCapturesPost201Response > CapturePaymentWithHtt } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CapturePayment,CapturePaymentAsync,CapturePaymentWithHttpInfo,CapturePaymentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -335,7 +337,7 @@ public ApiResponse< PtsV2PaymentsCapturesPost201Response > CapturePaymentWithHtt return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsCapturesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsCapturesPost201Response))); // Return statement + (PtsV2PaymentsCapturesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsCapturesPost201Response),merchantConfig)); // Return statement } /// @@ -421,7 +423,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsCapturesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsCapturesPost201Response))); // Return statement + (PtsV2PaymentsCapturesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsCapturesPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackDetailsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackDetailsApi.cs index eb061ae7..d703917f 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackDetailsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackDetailsApi.cs @@ -320,7 +320,7 @@ public ApiResponse< ReportingV3ChargebackDetailsGet200Response > GetChargebackDe } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetChargebackDetails,GetChargebackDetailsAsync,GetChargebackDetailsWithHttpInfo,GetChargebackDetailsAsyncWithHttpInfo")) { try @@ -334,12 +334,14 @@ public ApiResponse< ReportingV3ChargebackDetailsGet200Response > GetChargebackDe } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetChargebackDetails,GetChargebackDetailsAsync,GetChargebackDetailsWithHttpInfo,GetChargebackDetailsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -355,7 +357,7 @@ public ApiResponse< ReportingV3ChargebackDetailsGet200Response > GetChargebackDe return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ChargebackDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackDetailsGet200Response))); // Return statement + (ReportingV3ChargebackDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackDetailsGet200Response),merchantConfig)); // Return statement } /// @@ -458,7 +460,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ChargebackDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackDetailsGet200Response))); // Return statement + (ReportingV3ChargebackDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackDetailsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackSummariesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackSummariesApi.cs index 8edfe553..94abaa51 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackSummariesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ChargebackSummariesApi.cs @@ -320,7 +320,7 @@ public ApiResponse< ReportingV3ChargebackSummariesGet200Response > GetChargeback } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetChargebackSummaries,GetChargebackSummariesAsync,GetChargebackSummariesWithHttpInfo,GetChargebackSummariesAsyncWithHttpInfo")) { try @@ -334,12 +334,14 @@ public ApiResponse< ReportingV3ChargebackSummariesGet200Response > GetChargeback } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetChargebackSummaries,GetChargebackSummariesAsync,GetChargebackSummariesWithHttpInfo,GetChargebackSummariesAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -355,7 +357,7 @@ public ApiResponse< ReportingV3ChargebackSummariesGet200Response > GetChargeback return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ChargebackSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackSummariesGet200Response))); // Return statement + (ReportingV3ChargebackSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackSummariesGet200Response),merchantConfig)); // Return statement } /// @@ -458,7 +460,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ChargebackSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackSummariesGet200Response))); // Return statement + (ReportingV3ChargebackSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ChargebackSummariesGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ConversionDetailsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ConversionDetailsApi.cs index b15f6576..94ce2cdf 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ConversionDetailsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ConversionDetailsApi.cs @@ -320,7 +320,7 @@ public ApiResponse< ReportingV3ConversionDetailsGet200Response > GetConversionDe } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetConversionDetail,GetConversionDetailAsync,GetConversionDetailWithHttpInfo,GetConversionDetailAsyncWithHttpInfo")) { try @@ -334,12 +334,14 @@ public ApiResponse< ReportingV3ConversionDetailsGet200Response > GetConversionDe } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetConversionDetail,GetConversionDetailAsync,GetConversionDetailWithHttpInfo,GetConversionDetailAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -355,7 +357,7 @@ public ApiResponse< ReportingV3ConversionDetailsGet200Response > GetConversionDe return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ConversionDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ConversionDetailsGet200Response))); // Return statement + (ReportingV3ConversionDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ConversionDetailsGet200Response),merchantConfig)); // Return statement } /// @@ -458,7 +460,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ConversionDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ConversionDetailsGet200Response))); // Return statement + (ReportingV3ConversionDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ConversionDetailsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreateNewWebhooksApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreateNewWebhooksApi.cs index f76601df..135cc212 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreateNewWebhooksApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreateNewWebhooksApi.cs @@ -387,7 +387,7 @@ public ApiResponse< List > FindProductsToSubscribeWithHttpIn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "FindProductsToSubscribe,FindProductsToSubscribeAsync,FindProductsToSubscribeWithHttpInfo,FindProductsToSubscribeAsyncWithHttpInfo")) { try @@ -401,12 +401,14 @@ public ApiResponse< List > FindProductsToSubscribeWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "FindProductsToSubscribe,FindProductsToSubscribeAsync,FindProductsToSubscribeWithHttpInfo,FindProductsToSubscribeAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -422,7 +424,7 @@ public ApiResponse< List > FindProductsToSubscribeWithHttpIn return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List),merchantConfig)); // Return statement } /// @@ -504,7 +506,7 @@ public async System.Threading.Tasks.Task>> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "FindProductsToSubscribe,FindProductsToSubscribeAsync,FindProductsToSubscribeWithHttpInfo,FindProductsToSubscribeAsyncWithHttpInfo")) { try @@ -518,12 +520,14 @@ public async System.Threading.Tasks.Task>> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "FindProductsToSubscribe,FindProductsToSubscribeAsync,FindProductsToSubscribeWithHttpInfo,FindProductsToSubscribeAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -539,7 +543,7 @@ public async System.Threading.Tasks.Task>> return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List), merchantConfig)); // Return statement } /// /// Create a New Webhook Subscription Create a new webhook subscription. Before creating a webhook, ensure that a signature key has been created. For the example \"Create Webhook using oAuth with Client Credentials\" - for clients who have more than one oAuth Provider and have different client secrets that they would like to config for a given webhook, they may do so by overriding the keyId inside security config of webhook subscription. See the Developer Center examples section titled \"Webhook Security - Create or Store Egress Symmetric Key - Store oAuth Credentials For Symmetric Key\" to store these oAuth credentials that CYBS will need for oAuth. For JWT authentication, attach your oAuth details to the webhook subscription. See the example \"Create Webhook using oAuth with JWT\" @@ -604,7 +608,7 @@ public ApiResponse< InlineResponse2015 > NotificationSubscriptionsV2WebhooksPost } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV2WebhooksPost,NotificationSubscriptionsV2WebhooksPostAsync,NotificationSubscriptionsV2WebhooksPostWithHttpInfo,NotificationSubscriptionsV2WebhooksPostAsyncWithHttpInfo")) { try @@ -618,13 +622,15 @@ public ApiResponse< InlineResponse2015 > NotificationSubscriptionsV2WebhooksPost } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV2WebhooksPost,NotificationSubscriptionsV2WebhooksPostAsync,NotificationSubscriptionsV2WebhooksPostWithHttpInfo,NotificationSubscriptionsV2WebhooksPostAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -640,7 +646,7 @@ public ApiResponse< InlineResponse2015 > NotificationSubscriptionsV2WebhooksPost return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015))); // Return statement + (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015),merchantConfig)); // Return statement } /// @@ -707,7 +713,7 @@ public async System.Threading.Tasks.Task> Notifi } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV2WebhooksPost,NotificationSubscriptionsV2WebhooksPostAsync,NotificationSubscriptionsV2WebhooksPostWithHttpInfo,NotificationSubscriptionsV2WebhooksPostAsyncWithHttpInfo")) { try @@ -721,13 +727,15 @@ public async System.Threading.Tasks.Task> Notifi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV2WebhooksPost,NotificationSubscriptionsV2WebhooksPostAsync,NotificationSubscriptionsV2WebhooksPostWithHttpInfo,NotificationSubscriptionsV2WebhooksPostAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -743,7 +751,7 @@ public async System.Threading.Tasks.Task> Notifi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015))); // Return statement + (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015), merchantConfig)); // Return statement } /// /// Create Webhook Security Keys Create security keys that CyberSource will use internally to connect to your servers and validate messages using a digital signature. Select the CREATE example for CyberSource to generate the key on our server and maintain it for you as well. Remember to save the key in the API response, so that you can use it to validate messages later. @@ -838,7 +846,7 @@ public ApiResponse< InlineResponse2014 > SaveSymEgressKeyWithHttpInfo (string vC } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SaveSymEgressKey,SaveSymEgressKeyAsync,SaveSymEgressKeyWithHttpInfo,SaveSymEgressKeyAsyncWithHttpInfo")) { try @@ -852,13 +860,15 @@ public ApiResponse< InlineResponse2014 > SaveSymEgressKeyWithHttpInfo (string vC } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SaveSymEgressKey,SaveSymEgressKeyAsync,SaveSymEgressKeyWithHttpInfo,SaveSymEgressKeyAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -874,7 +884,7 @@ public ApiResponse< InlineResponse2014 > SaveSymEgressKeyWithHttpInfo (string vC return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2014) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2014))); // Return statement + (InlineResponse2014) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2014),merchantConfig)); // Return statement } /// @@ -971,7 +981,7 @@ public async System.Threading.Tasks.Task> SaveSy } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SaveSymEgressKey,SaveSymEgressKeyAsync,SaveSymEgressKeyWithHttpInfo,SaveSymEgressKeyAsyncWithHttpInfo")) { try @@ -985,13 +995,15 @@ public async System.Threading.Tasks.Task> SaveSy } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SaveSymEgressKey,SaveSymEgressKeyAsync,SaveSymEgressKeyWithHttpInfo,SaveSymEgressKeyAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1007,7 +1019,7 @@ public async System.Threading.Tasks.Task> SaveSy return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2014) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2014))); // Return statement + (InlineResponse2014) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2014), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreditApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreditApi.cs index 5bcf49ee..1264b380 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreditApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CreditApi.cs @@ -282,7 +282,7 @@ public ApiResponse< PtsV2CreditsPost201Response > CreateCreditWithHttpInfo (Crea } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateCredit,CreateCreditAsync,CreateCreditWithHttpInfo,CreateCreditAsyncWithHttpInfo")) { try @@ -296,13 +296,15 @@ public ApiResponse< PtsV2CreditsPost201Response > CreateCreditWithHttpInfo (Crea } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateCredit,CreateCreditAsync,CreateCreditWithHttpInfo,CreateCreditAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -318,7 +320,7 @@ public ApiResponse< PtsV2CreditsPost201Response > CreateCreditWithHttpInfo (Crea return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreditsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response))); // Return statement + (PtsV2CreditsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response),merchantConfig)); // Return statement } /// @@ -391,7 +393,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreditsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response))); // Return statement + (PtsV2CreditsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreditsPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerApi.cs index eb7261a4..cae3d73e 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerApi.cs @@ -444,7 +444,7 @@ public ApiResponse DeleteCustomerWithHttpInfo (string customerId, string } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteCustomer,DeleteCustomerAsync,DeleteCustomerWithHttpInfo,DeleteCustomerAsyncWithHttpInfo")) { try @@ -458,12 +458,14 @@ public ApiResponse DeleteCustomerWithHttpInfo (string customerId, string } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteCustomer,DeleteCustomerAsync,DeleteCustomerWithHttpInfo,DeleteCustomerAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -565,7 +567,7 @@ public async System.Threading.Tasks.Task> DeleteCustomerAsyn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteCustomer,DeleteCustomerAsync,DeleteCustomerWithHttpInfo,DeleteCustomerAsyncWithHttpInfo")) { try @@ -579,12 +581,14 @@ public async System.Threading.Tasks.Task> DeleteCustomerAsyn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteCustomer,DeleteCustomerAsync,DeleteCustomerWithHttpInfo,DeleteCustomerAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -687,7 +691,7 @@ public ApiResponse< PostCustomerRequest > GetCustomerWithHttpInfo (string custom } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCustomer,GetCustomerAsync,GetCustomerWithHttpInfo,GetCustomerAsyncWithHttpInfo")) { try @@ -701,12 +705,14 @@ public ApiResponse< PostCustomerRequest > GetCustomerWithHttpInfo (string custom } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCustomer,GetCustomerAsync,GetCustomerWithHttpInfo,GetCustomerAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -722,7 +728,7 @@ public ApiResponse< PostCustomerRequest > GetCustomerWithHttpInfo (string custom return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest))); // Return statement + (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest),merchantConfig)); // Return statement } /// @@ -810,7 +816,7 @@ public async System.Threading.Tasks.Task> GetCu } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCustomer,GetCustomerAsync,GetCustomerWithHttpInfo,GetCustomerAsyncWithHttpInfo")) { try @@ -824,12 +830,14 @@ public async System.Threading.Tasks.Task> GetCu } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCustomer,GetCustomerAsync,GetCustomerWithHttpInfo,GetCustomerAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -845,7 +853,7 @@ public async System.Threading.Tasks.Task> GetCu return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest))); // Return statement + (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest), merchantConfig)); // Return statement } /// /// Update a Customer | | | | | - -- | - -- | - -- | |**Customers**<br>A Customer represents your tokenized customer information.<br>You should associate the Customer Id with the customer account on your systems.<br>A Customer can have one or more [Payment Instruments](#token-management_customer-payment-instrument_create-a-customer-payment-instrumentl) or [Shipping Addresses](#token-management_customer-shipping-address_create-a-customer-shipping-address) with one allocated as the Customers default.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Updating a Customer**<br>Your system can use this API to update a Customers details including selecting a [default Payment Instrument](#token-management_customer_update-a-customer_samplerequests-dropdown_update-customers-default-payment-instrument_liveconsole-tab-request-body) or [default Shipping Address](#token-management_customer_update-a-customer_samplerequests-dropdown_update-customers-default-shipping-address_liveconsole-tab-request-body) for use in payments.<br>Note: Updating a Customers [Payment Instrument](#token-management_customer-payment-instrument_update-a-customer-payment-instrument) or [Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address) details is performed using their own dedicated API resources. @@ -941,7 +949,7 @@ public ApiResponse< PatchCustomerRequest > PatchCustomerWithHttpInfo (string cus } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PatchCustomer,PatchCustomerAsync,PatchCustomerWithHttpInfo,PatchCustomerAsyncWithHttpInfo")) { try @@ -955,13 +963,15 @@ public ApiResponse< PatchCustomerRequest > PatchCustomerWithHttpInfo (string cus } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PatchCustomer,PatchCustomerAsync,PatchCustomerWithHttpInfo,PatchCustomerAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -977,7 +987,7 @@ public ApiResponse< PatchCustomerRequest > PatchCustomerWithHttpInfo (string cus return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerRequest))); // Return statement + (PatchCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerRequest),merchantConfig)); // Return statement } /// @@ -1075,7 +1085,7 @@ public async System.Threading.Tasks.Task> Patc } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PatchCustomer,PatchCustomerAsync,PatchCustomerWithHttpInfo,PatchCustomerAsyncWithHttpInfo")) { try @@ -1089,13 +1099,15 @@ public async System.Threading.Tasks.Task> Patc } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PatchCustomer,PatchCustomerAsync,PatchCustomerWithHttpInfo,PatchCustomerAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1111,7 +1123,7 @@ public async System.Threading.Tasks.Task> Patc return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerRequest))); // Return statement + (PatchCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerRequest), merchantConfig)); // Return statement } /// /// Create a Customer | | | | | - -- | - -- | - -- | |**Customers**<br>A Customer represents your tokenized customer information.<br>You should associate the Customer Id with the customer account on your systems.<br>A Customer can have one or more [Payment Instruments](#token-management_customer-payment-instrument_create-a-customer-payment-instrumentl) or [Shipping Addresses](#token-management_customer-shipping-address_create-a-customer-shipping-address) with one allocated as the Customers default.<br><br>**Creating a Customer**<br>It is recommended you [create a Customer via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body), this can be for a zero amount.<br>The Customer will be created with a Payment Instrument and Shipping Address.<br>You can also [add additional Payment Instruments to a Customer via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-create-default-payment-instrument-shipping-address-for-existing-customer_liveconsole-tab-request-body).<br>In Europe: You should perform Payer Authentication alongside the Authorization.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Customers**<br>To perform a payment with the Customers default details specify the [Customer Id in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-token-id_liveconsole-tab-request-body).<br>To perform a payment with a particular Payment Instrument or Shipping Address <br>specify the [Payment Instrument or Shipping Address Ids in the payments request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body). The availability of API features for a merchant may depend on the portfolio configuration and may need to be enabled at the portfolio level before they can be added to merchant accounts. @@ -1188,7 +1200,7 @@ public ApiResponse< PostCustomerRequest > PostCustomerWithHttpInfo (PostCustomer } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostCustomer,PostCustomerAsync,PostCustomerWithHttpInfo,PostCustomerAsyncWithHttpInfo")) { try @@ -1202,13 +1214,15 @@ public ApiResponse< PostCustomerRequest > PostCustomerWithHttpInfo (PostCustomer } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostCustomer,PostCustomerAsync,PostCustomerWithHttpInfo,PostCustomerAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1224,7 +1238,7 @@ public ApiResponse< PostCustomerRequest > PostCustomerWithHttpInfo (PostCustomer return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest))); // Return statement + (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest),merchantConfig)); // Return statement } /// @@ -1303,7 +1317,7 @@ public async System.Threading.Tasks.Task> PostC } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostCustomer,PostCustomerAsync,PostCustomerWithHttpInfo,PostCustomerAsyncWithHttpInfo")) { try @@ -1317,13 +1331,15 @@ public async System.Threading.Tasks.Task> PostC } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostCustomer,PostCustomerAsync,PostCustomerWithHttpInfo,PostCustomerAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1339,7 +1355,7 @@ public async System.Threading.Tasks.Task> PostC return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest))); // Return statement + (PostCustomerRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerRequest), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerPaymentInstrumentApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerPaymentInstrumentApi.cs index 3b7eb3c7..b5ef6244 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerPaymentInstrumentApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerPaymentInstrumentApi.cs @@ -527,7 +527,7 @@ public ApiResponse DeleteCustomerPaymentInstrumentWithHttpInfo (string c } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteCustomerPaymentInstrument,DeleteCustomerPaymentInstrumentAsync,DeleteCustomerPaymentInstrumentWithHttpInfo,DeleteCustomerPaymentInstrumentAsyncWithHttpInfo")) { try @@ -541,12 +541,14 @@ public ApiResponse DeleteCustomerPaymentInstrumentWithHttpInfo (string c } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteCustomerPaymentInstrument,DeleteCustomerPaymentInstrumentAsync,DeleteCustomerPaymentInstrumentWithHttpInfo,DeleteCustomerPaymentInstrumentAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -661,7 +663,7 @@ public async System.Threading.Tasks.Task> DeleteCustomerPaym } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteCustomerPaymentInstrument,DeleteCustomerPaymentInstrumentAsync,DeleteCustomerPaymentInstrumentWithHttpInfo,DeleteCustomerPaymentInstrumentAsyncWithHttpInfo")) { try @@ -675,12 +677,14 @@ public async System.Threading.Tasks.Task> DeleteCustomerPaym } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteCustomerPaymentInstrument,DeleteCustomerPaymentInstrumentAsync,DeleteCustomerPaymentInstrumentWithHttpInfo,DeleteCustomerPaymentInstrumentAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -796,7 +800,7 @@ public ApiResponse< PostCustomerPaymentInstrumentRequest > GetCustomerPaymentIns } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCustomerPaymentInstrument,GetCustomerPaymentInstrumentAsync,GetCustomerPaymentInstrumentWithHttpInfo,GetCustomerPaymentInstrumentAsyncWithHttpInfo")) { try @@ -810,12 +814,14 @@ public ApiResponse< PostCustomerPaymentInstrumentRequest > GetCustomerPaymentIns } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCustomerPaymentInstrument,GetCustomerPaymentInstrumentAsync,GetCustomerPaymentInstrumentWithHttpInfo,GetCustomerPaymentInstrumentAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -831,7 +837,7 @@ public ApiResponse< PostCustomerPaymentInstrumentRequest > GetCustomerPaymentIns return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest))); // Return statement + (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest),merchantConfig)); // Return statement } /// @@ -932,7 +938,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest))); // Return statement + (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest), merchantConfig)); // Return statement } /// /// List Payment Instruments for a Customer | | | | | - -- | - -- | - -- | |**Customer Payment Instrument**<br>A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Payment Instruments](#token-management_customer-payment-instrument_retrieve-a-customer-payment-instrument), with one allocated as the Customers default for use in payments.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Retrieving all Customer Payment Instruments**<br>Your system can use this API to retrieve all existing Payment Instruments for a Customer. @@ -1067,7 +1075,7 @@ public ApiResponse< PaymentInstrumentList > GetCustomerPaymentInstrumentsListWit } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCustomerPaymentInstrumentsList,GetCustomerPaymentInstrumentsListAsync,GetCustomerPaymentInstrumentsListWithHttpInfo,GetCustomerPaymentInstrumentsListAsyncWithHttpInfo")) { try @@ -1081,12 +1089,14 @@ public ApiResponse< PaymentInstrumentList > GetCustomerPaymentInstrumentsListWit } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCustomerPaymentInstrumentsList,GetCustomerPaymentInstrumentsListAsync,GetCustomerPaymentInstrumentsListWithHttpInfo,GetCustomerPaymentInstrumentsListAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1102,7 +1112,7 @@ public ApiResponse< PaymentInstrumentList > GetCustomerPaymentInstrumentsListWit return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PaymentInstrumentList) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList))); // Return statement + (PaymentInstrumentList) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList),merchantConfig)); // Return statement } /// @@ -1204,7 +1214,7 @@ public async System.Threading.Tasks.Task> Get } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCustomerPaymentInstrumentsList,GetCustomerPaymentInstrumentsListAsync,GetCustomerPaymentInstrumentsListWithHttpInfo,GetCustomerPaymentInstrumentsListAsyncWithHttpInfo")) { try @@ -1218,12 +1228,14 @@ public async System.Threading.Tasks.Task> Get } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCustomerPaymentInstrumentsList,GetCustomerPaymentInstrumentsListAsync,GetCustomerPaymentInstrumentsListWithHttpInfo,GetCustomerPaymentInstrumentsListAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1239,7 +1251,7 @@ public async System.Threading.Tasks.Task> Get return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PaymentInstrumentList) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList))); // Return statement + (PaymentInstrumentList) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList), merchantConfig)); // Return statement } /// /// Update a Customer Payment Instrument | | | | | - -- | - -- | - -- | |**Customer Payment Instrument**<br>A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Payment Instruments](#token-management_customer-payment-instrument_retrieve-a-customer-payment-instrument), with one allocated as the Customers default for use in payments.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Updating a Customers Payment Instrument**<br>Your system can use this API to update an existing Payment Instrument for a Customer, including selecting a [default Payment Instrument](#token-management_customer-payment-instrument_update-a-customer-payment-instrument_samplerequests-dropdown_make-customer-payment-instrument-the-default_liveconsole-tab-request-body) for use in payments. @@ -1348,7 +1360,7 @@ public ApiResponse< PatchCustomerPaymentInstrumentRequest > PatchCustomersPaymen } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PatchCustomersPaymentInstrument,PatchCustomersPaymentInstrumentAsync,PatchCustomersPaymentInstrumentWithHttpInfo,PatchCustomersPaymentInstrumentAsyncWithHttpInfo")) { try @@ -1362,13 +1374,15 @@ public ApiResponse< PatchCustomerPaymentInstrumentRequest > PatchCustomersPaymen } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PatchCustomersPaymentInstrument,PatchCustomersPaymentInstrumentAsync,PatchCustomersPaymentInstrumentWithHttpInfo,PatchCustomersPaymentInstrumentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1384,7 +1398,7 @@ public ApiResponse< PatchCustomerPaymentInstrumentRequest > PatchCustomersPaymen return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerPaymentInstrumentRequest))); // Return statement + (PatchCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerPaymentInstrumentRequest),merchantConfig)); // Return statement } /// @@ -1495,7 +1509,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerPaymentInstrumentRequest))); // Return statement + (PatchCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerPaymentInstrumentRequest), merchantConfig)); // Return statement } /// /// Create a Customer Payment Instrument | | | | | - -- | - -- | - -- | |**Customer Payment Instrument**<br>A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Payment Instruments](#token-management_customer-payment-instrument_retrieve-a-customer-payment-instrument), with one allocated as the Customers default for use in payments.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br><br>**Creating a Customer Payment Instrument**<br>It is recommended you [create a Customer Payment Instrument via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-create-default-payment-instrument-shipping-address-for-existing-customer_liveconsole-tab-request-body), this can be for a zero amount.<br>In Europe: You should perform Payer Authentication alongside the Authorization.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Customers Payment Instrument**<br>To perform a payment with a particular Payment Instrument or Shipping Address specify the [Payment Instrument in the payment request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body). @@ -1621,7 +1637,7 @@ public ApiResponse< PostCustomerPaymentInstrumentRequest > PostCustomerPaymentIn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostCustomerPaymentInstrument,PostCustomerPaymentInstrumentAsync,PostCustomerPaymentInstrumentWithHttpInfo,PostCustomerPaymentInstrumentAsyncWithHttpInfo")) { try @@ -1635,13 +1651,15 @@ public ApiResponse< PostCustomerPaymentInstrumentRequest > PostCustomerPaymentIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostCustomerPaymentInstrument,PostCustomerPaymentInstrumentAsync,PostCustomerPaymentInstrumentWithHttpInfo,PostCustomerPaymentInstrumentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1657,7 +1675,7 @@ public ApiResponse< PostCustomerPaymentInstrumentRequest > PostCustomerPaymentIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest))); // Return statement + (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest),merchantConfig)); // Return statement } /// @@ -1749,7 +1767,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest))); // Return statement + (PostCustomerPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerPaymentInstrumentRequest), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerShippingAddressApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerShippingAddressApi.cs index 68ca5729..dbb972f6 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerShippingAddressApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/CustomerShippingAddressApi.cs @@ -527,7 +527,7 @@ public ApiResponse DeleteCustomerShippingAddressWithHttpInfo (string cus } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteCustomerShippingAddress,DeleteCustomerShippingAddressAsync,DeleteCustomerShippingAddressWithHttpInfo,DeleteCustomerShippingAddressAsyncWithHttpInfo")) { try @@ -541,12 +541,14 @@ public ApiResponse DeleteCustomerShippingAddressWithHttpInfo (string cus } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteCustomerShippingAddress,DeleteCustomerShippingAddressAsync,DeleteCustomerShippingAddressWithHttpInfo,DeleteCustomerShippingAddressAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -661,7 +663,7 @@ public async System.Threading.Tasks.Task> DeleteCustomerShip } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteCustomerShippingAddress,DeleteCustomerShippingAddressAsync,DeleteCustomerShippingAddressWithHttpInfo,DeleteCustomerShippingAddressAsyncWithHttpInfo")) { try @@ -675,12 +677,14 @@ public async System.Threading.Tasks.Task> DeleteCustomerShip } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteCustomerShippingAddress,DeleteCustomerShippingAddressAsync,DeleteCustomerShippingAddressWithHttpInfo,DeleteCustomerShippingAddressAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -796,7 +800,7 @@ public ApiResponse< PostCustomerShippingAddressRequest > GetCustomerShippingAddr } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCustomerShippingAddress,GetCustomerShippingAddressAsync,GetCustomerShippingAddressWithHttpInfo,GetCustomerShippingAddressAsyncWithHttpInfo")) { try @@ -810,12 +814,14 @@ public ApiResponse< PostCustomerShippingAddressRequest > GetCustomerShippingAddr } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCustomerShippingAddress,GetCustomerShippingAddressAsync,GetCustomerShippingAddressWithHttpInfo,GetCustomerShippingAddressAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -831,7 +837,7 @@ public ApiResponse< PostCustomerShippingAddressRequest > GetCustomerShippingAddr return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest))); // Return statement + (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest),merchantConfig)); // Return statement } /// @@ -932,7 +938,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest))); // Return statement + (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest), merchantConfig)); // Return statement } /// /// List Shipping Addresses for a Customer | | | | | - -- | - -- | - -- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Retrieving all Customer Shipping Addresses**<br>Your system can use this API to retrieve all existing Shipping Addresses for a Customer. @@ -1067,7 +1075,7 @@ public ApiResponse< ShippingAddressListForCustomer > GetCustomerShippingAddresse } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCustomerShippingAddressesList,GetCustomerShippingAddressesListAsync,GetCustomerShippingAddressesListWithHttpInfo,GetCustomerShippingAddressesListAsyncWithHttpInfo")) { try @@ -1081,12 +1089,14 @@ public ApiResponse< ShippingAddressListForCustomer > GetCustomerShippingAddresse } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCustomerShippingAddressesList,GetCustomerShippingAddressesListAsync,GetCustomerShippingAddressesListWithHttpInfo,GetCustomerShippingAddressesListAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1102,7 +1112,7 @@ public ApiResponse< ShippingAddressListForCustomer > GetCustomerShippingAddresse return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ShippingAddressListForCustomer) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ShippingAddressListForCustomer))); // Return statement + (ShippingAddressListForCustomer) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ShippingAddressListForCustomer),merchantConfig)); // Return statement } /// @@ -1204,7 +1214,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ShippingAddressListForCustomer) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ShippingAddressListForCustomer))); // Return statement + (ShippingAddressListForCustomer) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ShippingAddressListForCustomer), merchantConfig)); // Return statement } /// /// Update a Customer Shipping Address | | | | | - -- | - -- | - -- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Updating a Customers Shipping Address**<br>Your system can use this API to update an existing Shipping Addresses for a Customer, including selecting a [default Shipping Address](#token-management_customer-shipping-address_update-a-customer-shipping-address_samplerequests-dropdown_make-customer-shipping-address-the-default_liveconsole-tab-request-body) for use in payments. @@ -1348,7 +1360,7 @@ public ApiResponse< PatchCustomerShippingAddressRequest > PatchCustomersShipping } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PatchCustomersShippingAddress,PatchCustomersShippingAddressAsync,PatchCustomersShippingAddressWithHttpInfo,PatchCustomersShippingAddressAsyncWithHttpInfo")) { try @@ -1362,13 +1374,15 @@ public ApiResponse< PatchCustomerShippingAddressRequest > PatchCustomersShipping } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PatchCustomersShippingAddress,PatchCustomersShippingAddressAsync,PatchCustomersShippingAddressWithHttpInfo,PatchCustomersShippingAddressAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1384,7 +1398,7 @@ public ApiResponse< PatchCustomerShippingAddressRequest > PatchCustomersShipping return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerShippingAddressRequest))); // Return statement + (PatchCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerShippingAddressRequest),merchantConfig)); // Return statement } /// @@ -1495,7 +1509,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerShippingAddressRequest))); // Return statement + (PatchCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchCustomerShippingAddressRequest), merchantConfig)); // Return statement } /// /// Create a Customer Shipping Address | | | | | - -- | - -- | - -- | |**Customer Shipping Address**<br>A Customer Shipping Address represents tokenized customer shipping information.<br>A [Customer](#token-management_customer_create-a-customer) can have [one or more Shipping Addresses](#token-management_customer-shipping-address_list-shipping-addresses-for-a-customer), with one allocated as the Customers default for use in payments.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Creating a Customer Shipping Address**<br>Your system can use this API to create an existing Customers default or non default Shipping Address.<br>You can also create additional Customer Shipping Addresses via the [Payments API](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-create-default-payment-instrument-shipping-address-for-existing-customer_liveconsole-tab-request-body). @@ -1621,7 +1637,7 @@ public ApiResponse< PostCustomerShippingAddressRequest > PostCustomerShippingAdd } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostCustomerShippingAddress,PostCustomerShippingAddressAsync,PostCustomerShippingAddressWithHttpInfo,PostCustomerShippingAddressAsyncWithHttpInfo")) { try @@ -1635,13 +1651,15 @@ public ApiResponse< PostCustomerShippingAddressRequest > PostCustomerShippingAdd } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostCustomerShippingAddress,PostCustomerShippingAddressAsync,PostCustomerShippingAddressWithHttpInfo,PostCustomerShippingAddressAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1657,7 +1675,7 @@ public ApiResponse< PostCustomerShippingAddressRequest > PostCustomerShippingAdd return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest))); // Return statement + (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest),merchantConfig)); // Return statement } /// @@ -1749,7 +1767,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest))); // Return statement + (PostCustomerShippingAddressRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostCustomerShippingAddressRequest), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DecisionManagerApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DecisionManagerApi.cs index 08d45a6f..00ecf6fe 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DecisionManagerApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DecisionManagerApi.cs @@ -479,7 +479,7 @@ public ApiResponse< InlineResponse2001 > ActionDecisionManagerCaseWithHttpInfo ( } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "ActionDecisionManagerCase,ActionDecisionManagerCaseAsync,ActionDecisionManagerCaseWithHttpInfo,ActionDecisionManagerCaseAsyncWithHttpInfo")) { try @@ -493,13 +493,15 @@ public ApiResponse< InlineResponse2001 > ActionDecisionManagerCaseWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "ActionDecisionManagerCase,ActionDecisionManagerCaseAsync,ActionDecisionManagerCaseWithHttpInfo,ActionDecisionManagerCaseAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -515,7 +517,7 @@ public ApiResponse< InlineResponse2001 > ActionDecisionManagerCaseWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2001) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2001))); // Return statement + (InlineResponse2001) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2001),merchantConfig)); // Return statement } /// @@ -601,7 +603,7 @@ public async System.Threading.Tasks.Task> Action } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "ActionDecisionManagerCase,ActionDecisionManagerCaseAsync,ActionDecisionManagerCaseWithHttpInfo,ActionDecisionManagerCaseAsyncWithHttpInfo")) { try @@ -615,13 +617,15 @@ public async System.Threading.Tasks.Task> Action } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "ActionDecisionManagerCase,ActionDecisionManagerCaseAsync,ActionDecisionManagerCaseWithHttpInfo,ActionDecisionManagerCaseAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -637,7 +641,7 @@ public async System.Threading.Tasks.Task> Action return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2001) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2001))); // Return statement + (InlineResponse2001) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2001), merchantConfig)); // Return statement } /// /// List Management This call adds/deletes/converts the request information in the negative list. Provide the list to be updated as the path parameter. This value can be 'postiive', 'negative' or 'review'. @@ -721,7 +725,7 @@ public ApiResponse< RiskV1UpdatePost201Response > AddNegativeWithHttpInfo (strin } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "AddNegative,AddNegativeAsync,AddNegativeWithHttpInfo,AddNegativeAsyncWithHttpInfo")) { try @@ -735,13 +739,15 @@ public ApiResponse< RiskV1UpdatePost201Response > AddNegativeWithHttpInfo (strin } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "AddNegative,AddNegativeAsync,AddNegativeWithHttpInfo,AddNegativeAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -757,7 +763,7 @@ public ApiResponse< RiskV1UpdatePost201Response > AddNegativeWithHttpInfo (strin return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response))); // Return statement + (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response),merchantConfig)); // Return statement } /// @@ -843,7 +849,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response))); // Return statement + (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response), merchantConfig)); // Return statement } /// /// Add a comment to a DM post-transactional case Add a comment to a DM post-transactional case @@ -963,7 +971,7 @@ public ApiResponse< InlineResponse2011 > CommentDecisionManagerCaseWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CommentDecisionManagerCase,CommentDecisionManagerCaseAsync,CommentDecisionManagerCaseWithHttpInfo,CommentDecisionManagerCaseAsyncWithHttpInfo")) { try @@ -977,13 +985,15 @@ public ApiResponse< InlineResponse2011 > CommentDecisionManagerCaseWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CommentDecisionManagerCase,CommentDecisionManagerCaseAsync,CommentDecisionManagerCaseWithHttpInfo,CommentDecisionManagerCaseAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -999,7 +1009,7 @@ public ApiResponse< InlineResponse2011 > CommentDecisionManagerCaseWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2011))); // Return statement + (InlineResponse2011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2011),merchantConfig)); // Return statement } /// @@ -1085,7 +1095,7 @@ public async System.Threading.Tasks.Task> Commen } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CommentDecisionManagerCase,CommentDecisionManagerCaseAsync,CommentDecisionManagerCaseWithHttpInfo,CommentDecisionManagerCaseAsyncWithHttpInfo")) { try @@ -1099,13 +1109,15 @@ public async System.Threading.Tasks.Task> Commen } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CommentDecisionManagerCase,CommentDecisionManagerCaseAsync,CommentDecisionManagerCaseWithHttpInfo,CommentDecisionManagerCaseAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1121,7 +1133,7 @@ public async System.Threading.Tasks.Task> Commen return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2011))); // Return statement + (InlineResponse2011) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2011), merchantConfig)); // Return statement } /// /// Create Decision Manager Decision Manager can help you automate and streamline your fraud operations. Decision Manager will return a decision based on the request values. @@ -1192,7 +1204,7 @@ public ApiResponse< RiskV1DecisionsPost201Response > CreateBundledDecisionManage } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateBundledDecisionManagerCase,CreateBundledDecisionManagerCaseAsync,CreateBundledDecisionManagerCaseWithHttpInfo,CreateBundledDecisionManagerCaseAsyncWithHttpInfo")) { try @@ -1206,13 +1218,15 @@ public ApiResponse< RiskV1DecisionsPost201Response > CreateBundledDecisionManage } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateBundledDecisionManagerCase,CreateBundledDecisionManagerCaseAsync,CreateBundledDecisionManagerCaseWithHttpInfo,CreateBundledDecisionManagerCaseAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1228,7 +1242,7 @@ public ApiResponse< RiskV1DecisionsPost201Response > CreateBundledDecisionManage return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1DecisionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1DecisionsPost201Response))); // Return statement + (RiskV1DecisionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1DecisionsPost201Response),merchantConfig)); // Return statement } /// @@ -1301,7 +1315,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1DecisionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1DecisionsPost201Response))); // Return statement + (RiskV1DecisionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1DecisionsPost201Response), merchantConfig)); // Return statement } /// /// Fraud Marking This can be used to - 1. Add known fraudulent data to the fraud history 2. Remove data added to history with Transaction Marking Tool or by uploading chargeback files 3. Remove chargeback data from history that was automatically added. For detailed information, contact your Cybersource representative Place the request ID of the transaction you want to mark as suspect (or remove from history) as the path parameter in this request. @@ -1421,7 +1437,7 @@ public ApiResponse< RiskV1UpdatePost201Response > FraudUpdateWithHttpInfo (strin } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "FraudUpdate,FraudUpdateAsync,FraudUpdateWithHttpInfo,FraudUpdateAsyncWithHttpInfo")) { try @@ -1435,13 +1451,15 @@ public ApiResponse< RiskV1UpdatePost201Response > FraudUpdateWithHttpInfo (strin } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "FraudUpdate,FraudUpdateAsync,FraudUpdateWithHttpInfo,FraudUpdateAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1457,7 +1475,7 @@ public ApiResponse< RiskV1UpdatePost201Response > FraudUpdateWithHttpInfo (strin return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response))); // Return statement + (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response),merchantConfig)); // Return statement } /// @@ -1543,7 +1561,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response))); // Return statement + (RiskV1UpdatePost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceDeAssociationApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceDeAssociationApi.cs index 8cd45f8d..8f0bd717 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceDeAssociationApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceDeAssociationApi.cs @@ -321,7 +321,7 @@ public ApiResponse DeleteTerminalAssociationWithHttpInfo (DeAssociationR } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteTerminalAssociation,DeleteTerminalAssociationAsync,DeleteTerminalAssociationWithHttpInfo,DeleteTerminalAssociationAsyncWithHttpInfo")) { try @@ -335,13 +335,15 @@ public ApiResponse DeleteTerminalAssociationWithHttpInfo (DeAssociationR } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteTerminalAssociation,DeleteTerminalAssociationAsync,DeleteTerminalAssociationWithHttpInfo,DeleteTerminalAssociationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -428,7 +430,7 @@ public async System.Threading.Tasks.Task> DeleteTerminalAsso } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteTerminalAssociation,DeleteTerminalAssociationAsync,DeleteTerminalAssociationWithHttpInfo,DeleteTerminalAssociationAsyncWithHttpInfo")) { try @@ -442,13 +444,15 @@ public async System.Threading.Tasks.Task> DeleteTerminalAsso } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteTerminalAssociation,DeleteTerminalAssociationAsync,DeleteTerminalAssociationWithHttpInfo,DeleteTerminalAssociationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -536,7 +540,7 @@ public ApiResponse< List > PostDeAssociateV3TerminalWithHttp } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostDeAssociateV3Terminal,PostDeAssociateV3TerminalAsync,PostDeAssociateV3TerminalWithHttpInfo,PostDeAssociateV3TerminalAsyncWithHttpInfo")) { try @@ -550,13 +554,15 @@ public ApiResponse< List > PostDeAssociateV3TerminalWithHttp } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostDeAssociateV3Terminal,PostDeAssociateV3TerminalAsync,PostDeAssociateV3TerminalWithHttpInfo,PostDeAssociateV3TerminalAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -572,7 +578,7 @@ public ApiResponse< List > PostDeAssociateV3TerminalWithHttp return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List),merchantConfig)); // Return statement } /// @@ -645,7 +651,7 @@ public async System.Threading.Tasks.Task>> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostDeAssociateV3Terminal,PostDeAssociateV3TerminalAsync,PostDeAssociateV3TerminalWithHttpInfo,PostDeAssociateV3TerminalAsyncWithHttpInfo")) { try @@ -659,13 +665,15 @@ public async System.Threading.Tasks.Task>> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostDeAssociateV3Terminal,PostDeAssociateV3TerminalAsync,PostDeAssociateV3TerminalWithHttpInfo,PostDeAssociateV3TerminalAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -681,7 +689,7 @@ public async System.Threading.Tasks.Task>> return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceSearchApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceSearchApi.cs index f56c8f36..800306c2 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceSearchApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DeviceSearchApi.cs @@ -324,7 +324,7 @@ public ApiResponse< InlineResponse2007 > PostSearchQueryWithHttpInfo (PostDevice } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostSearchQuery,PostSearchQueryAsync,PostSearchQueryWithHttpInfo,PostSearchQueryAsyncWithHttpInfo")) { try @@ -338,13 +338,15 @@ public ApiResponse< InlineResponse2007 > PostSearchQueryWithHttpInfo (PostDevice } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostSearchQuery,PostSearchQueryAsync,PostSearchQueryWithHttpInfo,PostSearchQueryAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -360,7 +362,7 @@ public ApiResponse< InlineResponse2007 > PostSearchQueryWithHttpInfo (PostDevice return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2007) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2007))); // Return statement + (InlineResponse2007) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2007),merchantConfig)); // Return statement } /// @@ -433,7 +435,7 @@ public async System.Threading.Tasks.Task> PostSe } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostSearchQuery,PostSearchQueryAsync,PostSearchQueryWithHttpInfo,PostSearchQueryAsyncWithHttpInfo")) { try @@ -447,13 +449,15 @@ public async System.Threading.Tasks.Task> PostSe } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostSearchQuery,PostSearchQueryAsync,PostSearchQueryWithHttpInfo,PostSearchQueryAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -469,7 +473,7 @@ public async System.Threading.Tasks.Task> PostSe return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2007) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2007))); // Return statement + (InlineResponse2007) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2007), merchantConfig)); // Return statement } /// /// Retrieve List of Devices for a given search query Search for devices matching a given search query. The search query supports serialNumber, readerId, terminalId, status, statusChangeReason or organizationId Matching results are paginated. @@ -540,7 +544,7 @@ public ApiResponse< InlineResponse2009 > PostSearchQueryV3WithHttpInfo (PostDevi } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostSearchQueryV3,PostSearchQueryV3Async,PostSearchQueryV3WithHttpInfo,PostSearchQueryV3AsyncWithHttpInfo")) { try @@ -554,13 +558,15 @@ public ApiResponse< InlineResponse2009 > PostSearchQueryV3WithHttpInfo (PostDevi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostSearchQueryV3,PostSearchQueryV3Async,PostSearchQueryV3WithHttpInfo,PostSearchQueryV3AsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -576,7 +582,7 @@ public ApiResponse< InlineResponse2009 > PostSearchQueryV3WithHttpInfo (PostDevi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2009) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2009))); // Return statement + (InlineResponse2009) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2009),merchantConfig)); // Return statement } /// @@ -649,7 +655,7 @@ public async System.Threading.Tasks.Task> PostSe } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostSearchQueryV3,PostSearchQueryV3Async,PostSearchQueryV3WithHttpInfo,PostSearchQueryV3AsyncWithHttpInfo")) { try @@ -663,13 +669,15 @@ public async System.Threading.Tasks.Task> PostSe } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostSearchQueryV3,PostSearchQueryV3Async,PostSearchQueryV3WithHttpInfo,PostSearchQueryV3AsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -685,7 +693,7 @@ public async System.Threading.Tasks.Task> PostSe return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2009) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2009))); // Return statement + (InlineResponse2009) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2009), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadDTDApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadDTDApi.cs index 26584933..c2e292ff 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadDTDApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadDTDApi.cs @@ -287,7 +287,7 @@ public ApiResponse GetDTDV2WithHttpInfo (string reportDefinitionNameVers } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetDTDV2,GetDTDV2Async,GetDTDV2WithHttpInfo,GetDTDV2AsyncWithHttpInfo")) { try @@ -301,12 +301,14 @@ public ApiResponse GetDTDV2WithHttpInfo (string reportDefinitionNameVers } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetDTDV2,GetDTDV2Async,GetDTDV2WithHttpInfo,GetDTDV2AsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -402,7 +404,7 @@ public async System.Threading.Tasks.Task> GetDTDV2AsyncWithH } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetDTDV2,GetDTDV2Async,GetDTDV2WithHttpInfo,GetDTDV2AsyncWithHttpInfo")) { try @@ -416,12 +418,14 @@ public async System.Threading.Tasks.Task> GetDTDV2AsyncWithH } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetDTDV2,GetDTDV2Async,GetDTDV2WithHttpInfo,GetDTDV2AsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadXSDApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadXSDApi.cs index 111ce2a4..7415ec8f 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadXSDApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/DownloadXSDApi.cs @@ -287,7 +287,7 @@ public ApiResponse GetXSDV2WithHttpInfo (string reportDefinitionNameVers } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetXSDV2,GetXSDV2Async,GetXSDV2WithHttpInfo,GetXSDV2AsyncWithHttpInfo")) { try @@ -301,12 +301,14 @@ public ApiResponse GetXSDV2WithHttpInfo (string reportDefinitionNameVers } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetXSDV2,GetXSDV2Async,GetXSDV2WithHttpInfo,GetXSDV2AsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -402,7 +404,7 @@ public async System.Threading.Tasks.Task> GetXSDV2AsyncWithH } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetXSDV2,GetXSDV2Async,GetXSDV2WithHttpInfo,GetXSDV2AsyncWithHttpInfo")) { try @@ -416,12 +418,14 @@ public async System.Threading.Tasks.Task> GetXSDV2AsyncWithH } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetXSDV2,GetXSDV2Async,GetXSDV2WithHttpInfo,GetXSDV2AsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/EMVTagDetailsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/EMVTagDetailsApi.cs index 10d76956..501831c2 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/EMVTagDetailsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/EMVTagDetailsApi.cs @@ -316,7 +316,7 @@ public ApiResponse< TssV2GetEmvTags200Response > GetEmvTagsWithHttpInfo () } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetEmvTags,GetEmvTagsAsync,GetEmvTagsWithHttpInfo,GetEmvTagsAsyncWithHttpInfo")) { try @@ -330,12 +330,14 @@ public ApiResponse< TssV2GetEmvTags200Response > GetEmvTagsWithHttpInfo () } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetEmvTags,GetEmvTagsAsync,GetEmvTagsWithHttpInfo,GetEmvTagsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -351,7 +353,7 @@ public ApiResponse< TssV2GetEmvTags200Response > GetEmvTagsWithHttpInfo () return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2GetEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2GetEmvTags200Response))); // Return statement + (TssV2GetEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2GetEmvTags200Response),merchantConfig)); // Return statement } /// @@ -420,7 +422,7 @@ public async System.Threading.Tasks.Task } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetEmvTags,GetEmvTagsAsync,GetEmvTagsWithHttpInfo,GetEmvTagsAsyncWithHttpInfo")) { try @@ -434,12 +436,14 @@ public async System.Threading.Tasks.Task } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetEmvTags,GetEmvTagsAsync,GetEmvTagsWithHttpInfo,GetEmvTagsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -455,7 +459,7 @@ public async System.Threading.Tasks.Task return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2GetEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2GetEmvTags200Response))); // Return statement + (TssV2GetEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2GetEmvTags200Response), merchantConfig)); // Return statement } /// /// Parse an EMV String Pass an EMV Tag-Length-Value (TLV) string for parsing. @@ -526,7 +530,7 @@ public ApiResponse< TssV2PostEmvTags200Response > ParseEmvTagsWithHttpInfo (Body } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "ParseEmvTags,ParseEmvTagsAsync,ParseEmvTagsWithHttpInfo,ParseEmvTagsAsyncWithHttpInfo")) { try @@ -540,13 +544,15 @@ public ApiResponse< TssV2PostEmvTags200Response > ParseEmvTagsWithHttpInfo (Body } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "ParseEmvTags,ParseEmvTagsAsync,ParseEmvTagsWithHttpInfo,ParseEmvTagsAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -562,7 +568,7 @@ public ApiResponse< TssV2PostEmvTags200Response > ParseEmvTagsWithHttpInfo (Body return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2PostEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2PostEmvTags200Response))); // Return statement + (TssV2PostEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2PostEmvTags200Response),merchantConfig)); // Return statement } /// @@ -635,7 +641,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2PostEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2PostEmvTags200Response))); // Return statement + (TssV2PostEmvTags200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2PostEmvTags200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/FlexAPIApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/FlexAPIApi.cs index 7c250512..bce3806d 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/FlexAPIApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/FlexAPIApi.cs @@ -282,7 +282,7 @@ public ApiResponse< string > GenerateFlexAPICaptureContextWithHttpInfo (Generate } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GenerateFlexAPICaptureContext,GenerateFlexAPICaptureContextAsync,GenerateFlexAPICaptureContextWithHttpInfo,GenerateFlexAPICaptureContextAsyncWithHttpInfo")) { try @@ -296,13 +296,15 @@ public ApiResponse< string > GenerateFlexAPICaptureContextWithHttpInfo (Generate } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GenerateFlexAPICaptureContext,GenerateFlexAPICaptureContextAsync,GenerateFlexAPICaptureContextWithHttpInfo,GenerateFlexAPICaptureContextAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -318,7 +320,7 @@ public ApiResponse< string > GenerateFlexAPICaptureContextWithHttpInfo (Generate return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string),merchantConfig)); // Return statement } /// @@ -391,7 +393,7 @@ public async System.Threading.Tasks.Task> GenerateFlexAPICap } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GenerateFlexAPICaptureContext,GenerateFlexAPICaptureContextAsync,GenerateFlexAPICaptureContextWithHttpInfo,GenerateFlexAPICaptureContextAsyncWithHttpInfo")) { try @@ -405,13 +407,15 @@ public async System.Threading.Tasks.Task> GenerateFlexAPICap } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GenerateFlexAPICaptureContext,GenerateFlexAPICaptureContextAsync,GenerateFlexAPICaptureContextWithHttpInfo,GenerateFlexAPICaptureContextAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -427,7 +431,7 @@ public async System.Threading.Tasks.Task> GenerateFlexAPICap return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InstrumentIdentifierApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InstrumentIdentifierApi.cs index 50bca029..36f7c132 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InstrumentIdentifierApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InstrumentIdentifierApi.cs @@ -564,7 +564,7 @@ public ApiResponse DeleteInstrumentIdentifierWithHttpInfo (string instru } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteInstrumentIdentifier,DeleteInstrumentIdentifierAsync,DeleteInstrumentIdentifierWithHttpInfo,DeleteInstrumentIdentifierAsyncWithHttpInfo")) { try @@ -578,12 +578,14 @@ public ApiResponse DeleteInstrumentIdentifierWithHttpInfo (string instru } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteInstrumentIdentifier,DeleteInstrumentIdentifierAsync,DeleteInstrumentIdentifierWithHttpInfo,DeleteInstrumentIdentifierAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -685,7 +687,7 @@ public async System.Threading.Tasks.Task> DeleteInstrumentId } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteInstrumentIdentifier,DeleteInstrumentIdentifierAsync,DeleteInstrumentIdentifierWithHttpInfo,DeleteInstrumentIdentifierAsyncWithHttpInfo")) { try @@ -699,12 +701,14 @@ public async System.Threading.Tasks.Task> DeleteInstrumentId } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteInstrumentIdentifier,DeleteInstrumentIdentifierAsync,DeleteInstrumentIdentifierWithHttpInfo,DeleteInstrumentIdentifierAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -814,7 +818,7 @@ public ApiResponse< PostInstrumentIdentifierRequest > GetInstrumentIdentifierWit } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetInstrumentIdentifier,GetInstrumentIdentifierAsync,GetInstrumentIdentifierWithHttpInfo,GetInstrumentIdentifierAsyncWithHttpInfo")) { try @@ -828,12 +832,14 @@ public ApiResponse< PostInstrumentIdentifierRequest > GetInstrumentIdentifierWit } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetInstrumentIdentifier,GetInstrumentIdentifierAsync,GetInstrumentIdentifierWithHttpInfo,GetInstrumentIdentifierAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -849,7 +855,7 @@ public ApiResponse< PostInstrumentIdentifierRequest > GetInstrumentIdentifierWit return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest))); // Return statement + (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest),merchantConfig)); // Return statement } /// @@ -944,7 +950,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest))); // Return statement + (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest), merchantConfig)); // Return statement } /// /// List Payment Instruments for an Instrument Identifier | | | | | - -- | - -- | - -- | |**Instrument Identifiers**<br>An Instrument Identifier represents either a card number, or in the case of an ACH bank account, the routing <br>and account numbers.<br>The same token Id is returned for a specific card number or bank account & routing number allowing the <br>Instrument Identifier Id to be used for cross-channel payment tracking.<br>An Instrument Identifier can exist independently but also be associated with a [Customer Payment Instrument](#token-management_customer-payment-instrument_create-a-customer-payment-instrument) <br>or [Standalone Payment Instrument](#token-management_payment-instrument_create-a-payment-instrument).|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Retrieving all Payment Instruments associated with an Instrument Identifier**<br>Your system can use this API to retrieve all Payment Instruments linked to an Instrument Identifier. @@ -1086,7 +1094,7 @@ public ApiResponse< PaymentInstrumentList1 > GetInstrumentIdentifierPaymentInstr } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetInstrumentIdentifierPaymentInstrumentsList,GetInstrumentIdentifierPaymentInstrumentsListAsync,GetInstrumentIdentifierPaymentInstrumentsListWithHttpInfo,GetInstrumentIdentifierPaymentInstrumentsListAsyncWithHttpInfo")) { try @@ -1100,12 +1108,14 @@ public ApiResponse< PaymentInstrumentList1 > GetInstrumentIdentifierPaymentInstr } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetInstrumentIdentifierPaymentInstrumentsList,GetInstrumentIdentifierPaymentInstrumentsListAsync,GetInstrumentIdentifierPaymentInstrumentsListWithHttpInfo,GetInstrumentIdentifierPaymentInstrumentsListAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1121,7 +1131,7 @@ public ApiResponse< PaymentInstrumentList1 > GetInstrumentIdentifierPaymentInstr return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PaymentInstrumentList1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList1))); // Return statement + (PaymentInstrumentList1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList1),merchantConfig)); // Return statement } /// @@ -1230,7 +1240,7 @@ public async System.Threading.Tasks.Task> Ge } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetInstrumentIdentifierPaymentInstrumentsList,GetInstrumentIdentifierPaymentInstrumentsListAsync,GetInstrumentIdentifierPaymentInstrumentsListWithHttpInfo,GetInstrumentIdentifierPaymentInstrumentsListAsyncWithHttpInfo")) { try @@ -1244,12 +1254,14 @@ public async System.Threading.Tasks.Task> Ge } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetInstrumentIdentifierPaymentInstrumentsList,GetInstrumentIdentifierPaymentInstrumentsListAsync,GetInstrumentIdentifierPaymentInstrumentsListWithHttpInfo,GetInstrumentIdentifierPaymentInstrumentsListAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1265,7 +1277,7 @@ public async System.Threading.Tasks.Task> Ge return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PaymentInstrumentList1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList1))); // Return statement + (PaymentInstrumentList1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentInstrumentList1), merchantConfig)); // Return statement } /// /// Update an Instrument Identifier | | | | | - -- | - -- | - -- | |**Instrument Identifiers**<br>An Instrument Identifier represents either a card number, or in the case of an ACH bank account, the routing and account number.<br>The same token Id is returned for a specific card number or bank account & routing number allowing the Instrument Identifier Id to be used for cross-channel payment tracking.<br>An Instrument Identifier can exist independently but also be associated with a [Customer Payment Instrument](#token-management_customer-payment-instrument_create-a-customer-payment-instrument) or [Standalone Payment Instrument](#token-management_payment-instrument_create-a-payment-instrument).|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Updating an Instrument Identifier**<br>When an Instrument Identifier is used in a payment the **_previousTransactionId_** and **_originalAuthorizedAmount_** values are automatically recorded.<br>These values will be added for you to future Merchant Initiated Transaction payments.<br>Your system can use this API to update these values. @@ -1368,7 +1380,7 @@ public ApiResponse< PatchInstrumentIdentifierRequest > PatchInstrumentIdentifier } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PatchInstrumentIdentifier,PatchInstrumentIdentifierAsync,PatchInstrumentIdentifierWithHttpInfo,PatchInstrumentIdentifierAsyncWithHttpInfo")) { try @@ -1382,13 +1394,15 @@ public ApiResponse< PatchInstrumentIdentifierRequest > PatchInstrumentIdentifier } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PatchInstrumentIdentifier,PatchInstrumentIdentifierAsync,PatchInstrumentIdentifierWithHttpInfo,PatchInstrumentIdentifierAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1404,7 +1418,7 @@ public ApiResponse< PatchInstrumentIdentifierRequest > PatchInstrumentIdentifier return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchInstrumentIdentifierRequest))); // Return statement + (PatchInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchInstrumentIdentifierRequest),merchantConfig)); // Return statement } /// @@ -1509,7 +1523,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchInstrumentIdentifierRequest))); // Return statement + (PatchInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchInstrumentIdentifierRequest), merchantConfig)); // Return statement } /// /// Create an Instrument Identifier | | | | | - -- | - -- | - -- | |**Instrument Identifiers**<br>An Instrument Identifier represents either a card number, or in the case of an ACH bank account, the routing and account number.<br>The same token Id is returned for a specific card number or bank account & routing number allowing the Instrument Identifier Id to be used for cross-channel payment tracking.<br>An Instrument Identifier can exist independently but also be associated with a [Customer Payment Instrument](#token-management_customer-payment-instrument_create-a-customer-payment-instrument) or [Standalone Payment Instrument](#token-management_payment-instrument_create-a-payment-instrument).<br><br>**Creating an Instrument Identifier**<br>It is recommended you [create an Instrument Identifier via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-instrument-identifier-token-creation_liveconsole-tab-request-body), this can be for a zero amount.<br>An Instrument Identifier will also be created if you [create a Customer via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body)<br>In Europe: You should perform Payer Authentication alongside the Authorization.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Instrument Identifiers**<br>To perform a payment with an Instrument Identifier simply specify the [Instrument Identifier Id in the payments request along with the expiration date, card type, & billing address](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-instrument-identifier-token-id_liveconsole-tab-request-body).<br>When an Instrument Identifier is used in a payment the **_previousTransactionId_** and **_originalAuthorizedAmount_** values are automatically recorded.<br>These values will be added for you to future Merchant Initiated Transaction payments. @@ -1629,7 +1645,7 @@ public ApiResponse< PostInstrumentIdentifierRequest > PostInstrumentIdentifierWi } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostInstrumentIdentifier,PostInstrumentIdentifierAsync,PostInstrumentIdentifierWithHttpInfo,PostInstrumentIdentifierAsyncWithHttpInfo")) { try @@ -1643,13 +1659,15 @@ public ApiResponse< PostInstrumentIdentifierRequest > PostInstrumentIdentifierWi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostInstrumentIdentifier,PostInstrumentIdentifierAsync,PostInstrumentIdentifierWithHttpInfo,PostInstrumentIdentifierAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1665,7 +1683,7 @@ public ApiResponse< PostInstrumentIdentifierRequest > PostInstrumentIdentifierWi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest))); // Return statement + (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest),merchantConfig)); // Return statement } /// @@ -1751,7 +1769,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest))); // Return statement + (PostInstrumentIdentifierRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostInstrumentIdentifierRequest), merchantConfig)); // Return statement } /// /// Enroll an Instrument Identifier for Payment Network Token | | | | | - -- | - -- | - -- | |**Instrument Identifiers**<br>An Instrument Identifier represents either a card number, or in the case of an ACH bank account, the routing and account number.<br>The same token Id is returned for a specific card number or bank account & routing number allowing the Instrument Identifier Id to be used for cross-channel payment tracking.<br>An Instrument Identifier can exist independently but also be associated with a [Customer Payment Instrument](#token-management_customer-payment-instrument_create-a-customer-payment-instrument) or [Standalone Payment Instrument](#token-management_payment-instrument_create-a-payment-instrument).|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Enroll an Instrument Identifier for a Payment Network Token**<br>Your system can use this API to provision a Network token for an existing Instrument Identifier.<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Network token can be [provisioned when creating an Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier_samplerequests-dropdown_create-instrument-identifier-card-enroll-for-network-token_liveconsole-tab-request-body).This will occur automatically when creating a [Customer](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body), [Payment Instrument](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-create-default-payment-instrument-shipping-address-for-existing-customer_liveconsole-tab-request-body) or [Instrument Identifier](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-instrument-identifier-token-creation_liveconsole-tab-request-body) via the Payments API.<br>For more information about Payment Network Tokens see the Developer Guide. @@ -1874,7 +1894,7 @@ public ApiResponse PostInstrumentIdentifierEnrollmentWithHttpInfo (strin } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostInstrumentIdentifierEnrollment,PostInstrumentIdentifierEnrollmentAsync,PostInstrumentIdentifierEnrollmentWithHttpInfo,PostInstrumentIdentifierEnrollmentAsyncWithHttpInfo")) { try @@ -1888,13 +1908,15 @@ public ApiResponse PostInstrumentIdentifierEnrollmentWithHttpInfo (strin } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostInstrumentIdentifierEnrollment,PostInstrumentIdentifierEnrollmentAsync,PostInstrumentIdentifierEnrollmentWithHttpInfo,PostInstrumentIdentifierEnrollmentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -2000,7 +2022,7 @@ public async System.Threading.Tasks.Task> PostInstrumentIden } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostInstrumentIdentifierEnrollment,PostInstrumentIdentifierEnrollmentAsync,PostInstrumentIdentifierEnrollmentWithHttpInfo,PostInstrumentIdentifierEnrollmentAsyncWithHttpInfo")) { try @@ -2014,13 +2036,15 @@ public async System.Threading.Tasks.Task> PostInstrumentIden } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostInstrumentIdentifierEnrollment,PostInstrumentIdentifierEnrollmentAsync,PostInstrumentIdentifierEnrollmentWithHttpInfo,PostInstrumentIdentifierEnrollmentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InterchangeClearingLevelDetailsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InterchangeClearingLevelDetailsApi.cs index 2d25adcc..67c17f3c 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InterchangeClearingLevelDetailsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InterchangeClearingLevelDetailsApi.cs @@ -320,7 +320,7 @@ public ApiResponse< ReportingV3InterchangeClearingLevelDetailsGet200Response > G } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetInterchangeClearingLevelDetails,GetInterchangeClearingLevelDetailsAsync,GetInterchangeClearingLevelDetailsWithHttpInfo,GetInterchangeClearingLevelDetailsAsyncWithHttpInfo")) { try @@ -334,12 +334,14 @@ public ApiResponse< ReportingV3InterchangeClearingLevelDetailsGet200Response > G } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetInterchangeClearingLevelDetails,GetInterchangeClearingLevelDetailsAsync,GetInterchangeClearingLevelDetailsWithHttpInfo,GetInterchangeClearingLevelDetailsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -355,7 +357,7 @@ public ApiResponse< ReportingV3InterchangeClearingLevelDetailsGet200Response > G return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3InterchangeClearingLevelDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3InterchangeClearingLevelDetailsGet200Response))); // Return statement + (ReportingV3InterchangeClearingLevelDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3InterchangeClearingLevelDetailsGet200Response),merchantConfig)); // Return statement } /// @@ -458,7 +460,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3InterchangeClearingLevelDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3InterchangeClearingLevelDetailsGet200Response))); // Return statement + (ReportingV3InterchangeClearingLevelDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3InterchangeClearingLevelDetailsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoiceSettingsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoiceSettingsApi.cs index 68f013c4..4ea1489f 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoiceSettingsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoiceSettingsApi.cs @@ -319,7 +319,7 @@ public ApiResponse< InvoicingV2InvoiceSettingsGet200Response > GetInvoiceSetting } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetInvoiceSettings,GetInvoiceSettingsAsync,GetInvoiceSettingsWithHttpInfo,GetInvoiceSettingsAsyncWithHttpInfo")) { try @@ -333,12 +333,14 @@ public ApiResponse< InvoicingV2InvoiceSettingsGet200Response > GetInvoiceSetting } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetInvoiceSettings,GetInvoiceSettingsAsync,GetInvoiceSettingsWithHttpInfo,GetInvoiceSettingsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -354,7 +356,7 @@ public ApiResponse< InvoicingV2InvoiceSettingsGet200Response > GetInvoiceSetting return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response))); // Return statement + (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response),merchantConfig)); // Return statement } /// @@ -426,7 +428,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response))); // Return statement + (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response), merchantConfig)); // Return statement } /// /// Update Invoice Settings Allows you to customize the payment page, the checkout experience, email communication and payer authentication. You can customize the invoice to match your brand with your business name, logo and brand colors, and a VAT Tax number. You can choose to capture the payers shipping details, phone number and email during the checkout process. You can add a custom message to all invoice emails and enable or disable payer authentication for invoice payments. @@ -535,7 +539,7 @@ public ApiResponse< InvoicingV2InvoiceSettingsGet200Response > UpdateInvoiceSett } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdateInvoiceSettings,UpdateInvoiceSettingsAsync,UpdateInvoiceSettingsWithHttpInfo,UpdateInvoiceSettingsAsyncWithHttpInfo")) { try @@ -549,13 +553,15 @@ public ApiResponse< InvoicingV2InvoiceSettingsGet200Response > UpdateInvoiceSett } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdateInvoiceSettings,UpdateInvoiceSettingsAsync,UpdateInvoiceSettingsWithHttpInfo,UpdateInvoiceSettingsAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -571,7 +577,7 @@ public ApiResponse< InvoicingV2InvoiceSettingsGet200Response > UpdateInvoiceSett return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response))); // Return statement + (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response),merchantConfig)); // Return statement } /// @@ -647,7 +653,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response))); // Return statement + (InvoicingV2InvoiceSettingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoiceSettingsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoicesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoicesApi.cs index 4ab497af..170d0721 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoicesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoicesApi.cs @@ -549,7 +549,7 @@ public ApiResponse< InvoicingV2InvoicesPost201Response > CreateInvoiceWithHttpIn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateInvoice,CreateInvoiceAsync,CreateInvoiceWithHttpInfo,CreateInvoiceAsyncWithHttpInfo")) { try @@ -563,13 +563,15 @@ public ApiResponse< InvoicingV2InvoicesPost201Response > CreateInvoiceWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateInvoice,CreateInvoiceAsync,CreateInvoiceWithHttpInfo,CreateInvoiceAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -585,7 +587,7 @@ public ApiResponse< InvoicingV2InvoicesPost201Response > CreateInvoiceWithHttpIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPost201Response))); // Return statement + (InvoicingV2InvoicesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPost201Response),merchantConfig)); // Return statement } /// @@ -661,7 +663,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPost201Response))); // Return statement + (InvoicingV2InvoicesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPost201Response), merchantConfig)); // Return statement } /// /// Get a List of Invoices Provides a (filtered) list of invoices that have been created in your account. You can filter the list based on Invoice Status by setting the status query parameter to one of DRAFT, CREATED, SENT, PARTIAL, PAID or CANCELED. @@ -800,7 +804,7 @@ public ApiResponse< InvoicingV2InvoicesAllGet200Response > GetAllInvoicesWithHtt } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetAllInvoices,GetAllInvoicesAsync,GetAllInvoicesWithHttpInfo,GetAllInvoicesAsyncWithHttpInfo")) { try @@ -814,12 +818,14 @@ public ApiResponse< InvoicingV2InvoicesAllGet200Response > GetAllInvoicesWithHtt } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetAllInvoices,GetAllInvoicesAsync,GetAllInvoicesWithHttpInfo,GetAllInvoicesAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -835,7 +841,7 @@ public ApiResponse< InvoicingV2InvoicesAllGet200Response > GetAllInvoicesWithHtt return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesAllGet200Response))); // Return statement + (InvoicingV2InvoicesAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesAllGet200Response),merchantConfig)); // Return statement } /// @@ -940,7 +946,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesAllGet200Response))); // Return statement + (InvoicingV2InvoicesAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesAllGet200Response), merchantConfig)); // Return statement } /// /// Get Invoice Details You can retrieve details of a specific invoice. This can be used to check the Invoice status and get a list of invoice payments in the invoice history section of the response. For each payment transaction you can use the Transaction Details API to get more details on the payment transaction. @@ -1058,7 +1066,7 @@ public ApiResponse< InvoicingV2InvoicesGet200Response > GetInvoiceWithHttpInfo ( } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetInvoice,GetInvoiceAsync,GetInvoiceWithHttpInfo,GetInvoiceAsyncWithHttpInfo")) { try @@ -1072,12 +1080,14 @@ public ApiResponse< InvoicingV2InvoicesGet200Response > GetInvoiceWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetInvoice,GetInvoiceAsync,GetInvoiceWithHttpInfo,GetInvoiceAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1093,7 +1103,7 @@ public ApiResponse< InvoicingV2InvoicesGet200Response > GetInvoiceWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesGet200Response))); // Return statement + (InvoicingV2InvoicesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesGet200Response),merchantConfig)); // Return statement } /// @@ -1178,7 +1188,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesGet200Response))); // Return statement + (InvoicingV2InvoicesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesGet200Response), merchantConfig)); // Return statement } /// /// Cancel an Invoice You can cancel an invoice if no payment is made to it. You cannot cancel partially or fully paid invoices. @@ -1296,7 +1308,7 @@ public ApiResponse< InvoicingV2InvoicesCancel200Response > PerformCancelActionWi } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PerformCancelAction,PerformCancelActionAsync,PerformCancelActionWithHttpInfo,PerformCancelActionAsyncWithHttpInfo")) { try @@ -1310,12 +1322,14 @@ public ApiResponse< InvoicingV2InvoicesCancel200Response > PerformCancelActionWi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PerformCancelAction,PerformCancelActionAsync,PerformCancelActionWithHttpInfo,PerformCancelActionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1331,7 +1345,7 @@ public ApiResponse< InvoicingV2InvoicesCancel200Response > PerformCancelActionWi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesCancel200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesCancel200Response))); // Return statement + (InvoicingV2InvoicesCancel200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesCancel200Response),merchantConfig)); // Return statement } /// @@ -1416,7 +1430,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesCancel200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesCancel200Response))); // Return statement + (InvoicingV2InvoicesCancel200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesCancel200Response), merchantConfig)); // Return statement } /// /// Publish an Invoice You can publish an invoice in DRAFT status. After invoking this method, the invoice status is changed to CREATED. @@ -1534,7 +1550,7 @@ public ApiResponse< InvoicingV2InvoicesPublish200Response > PerformPublishAction } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PerformPublishAction,PerformPublishActionAsync,PerformPublishActionWithHttpInfo,PerformPublishActionAsyncWithHttpInfo")) { try @@ -1548,12 +1564,14 @@ public ApiResponse< InvoicingV2InvoicesPublish200Response > PerformPublishAction } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PerformPublishAction,PerformPublishActionAsync,PerformPublishActionWithHttpInfo,PerformPublishActionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1569,7 +1587,7 @@ public ApiResponse< InvoicingV2InvoicesPublish200Response > PerformPublishAction return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesPublish200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPublish200Response))); // Return statement + (InvoicingV2InvoicesPublish200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPublish200Response),merchantConfig)); // Return statement } /// @@ -1654,7 +1672,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesPublish200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPublish200Response))); // Return statement + (InvoicingV2InvoicesPublish200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPublish200Response), merchantConfig)); // Return statement } /// /// Send an Invoice You can send an invoice in draft or created state or resend a sent or partially paid invoice. Fully paid or canceled invoices cannot be resent. @@ -1772,7 +1792,7 @@ public ApiResponse< InvoicingV2InvoicesSend200Response > PerformSendActionWithHt } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PerformSendAction,PerformSendActionAsync,PerformSendActionWithHttpInfo,PerformSendActionAsyncWithHttpInfo")) { try @@ -1786,12 +1806,14 @@ public ApiResponse< InvoicingV2InvoicesSend200Response > PerformSendActionWithHt } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PerformSendAction,PerformSendActionAsync,PerformSendActionWithHttpInfo,PerformSendActionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1807,7 +1829,7 @@ public ApiResponse< InvoicingV2InvoicesSend200Response > PerformSendActionWithHt return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesSend200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesSend200Response))); // Return statement + (InvoicingV2InvoicesSend200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesSend200Response),merchantConfig)); // Return statement } /// @@ -1892,7 +1914,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesSend200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesSend200Response))); // Return statement + (InvoicingV2InvoicesSend200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesSend200Response), merchantConfig)); // Return statement } /// /// Update an Invoice You can update all information except the invoice number till any payment is received for an invoice. Invoices that are partially or fully paid or cancelled cannot be updated. @@ -2014,7 +2038,7 @@ public ApiResponse< InvoicingV2InvoicesPut200Response > UpdateInvoiceWithHttpInf } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdateInvoice,UpdateInvoiceAsync,UpdateInvoiceWithHttpInfo,UpdateInvoiceAsyncWithHttpInfo")) { try @@ -2028,13 +2052,15 @@ public ApiResponse< InvoicingV2InvoicesPut200Response > UpdateInvoiceWithHttpInf } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdateInvoice,UpdateInvoiceAsync,UpdateInvoiceWithHttpInfo,UpdateInvoiceAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -2050,7 +2076,7 @@ public ApiResponse< InvoicingV2InvoicesPut200Response > UpdateInvoiceWithHttpInf return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesPut200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPut200Response))); // Return statement + (InvoicingV2InvoicesPut200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPut200Response),merchantConfig)); // Return statement } /// @@ -2139,7 +2165,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InvoicingV2InvoicesPut200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPut200Response))); // Return statement + (InvoicingV2InvoicesPut200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InvoicingV2InvoicesPut200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ManageWebhooksApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ManageWebhooksApi.cs index c7fe1ec8..5e3e25e7 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ManageWebhooksApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ManageWebhooksApi.cs @@ -568,7 +568,7 @@ public ApiResponse DeleteWebhookSubscriptionWithHttpInfo (string webhook } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteWebhookSubscription,DeleteWebhookSubscriptionAsync,DeleteWebhookSubscriptionWithHttpInfo,DeleteWebhookSubscriptionAsyncWithHttpInfo")) { try @@ -582,12 +582,14 @@ public ApiResponse DeleteWebhookSubscriptionWithHttpInfo (string webhook } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteWebhookSubscription,DeleteWebhookSubscriptionAsync,DeleteWebhookSubscriptionWithHttpInfo,DeleteWebhookSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -683,7 +685,7 @@ public async System.Threading.Tasks.Task> DeleteWebhookSubsc } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteWebhookSubscription,DeleteWebhookSubscriptionAsync,DeleteWebhookSubscriptionWithHttpInfo,DeleteWebhookSubscriptionAsyncWithHttpInfo")) { try @@ -697,12 +699,14 @@ public async System.Threading.Tasks.Task> DeleteWebhookSubsc } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteWebhookSubscription,DeleteWebhookSubscriptionAsync,DeleteWebhookSubscriptionWithHttpInfo,DeleteWebhookSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -799,7 +803,7 @@ public ApiResponse< InlineResponse2015 > GetWebhookSubscriptionByIdWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetWebhookSubscriptionById,GetWebhookSubscriptionByIdAsync,GetWebhookSubscriptionByIdWithHttpInfo,GetWebhookSubscriptionByIdAsyncWithHttpInfo")) { try @@ -813,12 +817,14 @@ public ApiResponse< InlineResponse2015 > GetWebhookSubscriptionByIdWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetWebhookSubscriptionById,GetWebhookSubscriptionByIdAsync,GetWebhookSubscriptionByIdWithHttpInfo,GetWebhookSubscriptionByIdAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -834,7 +840,7 @@ public ApiResponse< InlineResponse2015 > GetWebhookSubscriptionByIdWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015))); // Return statement + (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015),merchantConfig)); // Return statement } /// @@ -916,7 +922,7 @@ public async System.Threading.Tasks.Task> GetWeb } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetWebhookSubscriptionById,GetWebhookSubscriptionByIdAsync,GetWebhookSubscriptionByIdWithHttpInfo,GetWebhookSubscriptionByIdAsyncWithHttpInfo")) { try @@ -930,12 +936,14 @@ public async System.Threading.Tasks.Task> GetWeb } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetWebhookSubscriptionById,GetWebhookSubscriptionByIdAsync,GetWebhookSubscriptionByIdWithHttpInfo,GetWebhookSubscriptionByIdAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -951,7 +959,7 @@ public async System.Threading.Tasks.Task> GetWeb return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015))); // Return statement + (InlineResponse2015) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2015), merchantConfig)); // Return statement } /// /// Get Details On All Created Webhooks Retrieve a list of all previously created webhooks. @@ -1045,7 +1053,7 @@ public ApiResponse< List > GetWebhookSubscriptionsByOrgWithH } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetWebhookSubscriptionsByOrg,GetWebhookSubscriptionsByOrgAsync,GetWebhookSubscriptionsByOrgWithHttpInfo,GetWebhookSubscriptionsByOrgAsyncWithHttpInfo")) { try @@ -1059,12 +1067,14 @@ public ApiResponse< List > GetWebhookSubscriptionsByOrgWithH } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetWebhookSubscriptionsByOrg,GetWebhookSubscriptionsByOrgAsync,GetWebhookSubscriptionsByOrgWithHttpInfo,GetWebhookSubscriptionsByOrgAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1080,7 +1090,7 @@ public ApiResponse< List > GetWebhookSubscriptionsByOrgWithH return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List),merchantConfig)); // Return statement } /// @@ -1176,7 +1186,7 @@ public async System.Threading.Tasks.Task>> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetWebhookSubscriptionsByOrg,GetWebhookSubscriptionsByOrgAsync,GetWebhookSubscriptionsByOrgWithHttpInfo,GetWebhookSubscriptionsByOrgAsyncWithHttpInfo")) { try @@ -1190,12 +1200,14 @@ public async System.Threading.Tasks.Task>> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetWebhookSubscriptionsByOrg,GetWebhookSubscriptionsByOrgAsync,GetWebhookSubscriptionsByOrgWithHttpInfo,GetWebhookSubscriptionsByOrgAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1211,7 +1223,7 @@ public async System.Threading.Tasks.Task>> return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List), merchantConfig)); // Return statement } /// /// Test a Webhook Configuration Test the webhook configuration by sending a sample webhook. Calling this endpoint sends a sample webhook to the endpoint identified in the user's subscription. It will contain sample values for the product & eventType based on values present in your subscription along with a sample message in the payload. Based on the webhook response users can make any necessary modifications or rest assured knowing their setup is configured correctly. @@ -1291,7 +1303,7 @@ public ApiResponse< InlineResponse2016 > NotificationSubscriptionsV1WebhooksWebh } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV1WebhooksWebhookIdPost,NotificationSubscriptionsV1WebhooksWebhookIdPostAsync,NotificationSubscriptionsV1WebhooksWebhookIdPostWithHttpInfo,NotificationSubscriptionsV1WebhooksWebhookIdPostAsyncWithHttpInfo")) { try @@ -1305,12 +1317,14 @@ public ApiResponse< InlineResponse2016 > NotificationSubscriptionsV1WebhooksWebh } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV1WebhooksWebhookIdPost,NotificationSubscriptionsV1WebhooksWebhookIdPostAsync,NotificationSubscriptionsV1WebhooksWebhookIdPostWithHttpInfo,NotificationSubscriptionsV1WebhooksWebhookIdPostAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1326,7 +1340,7 @@ public ApiResponse< InlineResponse2016 > NotificationSubscriptionsV1WebhooksWebh return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2016) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2016))); // Return statement + (InlineResponse2016) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2016),merchantConfig)); // Return statement } /// @@ -1408,7 +1422,7 @@ public async System.Threading.Tasks.Task> Notifi } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV1WebhooksWebhookIdPost,NotificationSubscriptionsV1WebhooksWebhookIdPostAsync,NotificationSubscriptionsV1WebhooksWebhookIdPostWithHttpInfo,NotificationSubscriptionsV1WebhooksWebhookIdPostAsyncWithHttpInfo")) { try @@ -1422,12 +1436,14 @@ public async System.Threading.Tasks.Task> Notifi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV1WebhooksWebhookIdPost,NotificationSubscriptionsV1WebhooksWebhookIdPostAsync,NotificationSubscriptionsV1WebhooksWebhookIdPostWithHttpInfo,NotificationSubscriptionsV1WebhooksWebhookIdPostAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1443,7 +1459,7 @@ public async System.Threading.Tasks.Task> Notifi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2016) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2016))); // Return statement + (InlineResponse2016) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2016), merchantConfig)); // Return statement } /// /// Update a Webhook Subscription Update a Webhook Subscription. @@ -1521,7 +1537,7 @@ public ApiResponse< InlineResponse2006 > NotificationSubscriptionsV2WebhooksWebh } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV2WebhooksWebhookIdPatch,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsync,NotificationSubscriptionsV2WebhooksWebhookIdPatchWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsyncWithHttpInfo")) { try @@ -1535,13 +1551,15 @@ public ApiResponse< InlineResponse2006 > NotificationSubscriptionsV2WebhooksWebh } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV2WebhooksWebhookIdPatch,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsync,NotificationSubscriptionsV2WebhooksWebhookIdPatchWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1557,7 +1575,7 @@ public ApiResponse< InlineResponse2006 > NotificationSubscriptionsV2WebhooksWebh return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2006) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2006))); // Return statement + (InlineResponse2006) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2006),merchantConfig)); // Return statement } /// @@ -1637,7 +1655,7 @@ public async System.Threading.Tasks.Task> Notifi } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV2WebhooksWebhookIdPatch,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsync,NotificationSubscriptionsV2WebhooksWebhookIdPatchWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsyncWithHttpInfo")) { try @@ -1651,13 +1669,15 @@ public async System.Threading.Tasks.Task> Notifi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV2WebhooksWebhookIdPatch,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsync,NotificationSubscriptionsV2WebhooksWebhookIdPatchWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdPatchAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1673,7 +1693,7 @@ public async System.Threading.Tasks.Task> Notifi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2006) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2006))); // Return statement + (InlineResponse2006) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2006), merchantConfig)); // Return statement } /// /// Update a Webhook Status Users can update the status of a webhook subscription by calling this endpoint. The webhookId parameter in the URL path identifies the specific webhook subscription to be updated. The request body accepts the values ACTIVE or INACTIVE. If the subscription is set to INACTIVE, webhooks will not be delivered until the subscription is activated again. @@ -1748,7 +1768,7 @@ public ApiResponse NotificationSubscriptionsV2WebhooksWebhookIdStatusPut } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV2WebhooksWebhookIdStatusPut,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsync,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsyncWithHttpInfo")) { try @@ -1762,13 +1782,15 @@ public ApiResponse NotificationSubscriptionsV2WebhooksWebhookIdStatusPut } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV2WebhooksWebhookIdStatusPut,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsync,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1862,7 +1884,7 @@ public async System.Threading.Tasks.Task> NotificationSubscr } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "NotificationSubscriptionsV2WebhooksWebhookIdStatusPut,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsync,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsyncWithHttpInfo")) { try @@ -1876,13 +1898,15 @@ public async System.Threading.Tasks.Task> NotificationSubscr } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "NotificationSubscriptionsV2WebhooksWebhookIdStatusPut,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsync,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutWithHttpInfo,NotificationSubscriptionsV2WebhooksWebhookIdStatusPutAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2000,7 +2024,7 @@ public ApiResponse< InlineResponse2017 > SaveAsymEgressKeyWithHttpInfo (string v } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SaveAsymEgressKey,SaveAsymEgressKeyAsync,SaveAsymEgressKeyWithHttpInfo,SaveAsymEgressKeyAsyncWithHttpInfo")) { try @@ -2014,13 +2038,15 @@ public ApiResponse< InlineResponse2017 > SaveAsymEgressKeyWithHttpInfo (string v } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SaveAsymEgressKey,SaveAsymEgressKeyAsync,SaveAsymEgressKeyWithHttpInfo,SaveAsymEgressKeyAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -2036,7 +2062,7 @@ public ApiResponse< InlineResponse2017 > SaveAsymEgressKeyWithHttpInfo (string v return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2017) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2017))); // Return statement + (InlineResponse2017) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2017),merchantConfig)); // Return statement } /// @@ -2139,7 +2165,7 @@ public async System.Threading.Tasks.Task> SaveAs } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SaveAsymEgressKey,SaveAsymEgressKeyAsync,SaveAsymEgressKeyWithHttpInfo,SaveAsymEgressKeyAsyncWithHttpInfo")) { try @@ -2153,13 +2179,15 @@ public async System.Threading.Tasks.Task> SaveAs } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SaveAsymEgressKey,SaveAsymEgressKeyAsync,SaveAsymEgressKeyWithHttpInfo,SaveAsymEgressKeyAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2175,7 +2203,7 @@ public async System.Threading.Tasks.Task> SaveAs return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2017) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2017))); // Return statement + (InlineResponse2017) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2017), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantBoardingApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantBoardingApi.cs index 67b2cfe1..29ccd836 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantBoardingApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantBoardingApi.cs @@ -337,7 +337,7 @@ public ApiResponse< InlineResponse2003 > GetRegistrationWithHttpInfo (string reg } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetRegistration,GetRegistrationAsync,GetRegistrationWithHttpInfo,GetRegistrationAsyncWithHttpInfo")) { try @@ -351,12 +351,14 @@ public ApiResponse< InlineResponse2003 > GetRegistrationWithHttpInfo (string reg } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetRegistration,GetRegistrationAsync,GetRegistrationWithHttpInfo,GetRegistrationAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -372,7 +374,7 @@ public ApiResponse< InlineResponse2003 > GetRegistrationWithHttpInfo (string reg return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2003) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2003))); // Return statement + (InlineResponse2003) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2003),merchantConfig)); // Return statement } /// @@ -454,7 +456,7 @@ public async System.Threading.Tasks.Task> GetReg } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetRegistration,GetRegistrationAsync,GetRegistrationWithHttpInfo,GetRegistrationAsyncWithHttpInfo")) { try @@ -468,12 +470,14 @@ public async System.Threading.Tasks.Task> GetReg } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetRegistration,GetRegistrationAsync,GetRegistrationWithHttpInfo,GetRegistrationAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -489,7 +493,7 @@ public async System.Threading.Tasks.Task> GetReg return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2003) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2003))); // Return statement + (InlineResponse2003) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2003), merchantConfig)); // Return statement } /// /// Create a boarding registration Boarding Product is specifically for resellers who onboard merchants to resell their services to merchants and help integrate REST API into their systems. The Boarding API is designed to simplify and streamline the onboarding process of merchants by enabling administrators and developers to: 1. Enable and Configure Products: The API helps in adding new products to an existing organization and configuring them to suit specific needs. 2. Update Merchant Information: The API allows for updating an organization's information efficiently. 3. Manage Payment Integration: It provides templates for secure payment integration and management. @@ -566,7 +570,7 @@ public ApiResponse< InlineResponse2013 > PostRegistrationWithHttpInfo (PostRegis } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostRegistration,PostRegistrationAsync,PostRegistrationWithHttpInfo,PostRegistrationAsyncWithHttpInfo")) { try @@ -580,13 +584,15 @@ public ApiResponse< InlineResponse2013 > PostRegistrationWithHttpInfo (PostRegis } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostRegistration,PostRegistrationAsync,PostRegistrationWithHttpInfo,PostRegistrationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -602,7 +608,7 @@ public ApiResponse< InlineResponse2013 > PostRegistrationWithHttpInfo (PostRegis return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2013))); // Return statement + (InlineResponse2013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2013),merchantConfig)); // Return statement } /// @@ -681,7 +687,7 @@ public async System.Threading.Tasks.Task> PostRe } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostRegistration,PostRegistrationAsync,PostRegistrationWithHttpInfo,PostRegistrationAsyncWithHttpInfo")) { try @@ -695,13 +701,15 @@ public async System.Threading.Tasks.Task> PostRe } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostRegistration,PostRegistrationAsync,PostRegistrationWithHttpInfo,PostRegistrationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -717,7 +725,7 @@ public async System.Threading.Tasks.Task> PostRe return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse2013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2013))); // Return statement + (InlineResponse2013) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2013), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantDefinedFieldsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantDefinedFieldsApi.cs index 80222e01..7117b30e 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantDefinedFieldsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MerchantDefinedFieldsApi.cs @@ -437,7 +437,7 @@ public ApiResponse< List > CreateMerchantDefinedFieldDefinit } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateMerchantDefinedFieldDefinition,CreateMerchantDefinedFieldDefinitionAsync,CreateMerchantDefinedFieldDefinitionWithHttpInfo,CreateMerchantDefinedFieldDefinitionAsyncWithHttpInfo")) { try @@ -451,13 +451,15 @@ public ApiResponse< List > CreateMerchantDefinedFieldDefinit } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateMerchantDefinedFieldDefinition,CreateMerchantDefinedFieldDefinitionAsync,CreateMerchantDefinedFieldDefinitionWithHttpInfo,CreateMerchantDefinedFieldDefinitionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -473,7 +475,7 @@ public ApiResponse< List > CreateMerchantDefinedFieldDefinit return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List),merchantConfig)); // Return statement } /// @@ -559,7 +561,7 @@ public async System.Threading.Tasks.Task>> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateMerchantDefinedFieldDefinition,CreateMerchantDefinedFieldDefinitionAsync,CreateMerchantDefinedFieldDefinitionWithHttpInfo,CreateMerchantDefinedFieldDefinitionAsyncWithHttpInfo")) { try @@ -573,13 +575,15 @@ public async System.Threading.Tasks.Task>> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateMerchantDefinedFieldDefinition,CreateMerchantDefinedFieldDefinitionAsync,CreateMerchantDefinedFieldDefinitionWithHttpInfo,CreateMerchantDefinedFieldDefinitionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -595,7 +599,7 @@ public async System.Threading.Tasks.Task>> return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List), merchantConfig)); // Return statement } /// /// Get all merchant defined fields for a given reference type @@ -675,7 +679,7 @@ public ApiResponse< List > GetMerchantDefinedFieldsDefinitio } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetMerchantDefinedFieldsDefinitions,GetMerchantDefinedFieldsDefinitionsAsync,GetMerchantDefinedFieldsDefinitionsWithHttpInfo,GetMerchantDefinedFieldsDefinitionsAsyncWithHttpInfo")) { try @@ -689,12 +693,14 @@ public ApiResponse< List > GetMerchantDefinedFieldsDefinitio } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetMerchantDefinedFieldsDefinitions,GetMerchantDefinedFieldsDefinitionsAsync,GetMerchantDefinedFieldsDefinitionsWithHttpInfo,GetMerchantDefinedFieldsDefinitionsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -710,7 +716,7 @@ public ApiResponse< List > GetMerchantDefinedFieldsDefinitio return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List),merchantConfig)); // Return statement } /// @@ -792,7 +798,7 @@ public async System.Threading.Tasks.Task>> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetMerchantDefinedFieldsDefinitions,GetMerchantDefinedFieldsDefinitionsAsync,GetMerchantDefinedFieldsDefinitionsWithHttpInfo,GetMerchantDefinedFieldsDefinitionsAsyncWithHttpInfo")) { try @@ -806,12 +812,14 @@ public async System.Threading.Tasks.Task>> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetMerchantDefinedFieldsDefinitions,GetMerchantDefinedFieldsDefinitionsAsync,GetMerchantDefinedFieldsDefinitionsWithHttpInfo,GetMerchantDefinedFieldsDefinitionsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -827,7 +835,7 @@ public async System.Threading.Tasks.Task>> return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List), merchantConfig)); // Return statement } /// /// Delete a MerchantDefinedField by ID @@ -917,7 +925,7 @@ public ApiResponse InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDelete } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDelete,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsyncWithHttpInfo")) { try @@ -931,12 +939,14 @@ public ApiResponse InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDelete } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDelete,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1045,7 +1055,7 @@ public async System.Threading.Tasks.Task> InvoicingV2Referen } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDelete,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsyncWithHttpInfo")) { try @@ -1059,12 +1069,14 @@ public async System.Threading.Tasks.Task> InvoicingV2Referen } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDelete,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdDeleteAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1178,7 +1190,7 @@ public ApiResponse< List > InvoicingV2ReferenceTypeMerchantD } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPut,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsyncWithHttpInfo")) { try @@ -1192,13 +1204,15 @@ public ApiResponse< List > InvoicingV2ReferenceTypeMerchantD } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPut,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1214,7 +1228,7 @@ public ApiResponse< List > InvoicingV2ReferenceTypeMerchantD return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List),merchantConfig)); // Return statement } /// @@ -1313,7 +1327,7 @@ public async System.Threading.Tasks.Task>> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPut,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsyncWithHttpInfo")) { try @@ -1327,13 +1341,15 @@ public async System.Threading.Tasks.Task>> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPut,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsync,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutWithHttpInfo,InvoicingV2ReferenceTypeMerchantDefinedFieldsIdPutAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1349,7 +1365,7 @@ public async System.Threading.Tasks.Task>> return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); // Return statement + (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MicroformIntegrationApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MicroformIntegrationApi.cs index 7677d87a..6eb3c7e0 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MicroformIntegrationApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/MicroformIntegrationApi.cs @@ -282,7 +282,7 @@ public ApiResponse< string > GenerateCaptureContextWithHttpInfo (GenerateCapture } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GenerateCaptureContext,GenerateCaptureContextAsync,GenerateCaptureContextWithHttpInfo,GenerateCaptureContextAsyncWithHttpInfo")) { try @@ -296,13 +296,15 @@ public ApiResponse< string > GenerateCaptureContextWithHttpInfo (GenerateCapture } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GenerateCaptureContext,GenerateCaptureContextAsync,GenerateCaptureContextWithHttpInfo,GenerateCaptureContextAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -318,7 +320,7 @@ public ApiResponse< string > GenerateCaptureContextWithHttpInfo (GenerateCapture return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string),merchantConfig)); // Return statement } /// @@ -391,7 +393,7 @@ public async System.Threading.Tasks.Task> GenerateCaptureCon } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GenerateCaptureContext,GenerateCaptureContextAsync,GenerateCaptureContextWithHttpInfo,GenerateCaptureContextAsyncWithHttpInfo")) { try @@ -405,13 +407,15 @@ public async System.Threading.Tasks.Task> GenerateCaptureCon } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GenerateCaptureContext,GenerateCaptureContextAsync,GenerateCaptureContextWithHttpInfo,GenerateCaptureContextAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -427,7 +431,7 @@ public async System.Threading.Tasks.Task> GenerateCaptureCon return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NetFundingsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NetFundingsApi.cs index 7a14b80e..97acd8d4 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NetFundingsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NetFundingsApi.cs @@ -331,7 +331,7 @@ public ApiResponse< ReportingV3NetFundingsGet200Response > GetNetFundingDetailsW } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetNetFundingDetails,GetNetFundingDetailsAsync,GetNetFundingDetailsWithHttpInfo,GetNetFundingDetailsAsyncWithHttpInfo")) { try @@ -345,12 +345,14 @@ public ApiResponse< ReportingV3NetFundingsGet200Response > GetNetFundingDetailsW } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetNetFundingDetails,GetNetFundingDetailsAsync,GetNetFundingDetailsWithHttpInfo,GetNetFundingDetailsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -366,7 +368,7 @@ public ApiResponse< ReportingV3NetFundingsGet200Response > GetNetFundingDetailsW return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3NetFundingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NetFundingsGet200Response))); // Return statement + (ReportingV3NetFundingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NetFundingsGet200Response),merchantConfig)); // Return statement } /// @@ -476,7 +478,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3NetFundingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NetFundingsGet200Response))); // Return statement + (ReportingV3NetFundingsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NetFundingsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NotificationOfChangesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NotificationOfChangesApi.cs index 615cb59f..37b75284 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NotificationOfChangesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/NotificationOfChangesApi.cs @@ -310,7 +310,7 @@ public ApiResponse< ReportingV3NotificationofChangesGet200Response > GetNotifica } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetNotificationOfChangeReport,GetNotificationOfChangeReportAsync,GetNotificationOfChangeReportWithHttpInfo,GetNotificationOfChangeReportAsyncWithHttpInfo")) { try @@ -324,12 +324,14 @@ public ApiResponse< ReportingV3NotificationofChangesGet200Response > GetNotifica } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetNotificationOfChangeReport,GetNotificationOfChangeReportAsync,GetNotificationOfChangeReportWithHttpInfo,GetNotificationOfChangeReportAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -345,7 +347,7 @@ public ApiResponse< ReportingV3NotificationofChangesGet200Response > GetNotifica return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3NotificationofChangesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NotificationofChangesGet200Response))); // Return statement + (ReportingV3NotificationofChangesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NotificationofChangesGet200Response),merchantConfig)); // Return statement } /// @@ -442,7 +444,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3NotificationofChangesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NotificationofChangesGet200Response))); // Return statement + (ReportingV3NotificationofChangesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3NotificationofChangesGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OAuthApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OAuthApi.cs index 0714dd3d..48e47fc9 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OAuthApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OAuthApi.cs @@ -7,6 +7,7 @@ using CyberSource.Model; using NLog; using AuthenticationSdk.util; +using AuthenticationSdk.core; namespace CyberSource.Api { @@ -280,9 +281,11 @@ public ApiResponse PostAccessTokenRequestWithHttpInfo(Creat } } + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (AccessTokenResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(AccessTokenResponse))); // Return statement + (AccessTokenResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(AccessTokenResponse), merchantConfig)); // Return statement } /// @@ -377,9 +380,11 @@ public async System.Threading.Tasks.Task> PostA } } + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (AccessTokenResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(AccessTokenResponse))); // Return statement + (AccessTokenResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(AccessTokenResponse), merchantConfig)); // Return statement } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OrdersApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OrdersApi.cs index d33d7043..d41f36af 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OrdersApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/OrdersApi.cs @@ -328,7 +328,7 @@ public ApiResponse< PtsV2CreateOrderPost201Response > CreateOrderWithHttpInfo (C } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateOrder,CreateOrderAsync,CreateOrderWithHttpInfo,CreateOrderAsyncWithHttpInfo")) { try @@ -342,13 +342,15 @@ public ApiResponse< PtsV2CreateOrderPost201Response > CreateOrderWithHttpInfo (C } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateOrder,CreateOrderAsync,CreateOrderWithHttpInfo,CreateOrderAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -364,7 +366,7 @@ public ApiResponse< PtsV2CreateOrderPost201Response > CreateOrderWithHttpInfo (C return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreateOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateOrderPost201Response))); // Return statement + (PtsV2CreateOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateOrderPost201Response),merchantConfig)); // Return statement } /// @@ -437,7 +439,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2CreateOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateOrderPost201Response))); // Return statement + (PtsV2CreateOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2CreateOrderPost201Response), merchantConfig)); // Return statement } /// /// Update an Order This API can be used in two flavours - for updating the order as well as saving the order. @@ -557,7 +561,7 @@ public ApiResponse< PtsV2UpdateOrderPatch201Response > UpdateOrderWithHttpInfo ( } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdateOrder,UpdateOrderAsync,UpdateOrderWithHttpInfo,UpdateOrderAsyncWithHttpInfo")) { try @@ -571,13 +575,15 @@ public ApiResponse< PtsV2UpdateOrderPatch201Response > UpdateOrderWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdateOrder,UpdateOrderAsync,UpdateOrderWithHttpInfo,UpdateOrderAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -593,7 +599,7 @@ public ApiResponse< PtsV2UpdateOrderPatch201Response > UpdateOrderWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2UpdateOrderPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2UpdateOrderPatch201Response))); // Return statement + (PtsV2UpdateOrderPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2UpdateOrderPatch201Response),merchantConfig)); // Return statement } /// @@ -679,7 +685,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2UpdateOrderPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2UpdateOrderPatch201Response))); // Return statement + (PtsV2UpdateOrderPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2UpdateOrderPatch201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayerAuthenticationApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayerAuthenticationApi.cs index 881b5bf2..23bd68e6 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayerAuthenticationApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayerAuthenticationApi.cs @@ -366,7 +366,7 @@ public ApiResponse< RiskV1AuthenticationsPost201Response > CheckPayerAuthEnrollm } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CheckPayerAuthEnrollment,CheckPayerAuthEnrollmentAsync,CheckPayerAuthEnrollmentWithHttpInfo,CheckPayerAuthEnrollmentAsyncWithHttpInfo")) { try @@ -380,13 +380,15 @@ public ApiResponse< RiskV1AuthenticationsPost201Response > CheckPayerAuthEnrollm } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CheckPayerAuthEnrollment,CheckPayerAuthEnrollmentAsync,CheckPayerAuthEnrollmentWithHttpInfo,CheckPayerAuthEnrollmentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -402,7 +404,7 @@ public ApiResponse< RiskV1AuthenticationsPost201Response > CheckPayerAuthEnrollm return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AuthenticationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationsPost201Response))); // Return statement + (RiskV1AuthenticationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationsPost201Response),merchantConfig)); // Return statement } /// @@ -475,7 +477,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AuthenticationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationsPost201Response))); // Return statement + (RiskV1AuthenticationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationsPost201Response), merchantConfig)); // Return statement } /// /// Setup Payer Auth A new service for Merchants to get reference_id for Digital Wallets to use in place of BIN number in Cardinal. Set up file while authenticating with Cardinal. This service should be called by Merchant when payment instrument chosen or changes. This service has to be called before enrollment check. The availability of API features for a merchant may depend on the portfolio configuration and may need to be enabled at the portfolio level before they can be added to merchant accounts. @@ -582,7 +586,7 @@ public ApiResponse< RiskV1AuthenticationSetupsPost201Response > PayerAuthSetupWi } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PayerAuthSetup,PayerAuthSetupAsync,PayerAuthSetupWithHttpInfo,PayerAuthSetupAsyncWithHttpInfo")) { try @@ -596,13 +600,15 @@ public ApiResponse< RiskV1AuthenticationSetupsPost201Response > PayerAuthSetupWi } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PayerAuthSetup,PayerAuthSetupAsync,PayerAuthSetupWithHttpInfo,PayerAuthSetupAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -618,7 +624,7 @@ public ApiResponse< RiskV1AuthenticationSetupsPost201Response > PayerAuthSetupWi return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AuthenticationSetupsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationSetupsPost201Response))); // Return statement + (RiskV1AuthenticationSetupsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationSetupsPost201Response),merchantConfig)); // Return statement } /// @@ -691,7 +697,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AuthenticationSetupsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationSetupsPost201Response))); // Return statement + (RiskV1AuthenticationSetupsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationSetupsPost201Response), merchantConfig)); // Return statement } /// /// Validate Authentication Results This call retrieves and validates the authentication results from issuer and allows the merchant to proceed with processing the payment. @@ -798,7 +806,7 @@ public ApiResponse< RiskV1AuthenticationResultsPost201Response > ValidateAuthent } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "ValidateAuthenticationResults,ValidateAuthenticationResultsAsync,ValidateAuthenticationResultsWithHttpInfo,ValidateAuthenticationResultsAsyncWithHttpInfo")) { try @@ -812,13 +820,15 @@ public ApiResponse< RiskV1AuthenticationResultsPost201Response > ValidateAuthent } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "ValidateAuthenticationResults,ValidateAuthenticationResultsAsync,ValidateAuthenticationResultsWithHttpInfo,ValidateAuthenticationResultsAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -834,7 +844,7 @@ public ApiResponse< RiskV1AuthenticationResultsPost201Response > ValidateAuthent return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AuthenticationResultsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationResultsPost201Response))); // Return statement + (RiskV1AuthenticationResultsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationResultsPost201Response),merchantConfig)); // Return statement } /// @@ -907,7 +917,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AuthenticationResultsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationResultsPost201Response))); // Return statement + (RiskV1AuthenticationResultsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AuthenticationResultsPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentBatchSummariesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentBatchSummariesApi.cs index 237e8a89..2786d9e2 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentBatchSummariesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentBatchSummariesApi.cs @@ -354,7 +354,7 @@ public ApiResponse< ReportingV3PaymentBatchSummariesGet200Response > GetPaymentB } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPaymentBatchSummary,GetPaymentBatchSummaryAsync,GetPaymentBatchSummaryWithHttpInfo,GetPaymentBatchSummaryAsyncWithHttpInfo")) { try @@ -368,12 +368,14 @@ public ApiResponse< ReportingV3PaymentBatchSummariesGet200Response > GetPaymentB } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPaymentBatchSummary,GetPaymentBatchSummaryAsync,GetPaymentBatchSummaryWithHttpInfo,GetPaymentBatchSummaryAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -389,7 +391,7 @@ public ApiResponse< ReportingV3PaymentBatchSummariesGet200Response > GetPaymentB return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3PaymentBatchSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PaymentBatchSummariesGet200Response))); // Return statement + (ReportingV3PaymentBatchSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PaymentBatchSummariesGet200Response),merchantConfig)); // Return statement } /// @@ -514,7 +516,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3PaymentBatchSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PaymentBatchSummariesGet200Response))); // Return statement + (ReportingV3PaymentBatchSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PaymentBatchSummariesGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentInstrumentApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentInstrumentApi.cs index 8050944b..e86c9e01 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentInstrumentApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentInstrumentApi.cs @@ -456,7 +456,7 @@ public ApiResponse DeletePaymentInstrumentWithHttpInfo (string paymentIn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeletePaymentInstrument,DeletePaymentInstrumentAsync,DeletePaymentInstrumentWithHttpInfo,DeletePaymentInstrumentAsyncWithHttpInfo")) { try @@ -470,12 +470,14 @@ public ApiResponse DeletePaymentInstrumentWithHttpInfo (string paymentIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeletePaymentInstrument,DeletePaymentInstrumentAsync,DeletePaymentInstrumentWithHttpInfo,DeletePaymentInstrumentAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -577,7 +579,7 @@ public async System.Threading.Tasks.Task> DeletePaymentInstr } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeletePaymentInstrument,DeletePaymentInstrumentAsync,DeletePaymentInstrumentWithHttpInfo,DeletePaymentInstrumentAsyncWithHttpInfo")) { try @@ -591,12 +593,14 @@ public async System.Threading.Tasks.Task> DeletePaymentInstr } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeletePaymentInstrument,DeletePaymentInstrumentAsync,DeletePaymentInstrumentWithHttpInfo,DeletePaymentInstrumentAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -706,7 +710,7 @@ public ApiResponse< PostPaymentInstrumentRequest > GetPaymentInstrumentWithHttpI } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPaymentInstrument,GetPaymentInstrumentAsync,GetPaymentInstrumentWithHttpInfo,GetPaymentInstrumentAsyncWithHttpInfo")) { try @@ -720,12 +724,14 @@ public ApiResponse< PostPaymentInstrumentRequest > GetPaymentInstrumentWithHttpI } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPaymentInstrument,GetPaymentInstrumentAsync,GetPaymentInstrumentWithHttpInfo,GetPaymentInstrumentAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -741,7 +747,7 @@ public ApiResponse< PostPaymentInstrumentRequest > GetPaymentInstrumentWithHttpI return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest))); // Return statement + (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest),merchantConfig)); // Return statement } /// @@ -836,7 +842,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest))); // Return statement + (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest), merchantConfig)); // Return statement } /// /// Update a Payment Instrument | | | | | - -- | - -- | - -- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Updating a Payment Instrument**<br>Your system can use this API to update an existing Payment Instrument. @@ -974,7 +982,7 @@ public ApiResponse< PatchPaymentInstrumentRequest > PatchPaymentInstrumentWithHt } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PatchPaymentInstrument,PatchPaymentInstrumentAsync,PatchPaymentInstrumentWithHttpInfo,PatchPaymentInstrumentAsyncWithHttpInfo")) { try @@ -988,13 +996,15 @@ public ApiResponse< PatchPaymentInstrumentRequest > PatchPaymentInstrumentWithHt } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PatchPaymentInstrument,PatchPaymentInstrumentAsync,PatchPaymentInstrumentWithHttpInfo,PatchPaymentInstrumentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1010,7 +1020,7 @@ public ApiResponse< PatchPaymentInstrumentRequest > PatchPaymentInstrumentWithHt return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchPaymentInstrumentRequest))); // Return statement + (PatchPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchPaymentInstrumentRequest),merchantConfig)); // Return statement } /// @@ -1115,7 +1125,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PatchPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchPaymentInstrumentRequest))); // Return statement + (PatchPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PatchPaymentInstrumentRequest), merchantConfig)); // Return statement } /// /// Create a Payment Instrument | | | | | - -- | - -- | - -- | |**Standalone Payment Instruments**<br>A Payment Instrument represents tokenized payment information such as expiration date, billing address & card type.<br>A Payment Instrument token does not store the card number. A Payment Instrument is associated with an [Instrument Identifier](#token-management_instrument-identifier_create-an-instrument-identifier) that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.<br>**Standalone Payment Instruments do not belong to a [Customer](#token-management_customer_create-a-customer).**<br><br>**Creating a Payment Instrument**<br>It is recommended you [create a Payment Instrument via a Payment Authorization](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-with-token-create_authorization-with-customer-token-creation_liveconsole-tab-request-body), this can be for a zero amount.<br>In Europe: You should perform Payer Authentication alongside the Authorization.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Payment Network Tokens**<br>Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.<br>A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.<br>A Payment Network Token can also be [provisioned for an existing Instrument Identifier](#token-management_instrument-identifier_enroll-an-instrument-identifier-for-payment-network-token).<br>For more information about Payment Network Tokens see the Developer Guide.<br><br>**Payments with Payment Instruments**<br>To perform a payment with a particular Payment Instrument specify the [Payment Instrument in the payment request](#payments_payments_process-a-payment_samplerequests-dropdown_authorization-using-tokens_authorization-with-customer-payment-instrument-and-shipping-address-token-id_liveconsole-tab-request-body). @@ -1235,7 +1247,7 @@ public ApiResponse< PostPaymentInstrumentRequest > PostPaymentInstrumentWithHttp } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostPaymentInstrument,PostPaymentInstrumentAsync,PostPaymentInstrumentWithHttpInfo,PostPaymentInstrumentAsyncWithHttpInfo")) { try @@ -1249,13 +1261,15 @@ public ApiResponse< PostPaymentInstrumentRequest > PostPaymentInstrumentWithHttp } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostPaymentInstrument,PostPaymentInstrumentAsync,PostPaymentInstrumentWithHttpInfo,PostPaymentInstrumentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1271,7 +1285,7 @@ public ApiResponse< PostPaymentInstrumentRequest > PostPaymentInstrumentWithHttp return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest))); // Return statement + (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest),merchantConfig)); // Return statement } /// @@ -1357,7 +1371,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest))); // Return statement + (PostPaymentInstrumentRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostPaymentInstrumentRequest), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentLinksApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentLinksApi.cs index f02e16d4..a361ea5e 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentLinksApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentLinksApi.cs @@ -423,7 +423,7 @@ public ApiResponse< PblPaymentLinksPost201Response > CreatePaymentLinkWithHttpIn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreatePaymentLink,CreatePaymentLinkAsync,CreatePaymentLinkWithHttpInfo,CreatePaymentLinkAsyncWithHttpInfo")) { try @@ -437,13 +437,15 @@ public ApiResponse< PblPaymentLinksPost201Response > CreatePaymentLinkWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreatePaymentLink,CreatePaymentLinkAsync,CreatePaymentLinkWithHttpInfo,CreatePaymentLinkAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -459,7 +461,7 @@ public ApiResponse< PblPaymentLinksPost201Response > CreatePaymentLinkWithHttpIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response))); // Return statement + (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response),merchantConfig)); // Return statement } /// @@ -535,7 +537,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response))); // Return statement + (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response), merchantConfig)); // Return statement } /// /// Get a List of Payment Links Provides a (filtered) list of payment links that have been created in your account. You can filter the list based on the following status types: - ACTIVE - INACTIVE @@ -674,7 +678,7 @@ public ApiResponse< PblPaymentLinksAllGet200Response > GetAllPaymentLinksWithHtt } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetAllPaymentLinks,GetAllPaymentLinksAsync,GetAllPaymentLinksWithHttpInfo,GetAllPaymentLinksAsyncWithHttpInfo")) { try @@ -688,12 +692,14 @@ public ApiResponse< PblPaymentLinksAllGet200Response > GetAllPaymentLinksWithHtt } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetAllPaymentLinks,GetAllPaymentLinksAsync,GetAllPaymentLinksWithHttpInfo,GetAllPaymentLinksAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -709,7 +715,7 @@ public ApiResponse< PblPaymentLinksAllGet200Response > GetAllPaymentLinksWithHtt return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksAllGet200Response))); // Return statement + (PblPaymentLinksAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksAllGet200Response),merchantConfig)); // Return statement } /// @@ -814,7 +820,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksAllGet200Response))); // Return statement + (PblPaymentLinksAllGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksAllGet200Response), merchantConfig)); // Return statement } /// /// Get Payment Link Details You can retrieve details of a specific payment link. For each payment transaction you can use the Transaction Details API to get more details on the payment transaction. @@ -932,7 +940,7 @@ public ApiResponse< PblPaymentLinksGet200Response > GetPaymentLinkWithHttpInfo ( } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPaymentLink,GetPaymentLinkAsync,GetPaymentLinkWithHttpInfo,GetPaymentLinkAsyncWithHttpInfo")) { try @@ -946,12 +954,14 @@ public ApiResponse< PblPaymentLinksGet200Response > GetPaymentLinkWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPaymentLink,GetPaymentLinkAsync,GetPaymentLinkWithHttpInfo,GetPaymentLinkAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -967,7 +977,7 @@ public ApiResponse< PblPaymentLinksGet200Response > GetPaymentLinkWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksGet200Response))); // Return statement + (PblPaymentLinksGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksGet200Response),merchantConfig)); // Return statement } /// @@ -1052,7 +1062,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksGet200Response))); // Return statement + (PblPaymentLinksGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksGet200Response), merchantConfig)); // Return statement } /// /// Update a Payment Link You can update all information except the payment link number for a payment link. Changes made to amount/price will apply to new payments made using the payment link. @@ -1174,7 +1186,7 @@ public ApiResponse< PblPaymentLinksPost201Response > UpdatePaymentLinkWithHttpIn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdatePaymentLink,UpdatePaymentLinkAsync,UpdatePaymentLinkWithHttpInfo,UpdatePaymentLinkAsyncWithHttpInfo")) { try @@ -1188,13 +1200,15 @@ public ApiResponse< PblPaymentLinksPost201Response > UpdatePaymentLinkWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdatePaymentLink,UpdatePaymentLinkAsync,UpdatePaymentLinkWithHttpInfo,UpdatePaymentLinkAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1210,7 +1224,7 @@ public ApiResponse< PblPaymentLinksPost201Response > UpdatePaymentLinkWithHttpIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response))); // Return statement + (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response),merchantConfig)); // Return statement } /// @@ -1299,7 +1313,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response))); // Return statement + (PblPaymentLinksPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PblPaymentLinksPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentTokensApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentTokensApi.cs index c16e73de..cf1c36ed 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentTokensApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentTokensApi.cs @@ -282,7 +282,7 @@ public ApiResponse< InlineResponse201 > RetrieveOrDeletePaymentTokenWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "RetrieveOrDeletePaymentToken,RetrieveOrDeletePaymentTokenAsync,RetrieveOrDeletePaymentTokenWithHttpInfo,RetrieveOrDeletePaymentTokenAsyncWithHttpInfo")) { try @@ -296,13 +296,15 @@ public ApiResponse< InlineResponse201 > RetrieveOrDeletePaymentTokenWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "RetrieveOrDeletePaymentToken,RetrieveOrDeletePaymentTokenAsync,RetrieveOrDeletePaymentTokenWithHttpInfo,RetrieveOrDeletePaymentTokenAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -318,7 +320,7 @@ public ApiResponse< InlineResponse201 > RetrieveOrDeletePaymentTokenWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse201) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse201))); // Return statement + (InlineResponse201) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse201),merchantConfig)); // Return statement } /// @@ -391,7 +393,7 @@ public async System.Threading.Tasks.Task> Retriev } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "RetrieveOrDeletePaymentToken,RetrieveOrDeletePaymentTokenAsync,RetrieveOrDeletePaymentTokenWithHttpInfo,RetrieveOrDeletePaymentTokenAsyncWithHttpInfo")) { try @@ -405,13 +407,15 @@ public async System.Threading.Tasks.Task> Retriev } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "RetrieveOrDeletePaymentToken,RetrieveOrDeletePaymentTokenAsync,RetrieveOrDeletePaymentTokenWithHttpInfo,RetrieveOrDeletePaymentTokenAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -427,7 +431,7 @@ public async System.Threading.Tasks.Task> Retriev return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse201) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse201))); // Return statement + (InlineResponse201) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse201), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentsApi.cs index 6e8e396d..189aa863 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PaymentsApi.cs @@ -521,7 +521,7 @@ public ApiResponse< PtsV2PaymentsOrderPost201Response > CreateOrderRequestWithHt } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateOrderRequest,CreateOrderRequestAsync,CreateOrderRequestWithHttpInfo,CreateOrderRequestAsyncWithHttpInfo")) { try @@ -535,13 +535,15 @@ public ApiResponse< PtsV2PaymentsOrderPost201Response > CreateOrderRequestWithHt } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateOrderRequest,CreateOrderRequestAsync,CreateOrderRequestWithHttpInfo,CreateOrderRequestAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -557,7 +559,7 @@ public ApiResponse< PtsV2PaymentsOrderPost201Response > CreateOrderRequestWithHt return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsOrderPost201Response))); // Return statement + (PtsV2PaymentsOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsOrderPost201Response),merchantConfig)); // Return statement } /// @@ -643,7 +645,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsOrderPost201Response))); // Return statement + (PtsV2PaymentsOrderPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsOrderPost201Response), merchantConfig)); // Return statement } /// /// Process a Payment A payment authorizes the amount for the transaction. There are a number of supported payment features, such as E-commerce and Card Present - Credit Card/Debit Card, Echeck, e-Wallets, Level II/III Data, etc.. A payment response includes the status of the request. It also includes processor-specific information when the request is successful and errors if unsuccessful. See the [Payments Developer Guides Page](https://developer.cybersource.com/docs/cybs/en-us/payments/developer/ctv/rest/payments/payments-intro.html). Authorization can be requested with Capture, Decision Manager, Payer Authentication(3ds), and Token Creation. @@ -750,7 +754,7 @@ public ApiResponse< PtsV2PaymentsPost201Response > CreatePaymentWithHttpInfo (Cr } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreatePayment,CreatePaymentAsync,CreatePaymentWithHttpInfo,CreatePaymentAsyncWithHttpInfo")) { try @@ -764,13 +768,15 @@ public ApiResponse< PtsV2PaymentsPost201Response > CreatePaymentWithHttpInfo (Cr } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreatePayment,CreatePaymentAsync,CreatePaymentWithHttpInfo,CreatePaymentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -786,7 +792,7 @@ public ApiResponse< PtsV2PaymentsPost201Response > CreatePaymentWithHttpInfo (Cr return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response))); // Return statement + (PtsV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response),merchantConfig)); // Return statement } /// @@ -859,7 +865,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response))); // Return statement + (PtsV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response), merchantConfig)); // Return statement } /// /// Create Alternative Payments Sessions Request Create Alternative Payments Sessions Request @@ -966,7 +974,7 @@ public ApiResponse< PtsV2PaymentsPost201Response2 > CreateSessionRequestWithHttp } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateSessionRequest,CreateSessionRequestAsync,CreateSessionRequestWithHttpInfo,CreateSessionRequestAsyncWithHttpInfo")) { try @@ -980,13 +988,15 @@ public ApiResponse< PtsV2PaymentsPost201Response2 > CreateSessionRequestWithHttp } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateSessionRequest,CreateSessionRequestAsync,CreateSessionRequestWithHttpInfo,CreateSessionRequestAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1002,7 +1012,7 @@ public ApiResponse< PtsV2PaymentsPost201Response2 > CreateSessionRequestWithHttp return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2))); // Return statement + (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2),merchantConfig)); // Return statement } /// @@ -1075,7 +1085,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2))); // Return statement + (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2), merchantConfig)); // Return statement } /// /// Increment an Authorization Use this service to authorize additional charges in a lodging or autorental transaction. Include the ID returned from the original authorization in the PATCH request to add additional charges to that authorization. @@ -1195,7 +1207,7 @@ public ApiResponse< PtsV2IncrementalAuthorizationPatch201Response > IncrementAut } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "IncrementAuth,IncrementAuthAsync,IncrementAuthWithHttpInfo,IncrementAuthAsyncWithHttpInfo")) { try @@ -1209,13 +1221,15 @@ public ApiResponse< PtsV2IncrementalAuthorizationPatch201Response > IncrementAut } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "IncrementAuth,IncrementAuthAsync,IncrementAuthWithHttpInfo,IncrementAuthAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1231,7 +1245,7 @@ public ApiResponse< PtsV2IncrementalAuthorizationPatch201Response > IncrementAut return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2IncrementalAuthorizationPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2IncrementalAuthorizationPatch201Response))); // Return statement + (PtsV2IncrementalAuthorizationPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2IncrementalAuthorizationPatch201Response),merchantConfig)); // Return statement } /// @@ -1317,7 +1331,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2IncrementalAuthorizationPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2IncrementalAuthorizationPatch201Response))); // Return statement + (PtsV2IncrementalAuthorizationPatch201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2IncrementalAuthorizationPatch201Response), merchantConfig)); // Return statement } /// /// Check a Payment Status Checks and updates the payment status @@ -1437,7 +1453,7 @@ public ApiResponse< PtsV2PaymentsPost201Response1 > RefreshPaymentStatusWithHttp } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "RefreshPaymentStatus,RefreshPaymentStatusAsync,RefreshPaymentStatusWithHttpInfo,RefreshPaymentStatusAsyncWithHttpInfo")) { try @@ -1451,13 +1467,15 @@ public ApiResponse< PtsV2PaymentsPost201Response1 > RefreshPaymentStatusWithHttp } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "RefreshPaymentStatus,RefreshPaymentStatusAsync,RefreshPaymentStatusWithHttpInfo,RefreshPaymentStatusAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1473,7 +1491,7 @@ public ApiResponse< PtsV2PaymentsPost201Response1 > RefreshPaymentStatusWithHttp return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response1))); // Return statement + (PtsV2PaymentsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response1),merchantConfig)); // Return statement } /// @@ -1559,7 +1577,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response1))); // Return statement + (PtsV2PaymentsPost201Response1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response1), merchantConfig)); // Return statement } /// /// Update Alternative Payments Sessions Request Update Alternative Payments Sessions Request @@ -1679,7 +1699,7 @@ public ApiResponse< PtsV2PaymentsPost201Response2 > UpdateSessionReqWithHttpInfo } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdateSessionReq,UpdateSessionReqAsync,UpdateSessionReqWithHttpInfo,UpdateSessionReqAsyncWithHttpInfo")) { try @@ -1693,13 +1713,15 @@ public ApiResponse< PtsV2PaymentsPost201Response2 > UpdateSessionReqWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdateSessionReq,UpdateSessionReqAsync,UpdateSessionReqWithHttpInfo,UpdateSessionReqAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1715,7 +1737,7 @@ public ApiResponse< PtsV2PaymentsPost201Response2 > UpdateSessionReqWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2))); // Return statement + (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2),merchantConfig)); // Return statement } /// @@ -1801,7 +1823,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2))); // Return statement + (PtsV2PaymentsPost201Response2) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsPost201Response2), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayoutsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayoutsApi.cs index df258eb4..e58e2d15 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayoutsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PayoutsApi.cs @@ -282,7 +282,7 @@ public ApiResponse< PtsV2PayoutsPost201Response > OctCreatePaymentWithHttpInfo ( } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "OctCreatePayment,OctCreatePaymentAsync,OctCreatePaymentWithHttpInfo,OctCreatePaymentAsyncWithHttpInfo")) { try @@ -296,13 +296,15 @@ public ApiResponse< PtsV2PayoutsPost201Response > OctCreatePaymentWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "OctCreatePayment,OctCreatePaymentAsync,OctCreatePaymentWithHttpInfo,OctCreatePaymentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -318,7 +320,7 @@ public ApiResponse< PtsV2PayoutsPost201Response > OctCreatePaymentWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PayoutsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PayoutsPost201Response))); // Return statement + (PtsV2PayoutsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PayoutsPost201Response),merchantConfig)); // Return statement } /// @@ -391,7 +393,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PayoutsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PayoutsPost201Response))); // Return statement + (PtsV2PayoutsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PayoutsPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PlansApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PlansApi.cs index 29de5456..d39a1155 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PlansApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PlansApi.cs @@ -604,7 +604,7 @@ public ApiResponse< ActivateDeactivatePlanResponse > ActivatePlanWithHttpInfo (s } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "ActivatePlan,ActivatePlanAsync,ActivatePlanWithHttpInfo,ActivatePlanAsyncWithHttpInfo")) { try @@ -618,12 +618,14 @@ public ApiResponse< ActivateDeactivatePlanResponse > ActivatePlanWithHttpInfo (s } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "ActivatePlan,ActivatePlanAsync,ActivatePlanWithHttpInfo,ActivatePlanAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -639,7 +641,7 @@ public ApiResponse< ActivateDeactivatePlanResponse > ActivatePlanWithHttpInfo (s return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse))); // Return statement + (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse),merchantConfig)); // Return statement } /// @@ -724,7 +726,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse))); // Return statement + (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse), merchantConfig)); // Return statement } /// /// Create a Plan The recurring billing service enables you to manage payment plans and subscriptions for recurring payment schedules. It securely stores your customer's payment information and personal data within secure Visa data centers, reducing storage risks and PCI DSS scope through the use of *Token Management* (*TMS*). The three key elements of *Cybersource* Recurring Billing are: -  **Token**: stores customer billing, shipping, and payment details. -  **Plan**: stores the billing schedule. -  **Subscription**: combines the token and plan, and defines the subscription start date, name, and description. The APIs in this section demonstrate the management of the Plans and Subscriptions. For Tokens please refer to [Token Management](#token-management) The availability of API features for a merchant can depend on the portfolio configuration and may need to be enabled at the portfolio level before they can be added to merchant accounts. @@ -833,7 +837,7 @@ public ApiResponse< CreatePlanResponse > CreatePlanWithHttpInfo (CreatePlanReque } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreatePlan,CreatePlanAsync,CreatePlanWithHttpInfo,CreatePlanAsyncWithHttpInfo")) { try @@ -847,13 +851,15 @@ public ApiResponse< CreatePlanResponse > CreatePlanWithHttpInfo (CreatePlanReque } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreatePlan,CreatePlanAsync,CreatePlanWithHttpInfo,CreatePlanAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -869,7 +875,7 @@ public ApiResponse< CreatePlanResponse > CreatePlanWithHttpInfo (CreatePlanReque return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CreatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatePlanResponse))); // Return statement + (CreatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatePlanResponse),merchantConfig)); // Return statement } /// @@ -945,7 +951,7 @@ public async System.Threading.Tasks.Task> Create } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreatePlan,CreatePlanAsync,CreatePlanWithHttpInfo,CreatePlanAsyncWithHttpInfo")) { try @@ -959,13 +965,15 @@ public async System.Threading.Tasks.Task> Create } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreatePlan,CreatePlanAsync,CreatePlanWithHttpInfo,CreatePlanAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -981,7 +989,7 @@ public async System.Threading.Tasks.Task> Create return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CreatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatePlanResponse))); // Return statement + (CreatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreatePlanResponse), merchantConfig)); // Return statement } /// /// Deactivate a Plan Deactivate a Plan @@ -1064,7 +1072,7 @@ public ApiResponse< ActivateDeactivatePlanResponse > DeactivatePlanWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeactivatePlan,DeactivatePlanAsync,DeactivatePlanWithHttpInfo,DeactivatePlanAsyncWithHttpInfo")) { try @@ -1078,12 +1086,14 @@ public ApiResponse< ActivateDeactivatePlanResponse > DeactivatePlanWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeactivatePlan,DeactivatePlanAsync,DeactivatePlanWithHttpInfo,DeactivatePlanAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1099,7 +1109,7 @@ public ApiResponse< ActivateDeactivatePlanResponse > DeactivatePlanWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse))); // Return statement + (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse),merchantConfig)); // Return statement } /// @@ -1184,7 +1194,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse))); // Return statement + (ActivateDeactivatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateDeactivatePlanResponse), merchantConfig)); // Return statement } /// /// Delete a Plan Delete a Plan is only allowed: - plan status is in `DRAFT` - plan status is in `ACTIVE`, and `INACTIVE` only allowed when no subscriptions attached to a plan in the lifetime of a plan @@ -1302,7 +1314,7 @@ public ApiResponse< DeletePlanResponse > DeletePlanWithHttpInfo (string id) } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeletePlan,DeletePlanAsync,DeletePlanWithHttpInfo,DeletePlanAsyncWithHttpInfo")) { try @@ -1316,12 +1328,14 @@ public ApiResponse< DeletePlanResponse > DeletePlanWithHttpInfo (string id) } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeletePlan,DeletePlanAsync,DeletePlanWithHttpInfo,DeletePlanAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1337,7 +1351,7 @@ public ApiResponse< DeletePlanResponse > DeletePlanWithHttpInfo (string id) return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (DeletePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DeletePlanResponse))); // Return statement + (DeletePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DeletePlanResponse),merchantConfig)); // Return statement } /// @@ -1422,7 +1436,7 @@ public async System.Threading.Tasks.Task> Delete } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeletePlan,DeletePlanAsync,DeletePlanWithHttpInfo,DeletePlanAsyncWithHttpInfo")) { try @@ -1436,12 +1450,14 @@ public async System.Threading.Tasks.Task> Delete } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeletePlan,DeletePlanAsync,DeletePlanWithHttpInfo,DeletePlanAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1457,7 +1473,7 @@ public async System.Threading.Tasks.Task> Delete return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (DeletePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DeletePlanResponse))); // Return statement + (DeletePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(DeletePlanResponse), merchantConfig)); // Return statement } /// /// Get a Plan Retrieve a Plan details by Plan Id. @@ -1540,7 +1556,7 @@ public ApiResponse< GetPlanResponse > GetPlanWithHttpInfo (string id) } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPlan,GetPlanAsync,GetPlanWithHttpInfo,GetPlanAsyncWithHttpInfo")) { try @@ -1554,12 +1570,14 @@ public ApiResponse< GetPlanResponse > GetPlanWithHttpInfo (string id) } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPlan,GetPlanAsync,GetPlanWithHttpInfo,GetPlanAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1575,7 +1593,7 @@ public ApiResponse< GetPlanResponse > GetPlanWithHttpInfo (string id) return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetPlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanResponse))); // Return statement + (GetPlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanResponse),merchantConfig)); // Return statement } /// @@ -1660,7 +1678,7 @@ public async System.Threading.Tasks.Task> GetPlanAs } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPlan,GetPlanAsync,GetPlanWithHttpInfo,GetPlanAsyncWithHttpInfo")) { try @@ -1674,12 +1692,14 @@ public async System.Threading.Tasks.Task> GetPlanAs } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPlan,GetPlanAsync,GetPlanWithHttpInfo,GetPlanAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1695,7 +1715,7 @@ public async System.Threading.Tasks.Task> GetPlanAs return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetPlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanResponse))); // Return statement + (GetPlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanResponse), merchantConfig)); // Return statement } /// /// Get a Plan Code Get a Unique Plan Code @@ -1765,7 +1785,7 @@ public ApiResponse< GetPlanCodeResponse > GetPlanCodeWithHttpInfo () } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPlanCode,GetPlanCodeAsync,GetPlanCodeWithHttpInfo,GetPlanCodeAsyncWithHttpInfo")) { try @@ -1779,12 +1799,14 @@ public ApiResponse< GetPlanCodeResponse > GetPlanCodeWithHttpInfo () } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPlanCode,GetPlanCodeAsync,GetPlanCodeWithHttpInfo,GetPlanCodeAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1800,7 +1822,7 @@ public ApiResponse< GetPlanCodeResponse > GetPlanCodeWithHttpInfo () return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetPlanCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanCodeResponse))); // Return statement + (GetPlanCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanCodeResponse),merchantConfig)); // Return statement } /// @@ -1872,7 +1894,7 @@ public async System.Threading.Tasks.Task> GetPl } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPlanCode,GetPlanCodeAsync,GetPlanCodeWithHttpInfo,GetPlanCodeAsyncWithHttpInfo")) { try @@ -1886,12 +1908,14 @@ public async System.Threading.Tasks.Task> GetPl } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPlanCode,GetPlanCodeAsync,GetPlanCodeWithHttpInfo,GetPlanCodeAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1907,7 +1931,7 @@ public async System.Threading.Tasks.Task> GetPl return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetPlanCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanCodeResponse))); // Return statement + (GetPlanCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetPlanCodeResponse), merchantConfig)); // Return statement } /// /// Get a List of Plans Retrieve Plans by Plan Code & Plan Status. @@ -2012,7 +2036,7 @@ public ApiResponse< GetAllPlansResponse > GetPlansWithHttpInfo (int? offset = nu } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPlans,GetPlansAsync,GetPlansWithHttpInfo,GetPlansAsyncWithHttpInfo")) { try @@ -2026,12 +2050,14 @@ public ApiResponse< GetAllPlansResponse > GetPlansWithHttpInfo (int? offset = nu } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPlans,GetPlansAsync,GetPlansWithHttpInfo,GetPlansAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -2047,7 +2073,7 @@ public ApiResponse< GetAllPlansResponse > GetPlansWithHttpInfo (int? offset = nu return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetAllPlansResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllPlansResponse))); // Return statement + (GetAllPlansResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllPlansResponse),merchantConfig)); // Return statement } /// @@ -2154,7 +2180,7 @@ public async System.Threading.Tasks.Task> GetPl } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPlans,GetPlansAsync,GetPlansWithHttpInfo,GetPlansAsyncWithHttpInfo")) { try @@ -2168,12 +2194,14 @@ public async System.Threading.Tasks.Task> GetPl } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPlans,GetPlansAsync,GetPlansWithHttpInfo,GetPlansAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2189,7 +2217,7 @@ public async System.Threading.Tasks.Task> GetPl return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetAllPlansResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllPlansResponse))); // Return statement + (GetAllPlansResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllPlansResponse), merchantConfig)); // Return statement } /// /// Update a Plan Update a Plan Plan in `DRAFT` status - All updates are allowed on Plan with `DRAFT` status Plan in `ACTIVE` status [Following fields are **Not Updatable**] - `planInformation.billingPeriod` - `planInformation.billingCycles` [Update is only allowed to **increase** billingCycles] - `orderInformation.amountDetails.currency` @@ -2276,7 +2304,7 @@ public ApiResponse< UpdatePlanResponse > UpdatePlanWithHttpInfo (string id, Upda } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdatePlan,UpdatePlanAsync,UpdatePlanWithHttpInfo,UpdatePlanAsyncWithHttpInfo")) { try @@ -2290,13 +2318,15 @@ public ApiResponse< UpdatePlanResponse > UpdatePlanWithHttpInfo (string id, Upda } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdatePlan,UpdatePlanAsync,UpdatePlanWithHttpInfo,UpdatePlanAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -2312,7 +2342,7 @@ public ApiResponse< UpdatePlanResponse > UpdatePlanWithHttpInfo (string id, Upda return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UpdatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdatePlanResponse))); // Return statement + (UpdatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdatePlanResponse),merchantConfig)); // Return statement } /// @@ -2401,7 +2431,7 @@ public async System.Threading.Tasks.Task> Update } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdatePlan,UpdatePlanAsync,UpdatePlanWithHttpInfo,UpdatePlanAsyncWithHttpInfo")) { try @@ -2415,13 +2445,15 @@ public async System.Threading.Tasks.Task> Update } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdatePlan,UpdatePlanAsync,UpdatePlanWithHttpInfo,UpdatePlanAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2437,7 +2469,7 @@ public async System.Threading.Tasks.Task> Update return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UpdatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdatePlanResponse))); // Return statement + (UpdatePlanResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdatePlanResponse), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PurchaseAndRefundDetailsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PurchaseAndRefundDetailsApi.cs index dc38eeec..24d72d10 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PurchaseAndRefundDetailsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PurchaseAndRefundDetailsApi.cs @@ -376,7 +376,7 @@ public ApiResponse< ReportingV3PurchaseRefundDetailsGet200Response > GetPurchase } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPurchaseAndRefundDetails,GetPurchaseAndRefundDetailsAsync,GetPurchaseAndRefundDetailsWithHttpInfo,GetPurchaseAndRefundDetailsAsyncWithHttpInfo")) { try @@ -390,12 +390,14 @@ public ApiResponse< ReportingV3PurchaseRefundDetailsGet200Response > GetPurchase } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPurchaseAndRefundDetails,GetPurchaseAndRefundDetailsAsync,GetPurchaseAndRefundDetailsWithHttpInfo,GetPurchaseAndRefundDetailsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -411,7 +413,7 @@ public ApiResponse< ReportingV3PurchaseRefundDetailsGet200Response > GetPurchase return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3PurchaseRefundDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PurchaseRefundDetailsGet200Response))); // Return statement + (ReportingV3PurchaseRefundDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PurchaseRefundDetailsGet200Response),merchantConfig)); // Return statement } /// @@ -550,7 +552,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3PurchaseRefundDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PurchaseRefundDetailsGet200Response))); // Return statement + (ReportingV3PurchaseRefundDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3PurchaseRefundDetailsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PushFundsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PushFundsApi.cs index 439820de..b5ec4c97 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PushFundsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/PushFundsApi.cs @@ -378,7 +378,7 @@ public ApiResponse< PushFunds201Response > CreatePushFundsTransferWithHttpInfo ( } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreatePushFundsTransfer,CreatePushFundsTransferAsync,CreatePushFundsTransferWithHttpInfo,CreatePushFundsTransferAsyncWithHttpInfo")) { try @@ -392,13 +392,15 @@ public ApiResponse< PushFunds201Response > CreatePushFundsTransferWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreatePushFundsTransfer,CreatePushFundsTransferAsync,CreatePushFundsTransferWithHttpInfo,CreatePushFundsTransferAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -414,7 +416,7 @@ public ApiResponse< PushFunds201Response > CreatePushFundsTransferWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PushFunds201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PushFunds201Response))); // Return statement + (PushFunds201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PushFunds201Response),merchantConfig)); // Return statement } /// @@ -559,7 +561,7 @@ public async System.Threading.Tasks.Task> Crea } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreatePushFundsTransfer,CreatePushFundsTransferAsync,CreatePushFundsTransferWithHttpInfo,CreatePushFundsTransferAsyncWithHttpInfo")) { try @@ -573,13 +575,15 @@ public async System.Threading.Tasks.Task> Crea } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreatePushFundsTransfer,CreatePushFundsTransferAsync,CreatePushFundsTransferWithHttpInfo,CreatePushFundsTransferAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -595,7 +599,7 @@ public async System.Threading.Tasks.Task> Crea return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PushFunds201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PushFunds201Response))); // Return statement + (PushFunds201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PushFunds201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RefundApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RefundApi.cs index f8753b4b..6fc4c570 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RefundApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RefundApi.cs @@ -345,7 +345,7 @@ public ApiResponse< PtsV2PaymentsRefundPost201Response > RefundCaptureWithHttpIn } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "RefundCapture,RefundCaptureAsync,RefundCaptureWithHttpInfo,RefundCaptureAsyncWithHttpInfo")) { try @@ -359,13 +359,15 @@ public ApiResponse< PtsV2PaymentsRefundPost201Response > RefundCaptureWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "RefundCapture,RefundCaptureAsync,RefundCaptureWithHttpInfo,RefundCaptureAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -381,7 +383,7 @@ public ApiResponse< PtsV2PaymentsRefundPost201Response > RefundCaptureWithHttpIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response))); // Return statement + (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response),merchantConfig)); // Return statement } /// @@ -467,7 +469,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response))); // Return statement + (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response), merchantConfig)); // Return statement } /// /// Refund a Payment Refund a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to refund the payment amount. @@ -587,7 +591,7 @@ public ApiResponse< PtsV2PaymentsRefundPost201Response > RefundPaymentWithHttpIn } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "RefundPayment,RefundPaymentAsync,RefundPaymentWithHttpInfo,RefundPaymentAsyncWithHttpInfo")) { try @@ -601,13 +605,15 @@ public ApiResponse< PtsV2PaymentsRefundPost201Response > RefundPaymentWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "RefundPayment,RefundPaymentAsync,RefundPaymentWithHttpInfo,RefundPaymentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -623,7 +629,7 @@ public ApiResponse< PtsV2PaymentsRefundPost201Response > RefundPaymentWithHttpIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response))); // Return statement + (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response),merchantConfig)); // Return statement } /// @@ -709,7 +715,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response))); // Return statement + (PtsV2PaymentsRefundPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsRefundPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDefinitionsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDefinitionsApi.cs index fb4584ce..946679d2 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDefinitionsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDefinitionsApi.cs @@ -370,7 +370,7 @@ public ApiResponse< ReportingV3ReportDefinitionsNameGet200Response > GetResource } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetResourceInfoByReportDefinition,GetResourceInfoByReportDefinitionAsync,GetResourceInfoByReportDefinitionWithHttpInfo,GetResourceInfoByReportDefinitionAsyncWithHttpInfo")) { try @@ -384,12 +384,14 @@ public ApiResponse< ReportingV3ReportDefinitionsNameGet200Response > GetResource } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetResourceInfoByReportDefinition,GetResourceInfoByReportDefinitionAsync,GetResourceInfoByReportDefinitionWithHttpInfo,GetResourceInfoByReportDefinitionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -405,7 +407,7 @@ public ApiResponse< ReportingV3ReportDefinitionsNameGet200Response > GetResource return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportDefinitionsNameGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsNameGet200Response))); // Return statement + (ReportingV3ReportDefinitionsNameGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsNameGet200Response),merchantConfig)); // Return statement } /// @@ -508,7 +510,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportDefinitionsNameGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsNameGet200Response))); // Return statement + (ReportingV3ReportDefinitionsNameGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsNameGet200Response), merchantConfig)); // Return statement } /// /// Get Reporting Resource Information View a list of supported reports and their attributes before subscribing to them. @@ -624,7 +628,7 @@ public ApiResponse< ReportingV3ReportDefinitionsGet200Response > GetResourceV2In } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetResourceV2Info,GetResourceV2InfoAsync,GetResourceV2InfoWithHttpInfo,GetResourceV2InfoAsyncWithHttpInfo")) { try @@ -638,12 +642,14 @@ public ApiResponse< ReportingV3ReportDefinitionsGet200Response > GetResourceV2In } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetResourceV2Info,GetResourceV2InfoAsync,GetResourceV2InfoWithHttpInfo,GetResourceV2InfoAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -659,7 +665,7 @@ public ApiResponse< ReportingV3ReportDefinitionsGet200Response > GetResourceV2In return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportDefinitionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsGet200Response))); // Return statement + (ReportingV3ReportDefinitionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsGet200Response),merchantConfig)); // Return statement } /// @@ -742,7 +748,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportDefinitionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsGet200Response))); // Return statement + (ReportingV3ReportDefinitionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportDefinitionsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDownloadsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDownloadsApi.cs index 1ca79013..2be3152b 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDownloadsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportDownloadsApi.cs @@ -317,7 +317,7 @@ public ApiResponse DownloadReportWithHttpInfo (DateTime? reportDate, str } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DownloadReport,DownloadReportAsync,DownloadReportWithHttpInfo,DownloadReportAsyncWithHttpInfo")) { try @@ -331,12 +331,14 @@ public ApiResponse DownloadReportWithHttpInfo (DateTime? reportDate, str } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DownloadReport,DownloadReportAsync,DownloadReportWithHttpInfo,DownloadReportAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -453,7 +455,7 @@ public async System.Threading.Tasks.Task> DownloadReportAsyn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DownloadReport,DownloadReportAsync,DownloadReportWithHttpInfo,DownloadReportAsyncWithHttpInfo")) { try @@ -467,12 +469,14 @@ public async System.Threading.Tasks.Task> DownloadReportAsyn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DownloadReport,DownloadReportAsync,DownloadReportWithHttpInfo,DownloadReportAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportSubscriptionsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportSubscriptionsApi.cs index e4fd3dda..5c6ae7dd 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportSubscriptionsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportSubscriptionsApi.cs @@ -470,7 +470,7 @@ public ApiResponse CreateStandardOrClassicSubscriptionWithHttpInfo (Pred } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateStandardOrClassicSubscription,CreateStandardOrClassicSubscriptionAsync,CreateStandardOrClassicSubscriptionWithHttpInfo,CreateStandardOrClassicSubscriptionAsyncWithHttpInfo")) { try @@ -484,13 +484,15 @@ public ApiResponse CreateStandardOrClassicSubscriptionWithHttpInfo (Pred } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateStandardOrClassicSubscription,CreateStandardOrClassicSubscriptionAsync,CreateStandardOrClassicSubscriptionWithHttpInfo,CreateStandardOrClassicSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -584,7 +586,7 @@ public async System.Threading.Tasks.Task> CreateStandardOrCl } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateStandardOrClassicSubscription,CreateStandardOrClassicSubscriptionAsync,CreateStandardOrClassicSubscriptionWithHttpInfo,CreateStandardOrClassicSubscriptionAsyncWithHttpInfo")) { try @@ -598,13 +600,15 @@ public async System.Threading.Tasks.Task> CreateStandardOrCl } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateStandardOrClassicSubscription,CreateStandardOrClassicSubscriptionAsync,CreateStandardOrClassicSubscriptionWithHttpInfo,CreateStandardOrClassicSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -696,7 +700,7 @@ public ApiResponse CreateSubscriptionWithHttpInfo (CreateReportSubscript } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo")) { try @@ -710,13 +714,15 @@ public ApiResponse CreateSubscriptionWithHttpInfo (CreateReportSubscript } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -810,7 +816,7 @@ public async System.Threading.Tasks.Task> CreateSubscription } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo")) { try @@ -824,13 +830,15 @@ public async System.Threading.Tasks.Task> CreateSubscription } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -931,7 +939,7 @@ public ApiResponse DeleteSubscriptionWithHttpInfo (string reportName, st } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteSubscription,DeleteSubscriptionAsync,DeleteSubscriptionWithHttpInfo,DeleteSubscriptionAsyncWithHttpInfo")) { try @@ -945,12 +953,14 @@ public ApiResponse DeleteSubscriptionWithHttpInfo (string reportName, st } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteSubscription,DeleteSubscriptionAsync,DeleteSubscriptionWithHttpInfo,DeleteSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1053,7 +1063,7 @@ public async System.Threading.Tasks.Task> DeleteSubscription } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteSubscription,DeleteSubscriptionAsync,DeleteSubscriptionWithHttpInfo,DeleteSubscriptionAsyncWithHttpInfo")) { try @@ -1067,12 +1077,14 @@ public async System.Threading.Tasks.Task> DeleteSubscription } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteSubscription,DeleteSubscriptionAsync,DeleteSubscriptionWithHttpInfo,DeleteSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1163,7 +1175,7 @@ public ApiResponse< ReportingV3ReportSubscriptionsGet200Response > GetAllSubscri } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetAllSubscriptions,GetAllSubscriptionsAsync,GetAllSubscriptionsWithHttpInfo,GetAllSubscriptionsAsyncWithHttpInfo")) { try @@ -1177,12 +1189,14 @@ public ApiResponse< ReportingV3ReportSubscriptionsGet200Response > GetAllSubscri } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetAllSubscriptions,GetAllSubscriptionsAsync,GetAllSubscriptionsWithHttpInfo,GetAllSubscriptionsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1198,7 +1212,7 @@ public ApiResponse< ReportingV3ReportSubscriptionsGet200Response > GetAllSubscri return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportSubscriptionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200Response))); // Return statement + (ReportingV3ReportSubscriptionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200Response),merchantConfig)); // Return statement } /// @@ -1274,7 +1288,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportSubscriptionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200Response))); // Return statement + (ReportingV3ReportSubscriptionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200Response), merchantConfig)); // Return statement } /// /// Get Subscription for Report Name View the details of a report subscription, such as the report format or report frequency, using the report's unique name. @@ -1396,7 +1412,7 @@ public ApiResponse< ReportingV3ReportSubscriptionsGet200ResponseSubscriptions > } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetSubscription,GetSubscriptionAsync,GetSubscriptionWithHttpInfo,GetSubscriptionAsyncWithHttpInfo")) { try @@ -1410,12 +1426,14 @@ public ApiResponse< ReportingV3ReportSubscriptionsGet200ResponseSubscriptions > } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetSubscription,GetSubscriptionAsync,GetSubscriptionWithHttpInfo,GetSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1431,7 +1449,7 @@ public ApiResponse< ReportingV3ReportSubscriptionsGet200ResponseSubscriptions > return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportSubscriptionsGet200ResponseSubscriptions) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200ResponseSubscriptions))); // Return statement + (ReportingV3ReportSubscriptionsGet200ResponseSubscriptions) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200ResponseSubscriptions),merchantConfig)); // Return statement } /// @@ -1520,7 +1538,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportSubscriptionsGet200ResponseSubscriptions) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200ResponseSubscriptions))); // Return statement + (ReportingV3ReportSubscriptionsGet200ResponseSubscriptions) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportSubscriptionsGet200ResponseSubscriptions), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportsApi.cs index 22af447c..c67c0b88 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReportsApi.cs @@ -410,7 +410,7 @@ public ApiResponse CreateReportWithHttpInfo (CreateAdhocReportRequest cr } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateReport,CreateReportAsync,CreateReportWithHttpInfo,CreateReportAsyncWithHttpInfo")) { try @@ -424,13 +424,15 @@ public ApiResponse CreateReportWithHttpInfo (CreateAdhocReportRequest cr } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateReport,CreateReportAsync,CreateReportWithHttpInfo,CreateReportAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -524,7 +526,7 @@ public async System.Threading.Tasks.Task> CreateReportAsyncW } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateReport,CreateReportAsync,CreateReportWithHttpInfo,CreateReportAsyncWithHttpInfo")) { try @@ -538,13 +540,15 @@ public async System.Threading.Tasks.Task> CreateReportAsyncW } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateReport,CreateReportAsync,CreateReportWithHttpInfo,CreateReportAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -649,7 +653,7 @@ public ApiResponse< ReportingV3ReportsIdGet200Response > GetReportByReportIdWith } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetReportByReportId,GetReportByReportIdAsync,GetReportByReportIdWithHttpInfo,GetReportByReportIdAsyncWithHttpInfo")) { try @@ -663,12 +667,14 @@ public ApiResponse< ReportingV3ReportsIdGet200Response > GetReportByReportIdWith } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetReportByReportId,GetReportByReportIdAsync,GetReportByReportIdWithHttpInfo,GetReportByReportIdAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -684,7 +690,7 @@ public ApiResponse< ReportingV3ReportsIdGet200Response > GetReportByReportIdWith return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportsIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsIdGet200Response))); // Return statement + (ReportingV3ReportsIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsIdGet200Response),merchantConfig)); // Return statement } /// @@ -774,7 +780,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportsIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsIdGet200Response))); // Return statement + (ReportingV3ReportsIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsIdGet200Response), merchantConfig)); // Return statement } /// /// Retrieve Available Reports Retrieve a list of the available reports to which you are subscribed. This will also give you the reportId value, which you can also use to download a report. @@ -957,7 +965,7 @@ public ApiResponse< ReportingV3ReportsGet200Response > SearchReportsWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SearchReports,SearchReportsAsync,SearchReportsWithHttpInfo,SearchReportsAsyncWithHttpInfo")) { try @@ -971,12 +979,14 @@ public ApiResponse< ReportingV3ReportsGet200Response > SearchReportsWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SearchReports,SearchReportsAsync,SearchReportsWithHttpInfo,SearchReportsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -992,7 +1002,7 @@ public ApiResponse< ReportingV3ReportsGet200Response > SearchReportsWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsGet200Response))); // Return statement + (ReportingV3ReportsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsGet200Response),merchantConfig)); // Return statement } /// @@ -1142,7 +1152,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3ReportsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsGet200Response))); // Return statement + (ReportingV3ReportsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3ReportsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalDetailsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalDetailsApi.cs index 4f2726d6..ca13a65b 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalDetailsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalDetailsApi.cs @@ -320,7 +320,7 @@ public ApiResponse< ReportingV3RetrievalDetailsGet200Response > GetRetrievalDeta } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetRetrievalDetails,GetRetrievalDetailsAsync,GetRetrievalDetailsWithHttpInfo,GetRetrievalDetailsAsyncWithHttpInfo")) { try @@ -334,12 +334,14 @@ public ApiResponse< ReportingV3RetrievalDetailsGet200Response > GetRetrievalDeta } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetRetrievalDetails,GetRetrievalDetailsAsync,GetRetrievalDetailsWithHttpInfo,GetRetrievalDetailsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -355,7 +357,7 @@ public ApiResponse< ReportingV3RetrievalDetailsGet200Response > GetRetrievalDeta return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3RetrievalDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalDetailsGet200Response))); // Return statement + (ReportingV3RetrievalDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalDetailsGet200Response),merchantConfig)); // Return statement } /// @@ -458,7 +460,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3RetrievalDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalDetailsGet200Response))); // Return statement + (ReportingV3RetrievalDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalDetailsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalSummariesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalSummariesApi.cs index 26d1c6ca..972f01a8 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalSummariesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/RetrievalSummariesApi.cs @@ -320,7 +320,7 @@ public ApiResponse< ReportingV3RetrievalSummariesGet200Response > GetRetrievalSu } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetRetrievalSummary,GetRetrievalSummaryAsync,GetRetrievalSummaryWithHttpInfo,GetRetrievalSummaryAsyncWithHttpInfo")) { try @@ -334,12 +334,14 @@ public ApiResponse< ReportingV3RetrievalSummariesGet200Response > GetRetrievalSu } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetRetrievalSummary,GetRetrievalSummaryAsync,GetRetrievalSummaryWithHttpInfo,GetRetrievalSummaryAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -355,7 +357,7 @@ public ApiResponse< ReportingV3RetrievalSummariesGet200Response > GetRetrievalSu return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3RetrievalSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalSummariesGet200Response))); // Return statement + (ReportingV3RetrievalSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalSummariesGet200Response),merchantConfig)); // Return statement } /// @@ -458,7 +460,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ReportingV3RetrievalSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalSummariesGet200Response))); // Return statement + (ReportingV3RetrievalSummariesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ReportingV3RetrievalSummariesGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReversalApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReversalApi.cs index a48ec013..410082c9 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReversalApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/ReversalApi.cs @@ -341,7 +341,7 @@ public ApiResponse< PtsV2PaymentsReversalsPost201Response > AuthReversalWithHttp } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "AuthReversal,AuthReversalAsync,AuthReversalWithHttpInfo,AuthReversalAsyncWithHttpInfo")) { try @@ -355,13 +355,15 @@ public ApiResponse< PtsV2PaymentsReversalsPost201Response > AuthReversalWithHttp } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "AuthReversal,AuthReversalAsync,AuthReversalWithHttpInfo,AuthReversalAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -377,7 +379,7 @@ public ApiResponse< PtsV2PaymentsReversalsPost201Response > AuthReversalWithHttp return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response))); // Return statement + (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response),merchantConfig)); // Return statement } /// @@ -463,7 +465,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response))); // Return statement + (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response), merchantConfig)); // Return statement } /// /// Timeout Reversal This is to reverse a previous payment that merchant does not receive a reply(Mostly due to Timeout). To use this feature/API, make sure to pass unique value to field - clientReferenceInformation -> transactionId in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call and use same transactionId in this API request payload to reverse the payment. @@ -570,7 +574,7 @@ public ApiResponse< PtsV2PaymentsReversalsPost201Response > MitReversalWithHttpI } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "MitReversal,MitReversalAsync,MitReversalWithHttpInfo,MitReversalAsyncWithHttpInfo")) { try @@ -584,13 +588,15 @@ public ApiResponse< PtsV2PaymentsReversalsPost201Response > MitReversalWithHttpI } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "MitReversal,MitReversalAsync,MitReversalWithHttpInfo,MitReversalAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -606,7 +612,7 @@ public ApiResponse< PtsV2PaymentsReversalsPost201Response > MitReversalWithHttpI return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response))); // Return statement + (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response),merchantConfig)); // Return statement } /// @@ -679,7 +685,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response))); // Return statement + (PtsV2PaymentsReversalsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsReversalsPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SearchTransactionsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SearchTransactionsApi.cs index 876b11cf..88ee2297 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SearchTransactionsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SearchTransactionsApi.cs @@ -324,7 +324,7 @@ public ApiResponse< TssV2TransactionsPost201Response > CreateSearchWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateSearch,CreateSearchAsync,CreateSearchWithHttpInfo,CreateSearchAsyncWithHttpInfo")) { try @@ -338,13 +338,15 @@ public ApiResponse< TssV2TransactionsPost201Response > CreateSearchWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateSearch,CreateSearchAsync,CreateSearchWithHttpInfo,CreateSearchAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -360,7 +362,7 @@ public ApiResponse< TssV2TransactionsPost201Response > CreateSearchWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response))); // Return statement + (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response),merchantConfig)); // Return statement } /// @@ -433,7 +435,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response))); // Return statement + (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response), merchantConfig)); // Return statement } /// /// Get Search Results Include the Search ID in the GET request to retrieve the search results. @@ -549,7 +553,7 @@ public ApiResponse< TssV2TransactionsPost201Response > GetSearchWithHttpInfo (st } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetSearch,GetSearchAsync,GetSearchWithHttpInfo,GetSearchAsyncWithHttpInfo")) { try @@ -563,12 +567,14 @@ public ApiResponse< TssV2TransactionsPost201Response > GetSearchWithHttpInfo (st } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetSearch,GetSearchAsync,GetSearchWithHttpInfo,GetSearchAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -584,7 +590,7 @@ public ApiResponse< TssV2TransactionsPost201Response > GetSearchWithHttpInfo (st return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response))); // Return statement + (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response),merchantConfig)); // Return statement } /// @@ -666,7 +672,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response))); // Return statement + (TssV2TransactionsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SecureFileShareApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SecureFileShareApi.cs index 91f1c2e3..cf2d24c6 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SecureFileShareApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SecureFileShareApi.cs @@ -355,7 +355,7 @@ public ApiResponse GetFileWithHttpInfo (string fileId, string organizati } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetFile,GetFileAsync,GetFileWithHttpInfo,GetFileAsyncWithHttpInfo")) { try @@ -369,12 +369,14 @@ public ApiResponse GetFileWithHttpInfo (string fileId, string organizati } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetFile,GetFileAsync,GetFileWithHttpInfo,GetFileAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -479,7 +481,7 @@ public async System.Threading.Tasks.Task> GetFileAsyncWithHt } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetFile,GetFileAsync,GetFileWithHttpInfo,GetFileAsyncWithHttpInfo")) { try @@ -493,12 +495,14 @@ public async System.Threading.Tasks.Task> GetFileAsyncWithHt } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetFile,GetFileAsync,GetFileWithHttpInfo,GetFileAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -622,7 +626,7 @@ public ApiResponse< V1FileDetailsGet200Response > GetFileDetailWithHttpInfo (Dat } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetFileDetail,GetFileDetailAsync,GetFileDetailWithHttpInfo,GetFileDetailAsyncWithHttpInfo")) { try @@ -636,12 +640,14 @@ public ApiResponse< V1FileDetailsGet200Response > GetFileDetailWithHttpInfo (Dat } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetFileDetail,GetFileDetailAsync,GetFileDetailWithHttpInfo,GetFileDetailAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -657,7 +663,7 @@ public ApiResponse< V1FileDetailsGet200Response > GetFileDetailWithHttpInfo (Dat return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (V1FileDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(V1FileDetailsGet200Response))); // Return statement + (V1FileDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(V1FileDetailsGet200Response),merchantConfig)); // Return statement } /// @@ -766,7 +772,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (V1FileDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(V1FileDetailsGet200Response))); // Return statement + (V1FileDetailsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(V1FileDetailsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsApi.cs index da8c65c9..4de1997c 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsApi.cs @@ -611,7 +611,7 @@ public ApiResponse< ActivateSubscriptionResponse > ActivateSubscriptionWithHttpI } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "ActivateSubscription,ActivateSubscriptionAsync,ActivateSubscriptionWithHttpInfo,ActivateSubscriptionAsyncWithHttpInfo")) { try @@ -625,12 +625,14 @@ public ApiResponse< ActivateSubscriptionResponse > ActivateSubscriptionWithHttpI } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "ActivateSubscription,ActivateSubscriptionAsync,ActivateSubscriptionWithHttpInfo,ActivateSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -646,7 +648,7 @@ public ApiResponse< ActivateSubscriptionResponse > ActivateSubscriptionWithHttpI return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ActivateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateSubscriptionResponse))); // Return statement + (ActivateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateSubscriptionResponse),merchantConfig)); // Return statement } /// @@ -738,7 +740,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (ActivateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateSubscriptionResponse))); // Return statement + (ActivateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ActivateSubscriptionResponse), merchantConfig)); // Return statement } /// /// Cancel a Subscription Cancel a Subscription @@ -856,7 +860,7 @@ public ApiResponse< CancelSubscriptionResponse > CancelSubscriptionWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CancelSubscription,CancelSubscriptionAsync,CancelSubscriptionWithHttpInfo,CancelSubscriptionAsyncWithHttpInfo")) { try @@ -870,12 +874,14 @@ public ApiResponse< CancelSubscriptionResponse > CancelSubscriptionWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CancelSubscription,CancelSubscriptionAsync,CancelSubscriptionWithHttpInfo,CancelSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -891,7 +897,7 @@ public ApiResponse< CancelSubscriptionResponse > CancelSubscriptionWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CancelSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CancelSubscriptionResponse))); // Return statement + (CancelSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CancelSubscriptionResponse),merchantConfig)); // Return statement } /// @@ -976,7 +982,7 @@ public async System.Threading.Tasks.Task } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CancelSubscription,CancelSubscriptionAsync,CancelSubscriptionWithHttpInfo,CancelSubscriptionAsyncWithHttpInfo")) { try @@ -990,12 +996,14 @@ public async System.Threading.Tasks.Task } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CancelSubscription,CancelSubscriptionAsync,CancelSubscriptionWithHttpInfo,CancelSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1011,7 +1019,7 @@ public async System.Threading.Tasks.Task return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CancelSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CancelSubscriptionResponse))); // Return statement + (CancelSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CancelSubscriptionResponse), merchantConfig)); // Return statement } /// /// Create a Subscription Create a Recurring Billing Subscription @@ -1085,7 +1093,7 @@ public ApiResponse< CreateSubscriptionResponse > CreateSubscriptionWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo")) { try @@ -1099,13 +1107,15 @@ public ApiResponse< CreateSubscriptionResponse > CreateSubscriptionWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1121,7 +1131,7 @@ public ApiResponse< CreateSubscriptionResponse > CreateSubscriptionWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse))); // Return statement + (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse),merchantConfig)); // Return statement } /// @@ -1197,7 +1207,7 @@ public async System.Threading.Tasks.Task } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo")) { try @@ -1211,13 +1221,15 @@ public async System.Threading.Tasks.Task } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateSubscription,CreateSubscriptionAsync,CreateSubscriptionWithHttpInfo,CreateSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1233,7 +1245,7 @@ public async System.Threading.Tasks.Task return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse))); // Return statement + (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse), merchantConfig)); // Return statement } /// /// Get a List of Subscriptions Retrieve Subscriptions by Subscription Code & Subscription Status. @@ -1331,7 +1343,7 @@ public ApiResponse< GetAllSubscriptionsResponse > GetAllSubscriptionsWithHttpInf } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetAllSubscriptions,GetAllSubscriptionsAsync,GetAllSubscriptionsWithHttpInfo,GetAllSubscriptionsAsyncWithHttpInfo")) { try @@ -1345,12 +1357,14 @@ public ApiResponse< GetAllSubscriptionsResponse > GetAllSubscriptionsWithHttpInf } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetAllSubscriptions,GetAllSubscriptionsAsync,GetAllSubscriptionsWithHttpInfo,GetAllSubscriptionsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1366,7 +1380,7 @@ public ApiResponse< GetAllSubscriptionsResponse > GetAllSubscriptionsWithHttpInf return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetAllSubscriptionsResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllSubscriptionsResponse))); // Return statement + (GetAllSubscriptionsResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllSubscriptionsResponse),merchantConfig)); // Return statement } /// @@ -1466,7 +1480,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetAllSubscriptionsResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllSubscriptionsResponse))); // Return statement + (GetAllSubscriptionsResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetAllSubscriptionsResponse), merchantConfig)); // Return statement } /// /// Get a Subscription Get a Subscription by Subscription Id @@ -1584,7 +1600,7 @@ public ApiResponse< GetSubscriptionResponse > GetSubscriptionWithHttpInfo (strin } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetSubscription,GetSubscriptionAsync,GetSubscriptionWithHttpInfo,GetSubscriptionAsyncWithHttpInfo")) { try @@ -1598,12 +1614,14 @@ public ApiResponse< GetSubscriptionResponse > GetSubscriptionWithHttpInfo (strin } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetSubscription,GetSubscriptionAsync,GetSubscriptionWithHttpInfo,GetSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1619,7 +1637,7 @@ public ApiResponse< GetSubscriptionResponse > GetSubscriptionWithHttpInfo (strin return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse))); // Return statement + (GetSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse),merchantConfig)); // Return statement } /// @@ -1704,7 +1722,7 @@ public async System.Threading.Tasks.Task> G } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetSubscription,GetSubscriptionAsync,GetSubscriptionWithHttpInfo,GetSubscriptionAsyncWithHttpInfo")) { try @@ -1718,12 +1736,14 @@ public async System.Threading.Tasks.Task> G } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetSubscription,GetSubscriptionAsync,GetSubscriptionWithHttpInfo,GetSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1739,7 +1759,7 @@ public async System.Threading.Tasks.Task> G return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse))); // Return statement + (GetSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse), merchantConfig)); // Return statement } /// /// Get a Subscription Code Get a Unique Subscription Code @@ -1809,7 +1829,7 @@ public ApiResponse< GetSubscriptionCodeResponse > GetSubscriptionCodeWithHttpInf } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetSubscriptionCode,GetSubscriptionCodeAsync,GetSubscriptionCodeWithHttpInfo,GetSubscriptionCodeAsyncWithHttpInfo")) { try @@ -1823,12 +1843,14 @@ public ApiResponse< GetSubscriptionCodeResponse > GetSubscriptionCodeWithHttpInf } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetSubscriptionCode,GetSubscriptionCodeAsync,GetSubscriptionCodeWithHttpInfo,GetSubscriptionCodeAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1844,7 +1866,7 @@ public ApiResponse< GetSubscriptionCodeResponse > GetSubscriptionCodeWithHttpInf return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetSubscriptionCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionCodeResponse))); // Return statement + (GetSubscriptionCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionCodeResponse),merchantConfig)); // Return statement } /// @@ -1916,7 +1938,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetSubscriptionCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionCodeResponse))); // Return statement + (GetSubscriptionCodeResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionCodeResponse), merchantConfig)); // Return statement } /// /// Suspend a Subscription Suspend a Subscription @@ -2034,7 +2058,7 @@ public ApiResponse< SuspendSubscriptionResponse > SuspendSubscriptionWithHttpInf } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SuspendSubscription,SuspendSubscriptionAsync,SuspendSubscriptionWithHttpInfo,SuspendSubscriptionAsyncWithHttpInfo")) { try @@ -2048,12 +2072,14 @@ public ApiResponse< SuspendSubscriptionResponse > SuspendSubscriptionWithHttpInf } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SuspendSubscription,SuspendSubscriptionAsync,SuspendSubscriptionWithHttpInfo,SuspendSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -2069,7 +2095,7 @@ public ApiResponse< SuspendSubscriptionResponse > SuspendSubscriptionWithHttpInf return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (SuspendSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SuspendSubscriptionResponse))); // Return statement + (SuspendSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SuspendSubscriptionResponse),merchantConfig)); // Return statement } /// @@ -2154,7 +2180,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (SuspendSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SuspendSubscriptionResponse))); // Return statement + (SuspendSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(SuspendSubscriptionResponse), merchantConfig)); // Return statement } /// /// Update a Subscription Update a Subscription by Subscription Id @@ -2276,7 +2304,7 @@ public ApiResponse< UpdateSubscriptionResponse > UpdateSubscriptionWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdateSubscription,UpdateSubscriptionAsync,UpdateSubscriptionWithHttpInfo,UpdateSubscriptionAsyncWithHttpInfo")) { try @@ -2290,13 +2318,15 @@ public ApiResponse< UpdateSubscriptionResponse > UpdateSubscriptionWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdateSubscription,UpdateSubscriptionAsync,UpdateSubscriptionWithHttpInfo,UpdateSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -2312,7 +2342,7 @@ public ApiResponse< UpdateSubscriptionResponse > UpdateSubscriptionWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UpdateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdateSubscriptionResponse))); // Return statement + (UpdateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdateSubscriptionResponse),merchantConfig)); // Return statement } /// @@ -2401,7 +2431,7 @@ public async System.Threading.Tasks.Task } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UpdateSubscription,UpdateSubscriptionAsync,UpdateSubscriptionWithHttpInfo,UpdateSubscriptionAsyncWithHttpInfo")) { try @@ -2415,13 +2445,15 @@ public async System.Threading.Tasks.Task } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UpdateSubscription,UpdateSubscriptionAsync,UpdateSubscriptionWithHttpInfo,UpdateSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -2437,7 +2469,7 @@ public async System.Threading.Tasks.Task return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UpdateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdateSubscriptionResponse))); // Return statement + (UpdateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UpdateSubscriptionResponse), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsFollowOnsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsFollowOnsApi.cs index 89c52a97..95d2266a 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsFollowOnsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/SubscriptionsFollowOnsApi.cs @@ -344,7 +344,7 @@ public ApiResponse< CreateSubscriptionResponse > CreateFollowOnSubscriptionWithH } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateFollowOnSubscription,CreateFollowOnSubscriptionAsync,CreateFollowOnSubscriptionWithHttpInfo,CreateFollowOnSubscriptionAsyncWithHttpInfo")) { try @@ -358,13 +358,15 @@ public ApiResponse< CreateSubscriptionResponse > CreateFollowOnSubscriptionWithH } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateFollowOnSubscription,CreateFollowOnSubscriptionAsync,CreateFollowOnSubscriptionWithHttpInfo,CreateFollowOnSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -380,7 +382,7 @@ public ApiResponse< CreateSubscriptionResponse > CreateFollowOnSubscriptionWithH return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse))); // Return statement + (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse),merchantConfig)); // Return statement } /// @@ -469,7 +471,7 @@ public async System.Threading.Tasks.Task } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CreateFollowOnSubscription,CreateFollowOnSubscriptionAsync,CreateFollowOnSubscriptionWithHttpInfo,CreateFollowOnSubscriptionAsyncWithHttpInfo")) { try @@ -483,13 +485,15 @@ public async System.Threading.Tasks.Task } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CreateFollowOnSubscription,CreateFollowOnSubscriptionAsync,CreateFollowOnSubscriptionWithHttpInfo,CreateFollowOnSubscriptionAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -505,7 +509,7 @@ public async System.Threading.Tasks.Task return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse))); // Return statement + (CreateSubscriptionResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreateSubscriptionResponse), merchantConfig)); // Return statement } /// /// Get a Follow-On Subscription Get details of the Subscription being created based on the Request Id of an existing successful Transaction. @@ -588,7 +592,7 @@ public ApiResponse< GetSubscriptionResponse1 > GetFollowOnSubscriptionWithHttpIn } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetFollowOnSubscription,GetFollowOnSubscriptionAsync,GetFollowOnSubscriptionWithHttpInfo,GetFollowOnSubscriptionAsyncWithHttpInfo")) { try @@ -602,12 +606,14 @@ public ApiResponse< GetSubscriptionResponse1 > GetFollowOnSubscriptionWithHttpIn } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetFollowOnSubscription,GetFollowOnSubscriptionAsync,GetFollowOnSubscriptionWithHttpInfo,GetFollowOnSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -623,7 +629,7 @@ public ApiResponse< GetSubscriptionResponse1 > GetFollowOnSubscriptionWithHttpIn return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetSubscriptionResponse1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse1))); // Return statement + (GetSubscriptionResponse1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse1),merchantConfig)); // Return statement } /// @@ -708,7 +714,7 @@ public async System.Threading.Tasks.Task> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetFollowOnSubscription,GetFollowOnSubscriptionAsync,GetFollowOnSubscriptionWithHttpInfo,GetFollowOnSubscriptionAsyncWithHttpInfo")) { try @@ -722,12 +728,14 @@ public async System.Threading.Tasks.Task> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetFollowOnSubscription,GetFollowOnSubscriptionAsync,GetFollowOnSubscriptionWithHttpInfo,GetFollowOnSubscriptionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -743,7 +751,7 @@ public async System.Threading.Tasks.Task> return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (GetSubscriptionResponse1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse1))); // Return statement + (GetSubscriptionResponse1) Configuration.ApiClient.Deserialize(localVarResponse, typeof(GetSubscriptionResponse1), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TaxesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TaxesApi.cs index 08af8631..f9a0f372 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TaxesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TaxesApi.cs @@ -328,7 +328,7 @@ public ApiResponse< VasV2PaymentsPost201Response > CalculateTaxWithHttpInfo (Tax } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "CalculateTax,CalculateTaxAsync,CalculateTaxWithHttpInfo,CalculateTaxAsyncWithHttpInfo")) { try @@ -342,13 +342,15 @@ public ApiResponse< VasV2PaymentsPost201Response > CalculateTaxWithHttpInfo (Tax } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "CalculateTax,CalculateTaxAsync,CalculateTaxWithHttpInfo,CalculateTaxAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -364,7 +366,7 @@ public ApiResponse< VasV2PaymentsPost201Response > CalculateTaxWithHttpInfo (Tax return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (VasV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2PaymentsPost201Response))); // Return statement + (VasV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2PaymentsPost201Response),merchantConfig)); // Return statement } /// @@ -437,7 +439,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (VasV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2PaymentsPost201Response))); // Return statement + (VasV2PaymentsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2PaymentsPost201Response), merchantConfig)); // Return statement } /// /// Void Taxes Pass the Tax Request ID in the PATCH request to void the committed tax calculation. @@ -557,7 +561,7 @@ public ApiResponse< VasV2TaxVoid200Response > VoidTaxWithHttpInfo (VoidTaxReques } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "VoidTax,VoidTaxAsync,VoidTaxWithHttpInfo,VoidTaxAsyncWithHttpInfo")) { try @@ -571,13 +575,15 @@ public ApiResponse< VasV2TaxVoid200Response > VoidTaxWithHttpInfo (VoidTaxReques } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "VoidTax,VoidTaxAsync,VoidTaxWithHttpInfo,VoidTaxAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -593,7 +599,7 @@ public ApiResponse< VasV2TaxVoid200Response > VoidTaxWithHttpInfo (VoidTaxReques return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (VasV2TaxVoid200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2TaxVoid200Response))); // Return statement + (VasV2TaxVoid200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2TaxVoid200Response),merchantConfig)); // Return statement } /// @@ -679,7 +685,7 @@ public async System.Threading.Tasks.Task> V } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "VoidTax,VoidTaxAsync,VoidTaxWithHttpInfo,VoidTaxAsyncWithHttpInfo")) { try @@ -693,13 +699,15 @@ public async System.Threading.Tasks.Task> V } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "VoidTax,VoidTaxAsync,VoidTaxWithHttpInfo,VoidTaxAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -715,7 +723,7 @@ public async System.Threading.Tasks.Task> V return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (VasV2TaxVoid200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2TaxVoid200Response))); // Return statement + (VasV2TaxVoid200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(VasV2TaxVoid200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenApi.cs index eb7199a2..dc7a60ba 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenApi.cs @@ -375,7 +375,7 @@ public ApiResponse< InlineResponse200 > GetCardArtAssetWithHttpInfo (string inst } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCardArtAsset,GetCardArtAssetAsync,GetCardArtAssetWithHttpInfo,GetCardArtAssetAsyncWithHttpInfo")) { try @@ -389,12 +389,14 @@ public ApiResponse< InlineResponse200 > GetCardArtAssetWithHttpInfo (string inst } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCardArtAsset,GetCardArtAssetAsync,GetCardArtAssetWithHttpInfo,GetCardArtAssetAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -410,7 +412,7 @@ public ApiResponse< InlineResponse200 > GetCardArtAssetWithHttpInfo (string inst return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200))); // Return statement + (InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200),merchantConfig)); // Return statement } /// @@ -518,7 +520,7 @@ public async System.Threading.Tasks.Task> GetCard } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetCardArtAsset,GetCardArtAssetAsync,GetCardArtAssetWithHttpInfo,GetCardArtAssetAsyncWithHttpInfo")) { try @@ -532,12 +534,14 @@ public async System.Threading.Tasks.Task> GetCard } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetCardArtAsset,GetCardArtAssetAsync,GetCardArtAssetWithHttpInfo,GetCardArtAssetAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -553,7 +557,7 @@ public async System.Threading.Tasks.Task> GetCard return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200))); // Return statement + (InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200), merchantConfig)); // Return statement } /// /// Generate Payment Credentials for a TMS Token | | | | | - -- | - -- | - -- | |**Token**<br>A Token can represent your tokenized Customer, Payment Instrument or Instrument Identifier information.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|**Payment Credentials**<br>Contains payment information such as the network token, generated cryptogram for Visa & MasterCard or dynamic CVV for Amex in a JSON Web Encryption (JWE) response.<br>Your system can use this API to retrieve the Payment Credentials for an existing Customer, Payment Instrument or Instrument Identifier. @@ -643,7 +647,7 @@ public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tok } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostTokenPaymentCredentials,PostTokenPaymentCredentialsAsync,PostTokenPaymentCredentialsWithHttpInfo,PostTokenPaymentCredentialsAsyncWithHttpInfo")) { try @@ -657,13 +661,15 @@ public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tok } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostTokenPaymentCredentials,PostTokenPaymentCredentialsAsync,PostTokenPaymentCredentialsWithHttpInfo,PostTokenPaymentCredentialsAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -679,7 +685,7 @@ public ApiResponse< string > PostTokenPaymentCredentialsWithHttpInfo (string tok return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string),merchantConfig)); // Return statement } /// @@ -771,7 +777,7 @@ public async System.Threading.Tasks.Task> PostTokenPaymentCr } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostTokenPaymentCredentials,PostTokenPaymentCredentialsAsync,PostTokenPaymentCredentialsWithHttpInfo,PostTokenPaymentCredentialsAsyncWithHttpInfo")) { try @@ -785,13 +791,15 @@ public async System.Threading.Tasks.Task> PostTokenPaymentCr } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostTokenPaymentCredentials,PostTokenPaymentCredentialsAsync,PostTokenPaymentCredentialsWithHttpInfo,PostTokenPaymentCredentialsAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -807,7 +815,7 @@ public async System.Threading.Tasks.Task> PostTokenPaymentCr return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenizedCardApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenizedCardApi.cs index adc45093..d92bc0ac 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenizedCardApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TokenizedCardApi.cs @@ -440,7 +440,7 @@ public ApiResponse DeleteTokenizedCardWithHttpInfo (string tokenizedCard } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteTokenizedCard,DeleteTokenizedCardAsync,DeleteTokenizedCardWithHttpInfo,DeleteTokenizedCardAsyncWithHttpInfo")) { try @@ -454,12 +454,14 @@ public ApiResponse DeleteTokenizedCardWithHttpInfo (string tokenizedCard } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteTokenizedCard,DeleteTokenizedCardAsync,DeleteTokenizedCardWithHttpInfo,DeleteTokenizedCardAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -561,7 +563,7 @@ public async System.Threading.Tasks.Task> DeleteTokenizedCar } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "DeleteTokenizedCard,DeleteTokenizedCardAsync,DeleteTokenizedCardWithHttpInfo,DeleteTokenizedCardAsyncWithHttpInfo")) { try @@ -575,12 +577,14 @@ public async System.Threading.Tasks.Task> DeleteTokenizedCar } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "DeleteTokenizedCard,DeleteTokenizedCardAsync,DeleteTokenizedCardWithHttpInfo,DeleteTokenizedCardAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -683,7 +687,7 @@ public ApiResponse< TokenizedcardRequest > GetTokenizedCardWithHttpInfo (string } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTokenizedCard,GetTokenizedCardAsync,GetTokenizedCardWithHttpInfo,GetTokenizedCardAsyncWithHttpInfo")) { try @@ -697,12 +701,14 @@ public ApiResponse< TokenizedcardRequest > GetTokenizedCardWithHttpInfo (string } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTokenizedCard,GetTokenizedCardAsync,GetTokenizedCardWithHttpInfo,GetTokenizedCardAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -718,7 +724,7 @@ public ApiResponse< TokenizedcardRequest > GetTokenizedCardWithHttpInfo (string return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest))); // Return statement + (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest),merchantConfig)); // Return statement } /// @@ -806,7 +812,7 @@ public async System.Threading.Tasks.Task> GetT } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTokenizedCard,GetTokenizedCardAsync,GetTokenizedCardWithHttpInfo,GetTokenizedCardAsyncWithHttpInfo")) { try @@ -820,12 +826,14 @@ public async System.Threading.Tasks.Task> GetT } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTokenizedCard,GetTokenizedCardAsync,GetTokenizedCardWithHttpInfo,GetTokenizedCardAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -841,7 +849,7 @@ public async System.Threading.Tasks.Task> GetT return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest))); // Return statement + (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest), merchantConfig)); // Return statement } /// /// Simulate Issuer Life Cycle Management Events **Lifecycle Management Events**<br>Simulates an issuer life cycle manegement event for updates on the tokenized card. The events that can be simulated are: - Token status changes (e.g. active, suspended, deleted) - Updates to the underlying card, including card art changes, expiration date changes, and card number suffix. **Note:** This is only available in CAS environment. @@ -934,7 +942,7 @@ public ApiResponse PostIssuerLifeCycleSimulationWithHttpInfo (string pro } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostIssuerLifeCycleSimulation,PostIssuerLifeCycleSimulationAsync,PostIssuerLifeCycleSimulationWithHttpInfo,PostIssuerLifeCycleSimulationAsyncWithHttpInfo")) { try @@ -948,13 +956,15 @@ public ApiResponse PostIssuerLifeCycleSimulationWithHttpInfo (string pro } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostIssuerLifeCycleSimulation,PostIssuerLifeCycleSimulationAsync,PostIssuerLifeCycleSimulationWithHttpInfo,PostIssuerLifeCycleSimulationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1066,7 +1076,7 @@ public async System.Threading.Tasks.Task> PostIssuerLifeCycl } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostIssuerLifeCycleSimulation,PostIssuerLifeCycleSimulationAsync,PostIssuerLifeCycleSimulationWithHttpInfo,PostIssuerLifeCycleSimulationAsyncWithHttpInfo")) { try @@ -1080,13 +1090,15 @@ public async System.Threading.Tasks.Task> PostIssuerLifeCycl } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostIssuerLifeCycleSimulation,PostIssuerLifeCycleSimulationAsync,PostIssuerLifeCycleSimulationWithHttpInfo,PostIssuerLifeCycleSimulationAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1180,7 +1192,7 @@ public ApiResponse< TokenizedcardRequest > PostTokenizedCardWithHttpInfo (Tokeni } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostTokenizedCard,PostTokenizedCardAsync,PostTokenizedCardWithHttpInfo,PostTokenizedCardAsyncWithHttpInfo")) { try @@ -1194,13 +1206,15 @@ public ApiResponse< TokenizedcardRequest > PostTokenizedCardWithHttpInfo (Tokeni } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostTokenizedCard,PostTokenizedCardAsync,PostTokenizedCardWithHttpInfo,PostTokenizedCardAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1216,7 +1230,7 @@ public ApiResponse< TokenizedcardRequest > PostTokenizedCardWithHttpInfo (Tokeni return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest))); // Return statement + (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest),merchantConfig)); // Return statement } /// @@ -1295,7 +1309,7 @@ public async System.Threading.Tasks.Task> Post } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "PostTokenizedCard,PostTokenizedCardAsync,PostTokenizedCardWithHttpInfo,PostTokenizedCardAsyncWithHttpInfo")) { try @@ -1309,13 +1323,15 @@ public async System.Threading.Tasks.Task> Post } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "PostTokenizedCard,PostTokenizedCardAsync,PostTokenizedCardWithHttpInfo,PostTokenizedCardAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -1331,7 +1347,7 @@ public async System.Threading.Tasks.Task> Post return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest))); // Return statement + (TokenizedcardRequest) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TokenizedcardRequest), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionBatchesApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionBatchesApi.cs index 1b0fe2e1..fb40593d 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionBatchesApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionBatchesApi.cs @@ -442,7 +442,7 @@ public ApiResponse GetTransactionBatchDetailsWithHttpInfo (string id, Da } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTransactionBatchDetails,GetTransactionBatchDetailsAsync,GetTransactionBatchDetailsWithHttpInfo,GetTransactionBatchDetailsAsyncWithHttpInfo")) { try @@ -456,12 +456,14 @@ public ApiResponse GetTransactionBatchDetailsWithHttpInfo (string id, Da } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTransactionBatchDetails,GetTransactionBatchDetailsAsync,GetTransactionBatchDetailsWithHttpInfo,GetTransactionBatchDetailsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -573,7 +575,7 @@ public async System.Threading.Tasks.Task> GetTransactionBatc } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTransactionBatchDetails,GetTransactionBatchDetailsAsync,GetTransactionBatchDetailsWithHttpInfo,GetTransactionBatchDetailsAsyncWithHttpInfo")) { try @@ -587,12 +589,14 @@ public async System.Threading.Tasks.Task> GetTransactionBatc } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTransactionBatchDetails,GetTransactionBatchDetailsAsync,GetTransactionBatchDetailsWithHttpInfo,GetTransactionBatchDetailsAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -689,7 +693,7 @@ public ApiResponse< PtsV1TransactionBatchesIdGet200Response > GetTransactionBatc } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTransactionBatchId,GetTransactionBatchIdAsync,GetTransactionBatchIdWithHttpInfo,GetTransactionBatchIdAsyncWithHttpInfo")) { try @@ -703,12 +707,14 @@ public ApiResponse< PtsV1TransactionBatchesIdGet200Response > GetTransactionBatc } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTransactionBatchId,GetTransactionBatchIdAsync,GetTransactionBatchIdWithHttpInfo,GetTransactionBatchIdAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -724,7 +730,7 @@ public ApiResponse< PtsV1TransactionBatchesIdGet200Response > GetTransactionBatc return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV1TransactionBatchesIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesIdGet200Response))); // Return statement + (PtsV1TransactionBatchesIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesIdGet200Response),merchantConfig)); // Return statement } /// @@ -806,7 +812,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV1TransactionBatchesIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesIdGet200Response))); // Return statement + (PtsV1TransactionBatchesIdGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesIdGet200Response), merchantConfig)); // Return statement } /// /// Get a List of Batch Files Provide the date and time search range to get a list of Batch Files ready for settlement @@ -934,7 +942,7 @@ public ApiResponse< PtsV1TransactionBatchesGet200Response > GetTransactionBatche } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTransactionBatches,GetTransactionBatchesAsync,GetTransactionBatchesWithHttpInfo,GetTransactionBatchesAsyncWithHttpInfo")) { try @@ -948,12 +956,14 @@ public ApiResponse< PtsV1TransactionBatchesGet200Response > GetTransactionBatche } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTransactionBatches,GetTransactionBatchesAsync,GetTransactionBatchesWithHttpInfo,GetTransactionBatchesAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -969,7 +979,7 @@ public ApiResponse< PtsV1TransactionBatchesGet200Response > GetTransactionBatche return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV1TransactionBatchesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesGet200Response))); // Return statement + (PtsV1TransactionBatchesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesGet200Response),merchantConfig)); // Return statement } /// @@ -1064,7 +1074,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV1TransactionBatchesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesGet200Response))); // Return statement + (PtsV1TransactionBatchesGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV1TransactionBatchesGet200Response), merchantConfig)); // Return statement } /// /// Upload a Batch File This endpoint enables the upload of a batch file containing transactions for processing. @@ -1175,7 +1187,7 @@ public ApiResponse UploadTransactionBatchWithHttpInfo (System.IO.Stream } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UploadTransactionBatch,UploadTransactionBatchAsync,UploadTransactionBatchWithHttpInfo,UploadTransactionBatchAsyncWithHttpInfo")) { try @@ -1189,12 +1201,14 @@ public ApiResponse UploadTransactionBatchWithHttpInfo (System.IO.Stream } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UploadTransactionBatch,UploadTransactionBatchAsync,UploadTransactionBatchWithHttpInfo,UploadTransactionBatchAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1289,7 +1303,7 @@ public async System.Threading.Tasks.Task> UploadTransactionB } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "UploadTransactionBatch,UploadTransactionBatchAsync,UploadTransactionBatchWithHttpInfo,UploadTransactionBatchAsyncWithHttpInfo")) { try @@ -1303,12 +1317,14 @@ public async System.Threading.Tasks.Task> UploadTransactionB } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "UploadTransactionBatch,UploadTransactionBatchAsync,UploadTransactionBatchWithHttpInfo,UploadTransactionBatchAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionDetailsApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionDetailsApi.cs index 164b95fb..3821ccea 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionDetailsApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransactionDetailsApi.cs @@ -291,7 +291,7 @@ public ApiResponse< TssV2TransactionsGet200Response > GetTransactionWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTransaction,GetTransactionAsync,GetTransactionWithHttpInfo,GetTransactionAsyncWithHttpInfo")) { try @@ -305,12 +305,14 @@ public ApiResponse< TssV2TransactionsGet200Response > GetTransactionWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTransaction,GetTransactionAsync,GetTransactionWithHttpInfo,GetTransactionAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -326,7 +328,7 @@ public ApiResponse< TssV2TransactionsGet200Response > GetTransactionWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2TransactionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsGet200Response))); // Return statement + (TssV2TransactionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsGet200Response),merchantConfig)); // Return statement } /// @@ -408,7 +410,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (TssV2TransactionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsGet200Response))); // Return statement + (TssV2TransactionsGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(TssV2TransactionsGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransientTokenDataApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransientTokenDataApi.cs index 511a8aaf..0bc3803b 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransientTokenDataApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/TransientTokenDataApi.cs @@ -332,7 +332,7 @@ public ApiResponse< string > GetPaymentCredentialsForTransientTokenWithHttpInfo } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPaymentCredentialsForTransientToken,GetPaymentCredentialsForTransientTokenAsync,GetPaymentCredentialsForTransientTokenWithHttpInfo,GetPaymentCredentialsForTransientTokenAsyncWithHttpInfo")) { try @@ -346,12 +346,14 @@ public ApiResponse< string > GetPaymentCredentialsForTransientTokenWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPaymentCredentialsForTransientToken,GetPaymentCredentialsForTransientTokenAsync,GetPaymentCredentialsForTransientTokenWithHttpInfo,GetPaymentCredentialsForTransientTokenAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -367,7 +369,7 @@ public ApiResponse< string > GetPaymentCredentialsForTransientTokenWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string),merchantConfig)); // Return statement } /// @@ -449,7 +451,7 @@ public async System.Threading.Tasks.Task> GetPaymentCredenti } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetPaymentCredentialsForTransientToken,GetPaymentCredentialsForTransientTokenAsync,GetPaymentCredentialsForTransientTokenWithHttpInfo,GetPaymentCredentialsForTransientTokenAsyncWithHttpInfo")) { try @@ -463,12 +465,14 @@ public async System.Threading.Tasks.Task> GetPaymentCredenti } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetPaymentCredentialsForTransientToken,GetPaymentCredentialsForTransientTokenAsync,GetPaymentCredentialsForTransientTokenWithHttpInfo,GetPaymentCredentialsForTransientTokenAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -484,7 +488,7 @@ public async System.Threading.Tasks.Task> GetPaymentCredenti return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string), merchantConfig)); // Return statement } /// /// Get Transient Token Data Retrieve the data captured by Unified Checkout. This API is used to retrieve the detailed data represented by the Transient Token. This API will not return PCI payment data (PAN). Include the Request ID in the GET request to retrieve the transaction details. @@ -561,7 +565,7 @@ public ApiResponse GetTransactionForTransientTokenWithHttpInfo (string t } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTransactionForTransientToken,GetTransactionForTransientTokenAsync,GetTransactionForTransientTokenWithHttpInfo,GetTransactionForTransientTokenAsyncWithHttpInfo")) { try @@ -575,12 +579,14 @@ public ApiResponse GetTransactionForTransientTokenWithHttpInfo (string t } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTransactionForTransientToken,GetTransactionForTransientTokenAsync,GetTransactionForTransientTokenWithHttpInfo,GetTransactionForTransientTokenAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -676,7 +682,7 @@ public async System.Threading.Tasks.Task> GetTransactionForT } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetTransactionForTransientToken,GetTransactionForTransientTokenAsync,GetTransactionForTransientTokenWithHttpInfo,GetTransactionForTransientTokenAsyncWithHttpInfo")) { try @@ -690,12 +696,14 @@ public async System.Threading.Tasks.Task> GetTransactionForT } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetTransactionForTransientToken,GetTransactionForTransientTokenAsync,GetTransactionForTransientTokenWithHttpInfo,GetTransactionForTransientTokenAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UnifiedCheckoutCaptureContextApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UnifiedCheckoutCaptureContextApi.cs index 3d03f272..fcd94461 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UnifiedCheckoutCaptureContextApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UnifiedCheckoutCaptureContextApi.cs @@ -282,7 +282,7 @@ public ApiResponse< string > GenerateUnifiedCheckoutCaptureContextWithHttpInfo ( } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GenerateUnifiedCheckoutCaptureContext,GenerateUnifiedCheckoutCaptureContextAsync,GenerateUnifiedCheckoutCaptureContextWithHttpInfo,GenerateUnifiedCheckoutCaptureContextAsyncWithHttpInfo")) { try @@ -296,13 +296,15 @@ public ApiResponse< string > GenerateUnifiedCheckoutCaptureContextWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GenerateUnifiedCheckoutCaptureContext,GenerateUnifiedCheckoutCaptureContextAsync,GenerateUnifiedCheckoutCaptureContextWithHttpInfo,GenerateUnifiedCheckoutCaptureContextAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -318,7 +320,7 @@ public ApiResponse< string > GenerateUnifiedCheckoutCaptureContextWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string),merchantConfig)); // Return statement } /// @@ -391,7 +393,7 @@ public async System.Threading.Tasks.Task> GenerateUnifiedChe } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GenerateUnifiedCheckoutCaptureContext,GenerateUnifiedCheckoutCaptureContextAsync,GenerateUnifiedCheckoutCaptureContextWithHttpInfo,GenerateUnifiedCheckoutCaptureContextAsyncWithHttpInfo")) { try @@ -405,13 +407,15 @@ public async System.Threading.Tasks.Task> GenerateUnifiedChe } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GenerateUnifiedCheckoutCaptureContext,GenerateUnifiedCheckoutCaptureContextAsync,GenerateUnifiedCheckoutCaptureContextWithHttpInfo,GenerateUnifiedCheckoutCaptureContextAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -427,7 +431,7 @@ public async System.Threading.Tasks.Task> GenerateUnifiedChe return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); // Return statement + (string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementApi.cs index 5899546f..1f50d2f0 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementApi.cs @@ -318,7 +318,7 @@ public ApiResponse< UmsV1UsersGet200Response > GetUsersWithHttpInfo (string orga } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetUsers,GetUsersAsync,GetUsersWithHttpInfo,GetUsersAsyncWithHttpInfo")) { try @@ -332,12 +332,14 @@ public ApiResponse< UmsV1UsersGet200Response > GetUsersWithHttpInfo (string orga } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetUsers,GetUsersAsync,GetUsersWithHttpInfo,GetUsersAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -353,7 +355,7 @@ public ApiResponse< UmsV1UsersGet200Response > GetUsersWithHttpInfo (string orga return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response))); // Return statement + (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response),merchantConfig)); // Return statement } /// @@ -450,7 +452,7 @@ public async System.Threading.Tasks.Task> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "GetUsers,GetUsersAsync,GetUsersWithHttpInfo,GetUsersAsyncWithHttpInfo")) { try @@ -464,12 +466,14 @@ public async System.Threading.Tasks.Task> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "GetUsers,GetUsersAsync,GetUsersWithHttpInfo,GetUsersAsyncWithHttpInfo"); + // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -485,7 +489,7 @@ public async System.Threading.Tasks.Task> return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response))); // Return statement + (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementSearchApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementSearchApi.cs index 1c332559..bcec5eef 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementSearchApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/UserManagementSearchApi.cs @@ -282,7 +282,7 @@ public ApiResponse< UmsV1UsersGet200Response > SearchUsersWithHttpInfo (SearchRe } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SearchUsers,SearchUsersAsync,SearchUsersWithHttpInfo,SearchUsersAsyncWithHttpInfo")) { try @@ -296,13 +296,15 @@ public ApiResponse< UmsV1UsersGet200Response > SearchUsersWithHttpInfo (SearchRe } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SearchUsers,SearchUsersAsync,SearchUsersWithHttpInfo,SearchUsersAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -318,7 +320,7 @@ public ApiResponse< UmsV1UsersGet200Response > SearchUsersWithHttpInfo (SearchRe return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response))); // Return statement + (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response),merchantConfig)); // Return statement } /// @@ -391,7 +393,7 @@ public async System.Threading.Tasks.Task> } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "SearchUsers,SearchUsersAsync,SearchUsersWithHttpInfo,SearchUsersAsyncWithHttpInfo")) { try @@ -405,13 +407,15 @@ public async System.Threading.Tasks.Task> } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "SearchUsers,SearchUsersAsync,SearchUsersWithHttpInfo,SearchUsersAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -427,7 +431,7 @@ public async System.Threading.Tasks.Task> return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response))); // Return statement + (UmsV1UsersGet200Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(UmsV1UsersGet200Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VerificationApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VerificationApi.cs index 2826bc7a..417839c6 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VerificationApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VerificationApi.cs @@ -324,7 +324,7 @@ public ApiResponse< RiskV1ExportComplianceInquiriesPost201Response > ValidateExp } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "ValidateExportCompliance,ValidateExportComplianceAsync,ValidateExportComplianceWithHttpInfo,ValidateExportComplianceAsyncWithHttpInfo")) { try @@ -338,13 +338,15 @@ public ApiResponse< RiskV1ExportComplianceInquiriesPost201Response > ValidateExp } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "ValidateExportCompliance,ValidateExportComplianceAsync,ValidateExportComplianceWithHttpInfo,ValidateExportComplianceAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -360,7 +362,7 @@ public ApiResponse< RiskV1ExportComplianceInquiriesPost201Response > ValidateExp return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1ExportComplianceInquiriesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1ExportComplianceInquiriesPost201Response))); // Return statement + (RiskV1ExportComplianceInquiriesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1ExportComplianceInquiriesPost201Response),merchantConfig)); // Return statement } /// @@ -433,7 +435,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1ExportComplianceInquiriesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1ExportComplianceInquiriesPost201Response))); // Return statement + (RiskV1ExportComplianceInquiriesPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1ExportComplianceInquiriesPost201Response), merchantConfig)); // Return statement } /// /// Verify customer address This call verifies that the customer address submitted is valid. @@ -540,7 +544,7 @@ public ApiResponse< RiskV1AddressVerificationsPost201Response > VerifyCustomerAd } string inboundMLEStatus = "false"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "VerifyCustomerAddress,VerifyCustomerAddressAsync,VerifyCustomerAddressWithHttpInfo,VerifyCustomerAddressAsyncWithHttpInfo")) { try @@ -554,13 +558,15 @@ public ApiResponse< RiskV1AddressVerificationsPost201Response > VerifyCustomerAd } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "VerifyCustomerAddress,VerifyCustomerAddressAsync,VerifyCustomerAddressWithHttpInfo,VerifyCustomerAddressAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -576,7 +582,7 @@ public ApiResponse< RiskV1AddressVerificationsPost201Response > VerifyCustomerAd return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AddressVerificationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AddressVerificationsPost201Response))); // Return statement + (RiskV1AddressVerificationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AddressVerificationsPost201Response),merchantConfig)); // Return statement } /// @@ -649,7 +655,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (RiskV1AddressVerificationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AddressVerificationsPost201Response))); // Return statement + (RiskV1AddressVerificationsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AddressVerificationsPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VoidApi.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VoidApi.cs index a3a993ae..d37f73c5 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VoidApi.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/VoidApi.cs @@ -466,7 +466,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > MitVoidWithHttpInfo (Mit } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "MitVoid,MitVoidAsync,MitVoidWithHttpInfo,MitVoidAsyncWithHttpInfo")) { try @@ -480,13 +480,15 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > MitVoidWithHttpInfo (Mit } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "MitVoid,MitVoidAsync,MitVoidWithHttpInfo,MitVoidAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -502,7 +504,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > MitVoidWithHttpInfo (Mit return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response),merchantConfig)); // Return statement } /// @@ -575,7 +577,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response), merchantConfig)); // Return statement } /// /// Void a Capture Refund a capture API is only used, if you have requested Capture independenlty using [/pts/v2/payments/{id}/captures](https://developer.cybersource.com/api-reference-assets/index.html#payments_capture) API call. Include the capture ID in the POST request to cancel the capture. @@ -695,7 +699,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidCaptureWithHttpInfo } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "VoidCapture,VoidCaptureAsync,VoidCaptureWithHttpInfo,VoidCaptureAsyncWithHttpInfo")) { try @@ -709,13 +713,15 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidCaptureWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "VoidCapture,VoidCaptureAsync,VoidCaptureWithHttpInfo,VoidCaptureAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -731,7 +737,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidCaptureWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response),merchantConfig)); // Return statement } /// @@ -817,7 +823,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response), merchantConfig)); // Return statement } /// /// Void a Credit Include the credit ID in the POST request to cancel the credit. @@ -937,7 +945,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidCreditWithHttpInfo ( } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "VoidCredit,VoidCreditAsync,VoidCreditWithHttpInfo,VoidCreditAsyncWithHttpInfo")) { try @@ -951,13 +959,15 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidCreditWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "VoidCredit,VoidCreditAsync,VoidCreditWithHttpInfo,VoidCreditAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -973,7 +983,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidCreditWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response),merchantConfig)); // Return statement } /// @@ -1059,7 +1069,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response), merchantConfig)); // Return statement } /// /// Void a Payment Void a Payment API is only used, if you have requested Authorization and Capture together in [/pts/v2/payments](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments) API call. Include the payment ID in the POST request to cancel the payment. @@ -1179,7 +1191,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidPaymentWithHttpInfo } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "VoidPayment,VoidPaymentAsync,VoidPaymentWithHttpInfo,VoidPaymentAsyncWithHttpInfo")) { try @@ -1193,13 +1205,15 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidPaymentWithHttpInfo } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "VoidPayment,VoidPaymentAsync,VoidPaymentWithHttpInfo,VoidPaymentAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1215,7 +1229,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidPaymentWithHttpInfo return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response),merchantConfig)); // Return statement } /// @@ -1301,7 +1315,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response), merchantConfig)); // Return statement } /// /// Void a Refund Include the refund ID in the POST request to cancel the refund. @@ -1421,7 +1437,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidRefundWithHttpInfo ( } string inboundMLEStatus = "optional"; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "VoidRefund,VoidRefundAsync,VoidRefundWithHttpInfo,VoidRefundAsyncWithHttpInfo")) { try @@ -1435,13 +1451,15 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidRefundWithHttpInfo ( } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "VoidRefund,VoidRefundAsync,VoidRefundWithHttpInfo,VoidRefundAsyncWithHttpInfo"); + logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -1457,7 +1475,7 @@ public ApiResponse< PtsV2PaymentsVoidsPost201Response > VoidRefundWithHttpInfo ( return new ApiResponse(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response),merchantConfig)); // Return statement } /// @@ -1543,7 +1561,7 @@ public async System.Threading.Tasks.Task(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.Name).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response))); // Return statement + (PtsV2PaymentsVoidsPost201Response) Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2PaymentsVoidsPost201Response), merchantConfig)); // Return statement } } } diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/ApiClient.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/ApiClient.cs index f660fbb2..6cdcd2ff 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/ApiClient.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/ApiClient.cs @@ -200,7 +200,7 @@ private RestRequest PrepareRequest( string path, Method method, Dictionary queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, - string contentType) + string contentType, bool isResponseMLEForApi = false) { //1.set in the defaultHeaders of configuration @@ -244,11 +244,11 @@ private RestRequest PrepareRequest( if (postBody == null) { - CallAuthenticationHeaders(method.ToString(), path); + CallAuthenticationHeaders(method.ToString(), path,isResponseMLEForApi: isResponseMLEForApi); } else { - CallAuthenticationHeaders(method.ToString(), path, postBody.ToString()); + CallAuthenticationHeaders(method.ToString(), path, postBody.ToString(),isResponseMLEForApi: isResponseMLEForApi); } foreach (var param in Configuration.DefaultHeader) @@ -297,7 +297,7 @@ private RestRequest PrepareRequest( else if (contentType.Contains("multipart/form-data")) { request.AddBody(postBody, "multipart/form-data"); - request.AddHeader("Content-Type", contentType); //required to set in case of file params + request.AddHeader("Content-Type", contentType); //required to set in case of file params } else { @@ -331,7 +331,7 @@ public object CallApi( string path, Method method, Dictionary queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, - string contentType) + string contentType, bool isResponseMLEForApi = false) { //declared separately to handle both regular call and download file calls int httpResponseStatusCode; @@ -353,9 +353,9 @@ public object CallApi( //check if the Response is to be downloaded as a file, this value to be set by the calling API class var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType); + pathParams, contentType,isResponseMLEForApi); - MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI, responseMlePrivateKey: Configuration.ResponseMlePrivateKey); var newRestClientOptions = GetRestClientOptions(merchantConfig, Configuration.UserAgent, TimeSpan.FromMilliseconds(Configuration.Timeout)); @@ -497,13 +497,13 @@ public async System.Threading.Tasks.Task CallApiAsync( string path, Method method, Dictionary queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, - string contentType) + string contentType, bool isResponseMLEForApi = false) { LogUtility logUtility = new LogUtility(); var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType); + pathParams, contentType,isResponseMLEForApi); // Logging Request Headers var headerPrintOutput = new StringBuilder(); @@ -517,7 +517,7 @@ public async System.Threading.Tasks.Task CallApiAsync( logger.Debug($"HTTP Request Headers :\n{logUtility.MaskSensitiveData(headerPrintOutput.ToString())}"); - MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI, responseMlePrivateKey: Configuration.ResponseMlePrivateKey); var newRestClientOptions = GetRestClientOptions(merchantConfig, Configuration.UserAgent, TimeSpan.FromMilliseconds(Configuration.Timeout)); @@ -620,7 +620,7 @@ public string ParameterToString(object obj) /// The HTTP response. /// Object type. /// Object representation of the JSON string. - public object Deserialize(RestResponse response, Type type) // CHANGED + public object Deserialize(RestResponse response, Type type, MerchantConfig merchantConfig) // CHANGED { IList headers = response.Headers.ToList(); if (type == typeof(byte[])) // return byte array @@ -642,8 +642,16 @@ public object Deserialize(RestResponse response, Type type) // CHANGED if (match.Success) { string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, response.RawBytes); - return new FileStream(fileName, FileMode.Open); + try + { + File.WriteAllBytes(fileName, response.RawBytes); + return new FileStream(fileName, FileMode.Open); + } + catch (Exception ex) + { + logger.Error($"Error writing file '{fileName}': {ex.Message}"); + throw new Exception($"Error writing file '{fileName}': {ex.Message}"); + } } } } @@ -656,6 +664,29 @@ public object Deserialize(RestResponse response, Type type) // CHANGED return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); } + // check if Response MLE is enabled, then decrypt the response content and then deserialize + if (MLEUtility.CheckIsMleEncryptedResponse(response.Content)) + { + if (merchantConfig == null) + { + throw new ApiException((int)response.StatusCode, "merchantConfig cannot be null when decrypting MLE encrypted response."); + } + + // Inside the if (MLEUtility.CheckIsMleEncryptedResponse(response.Content)) block + try + { + // Decrypt the MLE encrypted response payload using the merchant configuration + var decryptedContent = MLEUtility.DecryptMleResponsePayload(merchantConfig, response.Content); + response.Content = decryptedContent; + } + catch (Exception e) + { + logger.Error($"MLE Encrypted Response Decryption Error Occurred. Error: {e.Message}"); + throw new ApiException((int)response.StatusCode, e.Message); + + } + } + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { return ConvertType(response.Content, type); @@ -842,12 +873,12 @@ public static string SanitizeFilename(string filename) /// GET/POST/PUT/PATCH/DELETE /// Resource Path /// Request Payload - public void CallAuthenticationHeaders(string requestType, string requestTarget, string requestJsonData = null) + public void CallAuthenticationHeaders(string requestType, string requestTarget, string requestJsonData = null,bool isResponseMLEForApi = false) { requestTarget = Uri.EscapeUriString(requestTarget); var merchantConfig = Configuration.MerchantConfigDictionaryObj != null - ? new MerchantConfig(Configuration.MerchantConfigDictionaryObj) + ? new MerchantConfig(Configuration.MerchantConfigDictionaryObj,Configuration.MapToControlMLEonAPI,Configuration.ResponseMlePrivateKey) : new MerchantConfig(); merchantConfig.RequestType = requestType; @@ -862,7 +893,7 @@ public void CallAuthenticationHeaders(string requestType, string requestTarget, if (merchantConfig.IsJwtTokenAuthType) { //generate token and set JWT token headers - var jwtToken = authorize.GetToken(); + var jwtToken = authorize.GetToken(isResponseMLEForApi); authenticationHeaders.Add("Authorization", jwtToken.BearerToken); } else if (merchantConfig.IsHttpSignAuthType) diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/Configuration.cs b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/Configuration.cs index 2633c4f1..37384fba 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/Configuration.cs +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Client/Configuration.cs @@ -15,6 +15,7 @@ using System.Linq; using System.Text; using System.Net; +using System.Security.Cryptography; namespace CyberSource.Client { @@ -51,7 +52,8 @@ public Configuration(ApiClient apiClient = null, int timeout = 100000, string userAgent = "Swagger-Codegen/1.0.0/csharp", IReadOnlyDictionary merchConfigDictObj = null, - Dictionary mapToControlMLEonAPI = null + Dictionary mapToControlMLEonAPI = null, + AsymmetricAlgorithm responseMlePrivateKey = null ) { Username = username; @@ -108,6 +110,7 @@ public Configuration(ApiClient apiClient = null, DateTimeFormat = dateTimeFormat; MerchantConfigDictionaryObj = merchConfigDictObj; MapToControlMLEonAPI = mapToControlMLEonAPI; + ResponseMlePrivateKey = responseMlePrivateKey; SetApiClientUsingDefault(apiClient); } @@ -208,7 +211,9 @@ public void SetApiClientUsingDefault (ApiClient apiClient = null) /// /// Gets or sets the MapToControlMLEonAPI /// - public Dictionary MapToControlMLEonAPI { get; set; } = new Dictionary(); + public Dictionary MapToControlMLEonAPI { get; set; } = new Dictionary(); + + public AsymmetricAlgorithm ResponseMlePrivateKey { get; set; } = null; /// /// Add default header. diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/ApiClient.mustache b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/ApiClient.mustache index 687acf68..27a1977c 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/ApiClient.mustache +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/ApiClient.mustache @@ -210,7 +210,7 @@ namespace {{packageName}}.Client string path, Method method, Dictionary queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, - string contentType) + string contentType, bool isResponseMLEForApi = false) { //1.set in the defaultHeaders of configuration @@ -258,11 +258,11 @@ namespace {{packageName}}.Client if (postBody == null) { - CallAuthenticationHeaders(method.ToString(), path); + CallAuthenticationHeaders(method.ToString(), path,isResponseMLEForApi: isResponseMLEForApi); } else { - CallAuthenticationHeaders(method.ToString(), path, postBody.ToString()); + CallAuthenticationHeaders(method.ToString(), path, postBody.ToString(),isResponseMLEForApi: isResponseMLEForApi); } foreach (var param in Configuration.DefaultHeader) @@ -328,7 +328,7 @@ namespace {{packageName}}.Client else if (contentType.Contains("multipart/form-data")) { request.AddBody(postBody, "multipart/form-data"); - request.AddHeader("Content-Type", contentType); //required to set in case of file params + request.AddHeader("Content-Type", contentType); //required to set in case of file params } else { @@ -373,7 +373,7 @@ namespace {{packageName}}.Client string path, Method method, Dictionary queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, - string contentType) + string contentType, bool isResponseMLEForApi = false) { //declared separately to handle both regular call and download file calls int httpResponseStatusCode; @@ -395,9 +395,9 @@ namespace {{packageName}}.Client //check if the Response is to be downloaded as a file, this value to be set by the calling API class var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType); + pathParams, contentType,isResponseMLEForApi); - MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI, responseMlePrivateKey: Configuration.ResponseMlePrivateKey); var newRestClientOptions = GetRestClientOptions(merchantConfig, Configuration.UserAgent, TimeSpan.FromMilliseconds(Configuration.Timeout)); @@ -551,13 +551,13 @@ namespace {{packageName}}.Client string path, Method method, Dictionary queryParams, object postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, - string contentType) + string contentType, bool isResponseMLEForApi = false) { LogUtility logUtility = new LogUtility(); var request = PrepareRequest( path, method, queryParams, postBody, headerParams, formParams, fileParams, - pathParams, contentType); + pathParams, contentType,isResponseMLEForApi); // Logging Request Headers var headerPrintOutput = new StringBuilder(); @@ -571,7 +571,7 @@ namespace {{packageName}}.Client logger.Debug($"HTTP Request Headers :\n{logUtility.MaskSensitiveData(headerPrintOutput.ToString())}"); - MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(merchantConfigDictionary: Configuration.MerchantConfigDictionaryObj, mapToControlMLEonAPI: Configuration.MapToControlMLEonAPI, responseMlePrivateKey: Configuration.ResponseMlePrivateKey); var newRestClientOptions = GetRestClientOptions(merchantConfig, Configuration.UserAgent, TimeSpan.FromMilliseconds(Configuration.Timeout)); @@ -674,7 +674,7 @@ namespace {{packageName}}.Client /// The HTTP response. /// Object type. /// Object representation of the JSON string. - public object Deserialize(RestResponse response, Type type) // CHANGED + public object Deserialize(RestResponse response, Type type, MerchantConfig merchantConfig) // CHANGED { {{^netStandard}}IList{{/netStandard}}{{#netStandard}}IHttpHeaders{{/netStandard}} headers = response.Headers.ToList(); if (type == typeof(byte[])) // return byte array @@ -696,8 +696,16 @@ namespace {{packageName}}.Client if (match.Success) { string fileName = filePath + SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", "")); - File.WriteAllBytes(fileName, response.RawBytes); - return new FileStream(fileName, FileMode.Open); + try + { + File.WriteAllBytes(fileName, response.RawBytes); + return new FileStream(fileName, FileMode.Open); + } + catch (Exception ex) + { + logger.Error($"Error writing file '{fileName}': {ex.Message}"); + throw new Exception($"Error writing file '{fileName}': {ex.Message}"); + } } } } @@ -710,6 +718,29 @@ namespace {{packageName}}.Client return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind); } + // check if Response MLE is enabled, then decrypt the response content and then deserialize + if (MLEUtility.CheckIsMleEncryptedResponse(response.Content)) + { + if (merchantConfig == null) + { + throw new ApiException((int)response.StatusCode, "merchantConfig cannot be null when decrypting MLE encrypted response."); + } + + // Inside the if (MLEUtility.CheckIsMleEncryptedResponse(response.Content)) block + try + { + // Decrypt the MLE encrypted response payload using the merchant configuration + var decryptedContent = MLEUtility.DecryptMleResponsePayload(merchantConfig, response.Content); + response.Content = decryptedContent; + } + catch (Exception e) + { + logger.Error($"MLE Encrypted Response Decryption Error Occurred. Error: {e.Message}"); + throw new ApiException((int)response.StatusCode, e.Message); + + } + } + if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type { return ConvertType(response.Content, type); @@ -913,12 +944,12 @@ namespace {{packageName}}.Client /// GET/POST/PUT/PATCH/DELETE /// Resource Path /// Request Payload - public void CallAuthenticationHeaders(string requestType, string requestTarget, string requestJsonData = null) + public void CallAuthenticationHeaders(string requestType, string requestTarget, string requestJsonData = null,bool isResponseMLEForApi = false) { requestTarget = Uri.EscapeUriString(requestTarget); var merchantConfig = Configuration.MerchantConfigDictionaryObj != null - ? new MerchantConfig(Configuration.MerchantConfigDictionaryObj) + ? new MerchantConfig(Configuration.MerchantConfigDictionaryObj,Configuration.MapToControlMLEonAPI,Configuration.ResponseMlePrivateKey) : new MerchantConfig(); merchantConfig.RequestType = requestType; @@ -933,7 +964,7 @@ namespace {{packageName}}.Client if (merchantConfig.IsJwtTokenAuthType) { //generate token and set JWT token headers - var jwtToken = authorize.GetToken(); + var jwtToken = authorize.GetToken(isResponseMLEForApi); authenticationHeaders.Add("Authorization", jwtToken.BearerToken); } else if (merchantConfig.IsHttpSignAuthType) diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/Configuration.mustache b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/Configuration.mustache index 93cf76f2..f32dea5d 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/Configuration.mustache +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/Configuration.mustache @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using System.Text; using System.Net; +using System.Security.Cryptography; namespace {{packageName}}.Client { @@ -42,7 +43,8 @@ namespace {{packageName}}.Client int timeout = 100000, string userAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{packageVersion}}/csharp{{/httpUserAgent}}", IReadOnlyDictionary merchConfigDictObj = null, - Dictionary mapToControlMLEonAPI = null + Dictionary mapToControlMLEonAPI = null, + AsymmetricAlgorithm responseMlePrivateKey = null ) { Username = username; @@ -99,6 +101,7 @@ namespace {{packageName}}.Client DateTimeFormat = dateTimeFormat; MerchantConfigDictionaryObj = merchConfigDictObj; MapToControlMLEonAPI = mapToControlMLEonAPI; + ResponseMlePrivateKey = responseMlePrivateKey; SetApiClientUsingDefault(apiClient); } @@ -201,7 +204,9 @@ namespace {{packageName}}.Client /// /// Gets or sets the MapToControlMLEonAPI /// - public Dictionary MapToControlMLEonAPI { get; set; } = new Dictionary(); + public Dictionary MapToControlMLEonAPI { get; set; } = new Dictionary(); + + public AsymmetricAlgorithm ResponseMlePrivateKey { get; set; } = null; /// /// Add default header. diff --git a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/api.mustache b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/api.mustache index 6825ac83..5a959cac 100644 --- a/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/api.mustache +++ b/cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/generator/cybersource-csharp-template/api.mustache @@ -344,7 +344,7 @@ namespace {{packageName}}.{{apiPackage}} {{/bodyParam}} string inboundMLEStatus = {{#vendorExtensions.x-devcenter-metaData.mleForRequest}}"{{vendorExtensions.x-devcenter-metaData.mleForRequest}}"{{/vendorExtensions.x-devcenter-metaData.mleForRequest}}{{^vendorExtensions.x-devcenter-metaData.mleForRequest}}"false"{{/vendorExtensions.x-devcenter-metaData.mleForRequest}}; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "{{operationId}},{{operationId}}Async,{{operationId}}WithHttpInfo,{{operationId}}AsyncWithHttpInfo")) { try @@ -358,6 +358,8 @@ namespace {{packageName}}.{{apiPackage}} } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "{{operationId}},{{operationId}}Async,{{operationId}}WithHttpInfo,{{operationId}}AsyncWithHttpInfo"); + {{#bodyParam}} logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); {{/bodyParam}} @@ -396,7 +398,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.{{httpMethod}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int) localVarResponse.StatusCode; @@ -413,7 +415,7 @@ namespace {{packageName}}.{{apiPackage}} {{#returnType}} return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); // Return statement + ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}),merchantConfig)); // Return statement {{/returnType}} {{^returnType}} this.SetStatusCode(localVarStatusCode); @@ -550,7 +552,7 @@ namespace {{packageName}}.{{apiPackage}} {{/bodyParam}} string inboundMLEStatus = {{#vendorExtensions.x-devcenter-metaData.mleForRequest}}"{{vendorExtensions.x-devcenter-metaData.mleForRequest}}"{{/vendorExtensions.x-devcenter-metaData.mleForRequest}}{{^vendorExtensions.x-devcenter-metaData.mleForRequest}}"false"{{/vendorExtensions.x-devcenter-metaData.mleForRequest}}; - MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI); + MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI, Configuration.ResponseMlePrivateKey); if (MLEUtility.CheckIsMLEForAPI(merchantConfig, inboundMLEStatus, "{{operationId}},{{operationId}}Async,{{operationId}}WithHttpInfo,{{operationId}}AsyncWithHttpInfo")) { try @@ -564,6 +566,8 @@ namespace {{packageName}}.{{apiPackage}} } } + bool isResponseMLEForApi = MLEUtility.CheckIsResponseMLEForAPI(merchantConfig, "{{operationId}},{{operationId}}Async,{{operationId}}WithHttpInfo,{{operationId}}AsyncWithHttpInfo"); + {{#bodyParam}} logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); {{/bodyParam}} @@ -602,7 +606,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.{{httpMethod}}, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); + localVarPathParams, localVarHttpContentType, isResponseMLEForApi); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -619,7 +623,7 @@ namespace {{packageName}}.{{apiPackage}} {{#returnType}} return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.GroupBy(h => h.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}).ToDictionary(x => x.Key, x => string.Join(", ", x.Select(h => h.Value.ToString()))), - ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); // Return statement + ({{{returnType}}}) Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}), merchantConfig)); // Return statement {{/returnType}} {{^returnType}} this.SetStatusCode(localVarStatusCode);