Alert: Built and tested only for iOS.
$ npm install react-native-paytm --save
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-paytm
and addRNPayTm.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNPayTm.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.reactlibrary.RNPayTmPackage;
to the imports at the top of the file
- Append the following lines to
android/settings.gradle
:include ':react-native-paytm' project(':react-native-paytm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-paytm/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-paytm')
import paytm from 'react-native-paytm';
var details = {
generationUrl: "http://somegenerationurl.in/checksumGenerator",
validationUrl: "http://somegenerationurl.in/checksumValidator",
mid: "YOUR_REGISTERED_MID", // Prod
industryType: "YOUR_REGISTERED_INDUSTRY", //Prod
website: "YOUR_REGISTERED_WEBSITE", //prod
channel: "Your_REGISTERED_CHANNEL",
amount: "5",
orderId: "someuniquestring",
requestType: "DEFAULT",
email: "mailz4sreejith@gmail.com",
phone: "9988755334",
theme: "merchant",
custId: "9988344556",
};
paytm.startPayment(details);