Quickly integrate payments into your app with our easy-to-use SDK.
- Overview
- Installation
- Security Best Practices
- Usage
- Payment Process
- UI Customization
- Google Pay Integration
The Monext Android SDK is designed for seamless integration of payment features. It provides a drop-in Jetpack Compose view that can be easily embedded into your existing U
Minimum Requirement:
- Android 8.0 (API 26)
Before using the SDK, ensure you have an active Monext merchant account. Visit our website for details.
Monext Android SDK is available via Gradle.
Add the Package Dependency:
implementation("com.monext:TODO:(insert latest version here)")
- BasicToken
- MerchantID
Never expose these credentials in your app’s code.
Once the SDK is installed and your Monext account is set up, you can integrate payment functionality into your app.
The main component is PaymentBox
, a ready-to-use Jetpack Compose view that manages the entire payment process. It integrates the PaymentSheet
composable:
@Composable fun ContentView {
var sessionToken: String? by rememberSaveable { mutableStateOf(null) }
Column {
if (sessionToken != null) {
PaymentBox(
sessionToken,
context = MnxtSDKContext(
environment = MnxtEnvironment.Sandbox,
appearance = selectedTheme.appearance()
),
onResult = { result ->
when (result) {
is PaymentResult.SheetDismissed ->
Log.d("APP", "SheetDismissed: " + (result.currentState?.toString() ?: "TransactionState UNKNOWN"))
is PaymentResult.PaymentCompleted ->
Log.d("APP", "PaymentCompleted: " + (result.finalState?.toString() ?: "TransactionState UNKNOWN"))
}
}
) { showSheet ->
Button(showSheet) {
Text("Checkout")
}
}
}
}
}
For greater control over the user interface, use the PaymentSheet
composable directly:
@Composable
fun CustomPaymentSheet {
var sessionToken: String? = ...
val context = MnxtSDKContext(...)
var showPaymentSheet by rememberSaveable { mutableStateOf(false) }
Box {
Button({
if (sessionToken != null) {
showPaymentSheet = true
}
}) {
Text("Checkout")
}
PaymentSheet(showPaymentSheet, sessionToken ?: "", context) { result ->
showPaymentSheet = false
onResult(result)
}
}
}
-
Create a Monext Payment Session Token:
Your backend must create a payment session via the Monext Retail API. Refer to the session creation documentation. -
Pass the Required Parameters to
PaymentBox
:sessionToken
context
: an instance of MnxtContext
(See UI Customization)- Button content and
onResult
closure to handle payment outcomes
-
Handle Payment Results:
TheonResult
closure receives aPaymentResult
when the payment session ends. The payment sheet dismisses automatically. -
Get a session detail You can then retrieve the payment data via an API call with a GET Session, for more information: Documentation.
Customize the payment sheet using MnxtSDKConfiguration
. Modify colors, texts, and themes to match your branding.
All available UI customizations are contained in this class. You are not required to modify any element, the default is a light theme.
It is recommended to provide the headerTitle
or headerImage
at a minimum to identify your brand.
Monext Android SDK supports Google Pay . Setup requires:
TODO