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); }
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(); }
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()); }
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()); }