Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add mle #196

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions Api/BatchesApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using NLog;
using AuthenticationSdk.util;
using CyberSource.Utilities.Tracking;
using AuthenticationSdk.core;

namespace CyberSource.Api
{
Expand Down Expand Up @@ -420,6 +421,22 @@ public ApiResponse< InlineResponse2007 > GetBatchReportWithHttpInfo (string batc
localVarPostBody = null;
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetBatchReport,GetBatchReportAsync,GetBatchReportWithHttpInfo,GetBatchReportAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}



// make the HTTP request
RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath,
Expand Down Expand Up @@ -515,6 +532,22 @@ public async System.Threading.Tasks.Task<ApiResponse<InlineResponse2007>> GetBat
localVarPostBody = null;
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetBatchReport,GetBatchReportAsync,GetBatchReportWithHttpInfo,GetBatchReportAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}



// make the HTTP request
RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Expand Down Expand Up @@ -608,6 +641,22 @@ public ApiResponse< InlineResponse2006 > GetBatchStatusWithHttpInfo (string batc
localVarPostBody = null;
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetBatchStatus,GetBatchStatusAsync,GetBatchStatusWithHttpInfo,GetBatchStatusAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}



// make the HTTP request
RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath,
Expand Down Expand Up @@ -703,6 +752,22 @@ public async System.Threading.Tasks.Task<ApiResponse<InlineResponse2006>> GetBat
localVarPostBody = null;
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetBatchStatus,GetBatchStatusAsync,GetBatchStatusWithHttpInfo,GetBatchStatusAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}



// make the HTTP request
RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Expand Down Expand Up @@ -811,6 +876,22 @@ public ApiResponse< InlineResponse2005 > GetBatchesListWithHttpInfo (long? offse
localVarPostBody = null;
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetBatchesList,GetBatchesListAsync,GetBatchesListWithHttpInfo,GetBatchesListAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}



// make the HTTP request
RestResponse localVarResponse = (RestResponse) Configuration.ApiClient.CallApi(localVarPath,
Expand Down Expand Up @@ -921,6 +1002,22 @@ public async System.Threading.Tasks.Task<ApiResponse<InlineResponse2005>> GetBat
localVarPostBody = null;
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetBatchesList,GetBatchesListAsync,GetBatchesListWithHttpInfo,GetBatchesListAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}



// make the HTTP request
RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
Expand Down Expand Up @@ -1011,6 +1108,22 @@ public ApiResponse< InlineResponse202 > PostBatchWithHttpInfo (Body body)
localVarPostBody = body; // byte array
}


bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "PostBatch,PostBatchAsync,PostBatchWithHttpInfo,PostBatchAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down Expand Up @@ -1112,6 +1225,21 @@ public async System.Threading.Tasks.Task<ApiResponse<InlineResponse202>> PostBat
localVarPostBody = body; // byte array
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "PostBatch,PostBatchAsync,PostBatchWithHttpInfo,PostBatchAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down
94 changes: 94 additions & 0 deletions Api/BillingAgreementsApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using NLog;
using AuthenticationSdk.util;
using CyberSource.Utilities.Tracking;
using AuthenticationSdk.core;

namespace CyberSource.Api
{
Expand Down Expand Up @@ -384,6 +385,22 @@ public ApiResponse< PtsV2ModifyBillingAgreementPost201Response > BillingAgreemen
localVarPostBody = modifyBillingAgreement; // byte array
}


bool isMLESupportedByCybsForApi = true;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsDeRegistration,BillingAgreementsDeRegistrationAsync,BillingAgreementsDeRegistrationWithHttpInfo,BillingAgreementsDeRegistrationAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down Expand Up @@ -498,6 +515,21 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2ModifyBillingAgreement
localVarPostBody = modifyBillingAgreement; // byte array
}

bool isMLESupportedByCybsForApi = true;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsDeRegistration,BillingAgreementsDeRegistrationAsync,BillingAgreementsDeRegistrationWithHttpInfo,BillingAgreementsDeRegistrationAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down Expand Up @@ -610,6 +642,22 @@ public ApiResponse< PtsV2CreditsPost201Response1 > BillingAgreementsIntimationWi
localVarPostBody = intimateBillingAgreement; // byte array
}


bool isMLESupportedByCybsForApi = true;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsIntimation,BillingAgreementsIntimationAsync,BillingAgreementsIntimationWithHttpInfo,BillingAgreementsIntimationAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down Expand Up @@ -724,6 +772,21 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2CreditsPost201Response
localVarPostBody = intimateBillingAgreement; // byte array
}

bool isMLESupportedByCybsForApi = true;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsIntimation,BillingAgreementsIntimationAsync,BillingAgreementsIntimationWithHttpInfo,BillingAgreementsIntimationAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down Expand Up @@ -823,6 +886,22 @@ public ApiResponse< PtsV2CreateBillingAgreementPost201Response > BillingAgreemen
localVarPostBody = createBillingAgreement; // byte array
}


bool isMLESupportedByCybsForApi = true;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsRegistration,BillingAgreementsRegistrationAsync,BillingAgreementsRegistrationWithHttpInfo,BillingAgreementsRegistrationAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down Expand Up @@ -924,6 +1003,21 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2CreateBillingAgreement
localVarPostBody = createBillingAgreement; // byte array
}

bool isMLESupportedByCybsForApi = true;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsRegistration,BillingAgreementsRegistrationAsync,BillingAgreementsRegistrationWithHttpInfo,BillingAgreementsRegistrationAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down
32 changes: 32 additions & 0 deletions Api/BinLookupApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using NLog;
using AuthenticationSdk.util;
using CyberSource.Utilities.Tracking;
using AuthenticationSdk.core;

namespace CyberSource.Api
{
Expand Down Expand Up @@ -280,6 +281,22 @@ public ApiResponse< InlineResponse2011 > GetAccountInfoWithHttpInfo (CreateBinLo
localVarPostBody = createBinLookupRequest; // byte array
}


bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down Expand Up @@ -381,6 +398,21 @@ public async System.Threading.Tasks.Task<ApiResponse<InlineResponse2011>> GetAcc
localVarPostBody = createBinLookupRequest; // byte array
}

bool isMLESupportedByCybsForApi = false;
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo"))
{
try
{
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
}
catch (Exception e)
{
logger.Error("Failed to encrypt request body {}", e.Message, e);
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
}
}

if (logUtility.IsMaskingEnabled(logger))
{
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
Expand Down
Loading