Skip to content

Commit 2db5016

Browse files
Merge pull request #87 from CyberSource/june-2024-release
June 2024 release
2 parents 4af705d + 6e82379 commit 2db5016

File tree

39 files changed

+422
-120
lines changed

39 files changed

+422
-120
lines changed

cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/AuthenticationSdk.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6-
<Version>0.0.1.13</Version>
6+
<Version>0.0.1.14</Version>
77
<Authors>CyberSource</Authors>
88
<Product>Authentication_SDK</Product>
99
<Description />

cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/Authorize.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ public class Authorize
1414
{
1515
private static Logger _logger;
1616
private readonly MerchantConfig _merchantConfig;
17+
LogUtility logUtility;
18+
1719

1820
public Authorize(MerchantConfig merchantConfig)
1921
{
2022
_merchantConfig = merchantConfig;
2123
Enumerations.ValidateRequestType(_merchantConfig.RequestType);
2224
Enumerations.SetRequestType(_merchantConfig);
23-
25+
logUtility = new LogUtility();
2426
if (_logger == null)
2527
{
2628
_logger = LogManager.GetCurrentClassLogger();
@@ -66,7 +68,7 @@ public HttpToken GetSignature()
6668
_logger.Debug($"digest: {signatureObj.Digest}");
6769
}
6870

69-
_logger.Debug($"signature: {signatureObj.SignatureParam}");
71+
logUtility.LogDebugMessage( _logger, $"Signature : {signatureObj.SignatureParam}");
7072

7173
return signatureObj;
7274
}
@@ -110,7 +112,7 @@ public JwtToken GetToken()
110112
_logger.Debug("Content-Type: application/hal+json");
111113
}
112114

113-
_logger.Debug($"Authorization: {tokenObj.BearerToken}");
115+
logUtility.LogDebugMessage(_logger, $"Authorization : Bearer {tokenObj.BearerToken}");
114116

115117
return tokenObj;
116118
}
@@ -154,7 +156,7 @@ public OAuthToken GetOAuthToken()
154156
_logger.Debug("Content-Type: application/hal+json");
155157
}
156158

157-
_logger.Debug($"Authorization: {tokenObj.AccessToken}");
159+
logUtility.LogDebugMessage(_logger, $"Authorization : Bearer {tokenObj.AccessToken}");
158160

159161
return tokenObj;
160162
}

cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/core/MerchantConfig.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ public MerchantConfig(IReadOnlyDictionary<string, string> merchantConfigDictiona
108108

109109
public string KeyPass { get; set; }
110110

111-
public string EnableLog { get; set; } = "TRUE";
111+
//public string EnableLog { get; set; } = "TRUE";
112112

113-
public string LogDirectory { get; set; } = "../../logs";
113+
//public string LogDirectory { get; set; } = "../../logs";
114114

115-
public string LogfileMaxSize { get; set; } = "10485760"; // 10 MB = 10485760 bytes
115+
//public string LogfileMaxSize { get; set; } = "10485760"; // 10 MB = 10485760 bytes
116116

117-
public string LogFileName { get; set; } = "cybs.log";
117+
//public string LogFileName { get; set; } = "cybs.log";
118118

119119
public string TimeOut { get; set; }
120120

cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/LogUtility.cs

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ public string MaskSensitiveData(string str)
9393
return str;
9494
}
9595

