PX.HMRC/PX.HMRC.VATApi.cs
/// <summary>
/// Refresh Access Token if it is need
/// </summary>
Refresh Access Token if it is need
Refresh Access Token if it is need
public void RefreshAccessToken()
        {
            if (token == null)
            {
                throw new Exceptions.VATAPIInvalidToken(Model.error.IMPOSSIBLE_TO_REFRESH_TOKEN);
            }
			if (token.UtcExpiredOn == null || token.UtcExpiredOn?.AddMinutes(-15) < token.UtcNow)
			{
				ApplicationProcessor.RefreshAccessToken(token, application);
                updateOAuthToken(token);
			}
		}
public void RefreshAccessToken ( ) { if ( token == null ) { throw new Exceptions . VATAPIInvalidToken ( Model . error . IMPOSSIBLE_TO_REFRESH_TOKEN ) ; } if ( token . UtcExpiredOn == null || token . UtcExpiredOn ? . AddMinutes ( - 15 ) < token . UtcNow ) { ApplicationProcessor . RefreshAccessToken ( token , application ) ; updateOAuthToken ( token ) ; } }
Refresh Access Token if it is need
Refresh Access Token if it is need