コード例 #1
0
        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());
        }
コード例 #2
0
 public BraintreeGateway(Configuration configuration)
 {
     Configuration = configuration;
 }
コード例 #3
0
 public BraintreeGateway(string clientId, string clientSecret)
 {
     Configuration = new Configuration(clientId, clientSecret);
 }
コード例 #4
0
 public BraintreeGateway(string accessToken)
 {
     Configuration = new Configuration(accessToken);
 }
コード例 #5
0
 public BraintreeGateway(Environment environment, string merchantId, string publicKey, string privateKey)
 {
     Configuration = new Configuration(environment, merchantId, publicKey, privateKey);
 }
コード例 #6
0
 public BraintreeGateway()
 {
     Configuration = new Configuration();
 }
コード例 #7
0
 public BraintreeService(Configuration configuration)
 {
     this.Configuration = configuration;
 }
コード例 #8
0
 public BraintreeGateway(Environment environment)
 {
     configuration = new Configuration(environment);
 }
コード例 #9
0
        public void Proxy_ReturnsProxyConfiguration()
        {
            Configuration configuration = new Configuration(
                Environment.DEVELOPMENT,
                "integration_merchant_id",
                "integration_public_key",
                "integration_private_key"
            );

            configuration.Proxy = "http://localhost:3000";
            BraintreeService service = new BraintreeService(configuration);
            Assert.AreEqual("http://localhost:3000", service.GetProxy());
        }