Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-native-stripe-payment-webview

ChainPlatform27MIT0.1.9

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

react, react-native, react-native-web, react-native-webview, react-native-stripe-payment-webview, react-native-payment-webview, react-native-stripe-payment, react-native-stripe

readme

React Native Stripe Payment and React Native Web Stripe Payment

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

Current npm package version. PRs welcome! Follow @doansan

Description

The library allows you to use Stripe.js Checkout with react-native without ejecting. You can use it with both server-side implementations and client-side implementations. Simply ensure you follow the url structure guidelines below.

Prequisites

Installation

  • Ensure you've completed the setps in prequisites.

  • Install package via npm or yarn:

npm install --save react-native-stripe-payment-webview OR yarn add react-native-stripe-payment-webview

  • 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 StripePayment from 'react-native-stripe-payment-webview';
    <StripePayment
        theme={"light"}
        style={"stripe"}
        return_url={"https://google.com"}
        public_key={datas.payment_infos.datas.publishable_key}
        client_secret={datas.payment_infos.datas.client_secret}
        paymentIntent={(datas) => {
            console.log("paymentIntent ", datas);
        }}
    />

Component props

  • theme (String) - theme dark or light
  • style (String) - Stripe layout theme
  • return_url (String) - optional.
  • publishable_key (String) - Stripe public key of your project.
  • client_secret (String) - String to be passed to Stripe's paymentIntent function. Docs.
  • paymentIntent (?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.

  • Other packages for react native and react native web: ChainPlatform