Skip to content

Online Payments

The Finix Android SDK lets you securely collect card and bank account details in your Android app using pre-built Jetpack Compose payment forms. Payment data is tokenized before it reaches your application, keeping sensitive card data out of your code and ensuring PCI compliance.

Tokens are created in Finix's vault and returned to your app. Use the token immediately to create a Payment Instrument via the Finix API.

Token Expiration

Tokens expire 30 minutes after creation. Create a Payment Instrument as soon as you receive the token.

Installing the Library

The library is available on Maven Central. Add it to your build.gradle:

buildscript {
    ext.finix_version = '0.4.1'
}

dependencies {
    implementation "com.finix:finix-android-payment-sheet:$finix_version"
}

Your project must be configured for Jetpack Compose:

android {
    compileSdk 36
    defaultConfig {
        minSdk 24
        targetSdk 36
    }
    kotlinOptions {
        jvmTarget = 11
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion '1.5.15'
    }
}

System Requirements

RequirementValue
minSdk24
targetSdk36
compileSdk36
Kotlin2.3.0
Kotlin Compiler Extension1.5.15
Material31.4.0
JVM target11
Kotlin Compatibility

Consult the Compose to Kotlin Compatibility Map if you need to match a specific Kotlin version.

Quick Start

Render a payment sheet, handle the token response, and dismiss the sheet on any user action.

@Composable
fun CheckoutScreen() {
    val viewModel = viewModel<CheckOutViewModel>()
    val state = viewModel.state

    if (state.showPaymentSheet) {
        CompletePaymentSheetOutlined(
            applicationId = "YOUR_APPLICATION_ID",
            isSandbox = true, // set to false for production
            onDismiss = { viewModel.setShowPaymentSheet(false) },
            onNegativeClick = { viewModel.setShowPaymentSheet(false) },
            onPositiveClick = { token ->
                // token.id — use this to create a Payment Instrument via the Finix API
                viewModel.saveTokenResponse(token)
                viewModel.setShowPaymentSheet(false)
            }
        )
    }
}