Skip to content

Commit b92d050

Browse files
committed
Auth sample code commented | GENAI=NO
1 parent 611894b commit b92d050

10 files changed

+490
-490
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
using System;
2-
using ApiSdk.controller;
3-
using AuthenticationSdk.core;
4-
using AuthenticationSdk.util;
1+
//using System;
2+
//using ApiSdk.controller;
3+
//using AuthenticationSdk.core;
4+
//using AuthenticationSdk.util;
55

6-
namespace Cybersource_rest_samples_dotnet.Samples.Authentication
7-
{
8-
public class DeleteMethod
9-
{
6+
//namespace Cybersource_rest_samples_dotnet.Samples.Authentication
7+
//{
8+
// public class DeleteMethod
9+
// {
1010
// DELETE Request to Delete subscription of (Unsubscribe) a report name by organization
1111
// Below request unsubscribes 'TRR Report' Subscription for Organization ID: testrest
12-
private const string RequestTarget = "/reporting/v2/reportSubscriptions/TRRReport?organizationId=testrest";
12+
//private const string RequestTarget = "/reporting/v2/reportSubscriptions/TRRReport?organizationId=testrest";
1313

14-
public static void WriteLogAudit(int status)
15-
{
16-
var filePath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString().Split('.');
17-
var filename = filePath[filePath.Length - 1];
18-
Console.WriteLine($"[Sample Code Testing] [{filename}] {status}");
19-
}
14+
//public static void WriteLogAudit(int status)
15+
//{
16+
// var filePath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString().Split('.');
17+
// var filename = filePath[filePath.Length - 1];
18+
// Console.WriteLine($"[Sample Code Testing] [{filename}] {status}");
19+
//}
2020

21-
public static void Run()
22-
{
23-
try
24-
{
21+
//public static void Run()
22+
//{
23+
// try
24+
// {
2525
// Setting up Merchant Config
26-
var merchantConfig = new MerchantConfig
27-
{
28-
RequestTarget = RequestTarget,
29-
RequestType = Enumerations.RequestType.DELETE.ToString()
30-
};
26+
//var merchantConfig = new MerchantConfig
27+
//{
28+
// RequestTarget = RequestTarget,
29+
// RequestType = Enumerations.RequestType.DELETE.ToString()
30+
//};
3131

3232
// Call to the Controller of API_SDK
33-
var apiController = new APIController(merchantConfig);
34-
var response = apiController.DeletePayment();
33+
//var apiController = new APIController(merchantConfig);
34+
//var response = apiController.DeletePayment();
3535

3636
// printing the response details
37-
if (response != null)
38-
{
39-
Console.WriteLine("\n v-c-correlation-id:{0}", response.GetResponseHeaderValue(response.Headers, "v-c-correlation-id"));
40-
Console.WriteLine("\n Response Code:{0}", response.StatusCode);
41-
Console.WriteLine("\n Response Message:{0}", response.Data);
42-
if (response.StatusCode == 200 || response.StatusCode == 404)
43-
{
44-
WriteLogAudit(200);
45-
}
46-
else
47-
{
48-
WriteLogAudit(response.StatusCode);
49-
}
50-
}
51-
}
52-
catch (Exception e)
53-
{
54-
Console.WriteLine(e.Message);
55-
Console.WriteLine(e.StackTrace);
56-
}
57-
}
58-
}
59-
}
37+
// if (response != null)
38+
// {
39+
// Console.WriteLine("\n v-c-correlation-id:{0}", response.GetResponseHeaderValue(response.Headers, "v-c-correlation-id"));
40+
// Console.WriteLine("\n Response Code:{0}", response.StatusCode);
41+
// Console.WriteLine("\n Response Message:{0}", response.Data);
42+
// if (response.StatusCode == 200 || response.StatusCode == 404)
43+
// {
44+
// WriteLogAudit(200);
45+
// }
46+
// else
47+
// {
48+
// WriteLogAudit(response.StatusCode);
49+
// }
50+
// }
51+
// }
52+
// catch (Exception e)
53+
// {
54+
// Console.WriteLine(e.Message);
55+
// Console.WriteLine(e.StackTrace);
56+
// }
57+
// }
58+
// }
59+
//}
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
using System;
2-
using ApiSdk.controller;
3-
using AuthenticationSdk.core;
4-
using AuthenticationSdk.util;
1+
//using System;
2+
//using ApiSdk.controller;
3+
//using AuthenticationSdk.core;
4+
//using AuthenticationSdk.util;
55

