当前位置: 首页>>代码示例>>C#>>正文


C# BraintreeService.BaseMerchantURL方法代码示例

本文整理汇总了C#中Braintree.BraintreeService.BaseMerchantURL方法的典型用法代码示例。如果您正苦于以下问题:C# BraintreeService.BaseMerchantURL方法的具体用法?C# BraintreeService.BaseMerchantURL怎么用?C# BraintreeService.BaseMerchantURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Braintree.BraintreeService的用法示例。


在下文中一共展示了BraintreeService.BaseMerchantURL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BaseMerchantURL_ReturnsProductionURL

        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());
        }
开发者ID:khorvat,项目名称:braintree_dotnet,代码行数:11,代码来源:ConfigurationTest.cs

示例2: BaseMerchantURL_ReturnsSandboxURL

        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());
        }
开发者ID:khorvat,项目名称:braintree_dotnet,代码行数:11,代码来源:ConfigurationTest.cs

示例3: BaseMerchantURL_ReturnsDevelopmentURL

        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());
        }
开发者ID:khorvat,项目名称:braintree_dotnet,代码行数:15,代码来源:ConfigurationTest.cs

示例4: Constructor_RaisesDownForMaintenanceExceptionIfDownForMaintenance

        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
            }
        }
开发者ID:zxed,项目名称:braintree_dotnet,代码行数:26,代码来源:TransparentRedirectRequestTest.cs

示例5: ConfigurationWithStringEnvironment_Initializes

        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());
        }
开发者ID:Jammyhammy,项目名称:braintree_dotnet,代码行数:16,代码来源:ConfigurationTest.cs


注:本文中的Braintree.BraintreeService.BaseMerchantURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。