Getnet DocsGetnet Docs

Override SDK Screens

This guide shows how to replace the appearance of an SDK screen while preserving its behavior (Level 3 — see Customization model).

How it works

You provide the UI (a Composable); the SDK provides the current ViewState (the data and state to present) and the onEvent channel (to report user interactions back to the SDK). The SDK builds its own default screen from those same artifacts, so your screen reproduces the correct presentation and returns the required interactions.

interface SdkRoute
interface SdkRouteContract<S : ViewState, E : ViewEvent> : SdkRoute
typealias OverrideScreenTyped<S, E> = @Composable (viewState: S, onEvent: (E) -> Unit) -> Unit

Routes without a typed contract (such as the internal warm-up loading screen) cannot be overridden. Overrides are registered in SdkUiNavigationConfig.overrideScreens.

Override a screen

import com.pagonxt.sdk.brazil.uxal.navigation.BrSdkRoutes
import com.pagonxt.sdk.core.uxal.navigation.SdkUiNavigationConfig
import com.pagonxt.sdk.core.uxal.navigation.overrideScreen

val config = SdkUiNavigationConfig(
    overrideScreens = mapOf(
        overrideScreen(BrSdkRoutes.Amount) { viewState, onEvent ->
            CustomAmountScreen(
                amountFormatted = viewState.amountFormatted,
                onAmountChanged = { onEvent(BrAmountViewEvent.OnAmountChanged(it)) },
                onConfirm = { onEvent(BrAmountViewEvent.OnContinueClicked) },
            )
        }
    )
)

ApoloSdk.Builder(applicationContext)
    // ...
    .customizeNavigationConfig(config)
    .build()

You can override several screens in the same configuration, and apply it at build or at runtime with Apolo.customizeNavigation(config) (see Insert screens with Slots).

Overridable routes

RouteScreenViewStateViewEvent
AmountAmount entryBrAmountViewStateBrAmountViewEvent
ProductSelectionMethod selection (credit/debit/voucher/Pix)BrProductSelectionViewStateBrProductSelectionViewEvent
InstallmentSelectionInstallment selectionBrInstallmentSelectionViewStateBrInstallmentSelectionViewEvent
CardReadingEMV reading / “insert, tap, or swipe” promptBrCardReadingViewStateBrCardReadingViewEvent
CardSelectionApplication selection (multi-app EMV)BrCardSelectionViewStateBrCardSelectionViewEvent
ProcessingAuthorization in progressBrProcessingViewState—
PaymentSuccessCard sale successBrPaymentSuccessViewStateBrPaymentSuccessViewEvent
PaymentErrorCard sale errorBrPaymentErrorViewStateBrPaymentErrorViewEvent
PixQrCodeLoadingPix QR loadingPixQrCodeLoadingViewStatePixQrCodeLoadingViewEvent
PixQrCodeQR Code displayPixQrCodeViewStatePixQrCodeViewEvent
PixPaymentRecognitionRecognition (30s window)PixPaymentRecognitionViewStatePixPaymentRecognitionViewEvent
PixPaymentVerificationFinal verification (10s window)PixPaymentVerificationViewStatePixPaymentVerificationViewEvent
PixPaymentSuccessPix successPixPaymentSuccessViewStatePixPaymentSuccessViewEvent
PixPaymentErrorPix errorPixPaymentErrorViewStatePixPaymentErrorViewEvent
CancelInputRefund entryBrCancelInputViewStateBrCancelInputViewEvent
SearchTransactionLookup of the transaction to refundBrSearchTransactionViewStateBrSearchTransactionViewEvent
CancelPaymentRefund confirmationBrCancelPaymentViewStateBrCancelPaymentViewEvent
CancelPaymentProcessingRefund processingBrCancelPaymentProcessingViewState—
CancelPaymentSuccessRefund successBrCancelPaymentSuccessViewStateBrCancelPaymentSuccessViewEvent
CancelPaymentErrorRefund errorBrCancelPaymentErrorViewStateBrCancelPaymentErrorViewEvent

Next steps