braintree
Version:
A library for integrating with Braintree.
45 lines (33 loc) • 1.12 kB
JavaScript
//@ sourceMappingURL=environment.map
// Generated by CoffeeScript 1.6.1
var Environment;
Environment = (function() {
var DEVELOPMENT_PORT;
DEVELOPMENT_PORT = process.env['GATEWAY_PORT'] || '3000';
Environment.Development = new Environment('localhost', DEVELOPMENT_PORT, "http://auth.venmo.dev:9292", false);
Environment.Sandbox = new Environment('api.sandbox.braintreegateway.com', '443', "https://auth.sandbox.venmo.com", true);
Environment.Production = new Environment('api.braintreegateway.com', '443', "https://auth.venmo.com", true);
function Environment(server, port, authUrl, ssl) {
this.server = server;
this.port = port;
this.authUrl = authUrl;
this.ssl = ssl;
}
Environment.prototype.baseUrl = function() {
var url;
url = this.uriScheme() + this.server;
if (this === Environment.Development) {
url += ":" + this.port;
}
return url;
};
Environment.prototype.uriScheme = function() {
if (this.ssl) {
return "https://";
} else {
return "http://";
}
};
return Environment;
})();
exports.Environment = Environment;