The React Native SDK bridges the native Android and iOS MIPS SDKs, offering seamless integration for cross-platform payment solutions.
Before you begin, ensure you have the following credentials provided by MIPS Admin:
sIdMerchant
id_entity
id_operator
operator_password
username
password
npm install mips-payment-sdk
import {
StartPayment,
Amount,
MerchantDetails,
MerchantCredentials,
Currency,
} from "mu.mips.react-native-sdk/src";
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
);
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
---
Hi! I'm Shyank, a full-stack Software developer and a call-of-duty enthusiast, I help businesses grow their company with the the help of technology, improve their work, save time, and serve their customers well, I have worked with many global startups and Govt bodies to develop some of the most secure and scaled apps