added getDomain
Showing
1 changed file
with
13 additions
and
1 deletions
| ... | @@ -164,13 +164,25 @@ abstract class ImmoScoutAPI extends GuzzleClient | ... | @@ -164,13 +164,25 @@ abstract class ImmoScoutAPI extends GuzzleClient |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | /** | 166 | /** |
| 167 | * get is24 domain depending on the sandbox. | ||
| 168 | * | ||
| 169 | * @return string base url | ||
| 170 | */ | ||
| 171 | public function getDomain() | ||
| 172 | { | ||
| 173 | return $this->isSandbox ? 'sandbox-immobilienscout24.de' : 'immobilienscout24.de'; | ||
| 174 | } | ||
| 175 | |||
| 176 | /** | ||
| 167 | * get base api url depending on the sandbox. | 177 | * get base api url depending on the sandbox. |
| 168 | * | 178 | * |
| 169 | * @return string base url | 179 | * @return string base url |
| 170 | */ | 180 | */ |
| 171 | private function getBaseUrl() | 181 | private function getBaseUrl() |
| 172 | { | 182 | { |
| 173 | return $this->isSandbox ? 'https://rest.sandbox-immobilienscout24.de/restapi/' : 'https://rest.immobilienscout24.de/restapi/'; | 183 | $domain = $this->getDomain(); |
| 184 | |||
| 185 | return 'https://rest.' . $domain . '/restapi/'; | ||
| 174 | } | 186 | } |
| 175 | 187 | ||
| 176 | /** | 188 | /** | ... | ... |
-
Please register or sign in to post a comment