Ad

How To Integrate Stripe With React-native Expo Sdk36 Without Ejecting?

I am reading:

I want to integrate stripe payment within a react-native app build with expo sdk 36.

My project is not ejected and I would like to keep it so I can still run and debug iOS app without needing apple hardware. (it's for developer experience, but I want to see if there's a way before squeezing that.)

  1. To me, it seems that stripe just need an HTTP client to communicate, while I have fetch, am I correct?
  2. Why exactly do I need to eject, what native library do I need to plug and why the http client is not sufficient?
    • How can I integrate stripe to target all of the platforms (web/ios/native) with the less effort (what library should I get started with to resolve my goal.)
Ad

Answer

Expo really doesn't support the expo-payments-stripe module for React Native in managed workflow. Although there is a little trick. You can implement it by using a WebView, as (for example) this npm-module does: expo-stripe-checkout. This module uses Stripe Checkout.

Regarding your question about using a normal HTTP-Client, maybe this article helps: Using Stripe API in React Native with fetch

I hope this helps!

EDIT: Stripe just released the official Stripe client library for React Native as public beta: stripe-react-native. I would suggest looking into that.

Ad
source: stackoverflow.com
Ad