Skip to content

Commit 16f0e46

Browse files
authored
Merge pull request #200 from CyberSource/release-march25
Release march25
2 parents c36948c + fe4e3c1 commit 16f0e46

File tree

248 files changed

+121847
-116200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+121847
-116200
lines changed

Api/BatchesApi.cs

Lines changed: 208 additions & 94 deletions
Large diffs are not rendered by default.

Api/BillingAgreementsApi.cs

Lines changed: 104 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using NLog;
1919
using AuthenticationSdk.util;
2020
using CyberSource.Utilities.Tracking;
21+
using AuthenticationSdk.core;
2122

2223
namespace CyberSource.Api
2324
{
@@ -372,7 +373,7 @@ public ApiResponse< PtsV2ModifyBillingAgreementPost201Response > BillingAgreemen
372373
{
373374
localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter
374375
}
375-
//logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
376+
logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
376377
if (modifyBillingAgreement != null && modifyBillingAgreement.GetType() != typeof(byte[]))
377378
{
378379
SdkTracker sdkTracker = new SdkTracker();
@@ -384,14 +385,23 @@ public ApiResponse< PtsV2ModifyBillingAgreementPost201Response > BillingAgreemen
384385
localVarPostBody = modifyBillingAgreement; // byte array
385386
}
386387

387-
//if (logUtility.IsMaskingEnabled(logger))
388-
//{
389-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
390-
//}
391-
//else
392-
//{
393-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
394-
//}
388+
389+
bool isMLESupportedByCybsForApi = true;
390+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
391+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsDeRegistration,BillingAgreementsDeRegistrationAsync,BillingAgreementsDeRegistrationWithHttpInfo,BillingAgreementsDeRegistrationAsyncWithHttpInfo"))
392+
{
393+
try
394+
{
395+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
396+
}
397+
catch (Exception e)
398+
{
399+
logger.Error("Failed to encrypt request body {}", e.Message, e);
400+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
401+
}
402+
}
403+
404+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
395405

396406

397407
// make the HTTP request
@@ -486,7 +496,7 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2ModifyBillingAgreement
486496
{
487497
localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter
488498
}
489-
//logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
499+
logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
490500
if (modifyBillingAgreement != null && modifyBillingAgreement.GetType() != typeof(byte[]))
491501
{
492502
SdkTracker sdkTracker = new SdkTracker();
@@ -498,14 +508,22 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2ModifyBillingAgreement
498508
localVarPostBody = modifyBillingAgreement; // byte array
499509
}
500510

501-
//if (logUtility.IsMaskingEnabled(logger))
502-
//{
503-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
504-
//}
505-
//else
506-
//{
507-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
508-
//}
511+
bool isMLESupportedByCybsForApi = true;
512+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
513+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsDeRegistration,BillingAgreementsDeRegistrationAsync,BillingAgreementsDeRegistrationWithHttpInfo,BillingAgreementsDeRegistrationAsyncWithHttpInfo"))
514+
{
515+
try
516+
{
517+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
518+
}
519+
catch (Exception e)
520+
{
521+
logger.Error("Failed to encrypt request body {}", e.Message, e);
522+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
523+
}
524+
}
525+
526+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
509527

510528

511529
// make the HTTP request
@@ -598,7 +616,7 @@ public ApiResponse< PtsV2CreditsPost201Response1 > BillingAgreementsIntimationWi
598616
{
599617
localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter
600618
}
601-
//logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
619+
logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
602620
if (intimateBillingAgreement != null && intimateBillingAgreement.GetType() != typeof(byte[]))
603621
{
604622
SdkTracker sdkTracker = new SdkTracker();
@@ -610,14 +628,23 @@ public ApiResponse< PtsV2CreditsPost201Response1 > BillingAgreementsIntimationWi
610628
localVarPostBody = intimateBillingAgreement; // byte array
611629
}
612630

613-
//if (logUtility.IsMaskingEnabled(logger))
614-
//{
615-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
616-
//}
617-
//else
618-
//{
619-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
620-
//}
631+
632+
bool isMLESupportedByCybsForApi = true;
633+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
634+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsIntimation,BillingAgreementsIntimationAsync,BillingAgreementsIntimationWithHttpInfo,BillingAgreementsIntimationAsyncWithHttpInfo"))
635+
{
636+
try
637+
{
638+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
639+
}
640+
catch (Exception e)
641+
{
642+
logger.Error("Failed to encrypt request body {}", e.Message, e);
643+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
644+
}
645+
}
646+
647+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
621648

622649

623650
// make the HTTP request
@@ -712,7 +739,7 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2CreditsPost201Response
712739
{
713740
localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter
714741
}
715-
//logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
742+
logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
716743
if (intimateBillingAgreement != null && intimateBillingAgreement.GetType() != typeof(byte[]))
717744
{
718745
SdkTracker sdkTracker = new SdkTracker();
@@ -724,14 +751,22 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2CreditsPost201Response
724751
localVarPostBody = intimateBillingAgreement; // byte array
725752
}
726753

727-
//if (logUtility.IsMaskingEnabled(logger))
728-
//{
729-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
730-
//}
731-
//else
732-
//{
733-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
734-
//}
754+
bool isMLESupportedByCybsForApi = true;
755+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
756+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsIntimation,BillingAgreementsIntimationAsync,BillingAgreementsIntimationWithHttpInfo,BillingAgreementsIntimationAsyncWithHttpInfo"))
757+
{
758+
try
759+
{
760+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
761+
}
762+
catch (Exception e)
763+
{
764+
logger.Error("Failed to encrypt request body {}", e.Message, e);
765+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
766+
}
767+
}
768+
769+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
735770

736771

737772
// make the HTTP request
@@ -823,14 +858,23 @@ public ApiResponse< PtsV2CreateBillingAgreementPost201Response > BillingAgreemen
823858
localVarPostBody = createBillingAgreement; // byte array
824859
}
825860

