コード例 #1
0
        public void GetEndpoint()
        {
            credential = credentialMngr.GetCredentials(ConfigManager.Instance.GetProperties(), Constants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(ConfigManager.Instance.GetProperties(), defaultSoapHandler, credential);
            string endpoint = soapHandler.GetEndpoint();

            Assert.AreEqual(Constants.APIEndpointNVP, endpoint);
        }
コード例 #2
0
        public void GetEndpointForDefaultModeWithoutEndpoint()
        {
            Dictionary <string, string> config = new Dictionary <string, string>(accountConfig);

            credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);

            soapHandler.GetEndpoint();
        }
コード例 #3
0
        public void GetEndpointForLiveMode()
        {
            Dictionary <string, string> config = new Dictionary <string, string>(accountConfig);

            config.Add(BaseConstants.ApplicationModeConfig, BaseConstants.SandboxMode);

            credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);

            Assert.AreEqual(BaseConstants.MerchantCertificateSandboxEndpoint, soapHandler.GetEndpoint());

            credential  = credentialMngr.GetCredentials(config, Constants.APIUserName);
            soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            Assert.AreEqual(BaseConstants.MerchantSignatureSandboxEndpoint, soapHandler.GetEndpoint());
        }
コード例 #4
0
        public void GetEndpointForDefaultModeWithExplicitEndpoint()
        {
            Dictionary <string, string> config = new Dictionary <string, string>(accountConfig);

            config.Add(BaseConstants.EndpointConfig, Constants.APIEndpointNVP);

            credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);

            Assert.AreEqual(Constants.APIEndpointNVP, soapHandler.GetEndpoint());

            config.Add("PayPalAPI", Constants.APIEndpointSOAP);
            credential           = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            soapHandler          = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            soapHandler.PortName = "PayPalAPI";
            Assert.AreEqual(Constants.APIEndpointSOAP, soapHandler.GetEndpoint());
        }
コード例 #5
0
        public void GetEndpointForSandboxMode()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.ApplicationModeConfig, BaseConstants.LiveMode);

            credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            Assert.AreEqual(BaseConstants.MerchantCertificateLiveEndpoint, soapHandler.GetEndpoint());

            credential = credentialMngr.GetCredentials(config, Constants.APIUserName);
            soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            Assert.AreEqual(BaseConstants.MerchantSignatureLiveEndpoint, soapHandler.GetEndpoint());
        }
コード例 #6
0
        public void GetEndpointForDefaultModeWithoutEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);

            credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            soapHandler.GetEndpoint();
        }
コード例 #7
0
        public void GetEndpointForDefaultModeWithExplicitEndpoint()
        {
            Dictionary<string, string> config = new Dictionary<string, string>(accountConfig);
            config.Add(BaseConstants.EndpointConfig, Constants.APIEndpointNVP);

            credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            Assert.AreEqual(Constants.APIEndpointNVP, soapHandler.GetEndpoint());

            config.Add("PayPalAPI", Constants.APIEndpointSOAP);
            credential = credentialMngr.GetCredentials(config, Constants.CertificateAPIUserName);
            soapHandler = new MerchantAPICallPreHandler(config, defaultSoapHandler, credential);
            soapHandler.PortName = "PayPalAPI";
            Assert.AreEqual(Constants.APIEndpointSOAP, soapHandler.GetEndpoint());
        }
コード例 #8
0
 public void GetEndpoint()
 {
     credential = credentialMngr.GetCredentials(ConfigManager.Instance.GetProperties(), Constants.CertificateAPIUserName);
     MerchantAPICallPreHandler soapHandler = new MerchantAPICallPreHandler(ConfigManager.Instance.GetProperties(), defaultSoapHandler, credential);
     string endpoint = soapHandler.GetEndpoint();
     Assert.AreEqual(Constants.APIEndpointNVP, endpoint);
 }