react-native-paypal-android
Getting started
$ npm install react-native-paypal-android --save
Mostly automatic installation
$ react-native link react-native-paypal-android
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.thebylito.rnpaypal.RnPaypalPackage;
to the imports at the top of the file - Add
new RnPaypalPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-paypal-android' project(':react-native-paypal-android').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-paypal-android/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-paypal-android')
Usage
;;; const client = sandbox: 'YOUR_SANDBOX_KEY' production: 'YOUR_PRODUCTION_KEY' { return <View style=stylescontainer> <Button title="Comprar" onPress=async { try await RNPaypal const pay = await RNPaypal; console;// SUCESSS catch e console;// NO MONEY :() } /> </View> ; } const styles = StyleSheet;
API
; // TODO: What to do with the module?RNPaypal;