GetEndpoint() public method

Returns the endpoint url
public GetEndpoint ( ) : string
return string
コード例 #1
0
        public void GetEndpointForDefaultModeWithoutEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);

            PlatformAPICallPreHandler platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            platformHandler.GetEndpoint();
        }
コード例 #2
0
        public void GetEndpointForSandboxMode()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.ApplicationModeConfig, BaseConstants.LiveMode);

            PlatformAPICallPreHandler platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            Assert.AreEqual(BaseConstants.PlatformLiveEndpoint + "servicename/method", platformHandler.GetEndpoint());
        }
コード例 #3
0
        public void GetEndpointForDefaultModeWithExplicitEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.EndpointConfig, Constants.APIEndpointNVP);

            PlatformAPICallPreHandler platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            Assert.AreEqual(Constants.APIEndpointNVP + "servicename/method", platformHandler.GetEndpoint());

            config.Add("PayPalAPI", Constants.APIEndpointSOAP);
            platformHandler = new PlatformAPICallPreHandler(config, "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
            platformHandler.PortName = "PayPalAPI";
            Assert.AreEqual(Constants.APIEndpointSOAP + "/servicename/method", platformHandler.GetEndpoint());
        }
コード例 #4
0
 public void GetPayloadEndpointWithoutTokenTest()
 {
     platformAPIHandler = new PlatformAPICallPreHandler(ConfigManager.Instance.GetProperties(), "payload", "servicename", "method", Constants.APIUserName, "accessToken", "tokenSecret");
     Assert.AreEqual("https://svcs.sandbox.paypal.com/servicename/method", platformAPIHandler.GetEndpoint());
     Assert.AreEqual("payload", platformAPIHandler.GetPayload());
     SignatureCredential signatureCredential = (SignatureCredential)platformAPIHandler.GetCredential();
     TokenAuthorization thirdAuth = (TokenAuthorization)signatureCredential.ThirdPartyAuthorization;
     Assert.AreEqual("accessToken", thirdAuth.AccessToken);
     Assert.AreEqual("tokenSecret", thirdAuth.AccessTokenSecret);
 }