Skip to main content

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

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

1

Step 1 - Add the JitPack Repository

In your project-level build.gradle, add the JitPack repository:
2

Step 2 - Add the SDK Dependency

In your app-level build.gradle, add the following dependency.

Initialize the SDK

Initialize the SDK in your Application 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


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 — use initiateCheckout directly within a coroutine:
Keep the following in mind when testing:
  • Always use a unique reference value 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.