826-
//if (logUtility.IsMaskingEnabled(logger))
827-
//{
828-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
829-
//}
830-
//else
831-
//{
832-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
833-
//}
861+
862+
bool isMLESupportedByCybsForApi = true;
863+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
864+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsRegistration,BillingAgreementsRegistrationAsync,BillingAgreementsRegistrationWithHttpInfo,BillingAgreementsRegistrationAsyncWithHttpInfo"))
865+
{
866+
try
867+
{
868+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
869+
}
870+
catch (Exception e)
871+
{
872+
logger.Error("Failed to encrypt request body {}", e.Message, e);
873+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
874+
}
875+
}
876+
877+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
834878

835879

836880
// make the HTTP request
@@ -924,14 +968,22 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2CreateBillingAgreement
924968
localVarPostBody = createBillingAgreement; // byte array
925969
}
926970

927-
//if (logUtility.IsMaskingEnabled(logger))
928-
//{
929-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
930-
//}
931-
//else
932-
//{
933-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
934-
//}
971+
bool isMLESupportedByCybsForApi = true;
972+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
973+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "BillingAgreementsRegistration,BillingAgreementsRegistrationAsync,BillingAgreementsRegistrationWithHttpInfo,BillingAgreementsRegistrationAsyncWithHttpInfo"))
974+
{
975+
try
976+
{
977+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
978+
}
979+
catch (Exception e)
980+
{
981+
logger.Error("Failed to encrypt request body {}", e.Message, e);
982+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
983+
}
984+
}
985+
986+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
935987

936988

937989
// make the HTTP request

Api/BinLookupApi.cs

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using NLog;
1919
using AuthenticationSdk.util;
2020
using CyberSource.Utilities.Tracking;
21+
using AuthenticationSdk.core;
2122

2223
namespace CyberSource.Api
2324
{
@@ -280,14 +281,23 @@ public ApiResponse< InlineResponse2011 > GetAccountInfoWithHttpInfo (CreateBinLo
280281
localVarPostBody = createBinLookupRequest; // byte array
281282
}
282283

283-
//if (logUtility.IsMaskingEnabled(logger))
284-
//{
285-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
286-
//}
287-
//else
288-
//{
289-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
290-
//}
284+
285+
bool isMLESupportedByCybsForApi = false;
286+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
287+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo"))
288+
{
289+
try
290+
{
291+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
292+
}
293+
catch (Exception e)
294+
{
295+
logger.Error("Failed to encrypt request body {}", e.Message, e);
296+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
297+
}
298+
}
299+
300+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
291301

292302

293303
// make the HTTP request
@@ -381,14 +391,22 @@ public async System.Threading.Tasks.Task<ApiResponse<InlineResponse2011>> GetAcc
381391
localVarPostBody = createBinLookupRequest; // byte array
382392
}
383393

