React Native Tap Payment binding for Android platform
- Android: version should be <= 0.59
- iOS: no support
$ npm install react-native-tap-payment --save
$ react-native link react-native-tap-payment
We are developing...
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.tappayment.RNTapPaymentPackage;
to the imports at the top of the file - Add
new RNTapPaymentPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-tap-payment' project(':react-native-tap-payment').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-tap-payment/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-tap-payment')
import TapPayment from 'react-native-tap-payment';
let data = {
SecretAPIkey: 'sk_test_kovrMB0mupFJXfNZWx6Etg5y',
AppID: "company.tap.goSellSDKExample",
CustomerId: '', //if customer id available then CustomerId :'cus_c1R02820192008h1X10805371', else empty string
price: 199,
Currency: 'KWD',
UILanguage: 'en',
Customer: {
firstName: 'Barack',
lastName: 'Obama',
email: '[email protected]',
countryCode: '965',
phoneNumber: '1234567'
}
}
TapPayment.openTapPaymentUI(data, (result) => {
console.log('payment result', result)
})