provideOkHttpClient

fun provideOkHttpClient(httpLoggingInterceptor: ERROR CLASS: Symbol not found for HttpLoggingInterceptor, credentialProvider: ERROR CLASS: Symbol not found for CredentialProvider, tokenAuthenticator: TokenAuthenticator, config: ERROR CLASS: Symbol not found for ApiConfig): ERROR CLASS: Symbol not found for OkHttpClient

Provides the singleton OkHttpClient wired with (in chain order):

  • BasicAuthenticationInterceptor (adds Basic Auth when no access token is present)

  • AccessTokenInterceptor (adds Bearer token when one is available)

  • EnvironmentInterceptor (adds the X-Target-Environment header, except on auth-bootstrap endpoints)

  • CallbackUrlInterceptor (adds the X-Callback-Url header to transaction-initiation POSTs when a callback URL is configured)

  • Logging interceptor (debug builds only; added last so it logs the fully-assembled request, including the Authorization header attached by the interceptors above)

  • TokenAuthenticator (refreshes the token automatically on 401)