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.
Tokens expire 30 minutes after creation. Create a Payment Instrument as soon as you receive the token.
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'
}
}| Requirement | Value |
|---|---|
minSdk | 24 |
targetSdk | 36 |
compileSdk | 36 |
| Kotlin | 2.3.0 |
| Kotlin Compiler Extension | 1.5.15 |
| Material3 | 1.4.0 |
| JVM target | 11 |
Consult the Compose to Kotlin Compatibility Map if you need to match a specific Kotlin version.
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)
}
)
}
}