Integrating MIPS Payment SDK into Your React Native App

Written by Shyank
Shyank
Banner

SHARE

The React Native SDK bridges the native Android and iOS MIPS SDKs, offering seamless integration for cross-platform payment solutions.

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

Step 1: Install the SDK

npm i mu.mips.react-native-sdk

Step 2: Import Required Classes

import {
  StartPayment,
  Amount,
  MerchantDetails,
  MerchantCredentials,
  Currency,
} from "mu.mips.react-native-sdk";

Step 3: Configure Merchant and Order Details

const orderID = "YOUR_ORDER_ID";

const amount = new Amount(Currency.Mauritian_Rupee, 100);
// Replace currency and amount with required values

const detail = new MerchantDetails(
  "XXXXX", // sIdMerchant
  "XXXXX", // id_entity
  "XXXXX", // id_operator
  "XXXXX" // operator_password
);

const cred = new MerchantCredentials(
  "XXXXX", // username
  "XXXXX" // password
);

Step 4: Start Payment Flow Using StartPayment Function

The StartPayment function provides two callback functions: one when the user completes the payment, and another when the payment fails for any reason

StartPayment(detail, cred, amount, orderID)
  .then((paymentMode) => {
    console.log("Payment success with payment mode " + paymentMode);
  })
  .catch((error) => {
    console.log("Payment failed with error ", error);
  });

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

For more information, visit the Official doc on GitHub

About & Technical Stack

Shyank Akshar

Shyank Akshar

Hi! I'm Shyank, a full-stack Software Developer and a Call of Duty enthusiast. I help businesses scale by engineering robust technology solutions that automate complex tasks, save hundreds of hours, and delight users. Over the years, I've partnered with leading global startups and government organizations to deliver high-performance, secure applications at scale.

Technical Stack

Languages, platforms, and architectures I build on.

iOS
Swift
SwiftUI
UIKit
Core Animation
Core Data
mobile
Objective-C
backend
Golang
Mongo DB
Docker
Kubernetes
bash
JWT
Kotlin
Javascript
Typescript
Git
Kafka
Maps
Widget
More Blogs
Recent Blogs