package com.braintreegateway;

import java.util.Arrays;

/**
 * Indicates the environment of the Braintree Gateway with which to interact.
 */
public class Environment {
    /** For Braintree internal development. */
    public static final Environment DEVELOPMENT = new Environment(developmentBaseURL() + ":" + developmentPort(), "http://auth.venmo.dev:9292", new String[] {});

    /** For production. */
    public static final Environment PRODUCTION = new Environment("https://api.braintreegateway.com:443", "https://auth.venmo.com", new String[] {"ssl/api_braintreegateway_com.ca.crt"});

    /** For merchant's to use during their development and testing. */
    public static final Environment SANDBOX = new Environment("https://api.sandbox.braintreegateway.com:443", "https://auth.sandbox.venmo.com", new String[] {"ssl/api_braintreegateway_com.ca.crt"});

    public final String baseURL;
    public final String authURL;
    public final String[] certificateFilenames;

    public Environment(String baseURL, String authURL, String[] certificateFilenames) {
        this.baseURL = baseURL;
        this.authURL = authURL;
        this.certificateFilenames = Arrays.copyOf(certificateFilenames, certificateFilenames.length);
    }

    private static String developmentBaseURL() {
        if (System.getProperty("GATEWAY_BASE_URL") != null) {
            return System.getProperty("GATEWAY_BASE_URL");
        } else {
            return "http://localhost";
        }
    }

    public static String developmentPort() {
        if (System.getProperty("GATEWAY_PORT") != null) {
            return System.getProperty("GATEWAY_PORT");
        } else {
            return "3000";
        }
    }
}

@@ -1301,32 +1301,33 @@
  (System.get
-Property
+env().get
 (%22GATEWAY_BA
@@ -1371,32 +1371,33 @@
 n System.get
-Property
+env().get
 (%22GATEWAY_BA
@@ -1542,32 +1542,33 @@
  (System.get
-Property
+env().get
 (%22GATEWAY_PO
@@ -1616,16 +1616,17 @@
 .get
-Property
+env().get
 (%22GA

Revert "Use getProperty instead of getenv.get."