384-
//if (logUtility.IsMaskingEnabled(logger))
385-
//{
386-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
387-
//}
388-
//else
389-
//{
390-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
391-
//}
394+
bool isMLESupportedByCybsForApi = false;
395+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
396+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "GetAccountInfo,GetAccountInfoAsync,GetAccountInfoWithHttpInfo,GetAccountInfoAsyncWithHttpInfo"))
397+
{
398+
try
399+
{
400+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
401+
}
402+
catch (Exception e)
403+
{
404+
logger.Error("Failed to encrypt request body {}", e.Message, e);
405+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
406+
}
407+
}
408+
409+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
392410

393411

394412
// make the HTTP request

Api/CaptureApi.cs

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using NLog;
1919
using AuthenticationSdk.util;
2020
using CyberSource.Utilities.Tracking;
21+
using AuthenticationSdk.core;
2122

2223
namespace CyberSource.Api
2324
{
@@ -284,7 +285,7 @@ public ApiResponse< PtsV2PaymentsCapturesPost201Response > CapturePaymentWithHtt
284285
{
285286
localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter
286287
}
287-
//logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
288+
logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
288289
if (capturePaymentRequest != null && capturePaymentRequest.GetType() != typeof(byte[]))
289290
{
290291
SdkTracker sdkTracker = new SdkTracker();
@@ -296,14 +297,23 @@ public ApiResponse< PtsV2PaymentsCapturesPost201Response > CapturePaymentWithHtt
296297
localVarPostBody = capturePaymentRequest; // byte array
297298
}
298299

299-
//if (logUtility.IsMaskingEnabled(logger))
300-
//{
301-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
302-
//}
303-
//else
304-
//{
305-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
306-
//}
300+
301+
bool isMLESupportedByCybsForApi = true;
302+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
303+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "CapturePayment,CapturePaymentAsync,CapturePaymentWithHttpInfo,CapturePaymentAsyncWithHttpInfo"))
304+
{
305+
try
306+
{
307+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
308+
}
309+
catch (Exception e)
310+
{
311+
logger.Error("Failed to encrypt request body {}", e.Message, e);
312+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
313+
}
314+
}
315+
316+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
307317

308318

309319
// make the HTTP request
@@ -398,7 +408,7 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2PaymentsCapturesPost20
398408
{
399409
localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter
400410
}
401-
//logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
411+
logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}");
402412
if (capturePaymentRequest != null && capturePaymentRequest.GetType() != typeof(byte[]))
403413
{
404414
SdkTracker sdkTracker = new SdkTracker();
@@ -410,14 +420,22 @@ public async System.Threading.Tasks.Task<ApiResponse<PtsV2PaymentsCapturesPost20
410420
localVarPostBody = capturePaymentRequest; // byte array
411421
}
412422

413-
//if (logUtility.IsMaskingEnabled(logger))
414-
//{
415-
// logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
416-
//}
417-
//else
418-
//{
419-
// logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
420-
//}
423+
bool isMLESupportedByCybsForApi = true;
424+
MerchantConfig merchantConfig = new MerchantConfig(Configuration.MerchantConfigDictionaryObj, Configuration.MapToControlMLEonAPI);
425+
if (MLEUtility.CheckIsMLEForAPI(merchantConfig, isMLESupportedByCybsForApi, "CapturePayment,CapturePaymentAsync,CapturePaymentWithHttpInfo,CapturePaymentAsyncWithHttpInfo"))
426+
{
427+
try
428+
{
429+
localVarPostBody = MLEUtility.EncryptRequestPayload(merchantConfig, localVarPostBody);
430+
}
431+
catch (Exception e)
432+
{
433+
logger.Error("Failed to encrypt request body {}", e.Message, e);
434+
throw new ApiException(400,"Failed to encrypt request body : " + e.Message);
435+
}
436+
}
437+
438+
logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
421439

422440

423441
// make the HTTP request

0 commit comments

Comments
 (0)