Skip to content

Commit 4357c7d

Browse files
authored
Merge pull request #70 from CyberSource/Nov_2021_Changes
Nov 2021 changes
2 parents aec2053 + b3dce7e commit 4357c7d

21 files changed

+24
-20
lines changed

Source/Resource/jwsToken.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
eyJhbGciOiJSUzI1NiIsInYtYy1tZXJjaGFudC1pZCI6InRlc3RyZXN0IiwieDVjIjpbIk1JSUNYekNDQWNpZ0F3SUJBZ0lXTlRjME5qWTBNalF6TURZNU1ERTNOekV3TnpBME5qQU5CZ2txaGtpRzl3MEJBUXNGQURBZU1Sd3dHZ1lEVlFRRERCTkRlV0psY2xOdmRYSmpaVU5sY25SQmRYUm9NQjRYRFRFNU1URXlOVEEyTkRRd00xb1hEVEl4TVRFeU5UQTJORFF3TTFvd05ERVJNQThHQTFVRUF3d0lkR1Z6ZEhKbGMzUXhIekFkQmdOVkJBVVRGalUzTkRZMk5ESTBNekEyT1RBeE56Y3hNRGN3TkRZd2dnRWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUJEd0F3Z2dFS0FvSUJBUUMrQnRkTWNva2FLd1RlczlPK3NucWpXc2VoTzAvWTRDSnJ3bzRjZEdDYWZSTzZvd3MzbUMxeG1wU1l0dFRLSWRlR1IxcU9ZcFRTZVk5dUpoMmNDZmF5TUtYbWhRZjRkNXY4cE5Ebm1ZQk1HQndVMXdXamxZc01MRmJjUEZXamRQdEtsb3UyUklXWjU2NllXSWJXQ0JmK0c0ZEhrQTBEN0NzcDNGVDNsblVOMm1lNGxKa2x5c2ZxcDFYOHEzSkRxVklRRlZBZHVhbWhXQ1lNUlM1S2c4c0t3TWpsZEdRVWJ5ODhTK01Pd2NDQTNIT0hUNjRiYXJ2UElkMkV4cUFxdmZ5QkNQQVI0OVY2L3l3RFZzSDlTeUhld2cxMjFja01jQTlnNTV0SXFkc3lIR1JaTjlmczIwa015cUVQNzhMNGN4ZmlzdVZRQzhrbmxmWn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yMDIxIDExOjEyOjQ2IEdNVCJ9.FlZyVcIllkpLWPeID8iOiuvypQuSDwRHQbepEWSIrY9GtrV-iSPcxNXK_Clu2Bdq1EsFumYVaN4yc5c05pe0ydLEpDrVhnEiyi-cQLJsfCcjBCAc2r2bMw4W3Ve4TDoQgV9B0eeGcSIxgQjkQnXl2PfTRyQxpPFq2d61noCvBkwRs1VidzAC6Q94AfgX9wbyAPQrQmusv5fYeiG6OdSurTjGdYBrPSle4jFvb9bXrrDEFSbVsCKieywjzy_-9I78YXt2LsNqbFypqtmBtXxNLblajT-OgSSDqKrKo3BWQq9HnHflUOoMh7Oxewo0Y1mGG1RJEyTPtornA-smjanbLw
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
keyid="08c94330-f618-42a3-b09d-e1e43be5efda", algorithm="HmacSHA256", headers="host date (request-target) digest v-c-merchant-id", signature="krGUxk11hI9Hgf3sYwGl4rUt26RKFRRMpw8OhX2aiTg="
1+
keyid="08c94330-f618-42a3-b09d-e1e43be5efda", algorithm="HmacSHA256", headers="host date (request-target) digest v-c-merchant-id", signature="uSkBBjN6ojmxWj1UL+FSPvVz8+IWUwr07iuhwlInxB4="

Source/Samples/Authentication/CallHttpMethods/PostMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class PostMethod
1111
// POST Request to Authorize the payment for a transaction.
1212
// Transaction details provided in the JSON File are sent along with the Request as Request Body
1313
private const string RequestTarget = "/pts/v2/payments/";
14-
private const string RequestJsonFilePath = "Source/Resource/request_payments.json";
14+
private const string RequestJsonFilePath = "../../../Source/Resource/request_payments.json";
1515

