# @chainplatform/paypal

> The library allows you to use Paypal Payment with react-native without ejecting support both react-native and react-native-web.

Latest version **0.1.0** (published 2024-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @chainplatform/paypal
pnpm add @chainplatform/paypal
yarn add @chainplatform/paypal
bun add @chainplatform/paypal
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2024-10-22 |
| First published | 2024-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Chain Platform |
| Maintainers | chainplatform |
| Keywords | react, react-native, react-native-web, react-native-webview, react-native-paypal-payment-webview, react-native-payment-webview, @chainplatform/paypal, react-native-paypal |

## Links

- npm: https://www.npmjs.com/package/@chainplatform/paypal
- Repository: https://github.com/ChainPlatform/react-native-paypal-payment-webview
- Issues: https://github.com/ChainPlatform/react-native-paypal-payment-webview/issues
- npm.io page: https://npm.io/package/@chainplatform/paypal

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2024-10-22

## README

# React Native Paypal Payment and React Native Web Paypal Payment
 The library allows you to use Paypal Payment with react-native without ejecting support both react-native and react-native-web.

<p align="center">
  <a href="https://github.com/ChainPlatform/react-native-paypal-payment-webview/blob/HEAD/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg" />
  </a>
  <a href="https://www.npmjs.com/package/react-native-paypal-payment-webview">
    <img src="https://img.shields.io/npm/v/react-native-paypal-payment-webview?color=brightgreen&label=npm%20package" alt="Current npm package version." />
  </a>
  <a href="https://www.npmjs.com/package/react-native-paypal-payment-webview">
    <img src="https://img.shields.io/npm/dt/react-native-paypal-payment-webview.svg"></img>
  </a>
  <a href="https://www.npmjs.com/package/react-native-paypal-payment-webview">
    <img src="https://img.shields.io/badge/platform-android%20%7C%20ios%20%7C%20web-blue"></img>
  </a>
  <a href="https://github.com/ChainPlatform/react-native-paypal-payment-webview/pulls">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
  </a>
  <a href="https://twitter.com/intent/follow?screen_name=doansan">
    <img src="https://img.shields.io/twitter/follow/doansan.svg?label=Follow%20@doansan" alt="Follow @doansan" />
  </a>
</p>


## Description
The library allows you to use [Paypal Checkout](https://developer.paypal.com/docs) with react-native without ejecting. You can use it with both server-side implementations and client-side implementations.


## Prequisites
- This library relies on [React Native Webview](https://www.npmjs.com/package/react-native-webview). Please follow [this guide](https://github.com/react-native-community/react-native-webview/blob/HEAD/docs/Getting-Started.md) to install in your project first.


## Installation

- Ensure you've completed the setps in [prequisites.](#prequisites)

- Install package via npm or yarn:

`npm install --save @chainplatform/paypal` OR `yarn add @chainplatform/paypal`

- If your project use react-native-web to build website:

`npm install --save @chainplatform/react-native-web-webview` OR `yarn add @chainplatform/react-native-web-webview`

Then setup by guide at: https://github.com/ChainPlatform/react-native-web-webview#readme

## Usage

- Import in your project

```javascript
import PaypalPayment from '@chainplatform/paypal';
```

```js
    <PaypalPayment
        theme={"light"}
        order_id={datas.payment_infos.datas.order_id}
        sandbox_client_id={datas.payment_infos.datas.sandbox_client_id}
        production_client_id={datas.payment_infos.datas.production_client_id}
        sandbox_environment={datas.payment_infos.datas.sandbox_environment}
        paymentResult={(datas) => {
            console.log("paymentResult ", datas);
        }}
    />
```

## Component props

- `theme` (String) - theme dark or light
- `order_id` (String) - order_id.
- `sandbox_client_id` (String) - Paypal sandbox client id of your project.
- `production_client_id` (String) - Paypal production client id of your project.
- `sandbox_environment` (String) - Paypal environment.
- `paymentResult` (?Function) - Called upon calback of the checkout session 
- Support full Webview props


## Contributing
Pull requests are highly appreciated! For major changes, please open an issue first to discuss what you would like to change.

### Related Projects
- Other packages for react native and react native web: [ChainPlatform](https://github.com/ChainPlatform)

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