96+
public void LogDebugMessage(Logger logger, String debugMessage)
97+
{
98+
if (IsMaskingEnabled(logger))
99+
{
100+
logger.Debug(MaskSensitiveData(debugMessage));
101+
}
102+
else
103+
{
104+
logger.Debug(debugMessage);
105+
}
106+
}
107+
96108
public bool IsMaskingEnabled(Logger logger)
97109
{
98110
if (!(logger.Factory.Configuration?.Variables?.ContainsKey("enableMasking") ?? false))

cybersource-rest-auth-netstandard/AuthenticationSdk/AuthenticationSdk/util/SensitiveDataConfigurationType.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public class SensitiveDataConfigurationType
2525

2626
public static AuthenticationSchemeTag[] authenticationTags = new AuthenticationSchemeTag[]
2727
{
28-
new AuthenticationSchemeTag("Signature", "(keyid=\\\"([\\w-]*)\\\"),([\\w\\\"\\-\\(\\),= ]*), (signature=\\\"([\\w\\/=\\+]*)\\\")", "Signature : keyid=\"XXXXX\",$3, signature=\"$5\"")
28+
new AuthenticationSchemeTag("Signature", "(keyid=\\\"([\\w-]*)\\\"),([\\w\\\"\\-\\(\\),= ]*), (signature=\\\"([\\w\\/=\\+]*)\\\")", "Signature : keyid=\"XXXXX\",$3, signature=\"$5\""),
29+
new AuthenticationSchemeTag("Authorization", "Bearer\\s.*","Authorization : Bearer xxxxxxxxxxxxxxxx")
2930
};
3031
}
3132

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Api/TransientTokenDataApiTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public void InstanceTest()
7070
public void GetPaymentCredentialsForTransientTokenTest()
7171
{
7272
// TODO uncomment below to test the method and replace null with proper value
73-
//string jti = null;
74-
//var response = instance.GetPaymentCredentialsForTransientToken(jti);
73+
//string paymentCredentialsReference = null;
74+
//var response = instance.GetPaymentCredentialsForTransientToken(paymentCredentialsReference);
7575
//Assert.IsInstanceOf<string> (response, "response is string");
7676
}
7777

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* CyberSource Merged Spec
3+
*
4+
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5+
*
6+
* OpenAPI spec version: 0.0.1
7+
*
8+
* Generated by: https://github.com/swagger-api/swagger-codegen.git
9+
*/
10+
11+
12+
using NUnit.Framework;
13+
14+
using System;
15+
using System.Linq;
16+
using System.IO;
17+
using System.Collections.Generic;
18+
using CyberSource.Api;
19+
using CyberSource.Model;
20+
using CyberSource.Client;
21+
using System.Reflection;
22+
23+
namespace CyberSource.Test
24+
{
25+
/// <summary>
26+
/// Class for testing Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation
27+
/// </summary>
28+
/// <remarks>
29+
/// This file is automatically generated by Swagger Codegen.
30+
/// Please update the test case below to test the model.
31+
/// </remarks>
32+
[TestFixture]
33+
public class Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformationTests
34+
{
35+
// TODO uncomment below to declare an instance variable for Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation
36+
//private Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation instance;
37+
38+
/// <summary>
39+
/// Setup before each test
40+
/// </summary>
41+
[SetUp]
42+
public void Init()
43+
{
44+
// TODO uncomment below to create an instance of Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation
45+
//instance = new Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation();
46+
}
47+
48+
/// <summary>
49+
/// Clean up after each test
50+
/// </summary>
51+
[TearDown]
52+
public void Cleanup()
53+
{
54+
55+
}
56+
57+
/// <summary>
58+
/// Test an instance of Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation
59+
/// </summary>
60+
[Test]
61+
public void Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformationInstanceTest()
62+
{
63+
// TODO uncomment below to test "IsInstanceOfType" Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation
64+
//Assert.IsInstanceOfType<Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation> (instance, "variable 'instance' is a Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIssuerInformation");
65+
}
66+
67+
/// <summary>
68+
/// Test the property 'ExemptionDataRaw'
69+
/// </summary>
70+
[Test]
71+
public void ExemptionDataRawTest()
72+
{
73+
// TODO unit test for the property 'ExemptionDataRaw'
74+
}
75+
76+
}
77+
78+
}

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Model/Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationTests.cs

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ public void Ptsv2paymentsConsumerAuthenticationInformationStrongAuthenticationIn
6464
//Assert.IsInstanceOfType<Ptsv2paymentsConsumerAuthenticationInformationStrongAuthentication> (instance, "variable 'instance' is a Ptsv2paymentsConsumerAuthenticationInformationStrongAuthentication");
6565
}
6666

67+
/// <summary>
68+
/// Test the property 'IssuerInformation'
69+
/// </summary>
70+
[Test]
71+
public void IssuerInformationTest()
72+
{
73+
// TODO unit test for the property 'IssuerInformation'
74+
}
6775
/// <summary>
6876
/// Test the property 'LowValueExemptionIndicator'
6977
/// </summary>

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard.Test/Model/RiskV1DecisionsPost201ResponseConsumerAuthenticationInformationTests.cs

+8
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ public void EffectiveAuthenticationTypeTest()
241241
// TODO unit test for the property 'EffectiveAuthenticationType'
242242
}
243243
/// <summary>
244+
/// Test the property 'ExemptionDataRaw'
245+
/// </summary>
246+
[Test]
247+
public void ExemptionDataRawTest()
248+
{
249+
// TODO unit test for the property 'ExemptionDataRaw'
250+
}
251+
/// <summary>
244252
/// Test the property 'Ivr'
245253
/// </summary>
246254
[Test]

