Change error message for geofence #693

This commit is contained in:
Kendrick Chan 2022-08-05 22:21:49 +08:00
parent 774599a01b
commit 80d4063238

View file

@ -902,7 +902,7 @@ class APIController extends Controller implements LoggedController
{ {
// TODO: put geofence error message in config file somewhere // TODO: put geofence error message in config file somewhere
$res->setError(true) $res->setError(true)
->setErrorMessage('Oops! Our service is limited to some areas in Metro Manila, Laguna, and Baguio only. We will update you as soon as we are able to cover your area'); ->setErrorMessage($this->getGeoErrorMessage());
return $res->getReturnResponse(); return $res->getReturnResponse();
} }
@ -2308,7 +2308,7 @@ class APIController extends Controller implements LoggedController
if (!$is_covered) if (!$is_covered)
{ {
$res->setError(true) $res->setError(true)
->setErrorMessage('Oops! Our service is limited to some areas in Metro Manila, Laguna, and Baguio only. We will update you as soon as we are able to cover your area'); ->setErrorMessage($this->getGeoErrorMessage());
} }
return $res->getReturnResponse(); return $res->getReturnResponse();
@ -2769,7 +2769,7 @@ class APIController extends Controller implements LoggedController
{ {
// TODO: put geofence error message in config file somewhere // TODO: put geofence error message in config file somewhere
$res->setError(true) $res->setError(true)
->setErrorMessage('Oops! Our service is limited to some areas in Metro Manila, Laguna, and Baguio only. We will update you as soon as we are able to cover your area'); ->setErrorMessage($this->getGeoErrorMessage());
return $res->getReturnResponse(); return $res->getReturnResponse();
} }
@ -4708,4 +4708,8 @@ class APIController extends Controller implements LoggedController
{ {
return trim(strtolower($string)); return trim(strtolower($string));
} }
protected function getGeoErrorMessage() {
return 'Oops! Our service is limited to some areas in Metro Manila, Laguna, Cavite, Pampanga and Baguio only. We will update you as soon as we are able to cover your area';
}
} }