-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathGetMethod.cs
52 lines (47 loc) · 2.02 KB
/
GetMethod.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//using System;
//using ApiSdk.controller;
//using AuthenticationSdk.core;
//using AuthenticationSdk.util;
//namespace Cybersource_rest_samples_dotnet.Samples.Authentication
//{
// public class GetMethod
// {
// GET request to retrieve the payment details of the provided Payment ID
// Below Request fetches the payment details of payment ID: 5319754772076048103525
// private const string RequestTarget = "/pts/v2/payments/5526383152166546003003";
//public static void WriteLogAudit(int status)
//{
// var filePath = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString().Split('.');
// var filename = filePath[filePath.Length - 1];
// Console.WriteLine($"[Sample Code Testing] [{filename}] {status}");
//}
//public static void Run()
//{
// try
// {
// Setting up Merchant Config
//var merchantConfig = new MerchantConfig
//{
// RequestTarget = RequestTarget,
// RequestType = Enumerations.RequestType.GET.ToString()
//};
// Call to the Controller of API_SDK
//var apiController = new APIController(merchantConfig);
//var response = apiController.GetPayment();
// printing the response details
// if (response != null)
// {
// Console.WriteLine("\n v-c-correlation-id:{0}", response.GetResponseHeaderValue(response.Headers, "v-c-correlation-id"));
// Console.WriteLine("\n Response Code:{0}", response.StatusCode);
// Console.WriteLine("\n Response Message:{0}", response.Data);
// WriteLogAudit(response.StatusCode);
// }
// }
// catch (Exception e)
// {
// Console.WriteLine(e.Message);
// Console.WriteLine(e.StackTrace);
// }
// }
// }
//}