6-
namespace Cybersource_rest_samples_dotnet.Samples.Authentication
7-
{
8-
public class GetMethod
9-
{
6+
//namespace Cybersource_rest_samples_dotnet.Samples.Authentication
7+
//{
8+
// public class GetMethod
9+
// {
1010
// GET request to retrieve the payment details of the provided Payment ID
1111
// Below Request fetches the payment details of payment ID: 5319754772076048103525
12-
private const string RequestTarget = "/pts/v2/payments/5526383152166546003003";
12+
// private const string RequestTarget = "/pts/v2/payments/5526383152166546003003";
1313

14-
public static void WriteLogAudit(int status)
15-
{
16-
var filePath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString().Split('.');
17-
var filename = filePath[filePath.Length - 1];
18-
Console.WriteLine($"[Sample Code Testing] [{filename}] {status}");
19-
}
14+
//public static void WriteLogAudit(int status)
15+
//{
16+
// var filePath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString().Split('.');
17+
// var filename = filePath[filePath.Length - 1];
18+
// Console.WriteLine($"[Sample Code Testing] [{filename}] {status}");
19+
//}
2020

21-
public static void Run()
22-
{
23-
try
24-
{
21+
//public static void Run()
22+
//{
23+
// try
24+
// {
2525
// Setting up Merchant Config
26-
var merchantConfig = new MerchantConfig
27-
{
28-
RequestTarget = RequestTarget,
29-
RequestType = Enumerations.RequestType.GET.ToString()
30-
};
26+
//var merchantConfig = new MerchantConfig
27+
//{
28+
// RequestTarget = RequestTarget,
29+
// RequestType = Enumerations.RequestType.GET.ToString()
30+
//};
3131

3232
// Call to the Controller of API_SDK
33-
var apiController = new APIController(merchantConfig);
34-
var response = apiController.GetPayment();
33+
//var apiController = new APIController(merchantConfig);
34+
//var response = apiController.GetPayment();
3535

3636
// printing the response details
37-
if (response != null)
38-
{
39-
Console.WriteLine("\n v-c-correlation-id:{0}", response.GetResponseHeaderValue(response.Headers, "v-c-correlation-id"));
40-
Console.WriteLine("\n Response Code:{0}", response.StatusCode);
41-
Console.WriteLine("\n Response Message:{0}", response.Data);
42-
WriteLogAudit(response.StatusCode);
43-
}
44-
}
45-
catch (Exception e)
46-
{
47-
Console.WriteLine(e.Message);
48-
Console.WriteLine(e.StackTrace);
49-
}
50-
}
51-
}
52-
}
37+
// if (response != null)
38+
// {
39+
// Console.WriteLine("\n v-c-correlation-id:{0}", response.GetResponseHeaderValue(response.Headers, "v-c-correlation-id"));
40+
// Console.WriteLine("\n Response Code:{0}", response.StatusCode);
41+
// Console.WriteLine("\n Response Message:{0}", response.Data);
42+
// WriteLogAudit(response.StatusCode);
43+
// }
44+
// }
45+
// catch (Exception e)
46+
// {
47+
// Console.WriteLine(e.Message);
48+
// Console.WriteLine(e.StackTrace);
49+
// }
50+
// }
51+
// }
52+
//}
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
using System;
2-
using ApiSdk.controller;
3-
using AuthenticationSdk.core;
4-
using AuthenticationSdk.util;
5-
using SampleCode.data;
1+
//using System;
2+
//using ApiSdk.controller;
3+
//using AuthenticationSdk.core;
4+
//using AuthenticationSdk.util;
5+
//using SampleCode.data;
66

