/** * Create a service object * * @param string $clientName Moneybird client name (<client>.moneybird.nl) * @param Transport $transport * @param Mapper $mapper * @access public * @throws NotLoggedInException */ public function __construct($clientName, Transport $transport, Mapper $mapper) { $this->transport = $transport; $this->mapper = $mapper; $this->transport->setUserAgent('MoneybirdPhpApi/2.1'); if (!preg_match('/^[a-z0-9_\\-]+$/', $clientName)) { throw new InvalidConfigException('Invalid companyname/clientname'); } $this->baseUri = 'https://' . $clientName . '.moneybird.nl/api/v' . self::API_VERSION; }