Modern, Kotlin-first Android SDK for Openpay: card tokenization, validation, antifraud device sessions and ready-made Jetpack Compose UI — so card data goes straight from the user's device to Openpay and never touches your servers.
Documentation languages: English · Español · Français · Português
- 100% Kotlin, coroutines-first API with a callback flavor for non-coroutine consumers
- Compose-first UI: a complete, themeable card form with live brand
detection, input formatting and full accessibility — plus an
AbstractComposeViewwrapper for XML apps - Card validation: Luhn, brand detection (Visa, Mastercard incl. 2-series, Amex), brand-aware CVV and expiration rules
- Tokenization against the Openpay API for Mexico, Colombia and Peru, sandbox and production
- Antifraud device sessions matching the legacy fingerprint flow
- 4 languages (en, es, pt, fr) with automatic device-locale resolution and a runtime override API
- Clean architecture + Koin in an isolated container that never clashes with the host app
- Tested: JUnit, Mockito and Robolectric with a JaCoCo-enforced 80% minimum line coverage
dependencies {
implementation("mx.dev1.openpay:openpay-sdk:1.0.0")
}Minimum Android version: 8.0 (API 26).
// 1. Configure once
val openpay = Openpay(
OpenpayConfig(
merchantId = "your-merchant-id",
publicApiKey = "pk_your_public_key",
country = OpenpayCountry.MEXICO,
environment = OpenpayEnvironment.SANDBOX,
)
)
// 2. Capture the card with the built-in form and tokenize it
OpenpayCardForm(
onCardValidated = { card ->
scope.launch {
openpay.createToken(card)
.onSuccess { token -> sendToBackend(token.tokenId) }
.onFailure { error -> showError(error) }
}
}
)
// 3. Antifraud device session (send it to your backend with the token)
val deviceSessionId = openpay.setupDeviceSession(activity)A full walkthrough lives in
docs/en/getting-started.md, and the :app
module is a runnable sample of every feature.
| Guide | en | es | fr | pt |
|---|---|---|---|---|
| Getting started | en | es | fr | pt |
| Architecture (with diagrams) | en | es | fr | pt |
| UI components & accessibility | en | es | fr | pt |
| Internationalization | en | es | fr | pt |
| Contributing | en | es | fr | pt |
| Continuous integration | en | es | fr | pt |
openpay-android/
├── openpay-sdk/ # the published library (Maven: mx.dev1.openpay:openpay-sdk)
├── app/ # sample application consuming the SDK
├── docs/ # documentation in en / es / fr / pt
└── gradle/libs.versions.toml # every dependency version, in one place
Pull requests are welcome — the project uses Git Flow (develop as the
integration branch, master as production). Start with
docs/en/contributing.md; it assumes no Android
experience.
Licensed under the Apache License, Version 2.0.