7-
namespace Cybersource_rest_samples_dotnet.Samples.Authentication
8-
{
9-
public class GetObjectMethod
10-
{
7+
//namespace Cybersource_rest_samples_dotnet.Samples.Authentication
8+
//{
9+
// public class GetObjectMethod
10+
// {
1111
// GET request to retrieve the payment details of the provided Payment ID
1212
// Below Request fetches the payment details of payment ID: 5319754772076048103525
13-
private const string RequestTarget = "/pts/v2/payments/5526478103126428303006";
13+
//private const string RequestTarget = "/pts/v2/payments/5526478103126428303006";
1414

15-
public static void WriteLogAudit(int status)
16-
{
17-
var filePath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString().Split('.');
18-
var filename = filePath[filePath.Length - 1];
19-
Console.WriteLine($"[Sample Code Testing] [{filename}] {status}");
20-
}
15+
//public static void WriteLogAudit(int status)
16+
//{
17+
// var filePath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString().Split('.');
18+
// var filename = filePath[filePath.Length - 1];
19+
// Console.WriteLine($"[Sample Code Testing] [{filename}] {status}");
20+
//}
2121

22-
public static void Run()
23-
{
24-
try
25-
{
22+
//public static void Run()
23+
//{
24+
// try
25+
// {
2626
// Creating a dictionary object which contains the merchant configuration
27-
var config = new Configuration();
27+
// var config = new Configuration();
2828

2929
// Passing the dictionary object to the Merchant Config Constructor to bypass the config set up via App.Config File
30-
var merchantConfig = new MerchantConfig(config.GetConfiguration())
31-
{
32-
RequestTarget = RequestTarget,
33-
RequestType = Enumerations.RequestType.GET.ToString()
34-
};
30+
//var merchantConfig = new MerchantConfig(config.GetConfiguration())
31+
//{
32+
// RequestTarget = RequestTarget,
33+
// RequestType = Enumerations.RequestType.GET.ToString()
34+
//};
3535

3636
// Call to the Controller of API_SDK
37-
var apiController = new APIController(merchantConfig);
38-
var response = apiController.GetPayment();
37+
//var apiController = new APIController(merchantConfig);
38+
//var response = apiController.GetPayment();
3939

4040
// printing the response details
41-
if (response != null)
42-
{
43-
Console.WriteLine("\n v-c-correlation-id:{0}", response.GetResponseHeaderValue(response.Headers, "v-c-correlation-id"));
44-
Console.WriteLine("\n Response Code:{0}", response.StatusCode);
45-
Console.WriteLine("\n Response Message:{0}", response.Data);
46-
WriteLogAudit(response.StatusCode);
47-
}
48-
}
49-
catch (Exception e)
50-
{
51-
Console.WriteLine(e.Message);
52-
Console.WriteLine(e.StackTrace);
53-
}
54-
}
55-
}
56-
}
41+
// if (response != null)
42+
// {
43+
// Console.WriteLine("\n v-c-correlation-id:{0}", response.GetResponseHeaderValue(response.Headers, "v-c-correlation-id"));
44+
// Console.WriteLine("\n Response Code:{0}", response.StatusCode);
45+
// Console.WriteLine("\n Response Message:{0}", response.Data);
46+
// WriteLogAudit(response.StatusCode);
47+
// }
48+
// }
49+
// catch (Exception e)
50+
// {
51+
// Console.WriteLine(e.Message);
52+
// Console.WriteLine(e.StackTrace);
53+
// }
54+
// }
55+
// }
56+
//}

0 commit comments

Comments
 (0)