Trustly/Api/api.php
public function setHost($host=NULL, $port=NULL, $is_https=NULL) {
		if(!isset($host)) {
			$host = $this->api_host;
		}

		if(!isset($port)) {
			$port = $this->api_port;
		}

		if($this->loadTrustlyPublicKey($host, $port) === FALSE) {
			$error = openssl_error_string();
			throw new InvalidArgumentException("Cannot load Trustly public key file for host $host".(isset($error)?", error $error":''));
		}

		if(isset($is_https)) {
			$this->api_is_https = $is_https;
		}
	}
public function setHost($host=NULL, $port=NULL, $is_https=NULL) {
		if(!isset($host)) {
			$host = $this->api_host;
		}

		if(!isset($port)) {
			$port = $this->api_port;
		}

		if($this->loadTrustlyPublicKey($host, $port) === FALSE) {
			$error = openssl_error_string();
			throw new InvalidArgumentException("Cannot load Trustly public key file for host $host".(isset($error)?", error $error":''));
		}

		if(isset($is_https)) {
			$this->api_is_https = $is_https;
		}
	}
public function setHost ( $ host = NULL , $ port = NULL , $ is_https = NULL ) { if ( ! isset ( $ host ) ) { $ host = $ this -> api_host ; } if ( ! isset ( $ port ) ) { $ port = $ this -> api_port ; } if ( $ this -> loadTrustlyPublicKey ( $ host , $ port ) === FALSE ) { $ error = openssl_error_string ( ) ; throw new InvalidArgumentException ( "Cannot load Trustly public key file for host $host" . ( isset ( $ error ) ? ", error $error" : '' ) ) ; } if ( isset ( $ is_https ) ) { $ this -> api_is_https = $ is_https ; } }
Update the host settings within the API. Use this method to switch API peer.

@throws InvalidArgumentException If the public key for the API host
cannot be loaded.

@param string $host API host used for communication. Fully qualified
hostname. When integrating with our public API this is typically
either 'test.trustly.com' or 'trustly.com'. NULL means do not change.

@param integer $port Port on API host used for communicaiton. Normally
443 for https, or 80 for http. NULL means do not change.

@param bool $is_https Indicator wether the port on the API host expects
https. NULL means do not change.
Update the host settings within the API . Use this method to switch API peer .