@chainplatform/paypal v0.1.0
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.
Description
The library allows you to use Paypal Checkout 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. Please follow this guide to install in your project first.
Installation
Ensure you've completed the setps in 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
import PaypalPayment from '@chainplatform/paypal';
<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 lightorder_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
6 months ago