Integrating MIPS Payment SDK into Your Android App

Written by Shyank
Shyank
Banner

SHARE

The MIPS Android SDK makes it easy to embed secure payment functionality into your native Android apps. This guide will help you get started.

Prerequisites

Before you begin, ensure you have the following credentials provided by MIPS Admin:

Merchant Details:

  • sIdMerchant
  • id_entity
  • id_operator
  • operator_password

Merchant Credentials:

  • username
  • password

Add the SDK Dependency

Step 1: Add the SDK Dependency

Include the MIPS SDK in your project's build.gradle file:

implementation 'mu.mips:android_sdk:0.2.11'

OR

implementation("mu.mips:android_sdk:0.2.11")

Step 2: Check min android sdk version

Ensure that your project's minSdkVersion is set to 24 or higher:

minSdkVersion 24

Update Android Manifest

Add the necessary permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Start Writing Payment Code

Step 1: Initialize Merchant Details and Credentials

Create instances of MerchantDetails and MerchantCredentials with your provided credentials.

Java
MerchantDetails merchantDetails = new MerchantDetails(
    "YOUR_MERCHANT_ID",
    "YOUR_ENTITY_ID",
    "YOUR_OPERATOR_ID",
    "YOUR_OPERATOR_PASSWORD"
);

MerchantCredentials credentials = new MerchantCredentials(
    "YOUR_USERNAME",
    "YOUR_PASSWORD"
);
Kotlin
val detail = MerchantDetails(
    sIdMerchant = "XXXXXXXXXX",
    id_entity = "XXXXXXXXXX",
    id_operator = "XXXXXXXXXX",
    operator_password = "XXXXXXXXXX"
)

val credential = MerchantCredentials(
    username = "XXXXXXXXXX",
    password = "XXXXXXXXXX"
)

Step 2: Set Up Order ID and Order Amount

Define the order ID and amount for the transaction.

Java
Amount amount = new Amount(Currency.MAURITIAN_RUPEE, 100);
String orderID = UUID.randomUUID().toString();
Kotlin
val orderID = "YOUR_ORDER_ID"
val amount = Amount(Currency.Mauritian_Rupee, 100)

Step 3: Create Payment Screen

Create a fragment of type MIPS_Payment_Fragment and handle payment success and error in callback functions.

Java
MIPS_Payment_Fragment paymentFrag =
    MIPS_Payment_Fragment.Companion.getInstance(
        detail,
        credential,
        amount,
        orderID,
        paymentMode -> {   // success handler
            PaymentMode mode = paymentMode;
            showSuccessScreen();
            return Unit.INSTANCE;
        },
        failureReason -> {  // failure handler
            showFailureScreen();
            return Unit.INSTANCE;
        }
);

Kotlin
var paymentFrag: MIPS_Payment_Fragment =
    MIPS_Payment_Fragment.getInstance(
        detail,
        credential,
        amount,
        orderID,
        successCallback = { mode ->
            showSuccessScreen()
        },
        failureHandler = { failureReason ->
            showFailureScreen()
        }
    )

Step 4: Show Payment Screen and Start Payment Flow

Show the payment fragment to start the payment flow.

Java
import androidx.fragment.app.FragmentTransaction;

FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.CONTAINER_ID, paymentFrag).commit();

Kotlin
import androidx.fragment.app.FragmentTransaction

val transaction = supportFragmentManager.beginTransaction()
transaction.add(R.id.CONTAINER, paymentFrag).commit()

By following these steps, you can seamlessly integrate the MIPS Payment SDK into your Android application, providing a secure and efficient payment experience for your users.

Check full Android SDK on GitHub

About & Technical Stack

Shyank Akshar

Shyank Akshar

I'm Shyank, a full-stack software engineer specializing in secure, high-scale systems.

Over 5+ years, I've shipped production applications across govtech, fintech, and consumer platforms — systems that handle national-scale authentication, real-time payments, and millions of users in production. I've built official SDKs live across iOS, Android, and React Native; engineered 2FA and biometric security infrastructure trusted by government and enterprise clients; and designed backend systems processing high-throughput transactions with zero tolerance for failure.

I work primarily in Swift and Golang, with deep experience in distributed systems, Apache Kafka, and applied cryptography. I care about building things that hold up under real load and real security scrutiny — not demos, production.

Technical Stack

Languages, platforms, and architectures I build on.

iOS
Swift
GCP
AWS
Java
backend
Golang
Javascript
Typescript
Mongo DB
MySQL
Redis
Kotlin
Kafka
Kubernetes
Docker
Microservices
System Design
Distributed Systems
More Blogs
Recent Blogs