RESTApiCallPreHandler requires a configuration system to function properly. Pass a config Dictionary for dynamic configuration.
Inheritance: IAPICallPreHandler
 public void RESTAPICallPreHandlerEndpointTest()
 {
     Dictionary<string, string> config = new Dictionary<string, string>();
     config.Add("endpoint", "https://localhost.sandbox.paypal.com");
     RESTAPICallPreHandler target = new RESTAPICallPreHandler(config);
     Assert.AreEqual(target.GetEndpoint().EndsWith("/"), true);
 }
 public void RESTAPICallPreHandlerPayloadTest()
 {
     Dictionary<string, string> config = new Dictionary<string, string>();
     config.Add("endpoint", "https://localhost.sandbox.paypal.com");
     RESTAPICallPreHandler target = new RESTAPICallPreHandler(config);
     target.Payload = "{ key : value}";
     Assert.AreEqual(target.Payload, "{ key : value}");
 }
Exemple #3
0
        private static IAPICallPreHandler CreateIAPICallPreHandler(Dictionary <string, string> config, Dictionary <string, string> headersMap, string authorizationToken, string requestId, string payLoad, SDKVersion sdkVersion)
        {
            RESTAPICallPreHandler restAPICallPreHandler = new RESTAPICallPreHandler(config, headersMap);

            restAPICallPreHandler.AuthorizationToken = authorizationToken;
            restAPICallPreHandler.RequestId          = requestId;
            restAPICallPreHandler.Payload            = payLoad;
            return((IAPICallPreHandler)restAPICallPreHandler);
        }