You are here

public static function Braintree_Configuration::serverName in Commerce Braintree 7

returns gateway server name depending on environment

@access public @static

Parameters

none:

Return value

string server domain name

2 calls to Braintree_Configuration::serverName()
Braintree_Configuration::baseUrl in braintree_php/lib/Braintree/Configuration.php
returns the base braintree gateway URL based on config values
Braintree_ConfigurationTest::testServerName in braintree_php/tests/unit/ConfigurationTest.php

File

braintree_php/lib/Braintree/Configuration.php, line 288

Class

Braintree_Configuration
acts as a registry for config data.

Code

public static function serverName() {
  switch (self::environment()) {
    case 'production':
      $serverName = 'www.braintreegateway.com';
      break;
    case 'qa':
      $serverName = 'qa.braintreegateway.com';
      break;
    case 'sandbox':
      $serverName = 'sandbox.braintreegateway.com';
      break;
    case 'development':
    default:
      $serverName = 'localhost';
      break;
  }
  return $serverName;
}