Ejemplo n.º 1
0
        public void BaseMerchantURL_ReturnsProductionURL()
        {
            BraintreeService service = new BraintreeService(new Configuration(
                Environment.PRODUCTION,
                "integration_merchant_id",
                "integration_public_key",
                "integration_private_key"
            ));

            Assert.AreEqual("https://www.braintreegateway.com:443/merchants/integration_merchant_id", service.BaseMerchantURL());
        }
Ejemplo n.º 2
0
        public void BaseMerchantURL_ReturnsSandboxURL()
        {
            BraintreeService service = new BraintreeService(new Configuration(
                Environment.SANDBOX,
                "integration_merchant_id",
                "integration_public_key",
                "integration_private_key"
            ));

            Assert.AreEqual("https://sandbox.braintreegateway.com:443/merchants/integration_merchant_id", service.BaseMerchantURL());
        }
Ejemplo n.º 3
0
        public void BaseMerchantURL_ReturnsDevelopmentURL()
        {
            BraintreeService service = new BraintreeService(new Configuration(
                Environment.DEVELOPMENT,
                "integration_merchant_id",
                "integration_public_key",
                "integration_private_key"
            ));

            var host = System.Environment.GetEnvironmentVariable("GATEWAY_HOST") ?? "localhost";
            var port = System.Environment.GetEnvironmentVariable("GATEWAY_PORT") ?? "3000";
            var expected = String.Format("http://{0}:{1}/merchants/integration_merchant_id", host, port);

            Assert.AreEqual(expected, service.BaseMerchantURL());
        }
 public virtual string TransparentRedirectURLForCreate()
 {
     return(service.BaseMerchantURL() + "/transactions/all/create_via_transparent_redirect_request");
 }
        public void Constructor_RaisesDownForMaintenanceExceptionIfDownForMaintenance()
        {
            BraintreeGateway gateway = new BraintreeGateway()
            {
                Environment = Environment.DEVELOPMENT,
                MerchantId = "integration_merchant_id",
                PublicKey = "integration_public_key",
                PrivateKey = "integration_private_key"
            };
            BraintreeService service = new BraintreeService(gateway.Configuration);

            try {
                CustomerRequest trParams = new CustomerRequest();
                CustomerRequest request = new CustomerRequest
                {
                    FirstName = "John",
                    LastName = "Doe"
                };

                String queryString = TestHelper.QueryStringForTR(trParams, request, service.BaseMerchantURL() + "/test/maintenance", service);
                gateway.Customer.ConfirmTransparentRedirect(queryString);
                Assert.Fail("Expected DownForMaintenanceException");
            } catch (Braintree.Exceptions.DownForMaintenanceException) {
                // expected
            }
        }
Ejemplo n.º 6
0
 public virtual String TransparentRedirectURLForCreate()
 {
     return(Service.BaseMerchantURL() + "/payment_methods/all/create_via_transparent_redirect_request");
 }
        public void ConfigurationWithStringEnvironment_Initializes()
        {
            Configuration config = new Configuration(
                "development",
                "integration_merchant_id",
                "integration_public_key",
                "integration_private_key"
            );
            BraintreeService service = new BraintreeService(config);

            var host = System.Environment.GetEnvironmentVariable("GATEWAY_HOST") ?? "localhost";
            var port = System.Environment.GetEnvironmentVariable("GATEWAY_PORT") ?? "3000";
            var expected = string.Format("http://{0}:{1}/merchants/integration_merchant_id", host, port);

            Assert.AreEqual(expected, service.BaseMerchantURL());
        }