NetworkModule
Provides network-related dependencies using Dagger Hilt.
Lives in the :app module (not :sample) because com.android.kotlin.multiplatform.library's compile JAR does not include KSP-generated Java factory classes.
Credential storage is handled by CredentialStorage (EncryptedSharedPreferences). Expired tokens are refreshed automatically by TokenAuthenticator on every 401 response.
Functions
Provides the AuthenticationService Retrofit service for token and API-user endpoints.
Provides the CollectionService Retrofit service for Collection product endpoints.
Provides the CommonService Retrofit service for cross-product endpoints (balance, account status, etc.).
Provides the DisbursementsService Retrofit service for Disbursement product endpoints.
Provides the RemittanceService Retrofit service for Remittance product endpoints (cash transfer V2).
Provides the Json instance used by the Retrofit converter factory; unknown keys are ignored.
Provides the app's CredentialProvider that the SDK's interceptors call on every request. Reads credentials from CredentialStorage at request time — the SDK never stores credentials.
Provides the singleton OkHttpClient wired with:
Provides the shared Retrofit instance used by all product-specific service factories.
Provides the HTTP logging interceptor configured to log full request and response bodies.
Provides the TokenAuthenticator that refreshes the Bearer access token whenever a 401 is received from a protected endpoint.
Provides a dedicated AuthenticationService backed by a minimal OkHttpClient that only attaches Basic Auth. Used exclusively by TokenAuthenticator to avoid a circular dependency with the main client (which has the authenticator wired in).