You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use omnikassa in our application, and sometimes the sandbox environment is unavailable, the problem is that the error that is send when the service is unavaible doesn't speak for itself. We hava a Warning: Trying to access array offset on value of type null send from the class AccessToken line 48.
Maybe a fix can be to see if the access token contain an error message before creating the access token from the json in the method retrieveNewToken in the class ApiConnector like this:
/** * @return AccessToken */privatefunctionretrieveNewToken()
{
$refreshToken = $this->tokenProvider->getRefreshToken();
$this->restTemplate->setToken($refreshToken);
$accessTokenJson = $this->restTemplate->get('gatekeeper/refresh');
if (str_contains($accessTokenJson, 'Tijdelijk niet beschikbaar')) {
thrownew \HttpException('OmniKassa is temporarily unavailable', 503);
}
return AccessToken::fromJson($accessTokenJson);
}
What do you think?
The text was updated successfully, but these errors were encountered:
Hello,
We use omnikassa in our application, and sometimes the sandbox environment is unavailable, the problem is that the error that is send when the service is unavaible doesn't speak for itself. We hava a
Warning: Trying to access array offset on value of type null
send from the classAccessToken
line 48.Maybe a fix can be to see if the access token contain an error message before creating the access token from the json in the method
retrieveNewToken
in the classApiConnector
like this:What do you think?
The text was updated successfully, but these errors were encountered: