Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Error being thrown when dealing with Stripe using @stripe/stripe-react-native

I've added Stripe into my React-Native/Expo (SDK 42) App. I am trying to make it so follow the "create payment" method laid out on stripes website, but it keeps throwing the following error:

undefined Unable to resolve module stripe from ../../../../.js stripe could not be found within the project.

I've tried calling Stripe, but I still keep getting the error.

Below is the code where the error lives:

import { CardField, useStripe, StripeProvider, Stripe } from '@stripe/stripe-react-native'

const stripe = require('stripe')('testKey')

const paymentMethod = async() => {
await stripe.paymentMethods.create({
    type: 'card',
    card:{
        number: '4242424242424242',
        exp_month: 9,
        exp_year: 2022,
        cvc: '314'
    }
})

}

I adapted this from the Node.js version found here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The code that you've included in your question is meant to be called server-side with Stripe's Node client library. It cannot be adapted to work client-side with the Stripe's React Native SDK.

Instead, you want to be calling the React Native equivalent of stripe.createPaymentMethod() (see JS library ref). There's a quick example in the React Native library docs about how to do this here (it was originally written for folks migrating from the Tipsi library, but it should also work for your use case).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!