public void TestTotalMinimalExample() { var authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "5e45c937b9db33ae", "I42Zf4pVnRdroHfuHnRiJjJ2B6+22h0yQt/R3nZR8Xg="); IList <RequestHeader> httpHeaders = new List <RequestHeader>(); httpHeaders.Add(new RequestHeader("User-Agent", "Apache-HttpClient/4.3.4 (java 1.5)")); httpHeaders.Add(new RequestHeader("Date", "Fri, 06 Jun 2014 13:39:43 GMT")); string signature = authenticator.CreateSimpleAuthenticationSignature(HttpMethod.Get, new Uri("https://payment.preprod.online-payments.com/v2/1/tokens/123456789"), httpHeaders); Assert.AreEqual("GCS v1HMAC:5e45c937b9db33ae:UpOoo/pmmj7tW03IbEcw2WtJURFCKL2/J6hqMc+1h1I=", signature); }
public void TestTotalFullExample() { var authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "5e45c937b9db33ae", "I42Zf4pVnRdroHfuHnRiJjJ2B6+22h0yQt/R3nZR8Xg="); IList <RequestHeader> httpHeaders = new List <RequestHeader>(); httpHeaders.Add(new RequestHeader("User-Agent", "Apache-HttpClient/4.3.4 (java 1.5)")); httpHeaders.Add(new RequestHeader("X-GCS-ServerMetaInfo", "processed header value")); httpHeaders.Add(new RequestHeader("X-GCS-ClientMetaInfo", "processed header value")); httpHeaders.Add(new RequestHeader("Content-Type", "application/json")); httpHeaders.Add(new RequestHeader("X-GCS-CustomerHeader", "processed header value")); httpHeaders.Add(new RequestHeader("Date", "Fri, 06 Jun 2014 13:39:43 GMT")); string signature = authenticator.CreateSimpleAuthenticationSignature(HttpMethod.Delete, new Uri("https://payment.preprod.online-payments.com/v2/1/tokens/123456789"), httpHeaders); Assert.AreEqual("GCS v1HMAC:5e45c937b9db33ae:TbiTwCCsGsyFFnfWt5Rreg0cGYJeTiofxjuZNSLUuGo=", signature); }