Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 1.94 KB

README.md

File metadata and controls

68 lines (51 loc) · 1.94 KB

react-native-tap-payment

React Native Tap Payment binding for Android platform

Support

  • Android: version should be <= 0.59
  • iOS: no support

Getting started

$ npm install react-native-tap-payment --save

Mostly automatic installation

$ react-native link react-native-tap-payment

Manual installation

iOS

We are developing...

Android

  1. 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 the getPackages() method
  1. 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')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-tap-payment')
    

Usage

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)
})