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

Link copied to clipboard
fun getAuthentication(retrofit: ERROR CLASS: Symbol not found for Retrofit): ERROR CLASS: Symbol not found for AuthenticationService

Provides the AuthenticationService Retrofit service for token and API-user endpoints.

Link copied to clipboard
fun getCollection(retrofit: ERROR CLASS: Symbol not found for Retrofit): ERROR CLASS: Symbol not found for CollectionService

Provides the CollectionService Retrofit service for Collection product endpoints.

Link copied to clipboard
fun getCommonService(retrofit: ERROR CLASS: Symbol not found for Retrofit): ERROR CLASS: Symbol not found for CommonService

Provides the CommonService Retrofit service for cross-product endpoints (balance, account status, etc.).

Link copied to clipboard
fun getDisbursement(retrofit: ERROR CLASS: Symbol not found for Retrofit): ERROR CLASS: Symbol not found for DisbursementsService

Provides the DisbursementsService Retrofit service for Disbursement product endpoints.

Link copied to clipboard
fun getRemittance(retrofit: ERROR CLASS: Symbol not found for Retrofit): ERROR CLASS: Symbol not found for RemittanceService

Provides the RemittanceService Retrofit service for Remittance product endpoints (cash transfer V2).

Link copied to clipboard
fun provideJson(): ERROR CLASS: Symbol not found for Json

Provides the Json instance used by the Retrofit converter factory; unknown keys are ignored.

Link copied to clipboard
fun provideMomoCredentialProvider(storage: ERROR CLASS: Symbol not found for CredentialStorage, sampleConfig: ERROR CLASS: Symbol not found for SampleConfig): ERROR CLASS: Symbol not found for CredentialProvider

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.

Link copied to clipboard
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:

Link copied to clipboard
fun provideRetrofit(okHttpClient: ERROR CLASS: Symbol not found for OkHttpClient, json: ERROR CLASS: Symbol not found for Json, config: ERROR CLASS: Symbol not found for ApiConfig): ERROR CLASS: Symbol not found for Retrofit

Provides the shared Retrofit instance used by all product-specific service factories.

Link copied to clipboard
fun providesHttpLoggingInterceptor(): ERROR CLASS: Symbol not found for HttpLoggingInterceptor

Provides the HTTP logging interceptor configured to log full request and response bodies.

Link copied to clipboard
fun provideTokenAuthenticator(storage: ERROR CLASS: Symbol not found for CredentialStorage, authService: ERROR CLASS: Symbol not found for AuthenticationService, config: ERROR CLASS: Symbol not found for ApiConfig): TokenAuthenticator

Provides the TokenAuthenticator that refreshes the Bearer access token whenever a 401 is received from a protected endpoint.

Link copied to clipboard
fun provideTokenRefreshAuthenticationService(config: ERROR CLASS: Symbol not found for ApiConfig, storage: ERROR CLASS: Symbol not found for CredentialStorage, json: ERROR CLASS: Symbol not found for Json): ERROR CLASS: Symbol not found for AuthenticationService

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).