Overview
Novac Android SDKs enable Android developers to extend Novac’s capabilities when building mobile platforms with minimal setup. The Novac Android SDK provides a seamless checkout experience with a customizable UI, native Jetpack Compose and Views support, and robust error handling—all with a simple setup.Prerequisites
See details
See details
Before you begin, ensure that you’ve completed the following steps:
- Obtain your API keys: required for making authenticated API calls.
- Android project with Gradle build system
- Minimum SDK version compatible with Jetpack Compose or AppCompat
Installation
Initialize the SDK
Initialize the SDK in yourApplication class or main Activity. You will need your merchantId and apiKey from your Novac dashboard, and you must specify the activities that will handle payment success and failure outcomes.
Checkout Config Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantId | String | true | Your merchant ID from Novac |
baseUrl | String | true | API base URL |
apiKey | String | true | Your API key from Novac |
enableLogging | Boolean | false | Enable debug logging |
successActivityClass | Class | true | Activity to launch on successful payment |
failureActivityClass | Class | true | Activity to launch on failed payment |
Create Result Activities
You need two activities to handle the payment outcomes: one for success and one for failure. The SDK passes transaction details to each via the intent.SuccessActivity.kt
FailureActivity.kt
Launch the Checkout Flow
Once the SDK is initialized, launching a payment is a single method call:Advanced Usage
Customizing the Checkout UI
You can personalize the checkout modal with your brand logo, a payment description, and a custom title:Manual Checkout Initiation
For greater control over the checkout flow — for example, to retrieve the payment URL and handle redirection yourself — useinitiateCheckout directly within a coroutine:
- Always use a unique
referencevalue for each transaction, duplicate references will be rejected. - Start with small test amounts (₦100) to validate your integration before going live.
- Check your sandbox dashboard to confirm transaction results and inspect any errors.