A React Native Stripe Checkout component compatible with Expo
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Feb 7, 2019
README.md Update README.md Feb 7, 2019
expo-stripe-checkout-demo.gif Publish expo-stripe-checkout 1.0.1 Feb 7, 2019
index.js Publish expo-stripe-checkout 1.0.1 Feb 7, 2019
package-lock.json Publish expo-stripe-checkout 1.0.1 Feb 7, 2019
package.json Publish expo-stripe-checkout 1.0.1 Feb 7, 2019

README.md

expo-stripe-checkout

Inspired by (https://github.com/catalinmiron/react-native-plaid-link)

Since currently the only way to implement Stripe Checkout on an Expo app is by ejecting, I've built this lib that adds support for Stripe Checkout using a WebView.

expo-stripe-checkout-demo

Usage

npm install expo-stripe-checkout --save

or

yarn add expo-stripe-checkout

API

Prop Type defaultValue
publicKey (required) string
amount (required) number
imageUrl (required) string
storeName (required) string
description (required) string
allowRememberMe (required) boolean
storeName (required) string
onPaymentSuccess (required) function
onClose (required) function
currency string USD
prepopulatedEmail string
style ViewStyle
render() {
  return <StripeCheckout
    publicKey="sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    amount={100000}
    imageUrl="https://pbs.twimg.com/profile_images/778378996580888577/MFKh-pNn_400x400.jpg"
    storeName="Stripe Checkout"
    description="Test"
    currency="USD"
    allowRememberMe={false}
    prepopulatedEmail="test@test.com"
    onClose={this.onClose}
    onPaymentSuccess={this.onPaymentSuccess}
  />
}

onPaymentSuccess = (token) => {
  // send the stripe token to your backend!
}

onClose = () => {
  // maybe navigate to other screen here?
}

For more information please read their docs

Questions?

Feel free to contact me:

Twitter: @briansztamfater Medium: http://medium.com/@briansztamfater