1313 */
1414abstract class AbstractNetAcuityDatabase implements NetAcuityDatabaseInterface
1515{
16+ /**
17+ * @var string
18+ * @internal
19+ */
20+ const DEFAULT_NETACUITY_BASE_URL = 'https://usa.cloud.netacuity.com/webservice/query ' ;
21+
1622 /**
1723 * @var ClientInterface The GuzzleHttp Client.
1824 */
@@ -23,6 +29,11 @@ abstract class AbstractNetAcuityDatabase implements NetAcuityDatabaseInterface
2329 */
2430 protected $ translations ;
2531
32+ /**
33+ * @var string
34+ */
35+ protected $ netacuityBaseUrl ;
36+
2637 /**
2738 * @var string The API User Token.
2839 */
@@ -36,15 +47,18 @@ abstract class AbstractNetAcuityDatabase implements NetAcuityDatabaseInterface
3647 /**
3748 * AbstractNetAcuityDatabase constructor.
3849 *
39- * @param ClientInterface $client The injected GuzzleHttp Client.
40- * @param string $apiUserToken The Net Acuity API User Token.
50+ * @param ClientInterface $client The injected GuzzleHttp Client.
51+ * @param string $apiUserToken The Net Acuity API User Token.
52+ * @param string $netacuityBaseUrl The base url for the netacuity webservice.
4153 */
4254 public function __construct (
4355 ClientInterface $ client ,
44- string $ apiUserToken
56+ string $ apiUserToken ,
57+ string $ netacuityBaseUrl
4558 ) {
4659 $ this ->client = $ client ;
4760 $ this ->apiUserToken = $ apiUserToken ;
61+ $ this ->netacuityBaseUrl = $ netacuityBaseUrl ;
4862 }
4963
5064 /**
@@ -117,7 +131,6 @@ protected function parseBody(array $response)
117131 */
118132 protected function buildQuery (string $ userToken , string $ ip ): string
119133 {
120- $ baseUrl = 'https://usa.cloud.netacuity.com/webservice/query ' ;
121- return "{$ baseUrl }?u= {$ userToken }&dbs= {$ this ->databaseIdentifier }&ip= {$ ip }&json=true " ;
134+ return "{$ this ->netacuityBaseUrl }?u= {$ userToken }&dbs= {$ this ->databaseIdentifier }&ip= {$ ip }&json=true " ;
122135 }
123136}
0 commit comments