Getnet DocsGetnet Docs

Initialization Reference

Reference for ApoloSdk.Builder, the credentials and sub-merchant configuration, and the warm-up states. For a walkthrough, see Quick Start.

Builder methods

MethodRequiredDescription
setCredentials(...)YesOnboarding credentials and integrator identifiers. Without them, warm-up fails.
setSubMerchantInformation(config)NoSub-merchant data, forwarded on each payment request. Depends on your business model.
setOnWarmUpStatus(callback)No (recommended)The channel to track warm-up progress and react to failures.
build()—Returns the Apolo client and starts the warm-up. Call it once per application lifecycle.

setCredentials

ParameterTypeRequiredDescription
clientIdStringYesClient identifier for authentication with the payment service.
clientSecretStringYesClient secret associated with the clientId.
terminalCodeStringYesCode of the terminal running the SDK.
partnerNameStringYesName of the integrating application.
partnerPackageNameStringYesAndroid package name of the integrating application. Must match the real package, or authentication fails.

SubMerchantConfig

All fields are required except url. Omitting a required field is a compile-time error.

FieldTypeRequiredDescription
subMerchantIdStringYesSub-merchant identifier.
cityStringYesSub-merchant city.
stateStringYesState (UF).
postalCodeStringYesPostal code (CEP).
taxIdStringYesTax number — CNPJ or CPF.
streetStringYesStreet address.
phoneStringYesContact phone.
corporateNameStringYesLegal name.
urlString?NoDefaults to null.

Warm-up states

setOnWarmUpStatus reports the progress of the warm-up:

StateMeaningRecommended action
LoadingInternal preparation in progress.Keep the UI in a waiting state; do not call SDK operations.
SuccessThe SDK is ready to operate.Release the SDK operations.
Failure(cause)Preparation could not complete.Inspect cause, show a message, and retry.

Lifecycle

SymbolBehavior
ApoloSdk.getClient()Returns the current Apolo client. Throws IllegalStateException if called before a successful build().
ApoloSdk.shutdown()Ends the current session so it can be rebuilt.

To recover from Failure, call shutdown(), then configure and build() again. Do not call build() more than once without a prior shutdown(), and always get the client through getClient() rather than retaining the reference returned by build().

For the warm-up error codes reported through Failure(cause) — network conditions, 401, 404, 422 — see the warm-up section of Error codes reference.