Android (Kotlin)
Integrate Wajub into your native Android app — installation, session creation, and the Jetpack Compose payment sheet.
8 min read
The Android SDK is split into two artifacts: wajub-mobile-core (HTTP client, session, realtime
status — no UI dependency) and wajub-mobile-compose (a Jetpack Compose PaymentSheet). No
WebView is used.
Requirements
minSdk | 24 (Android 7.0) |
compileSdk / targetSdk | 35 |
| JVM target | 17 |
| Kotlin | 2.0.21 |
Install
dependencies {
implementation("co.wajub:wajub-mobile-core:1.0.0")
implementation("co.wajub:wajub-mobile-compose:1.0.0") // Jetpack Compose payment sheet
}Create a session and present the sheet
Your server creates the payment session with the private key and returns an
authorization_token. Your app presents the payment sheet with this token.
val session = WajubMobile.createSession(authorizationToken)
PaymentSheet(
wajubSession = session,
onDismiss = { /* user closed the sheet */ },
onResult = { result -> /* PaymentResult — update the UI */ },
)Confirm server-side
onResult is for updating the UI, not for delivering. Wait for the
payment.succeeded webhook server-side before any delivery.
Headless
For a fully custom UI instead of the built-in Compose sheet, use wajub-mobile-core directly:
val result = session.payCard("card", paymentMethodId = "pm_...")
session.watchStatus().collect { update ->
// realtime status via Pusher/Reverb, with polling fallback
}Related pages
Was this page helpful?