1616
public static void Run()
1717
{

Source/Samples/Authentication/CallHttpMethods/PutMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PutMethod
1212
// Report Details provided in the JSON File are sent along with the Request as Request Body
1313
// Below request subscribes 'TRR Report' for Organization ID: testrest
1414
private const string RequestTarget = "/reporting/v2/reportSubscriptions/TRRReport?organizationId=testrest";
15-
private const string RequestJsonFilePath = "Source/Resource/TRRReport.json";
15+
private const string RequestJsonFilePath = "../../../Source/Resource/TRRReport.json";
1616

1717
public static void Run()
1818
{

Source/Samples/Authentication/GenerateHttpRequestHeaders/PostGenerateHeaders.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class PostGenerateHeaders
1010
// POST Request to Authorize the payment for a transaction.
1111
// Transaction details provided in the JSON File are sent along with the Request as Request Body
1212
private const string RequestTarget = "/pts/v2/payments";
13-
private const string RequestJsonFilePath = "Source/Resource/request_payments.json";
13+
private const string RequestJsonFilePath = "../../../Source/Resource/request_payments.json";
1414

1515
public static void Run()
1616
{

Source/Samples/Authentication/GenerateHttpRequestHeaders/PutGenerateHeaders.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class PutGenerateHeaders
1111
// Report Details provided in the JSON File are sent along with the Request as Request Body
1212
// Below request subscribes 'TRR Report' for Organization ID: testrest
1313
private const string RequestTarget = "/reporting/v2/reportSubscriptions/TRRReport?organizationId=testrest";
14-
private const string RequestJsonFilePath = "Source/Resource/TRRReport.json";
14+
private const string RequestJsonFilePath = "../../../Source/Resource/TRRReport.json";
1515

1616
public static void Run()
1717
{

Source/Samples/Authentication/StandAloneHttpSignature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public static StringBuilder GenerateSignature(string request, string digest, str
311311
signatureHeaderValue.Append(", signature=\"" + base64EncodedSignature + "\"");
312312

313313
// Writing Generated Token to file.
314-
File.WriteAllText(@"./Source/Resource/" + "signatureHeaderValue.txt", signatureHeaderValue.ToString());
314+
File.WriteAllText(@"../../../Source/Resource/" + "signatureHeaderValue.txt", signatureHeaderValue.ToString());
315315
}
316316
catch (Exception ex)
317317
{

Source/Samples/Authentication/StandAloneJWT.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public static string GenerateJWT(string request, string method)
181181
Console.WriteLine("\tJWT BODY : " + jwtBody);
182182

183183
// P12 certificate public key is sent in the header and the private key is used to sign the token
184-
X509Certificate2 x5Cert = new X509Certificate2(Path.Combine($"Source/Resource", $"testrest.p12"), merchantID, X509KeyStorageFlags.MachineKeySet);
184+
X509Certificate2 x5Cert = new X509Certificate2(Path.Combine($"../../../Source/Resource", $"testrest.p12"), merchantID, X509KeyStorageFlags.MachineKeySet);
185185

186186
// Extracting Public Key from .p12 file
187187
string x5cPublicKey = Convert.ToBase64String(x5Cert.RawData);
@@ -223,7 +223,7 @@ public static string GenerateJWT(string request, string method)
223223
token = Jose.JWT.Encode(jwtBody, privateKey, Jose.JwsAlgorithm.RS256, cybsHeaders);
224224

225225
// Writing Generated Token to file.
226-
File.WriteAllText(Path.Combine($"Source/Resource", $"jwsToken.txt"), token);
226+
File.WriteAllText(Path.Combine($"../../../Source/Resource", $"jwsToken.txt"), token);
227227
}
228228
catch (Exception ex)
229229
{

Source/Samples/Authentication/StandAloneOAuth.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
using System.Collections.Generic;
33
using CyberSource.Model;
44
using CyberSource.Api;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
85

96
namespace Cybersource_rest_samples_dotnet.Samples.Authentication
107
{

Source/Samples/Reporting/Reports/CreateAdhocReport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public static void Run()
2020
string reportMimeType = "application/xml";
2121
string reportName = "testrest_v2";
2222
string timezone = "GMT";
23-
var reportStartTime = DateTime.Parse("2020-03-01T17:30:00.000+05:30");
24-
var reportEndTime = DateTime.Parse("2020-03-02T17:30:00.000+05:30");
23+
var reportStartTime = DateTime.Parse("2021-03-01T17:30:00.000+05:30");
24+
var reportEndTime = DateTime.Parse("2021-03-02T17:30:00.000+05:30");
2525
bool reportPreferencesSignedAmounts = true;
2626
string reportPreferencesFieldNameConvention = "SOAPI";
2727
Reportingv3reportsReportPreferences reportPreferences = new Reportingv3reportsReportPreferences(

0 commit comments

Comments
 (0)