cybersource-rest-client-netstandard/cybersource-rest-client-netstandard/Api/InvoicesApi.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public interface IInvoicesApi : IApiAccessor
5757
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
5858
/// <param name="offset">Page offset number.</param>
5959
/// <param name="limit">Maximum number of items you would like returned.</param>
60-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
60+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
6161
/// <returns>InvoicingV2InvoicesAllGet200Response</returns>
6262
InvoicingV2InvoicesAllGet200Response GetAllInvoices (int? offset, int? limit, string status = null);
6363

@@ -70,7 +70,7 @@ public interface IInvoicesApi : IApiAccessor
7070
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
7171
/// <param name="offset">Page offset number.</param>
7272
/// <param name="limit">Maximum number of items you would like returned.</param>
73-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
73+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
7474
/// <returns>ApiResponse of InvoicingV2InvoicesAllGet200Response</returns>
7575
ApiResponse<InvoicingV2InvoicesAllGet200Response> GetAllInvoicesWithHttpInfo (int? offset, int? limit, string status = null);
7676
/// <summary>
@@ -191,7 +191,7 @@ public interface IInvoicesApi : IApiAccessor
191191
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
192192
/// <param name="offset">Page offset number.</param>
193193
/// <param name="limit">Maximum number of items you would like returned.</param>
194-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
194+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
195195
/// <returns>Task of InvoicingV2InvoicesAllGet200Response</returns>
196196
System.Threading.Tasks.Task<InvoicingV2InvoicesAllGet200Response> GetAllInvoicesAsync (int? offset, int? limit, string status = null);
197197

@@ -204,7 +204,7 @@ public interface IInvoicesApi : IApiAccessor
204204
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
205205
/// <param name="offset">Page offset number.</param>
206206
/// <param name="limit">Maximum number of items you would like returned.</param>
207-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
207+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
208208
/// <returns>Task of ApiResponse (InvoicingV2InvoicesAllGet200Response)</returns>
209209
System.Threading.Tasks.Task<ApiResponse<InvoicingV2InvoicesAllGet200Response>> GetAllInvoicesAsyncWithHttpInfo (int? offset, int? limit, string status = null);
210210
/// <summary>
@@ -645,7 +645,7 @@ public async System.Threading.Tasks.Task<ApiResponse<InvoicingV2InvoicesPost201R
645645
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
646646
/// <param name="offset">Page offset number.</param>
647647
/// <param name="limit">Maximum number of items you would like returned.</param>
648-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
648+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
649649
/// <returns>InvoicingV2InvoicesAllGet200Response</returns>
650650
public InvoicingV2InvoicesAllGet200Response GetAllInvoices (int? offset, int? limit, string status = null)
651651
{
@@ -663,7 +663,7 @@ public InvoicingV2InvoicesAllGet200Response GetAllInvoices (int? offset, int? li
663663
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
664664
/// <param name="offset">Page offset number.</param>
665665
/// <param name="limit">Maximum number of items you would like returned.</param>
666-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
666+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
667667
/// <returns>ApiResponse of InvoicingV2InvoicesAllGet200Response</returns>
668668
public ApiResponse< InvoicingV2InvoicesAllGet200Response > GetAllInvoicesWithHttpInfo (int? offset, int? limit, string status = null)
669669
{
@@ -762,7 +762,7 @@ public ApiResponse< InvoicingV2InvoicesAllGet200Response > GetAllInvoicesWithHtt
762762
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
763763
/// <param name="offset">Page offset number.</param>
764764
/// <param name="limit">Maximum number of items you would like returned.</param>
765-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
765+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
766766
/// <returns>Task of InvoicingV2InvoicesAllGet200Response</returns>
767767
public async System.Threading.Tasks.Task<InvoicingV2InvoicesAllGet200Response> GetAllInvoicesAsync (int? offset, int? limit, string status = null)
768768
{
@@ -781,7 +781,7 @@ public async System.Threading.Tasks.Task<InvoicingV2InvoicesAllGet200Response> G
781781
/// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
782782
/// <param name="offset">Page offset number.</param>
783783
/// <param name="limit">Maximum number of items you would like returned.</param>
784-
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED (optional)</param>
784+
/// <param name="status">The status of the invoice. Possible values: - DRAFT - CREATED - SENT - PARTIAL - PAID - CANCELED - PENDING (optional)</param>
785785
/// <returns>Task of ApiResponse (InvoicingV2InvoicesAllGet200Response)</returns>
786786
public async System.Threading.Tasks.Task<ApiResponse<InvoicingV2InvoicesAllGet200Response>> GetAllInvoicesAsyncWithHttpInfo (int? offset, int? limit, string status = null)
787787
{

0 commit comments

Comments
 (0)