# react-native-paypal-integration

> A PayPal wrapper for React Native

Latest version **1.1.1** (published 2016-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-paypal-integration
pnpm add react-native-paypal-integration
yarn add react-native-paypal-integration
bun add react-native-paypal-integration
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-12-14 |
| First published | 2016-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | hieudole |
| Maintainers | hieudole |
| Keywords | react, react-native, paypal |

## Links

- npm: https://www.npmjs.com/package/react-native-paypal-integration
- Repository: https://github.com/hieudole/react-native-paypal-integration
- Issues: https://github.com/hieudole/react-native-paypal-integration/issues
- npm.io page: https://npm.io/package/react-native-paypal-integration

## Recent versions

- 1.1.1 (latest) — 2016-12-14
- 1.1.0 — 2016-12-03
- 1.0.0 — 2016-11-29

## README

# react-native-paypal-integration

## Installation

``` bash
npm install --save react-native-paypal-integration
```
## Android

1. Edit `android/app/build.gradle`:

```diff
dependencies {
    ...
    compile "com.facebook.react:react-native:+"  // From node_modules
+   compile project(':react-native-paypal-integration')
}
```

2. Edit `android/settings.gradle`:

```diff
...
include ':app'
+ include ':react-native-paypal-integration'
+ project(':react-native-paypal-integration').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-paypal-integration/android')
```

3. Edit `MainApplication.java`:

```diff
+ import com.hieudole.paypal.PayPalPackage;

  public class MainApplication extends Application implements ReactApplication {
    //......
    
    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
+         new PayPalPackage(),
          new MainReactPackage()
      );
    }
    
    ......
  }
```

## Usage

### Import 

```javascript
import PayPal from 'react-native-paypal-integration';
```
### Profile Sharing

```javascript
PayPal.profileSharing({
    clientId: 'Your client ID',
    environment: PayPal.SANDBOX,
    merchantName: 'Your merchant name',
    merchantPrivacyPolicyUri: 'http://your-url.com/policy',
    merchantUserAgreementUri: 'http://your-url.com/legal',
    scopes: [
        PayPal.SCOPE_PROFILE, // Full Name, Birth Date, Time Zone, Locale, Language
        PayPal.SCOPE_PAYPAL_ATTRIBUTES, // Age Range, Account Status, Account Type, Account Creation Date
        PayPal.SCOPE_EMAIL, // Email
        PayPal.SCOPE_ADDRESS, // Address
        PayPal.SCOPE_PHONE // Telephone
    ]
  }, 
  function (r) {
    console.log(r);
  }
);
```

---
_Source: https://npm.io/package/react-native-paypal-integration · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
