@network-international/react-native-ngenius
v2.0.4
Published
Network Internation Payment SDK for React-Native
Readme
react-native-ni-sdk

Requirements
- Reat-native
v0.60+ - iOS version
11+ - Android minSDK version
19
Getting started
npm i @network-international/react-native-ngeniusNote: If your project is using iOS deployment target 10, you need to increase it to 11.
In order to increase change the versions in the following files
- Change the iOS deployment version in
your-project/ios/Podfileas followsplatform :ios, '11.0' - Open the
.xcworkspacefileinside the following directoryyour-project/ios/yourproject.xcworkspaceand change the deployment target to 11.0.
Basic usage example
import {
initiateCardPayment,
initiateSamsungPay,
initiateApplePay,
} from '@network-international/react-native-ngenius';
// order is the order response received from NGenius create order API
const makeCardPayment = async () => {
try {
const resp = await initiateCardPayment(order);
} catch (err) {
console.log({ err });
}
};
// order is the order response received from NGenius create order API
// merchantName is the name of merchant's establishment
// serviceId is the serviceId that is generated in the Samsung Pay developer portal
const makeSamsungPayPayment = async () => {
try {
const resp = await initiateSamsungPay(order, merchantName, serviceId);
} catch (err) {
console.log({ err });
}
};
// order is the order response received from NGenius create order API
// mid is the merchant ID that is generated in the Apple developer portal
// countryCode is the country code of the transaction country Eg: AE for UAE
const makeApplePayPayment = async () => {
try {
const resp = await initiateApplePay(order, { // order is the order response after creating an order
merchantIdentifier: '', // Merchant ID created in Apple's portal
countryCode: '', // Country code of the order Eg, AE
merchantName: '', // name of the merchant to be shown in Apple Pay button
});
} catch (err) {
console.log({ err });
}
};
