Dimitri Kopriwa
Dimitri Kopriwa

Reputation: 14363

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.)

Upvotes: 0

Views: 1617

Answers (1)

Jakob Meusburger
Jakob Meusburger

Reputation: 148

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.

Upvotes: 5

Related Questions