/**
  * Sets the API key to be used for requests.
  *
  * @param string $apiKey
  */
 public static function setApiKey($apiKey)
 {
     self::$apiKey = $apiKey;
     if (substr($apiKey, 0, 7) == 'testing') {
         self::$apiBase = self::$testingApiBase;
     } else {
         if (substr($apiKey, 0, 7) == 'staging') {
             self::$apiBase = self::$sandboxApiBase;
         } else {
             if (substr($apiKey, 0, 3) == 'dev') {
                 self::$apiBase = self::$devApiBase;
             } else {
                 if (substr($apiKey, 0, 7) == 'sandbox') {
                     self::$apiBase = self::$sandboxApiBase;
                 }
             }
         }
     }
 }